Merge branch 'salmon' into pavel

This commit is contained in:
Pavel Makarov 2025-03-02 16:49:35 +06:00 committed by GitHub
commit d35547560e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 17173 additions and 4 deletions

26
.vscode/settings.json vendored Normal file
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"
}
}

View File

@ -28,10 +28,15 @@ void GameObjectManager::initialize() {
testObjMeshMutable.data = testObjMesh;
testObjMeshMutable.RefreshVBO();
textMesh = ZL::LoadFromTextFile("./mesh001.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, 93, 0});
coneMesh = ZL::LoadFromTextFile("./cone001.txt"); // Add ZL:: namespace
coneMesh.Scale(200);
textMesh.Scale(20);
textMeshMutable.AssignFrom(textMesh);
textMeshMutable.RefreshVBO();

46
Readme.md.save Normal file
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
```

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)
{

View File

@ -52,6 +52,7 @@ namespace ZL {
void RotateByMatrix(Matrix3f m);
void Scale(float scale);
void Move(Vector3f diff);
void SwapZandY();
};

1
py_script.py Normal file
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

4833
textures/mesh_first_room.txt Normal file

File diff suppressed because it is too large Load Diff