mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 09:53:54 +00:00
Rotate movement in the movement solver
This commit is contained in:
parent
f7f1adfb9d
commit
8c0bb1ff4d
2 changed files with 9 additions and 9 deletions
|
@ -184,13 +184,6 @@ Ogre::Vector3 CharacterController::update(float duration)
|
|||
}
|
||||
mSkipAnim = false;
|
||||
|
||||
const ESM::Position &refpos = mPtr.getRefData().getPosition();
|
||||
// Rotates first around z, then y, then x
|
||||
movement = (Ogre::Quaternion(Ogre::Radian(-refpos.rot[0]), Ogre::Vector3::UNIT_X)*
|
||||
Ogre::Quaternion(Ogre::Radian(-refpos.rot[1]), Ogre::Vector3::UNIT_Y)*
|
||||
Ogre::Quaternion(Ogre::Radian(-refpos.rot[2]), Ogre::Vector3::UNIT_Z)) *
|
||||
movement;
|
||||
|
||||
return movement;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,10 +80,17 @@ namespace MWWorld
|
|||
}
|
||||
|
||||
public:
|
||||
static Ogre::Vector3 move(const MWWorld::Ptr &ptr, const Ogre::Vector3 &movement, float time,
|
||||
static Ogre::Vector3 move(const MWWorld::Ptr &ptr, Ogre::Vector3 movement, float time,
|
||||
OEngine::Physic::PhysicEngine *engine)
|
||||
{
|
||||
Ogre::Vector3 position(ptr.getRefData().getPosition().pos);
|
||||
const ESM::Position &refpos = ptr.getRefData().getPosition();
|
||||
Ogre::Vector3 position(refpos.pos);
|
||||
|
||||
// Rotates first around z, then y, then x
|
||||
movement = (Ogre::Quaternion(Ogre::Radian(-refpos.rot[0]), Ogre::Vector3::UNIT_X)*
|
||||
Ogre::Quaternion(Ogre::Radian(-refpos.rot[1]), Ogre::Vector3::UNIT_Y)*
|
||||
Ogre::Quaternion(Ogre::Radian(-refpos.rot[2]), Ogre::Vector3::UNIT_Z)) *
|
||||
movement;
|
||||
|
||||
/* Anything to collide with? */
|
||||
OEngine::Physic::PhysicActor *physicActor = engine->getCharacter(ptr.getRefData().getHandle());
|
||||
|
|
Loading…
Reference in a new issue