BGE mesh modifiers: fix view frustrum culling for mesh with modifiers. Update the bounding box based on mesh extent after applying the modifiers.

This commit is contained in:
2009-04-25 12:20:59 +00:00
parent 3038fb1a01
commit b991b32458
9 changed files with 49 additions and 3 deletions

View File

@@ -1298,8 +1298,14 @@ void BL_CreateGraphicObjectNew(KX_GameObject* gameobj,
gameobj->SetGraphicController(ctrl);
ctrl->setNewClientInfo(gameobj->getClientInfo());
ctrl->setLocalAabb(localAabbMin, localAabbMax);
if (isActive)
if (isActive) {
// add first, this will create the proxy handle
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)
deformer->UpdateBuckets();
}
}
break;
#endif