Optimize physics shape scaling on cell load

deque
scrawl 10 years ago
parent db6b04d127
commit 20777c1b2e

@ -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…
Cancel
Save