diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2015-01-08 07:41:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-20 12:18:21 +0300 |
commit | a1a182c2684a7f050f6a85820e183c31ff117e82 (patch) | |
tree | d8eaa439e16ddd0f40f21062ce0d154398bc4a44 | |
parent | e5fbe7466ecf733d7d3f394eded8901e07c55acd (diff) |
Fix T40257: Frustum culling not working properly
Instead of getting fancy this time, we'll just use Mahalin's simpler
fix. This may have slight performance impacts, but it is a lot simpler
than the previous fix and shouldn't cause as many bugs.
-rw-r--r-- | source/gameengine/Ketsji/KX_Scene.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 6b49e44bb77..040949dfaf2 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1502,6 +1502,15 @@ void KX_Scene::CalculateVisibleMeshes(RAS_IRasterizer* rasty,KX_Camera* cam, int bool dbvt_culling = false; if (m_dbvt_culling) { + /* Reset KX_GameObject m_bCulled to true before doing culling + * since DBVT culling will only set it to false. + * This is similar to what RAS_BucketManager does for RAS_MeshSlot culling. + */ + for (int i = 0; i < m_objectlist->GetCount(); i++) { + KX_GameObject *gameobj = static_cast<KX_GameObject*>(m_objectlist->GetValue(i)); + gameobj->SetCulled(true); + } + // test culling through Bullet MT_Vector4 planes[6]; // get the clip planes |