forked from mirror/openmw-tes3mp
Fix the collision shape not updating when scaling an object via script
This commit is contained in:
parent
e5ce3f62b7
commit
b2746c8c01
2 changed files with 3 additions and 2 deletions
|
@ -1062,9 +1062,9 @@ namespace MWPhysics
|
|||
void PhysicsSystem::updateScale(const MWWorld::Ptr &ptr)
|
||||
{
|
||||
ObjectMap::iterator found = mObjects.find(ptr);
|
||||
float scale = ptr.getCellRef().getScale();
|
||||
if (found != mObjects.end())
|
||||
{
|
||||
float scale = ptr.getCellRef().getScale();
|
||||
found->second->setScale(scale);
|
||||
mCollisionWorld->updateSingleAabb(found->second->getCollisionObject());
|
||||
return;
|
||||
|
|
|
@ -73,6 +73,8 @@ namespace
|
|||
osg::Vec3f scaleVec (scale, scale, scale);
|
||||
ptr.getClass().adjustScale(ptr, scaleVec, true);
|
||||
rendering.scaleObject(ptr, scaleVec);
|
||||
|
||||
physics.updateScale(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,7 +116,6 @@ namespace
|
|||
{
|
||||
addObject(ptr, mPhysics, mRendering);
|
||||
updateObjectRotation(ptr, mPhysics, mRendering, false);
|
||||
updateObjectScale(ptr, mPhysics, mRendering);
|
||||
ptr.getClass().adjustPosition (ptr, false);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
|
|
Loading…
Reference in a new issue