From 7a28c9f3aa8aef67abd7dcb20c8d87c6c0bfe643 Mon Sep 17 00:00:00 2001 From: gugus Date: Tue, 22 Mar 2011 20:15:19 +0100 Subject: [PATCH] fix the door bug --- apps/openmw/mwrender/mwscene.cpp | 9 +++++++-- apps/openmw/mwworld/world.cpp | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwrender/mwscene.cpp b/apps/openmw/mwrender/mwscene.cpp index b902708cfe..e0aa8c45b9 100644 --- a/apps/openmw/mwrender/mwscene.cpp +++ b/apps/openmw/mwrender/mwscene.cpp @@ -127,7 +127,6 @@ void MWScene::doPhysics (float duration, MWWorld::World& world, { OEngine::Physic::PhysicActor* act = it->second; btVector3 newPos = act->getPosition(); - std::cout << newPos.x()<first); world.moveObject (ptr, newPos.x(), newPos.y(), newPos.z()); } @@ -164,7 +163,7 @@ void MWScene::moveObject (const std::string& handle, const Ogre::Vector3& positi { rend.getScene()->getSceneNode(handle)->setPosition(position); - if(updatePhysics)//TODO: is it an actor? + if(updatePhysics)//TODO: is it an actor? Done? { if (OEngine::Physic::RigidBody* body = eng->getRigidBody(handle)) { @@ -174,6 +173,12 @@ void MWScene::moveObject (const std::string& handle, const Ogre::Vector3& positi tr.setOrigin(btVector3(position.x,position.y,position.z)); body->setWorldTransform(tr); } + if (OEngine::Physic::PhysicActor* act = eng->getCharacter(handle)) + { + // TODO very dirty hack to avoid crash during setup -> needs cleaning up to allow + // start positions others than 0, 0, 0 + act->setPosition(btVector3(position.x,position.y,position.z)); + } } } diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index e084253367..b30ee29a5f 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -313,7 +313,6 @@ namespace MWWorld mPlayer->setCell (cell); // TODO orientation - mEnvironment.mMechanicsManager->addActor (mPlayer->getPlayer()); mEnvironment.mMechanicsManager->watchActor (mPlayer->getPlayer()); }