Major refactoring for game objects

This commit is contained in:
Vladislav Khorev committed 2026-05-12 21:19:29 +03:00
1 parent efb85f7328
commit 2cae9998a0
18 files changed
+547 -716

No files matched your search

+3 -17
View File
@@ -11,26 +11,12 @@ namespace ZL {
namespace ZL {
void InteractiveObject::draw(Renderer& renderer) const {
if (!isActive || !texture) return;
/*
std::cout << "[DRAW] InteractiveObject::draw() called" << std::endl;
std::cout << "[DRAW] Object: " << name << std::endl;
std::cout << "[DRAW] Position: (" << position.x() << ", " << position.y() << ", " << position.z() << ")" << std::endl;
// Check mesh bounds
if (!mesh.data.PositionData.empty()) {
std::cout << "[DRAW] First vertex: (" << mesh.data.PositionData[0].x() << ", "
<< mesh.data.PositionData[0].y() << ", " << mesh.data.PositionData[0].z() << ")" << std::endl;
}
*/
// Apply position transformation
if (!isActive || !loadedObject.texture) return;
renderer.PushMatrix();
renderer.TranslateMatrix(position);
renderer.RenderUniform1i(textureUniformName, 0);
glBindTexture(GL_TEXTURE_2D, texture->getTexID());
renderer.DrawVertexRenderStruct(mesh);
glBindTexture(GL_TEXTURE_2D, loadedObject.texture->getTexID());
renderer.DrawVertexRenderStruct(loadedObject.mesh);
renderer.PopMatrix();
}