New meshes and new trees

This commit is contained in:
Vladislav Khorev committed 2026-06-21 15:15:40 +03:00
1 parent d7db0faea3
commit 130e4411cb
45 files changed
+36847 -256

No files matched your search

+29 -4
View File
@@ -439,18 +439,36 @@ namespace ZL
std::uniform_real_distribution<float> scaleDist(0.8f, 1.2f);
std::uniform_real_distribution<float> rotDist(0.0f, 360.0f);
std::uniform_int_distribution<int> tree_index(1, 3);
int treeNum = tree_index(rng);
int editorTreeNum = ++editorPlacedObjectCounter;
GameObjectData data;
data.name = "editor_tree_" + std::to_string(++editorPlacedObjectCounter);
data.texturePath = "resources/w/exterior/tree001.png";
data.meshPath = "resources/w/exterior/tree003.txt";
data.name = "editor_wood_" + std::to_string(editorTreeNum);
data.texturePath = "resources/w/exterior/texAtlas001.png";
data.meshPath = "resources/w/exterior/DTree_Wood_" + std::to_string(treeNum) + "_001.txt";
data.rotationX = 0.0f;
data.rotationY = rotDist(rng);
data.rotationZ = 0.0f;
data.positionX = loc.player->state.position.x();
data.positionY = loc.player->state.position.y();
data.positionY = loc.player->state.position.y()-0.1;
data.positionZ = loc.player->state.position.z();
data.scale = scaleDist(rng);
GameObjectData data2;
data2.name = "editor_tree_" + std::to_string(editorTreeNum);
data2.texturePath = "resources/w/exterior/texAtlas001.png";
data2.meshPath = "resources/w/exterior/DTree_Tree_" + std::to_string(treeNum) + "_001.txt";
data2.rotationX = 0.0f;
data2.rotationY = data.rotationY;
data2.rotationZ = 0.0f;
data2.positionX = data.positionX;
data2.positionY = data.positionY;
data2.positionZ = data.positionZ;
data2.scale = data.scale;
LoadedGameObject obj = GameObjectLoader::buildLoadedObject(data, loc.renderer, CONST_ZIP_FILE);
obj.mesh.data.Move({ data.positionX, data.positionY, data.positionZ });
obj.mesh.RefreshVBO();
@@ -458,6 +476,13 @@ namespace ZL
loc.gameObjects[data.name] = std::move(obj);
editorPlacedObjects.push_back(data);
LoadedGameObject obj2 = GameObjectLoader::buildLoadedObject(data2, loc.renderer, CONST_ZIP_FILE);
obj2.mesh.data.Move({ data2.positionX, data2.positionY, data2.positionZ });
obj2.mesh.RefreshVBO();
loc.gameObjects[data2.name] = std::move(obj2);
editorPlacedObjects.push_back(data2);
std::cout << "[GAME_EDITOR] Placed '" << data.name << "' at ("
<< data.positionX << ", " << data.positionZ
<< ") scale=" << data.scale << " rotY=" << data.rotationY << "\n";