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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user