Fix animated object physics

7220-lua-add-a-general-purpose-lexical-parser
Alexei Kotov 2 years ago
parent ee862fe825
commit b261f3bf65

@ -496,7 +496,11 @@ namespace MWPhysics
{
if (ptr.mRef->mData.mPhysicsPostponed)
return;
osg::ref_ptr<Resource::BulletShapeInstance> shapeInstance = mShapeManager->getInstance(mesh);
std::string animationMesh = mesh;
if (ptr.getClass().useAnim())
animationMesh = Misc::ResourceHelpers::correctActorModelPath(mesh, mResourceSystem->getVFS());
osg::ref_ptr<Resource::BulletShapeInstance> shapeInstance = mShapeManager->getInstance(animationMesh);
if (!shapeInstance || !shapeInstance->mCollisionShape)
return;

Loading…
Cancel
Save