Merge pull request #16 from mephi1984/Albert

Albert
This commit is contained in:
Albrut authored and GitHub committed 2025-03-02 16:23:20 +06:00
commit 980b8133a8
10 files changed
+17173 -4

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
{
"files.associations": {
"array": "cpp",
"bitset": "cpp",
"string_view": "cpp",
"hash_map": "cpp",
"hash_set": "cpp",
"initializer_list": "cpp",
"span": "cpp",
"regex": "cpp",
"valarray": "cpp",
"__hash_table": "cpp",
"__split_buffer": "cpp",
"__tree": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"queue": "cpp",
"set": "cpp",
"stack": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp"
}
}
+7 -2
View File
@@ -27,10 +27,15 @@ void GameObjectManager::initialize() {
testObjMeshMutable.data = testObjMesh;
testObjMeshMutable.RefreshVBO();
textMesh = ZL::LoadFromTextFile("./mesh_first_room.txt"); // Add ZL:: namespace
textMesh = ZL::LoadFromTextFile("./textures/mesh_first_room.txt"); // Add ZL:: namespace
textMesh.Scale(10);
textMesh.SwapZandY();
textMesh.RotateByMatrix(QuatToMatrix(QuatFromRotateAroundX(M_PI * 0.5)));
textMesh.Move(Vector3f{0, 70, 0});
coneMesh = ZL::LoadFromTextFile("./cone001.txt"); // Add ZL:: namespace
coneMesh.Scale(200);
textMesh.Scale(20);
textMeshMutable.AssignFrom(textMesh);
textMeshMutable.RefreshVBO();
+46
View File
@@ -0,0 +1,46 @@
# Script to run:
```
C:\Work\Projects\emsdk\emsdk.bat activate latest
C:\Work\Projects\emsdk\emsdk_env.bat
emcc main.cpp Game.cpp Math.cpp Physics.cpp Renderer.cpp ShaderManager.cpp TextureManager.cpp Utils.cpp OpenGlExtensions.cpp -O2 -std=c++14 -sTOTAL_MEMORY=33554432 -sUSE_SDL_IMAGE=2 -sSDL2_IMAGE_FORMATS="[""png""]" -sUSE_SDL=2 --preload-file background.bmp --preload-file bird.bmp32 --preload-file default.fragment --preload-file default.vertex --preload-file game_over.bmp32 --preload-file pipe.bmp32 -o jumpingbird.html
```
```
zlib-1.3.1:
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=install ..
then run ALL_BUILD and INSTALL in Visual Studio
lpng1645:
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=install -DZLIB_ROOT=C:\Work\Projects\zlib-1.3.1\build\install ..
then run ALL_BUILD and INSTALL in Visual Studio
```
https://github.com/Bly7/OBJ-Loader/blob/master/Source/OBJ_Loader.h
https://github.com/gametutorials/tutorials/blob/master/OpenGL/MD3%20Animation/Main.cpp
linux:
```
g++ Game.cpp main.cpp Math.cpp OpenGlExtensions.cpp Physics.cpp Renderer.cpp ShaderManager.cpp TextureManager.cpp Utils.cpp BoneAnimatedModel.cpp ObjLoader.cpp cmakeaudioplayer/src/AudioPlayer.cpp TextModel.cpp Inventory.cpp -o sdl_app -O2 -std=c++17 \
-I cmakeaudioplayer/include \
$(pkg-config --cflags --libs sdl2 gl) \
$(pkg-config --cflags --libs vorbis vorbisfile ogg) \
-lopenal
```
+9 -2
View File
@@ -1,6 +1,5 @@
#include "Renderer.h"
#include <cmath>
namespace ZL {
@@ -287,6 +286,13 @@ namespace ZL {
PositionData[i] = PositionData[i] * scale;
}
}
void VertexDataStruct::Move(Vector3f diff)
{
for (int i = 0; i < PositionData.size(); i++)
{
PositionData[i] = PositionData[i] + diff;
}
}
void VertexDataStruct::SwapZandY()
{
@@ -297,6 +303,7 @@ namespace ZL {
PositionData[i].v[2] = value;
}
}
void VertexDataStruct::RotateByMatrix(Matrix3f m)
{
+1
View File
@@ -52,6 +52,7 @@ namespace ZL {
void RotateByMatrix(Matrix3f m);
void Scale(float scale);
void Move(Vector3f diff);
void SwapZandY();
};
+1
View File
@@ -0,0 +1 @@
/home/albert/Downloads/Telegram Desktop/plain_obj_script.py
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File renamed without changes.
File diff suppressed because it is too large. Load diff