Merge remote branch 'gus/collision' into collision

actorid
Marc Zinnschlag 14 years ago
commit 9946bb36f7

@ -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
@ -163,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))
{
@ -173,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));
}
}
}

@ -309,11 +309,10 @@ 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
mEnvironment.mMechanicsManager->addActor (mPlayer->getPlayer());
mEnvironment.mMechanicsManager->watchActor (mPlayer->getPlayer());
}

Loading…
Cancel
Save