mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 16:20:21 +00:00
Fix the collision shape not updating when scaling an object via script
This commit is contained in:
parent
e5ce3f62b7
commit
b2746c8c01
@ -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…
x
Reference in New Issue
Block a user