|
|
|
@ -91,6 +91,8 @@ namespace MWMechanics
|
|
|
|
|
mPathFinder.checkPathCompleted(pos.pos[0],pos.pos[1],pos.pos[2]);
|
|
|
|
|
|
|
|
|
|
float zAngle = mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]);
|
|
|
|
|
|
|
|
|
|
// TODO: use movement settings instead of rotating directly
|
|
|
|
|
MWBase::Environment::get().getWorld()->rotateObject(actor, 0, 0, zAngle, false);
|
|
|
|
|
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 1;
|
|
|
|
|
|
|
|
|
@ -105,6 +107,7 @@ namespace MWMechanics
|
|
|
|
|
float directionResult = sqrt(directionX * directionX + directionY * directionY);
|
|
|
|
|
|
|
|
|
|
zAngle = Ogre::Radian( acos(directionY / directionResult) * sgn(asin(directionX / directionResult)) ).valueDegrees();
|
|
|
|
|
// TODO: use movement settings instead of rotating directly
|
|
|
|
|
MWBase::Environment::get().getWorld()->rotateObject(actor, 0, 0, zAngle, false);
|
|
|
|
|
|
|
|
|
|
mPathFinder.clearPath();
|
|
|
|
|