BGE: small performance problem: object set invisible at startup were still put in...
authorBenoit Bolsee <benoit.bolsee@online.be>
Fri, 29 May 2009 17:09:20 +0000 (17:09 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Fri, 29 May 2009 17:09:20 +0000 (17:09 +0000)
source/gameengine/Converter/BL_BlenderDataConversion.cpp

index d9e93d41f342b52a48bc2b3a839ecbc845f42615..385301b110587c06f65cdc739de1757f959a3fbc 100644 (file)
@@ -1338,8 +1338,9 @@ void BL_CreateGraphicObjectNew(KX_GameObject* gameobj,
                                ctrl->setNewClientInfo(gameobj->getClientInfo());
                                ctrl->setLocalAabb(localAabbMin, localAabbMax);
                                if (isActive) {
                                ctrl->setNewClientInfo(gameobj->getClientInfo());
                                ctrl->setLocalAabb(localAabbMin, localAabbMax);
                                if (isActive) {
-                                       // add first, this will create the proxy handle
-                                       env->addCcdGraphicController(ctrl);
+                                       // add first, this will create the proxy handle, only if the object is visible
+                                       if (gameobj->GetVisible())
+                                               env->addCcdGraphicController(ctrl);
                                        // update the mesh if there is a deformer, this will also update the bounding box for modifiers
                                        RAS_Deformer* deformer = gameobj->GetDeformer();
                                        if (deformer)
                                        // update the mesh if there is a deformer, this will also update the bounding box for modifiers
                                        RAS_Deformer* deformer = gameobj->GetDeformer();
                                        if (deformer)