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:
authorBenoit Bolsee <benoit.bolsee@online.be>2009-05-01 23:02:23 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2009-05-01 23:02:23 +0400
commite13a089d918cbe3709f544ccebbb718a452ac6fa (patch)
tree2b8d3e36659fe11591a981f6e12a9443bbfa2d57 /source/gameengine/Ketsji/KX_GameObject.cpp
parent672492f563e148dc608965c5d0011413fbfae0eb (diff)
BGE: work around a problem with DBVT culling when graphic objects are rescaled. This happens when objects with very diverse scale are instantiated with dupligroup. The problem remains when the objects are rescaled during the game. The effect of the problem is an inefficient culling: objects can have a bounding box larger than needed. Patch to fix the problem is filed at Bullet forum.
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 20113afaae2..fa95a89135b 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -331,6 +331,35 @@ void KX_GameObject::ProcessReplica()
}
+static void setGraphicController_recursive(SG_Node* node, bool v)
+{
+ NodeList& children = node->GetSGChildren();
+
+ for (NodeList::iterator childit = children.begin();!(childit==children.end());++childit)
+ {
+ SG_Node* childnode = (*childit);
+ KX_GameObject *clientgameobj = static_cast<KX_GameObject*>( (*childit)->GetSGClientObject());
+ if (clientgameobj != NULL) // This is a GameObject
+ clientgameobj->ActivateGraphicController(v, false);
+
+ // if the childobj is NULL then this may be an inverse parent link
+ // so a non recursive search should still look down this node.
+ setGraphicController_recursive(childnode, v);
+ }
+}
+
+
+void KX_GameObject::ActivateGraphicController(bool active, bool recurse)
+{
+ if (m_pGraphicController)
+ {
+ m_pGraphicController->Activate(active);
+ }
+ if (recurse)
+ {
+ setGraphicController_recursive(GetSGNode(), active);
+ }
+}
CValue* KX_GameObject::GetReplica()