mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 22:45:34 +00:00
Optimize physics shape scaling on cell load
This commit is contained in:
parent
db6b04d127
commit
20777c1b2e
2 changed files with 8 additions and 3 deletions
|
@ -661,9 +661,9 @@ namespace MWWorld
|
||||||
Ogre::SceneNode* node = ptr.getRefData().getBaseNode();
|
Ogre::SceneNode* node = ptr.getRefData().getBaseNode();
|
||||||
handleToMesh[node->getName()] = mesh;
|
handleToMesh[node->getName()] = mesh;
|
||||||
mEngine->createAndAdjustRigidBody(
|
mEngine->createAndAdjustRigidBody(
|
||||||
mesh, node->getName(), node->getScale().x, node->getPosition(), node->getOrientation(), 0, 0, false, placeable);
|
mesh, node->getName(), ptr.getCellRef().getScale(), node->getPosition(), node->getOrientation(), 0, 0, false, placeable);
|
||||||
mEngine->createAndAdjustRigidBody(
|
mEngine->createAndAdjustRigidBody(
|
||||||
mesh, node->getName(), node->getScale().x, node->getPosition(), node->getOrientation(), 0, 0, true, placeable);
|
mesh, node->getName(), ptr.getCellRef().getScale(), node->getPosition(), node->getOrientation(), 0, 0, true, placeable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhysicsSystem::addActor (const Ptr& ptr)
|
void PhysicsSystem::addActor (const Ptr& ptr)
|
||||||
|
|
|
@ -83,7 +83,12 @@ namespace
|
||||||
ptr.getClass().insertObject (ptr, mPhysics);
|
ptr.getClass().insertObject (ptr, mPhysics);
|
||||||
|
|
||||||
updateObjectLocalRotation(ptr, mPhysics, mRendering);
|
updateObjectLocalRotation(ptr, mPhysics, mRendering);
|
||||||
MWBase::Environment::get().getWorld()->scaleObject (ptr, ptr.getCellRef().getScale());
|
if (ptr.getRefData().getBaseNode())
|
||||||
|
{
|
||||||
|
float scale = ptr.getCellRef().getScale();
|
||||||
|
ptr.getClass().adjustScale(ptr, scale);
|
||||||
|
mRendering.scaleObject(ptr, Ogre::Vector3(scale));
|
||||||
|
}
|
||||||
ptr.getClass().adjustPosition (ptr, false);
|
ptr.getClass().adjustPosition (ptr, false);
|
||||||
}
|
}
|
||||||
catch (const std::exception& e)
|
catch (const std::exception& e)
|
||||||
|
|
Loading…
Reference in a new issue