Big update

This commit is contained in:
2026-03-07 03:14:10 +03:00
parent f8f69d3b88
commit a998771486
33 changed files with 1788 additions and 577 deletions

View File

@@ -18,6 +18,9 @@
#include <pugixml.hpp>
extern int g_NumModels;
static bool g_debugRenderScene = false;
static std::string getFileExtension(const std::string& filename)
{
size_t whereIsDot = filename.find_last_of('.');
@@ -398,7 +401,8 @@ void SceneManager::renderScene(const glm::mat4& cameraTranslation)
(*it)->RenderObjects();
g_debugRender->DrawBoundingBox((*it)->GetBoundingBox(), glm::vec3(1.0f));
if (g_debugRenderScene)
g_debugRender->DrawBoundingBox((*it)->GetBoundingBox(), glm::vec3(1.0f));
}
}
@@ -482,6 +486,11 @@ const char* SceneManager::getSceneName()
return m_sceneName.c_str();
}
void SceneManager::toggleDebugRender()
{
g_debugRenderScene = !g_debugRenderScene;
}
// SceneStaticMesh
SceneStaticMesh::SceneStaticMesh() :
@@ -818,7 +827,7 @@ void R_SceneStaticMesh_BindShader(const glm::mat4& worldMatrix, Texture2D* albed
{
glm::vec4 lightPos = glm::vec4(1.0f, 1.0f, 1.0f, 0.0f);
g_debugRender->DrawAxis(glm::vec3(lightPos));
// g_debugRender->DrawAxis(glm::vec3(lightPos));
Camera* camera = g_cameraManager.GetActiveCamera();
if (camera)
@@ -853,4 +862,6 @@ void SceneStaticMesh::RenderObjects()
R_SceneStaticMesh_BindShader(s_identity, m_albedoTexture);
g_renderDevice->DrawArrays(PT_TRIANGLES, 0, m_vbcount);
g_NumModels++;
}