Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Stokes <mogurijin@gmail.com>2014-07-01 23:39:17 +0400
committerMitchell Stokes <mogurijin@gmail.com>2014-07-01 23:39:17 +0400
commit978dba4616852e0b94374f2ae56934049d9b3669 (patch)
treef9c0514fc25bd81afe3b5dc38d4715ea68154e88 /source/gameengine/Ketsji/KX_GameObject.cpp
parentcc1372546ad5d05047a80251739d2aab9485b8f1 (diff)
Fix T40257: Frustum culling not working properly
Adding a hack so that KX_GameObjects' culling status is updated based on mesh slots.
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 9e8e58e9dfd..7b781344763 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -928,6 +928,27 @@ KX_GameObject::SetVisible(
}
}
+bool KX_GameObject::GetCulled()
+{
+ // If we're set to not cull, double-check with
+ // the mesh slots first. This is kind of nasty, but
+ // it allows us to get proper culling information.
+ if (!m_bCulled)
+ {
+ SG_QList::iterator<RAS_MeshSlot> mit(m_meshSlots);
+ for (mit.begin(); !mit.end(); ++mit)
+ {
+ if ((*mit)->m_bCulled)
+ {
+ m_bCulled = true;
+ break;
+ }
+ }
+ }
+
+ return m_bCulled;
+}
+
static void setOccluder_recursive(SG_Node* node, bool v)
{
NodeList& children = node->GetSGChildren();