mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
Remove a now-unneeded(?) hack
This commit is contained in:
parent
89fabdb3a9
commit
5d55b41714
@ -394,30 +394,13 @@ namespace MWWorld
|
|||||||
|
|
||||||
void PhysicsSystem::moveObject (const Ptr& ptr)
|
void PhysicsSystem::moveObject (const Ptr& ptr)
|
||||||
{
|
{
|
||||||
Ogre::SceneNode* node = ptr.getRefData().getBaseNode();
|
Ogre::SceneNode *node = ptr.getRefData().getBaseNode();
|
||||||
std::string handle = node->getName();
|
const std::string &handle = node->getName();
|
||||||
Ogre::Vector3 position = node->getPosition();
|
const Ogre::Vector3 &position = node->getPosition();
|
||||||
if (OEngine::Physic::RigidBody* body = mEngine->getRigidBody(handle))
|
if(OEngine::Physic::RigidBody *body = mEngine->getRigidBody(handle))
|
||||||
{
|
body->getWorldTransform().setOrigin(btVector3(position.x,position.y,position.z));
|
||||||
// TODO very dirty hack to avoid crash during setup -> needs cleaning up to allow
|
|
||||||
// start positions others than 0, 0, 0
|
|
||||||
|
|
||||||
|
|
||||||
if(dynamic_cast<btBoxShape*>(body->getCollisionShape()) == NULL){
|
|
||||||
btTransform tr = body->getWorldTransform();
|
|
||||||
tr.setOrigin(btVector3(position.x,position.y,position.z));
|
|
||||||
body->setWorldTransform(tr);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//For objects that contain a box shape.
|
|
||||||
//Do any such objects exist? Perhaps animated objects?
|
|
||||||
mEngine->boxAdjustExternal(handleToMesh[handle], body, node->getScale().x, position, node->getOrientation());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(OEngine::Physic::PhysicActor *physact = mEngine->getCharacter(handle))
|
else if(OEngine::Physic::PhysicActor *physact = mEngine->getCharacter(handle))
|
||||||
{
|
|
||||||
physact->setPosition(position);
|
physact->setPosition(position);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhysicsSystem::rotateObject (const Ptr& ptr)
|
void PhysicsSystem::rotateObject (const Ptr& ptr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user