forked from mirror/openmw-tes3mp
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();
|
||||
handleToMesh[node->getName()] = mesh;
|
||||
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(
|
||||
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)
|
||||
|
|
|
@ -83,7 +83,12 @@ namespace
|
|||
ptr.getClass().insertObject (ptr, mPhysics);
|
||||
|
||||
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);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
|
|
Loading…
Reference in a new issue