From 3dddcbd958eff7a19071cd3494b76c7c81923dbe Mon Sep 17 00:00:00 2001 From: gugus Date: Tue, 22 Mar 2011 13:01:23 +0100 Subject: [PATCH 1/2] fix a camera problem and increase player speed --- apps/openmw/mwrender/mwscene.cpp | 5 +++-- apps/openmw/mwworld/world.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwrender/mwscene.cpp b/apps/openmw/mwrender/mwscene.cpp index 5edadda97..0cd2634c5 100644 --- a/apps/openmw/mwrender/mwscene.cpp +++ b/apps/openmw/mwrender/mwscene.cpp @@ -109,13 +109,13 @@ void MWScene::doPhysics (float duration, MWWorld::World& world, Ogre::Quaternion yawQuat = yawNode->getOrientation(); Ogre::Quaternion pitchQuat = pitchNode->getOrientation(); Ogre::Vector3 dir1(iter->second.x,iter->second.z,-iter->second.y); - dir = 0.01*(yawQuat*pitchQuat*dir1); + dir = 0.07*(yawQuat*pitchQuat*dir1); } else { Ogre::Quaternion quat = yawNode->getOrientation(); Ogre::Vector3 dir1(iter->second.x,iter->second.z,-iter->second.y); - dir = 0.01*(quat*dir1); + dir = 0.07*(quat*dir1); } //set the walk direction @@ -127,6 +127,7 @@ 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()); } diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index 539fa8235..e08425336 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -309,7 +309,7 @@ namespace MWWorld bool adjustPlayerPos) { if (adjustPlayerPos) - mPlayer->setPos (position.pos[0], position.pos[1], position.pos[2], true); + mPlayer->setPos (position.pos[0], position.pos[1], position.pos[2], false); mPlayer->setCell (cell); // TODO orientation From 7a28c9f3aa8aef67abd7dcb20c8d87c6c0bfe643 Mon Sep 17 00:00:00 2001 From: gugus Date: Tue, 22 Mar 2011 20:15:19 +0100 Subject: [PATCH 2/2] 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 b902708cf..e0aa8c45b 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 e08425336..b30ee29a5 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()); }