forked from bartvdbraak/blender
BGE: small performance problem: object set invisible at startup were still put in the DBVT, causing unnecessary culling.
This commit is contained in:
parent
d5b27fabcc
commit
f5b3a00fbb
@ -1338,8 +1338,9 @@ void BL_CreateGraphicObjectNew(KX_GameObject* gameobj,
|
|||||||
ctrl->setNewClientInfo(gameobj->getClientInfo());
|
ctrl->setNewClientInfo(gameobj->getClientInfo());
|
||||||
ctrl->setLocalAabb(localAabbMin, localAabbMax);
|
ctrl->setLocalAabb(localAabbMin, localAabbMax);
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
// add first, this will create the proxy handle
|
// add first, this will create the proxy handle, only if the object is visible
|
||||||
env->addCcdGraphicController(ctrl);
|
if (gameobj->GetVisible())
|
||||||
|
env->addCcdGraphicController(ctrl);
|
||||||
// update the mesh if there is a deformer, this will also update the bounding box for modifiers
|
// update the mesh if there is a deformer, this will also update the bounding box for modifiers
|
||||||
RAS_Deformer* deformer = gameobj->GetDeformer();
|
RAS_Deformer* deformer = gameobj->GetDeformer();
|
||||||
if (deformer)
|
if (deformer)
|
||||||
|
Loading…
Reference in New Issue
Block a user