From e9e08a1d12594eab0e341049fc252ff8578e9333 Mon Sep 17 00:00:00 2001 From: Daniel Stokes Date: Tue, 17 Dec 2013 14:42:47 -0800 Subject: Game Engine: Level of detail support and tools Levels of detail can be added and modified in the object panel. The object panel also contains new tools for generating levels of detail, setting up levels of detail based on object names (useful for importing), and clearing an object's level of detail settings. This is meant as a game engine feature, though the level of details settings can be previewed in the viewport. Reviewed By: moguri, nexyon, brecht Differential Revision: http://developer.blender.org/D109 --- source/gameengine/Ketsji/KX_Scene.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/gameengine/Ketsji/KX_Scene.cpp') diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 70924c65519..4a147b4eb60 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1726,6 +1726,19 @@ void KX_Scene::RenderFonts() } } +void KX_Scene::UpdateObjectLods(void) +{ + KX_GameObject* gameobj; + MT_Vector3 cam_pos = this->m_active_camera->NodeGetWorldPosition(); + + for (int i = 0; i < this->GetObjectList()->GetCount(); i++) { + gameobj = (KX_GameObject*) GetObjectList()->GetValue(i); + if (!gameobj->GetCulled()){ + gameobj->UpdateLod(cam_pos); + } + } +} + void KX_Scene::UpdateObjectActivity(void) { if (m_activity_culling) { -- cgit v1.2.3