mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-31 14:36:39 +00:00
Evade obstacles after set rotation
This commit is contained in:
parent
eb10add0c4
commit
2c464bd682
1 changed files with 4 additions and 4 deletions
|
@ -186,15 +186,15 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const osg::Vec3f&
|
||||||
if (mRotateOnTheRunChecks > 0) mRotateOnTheRunChecks--;
|
if (mRotateOnTheRunChecks > 0) mRotateOnTheRunChecks--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// turn to next path point by X,Z axes
|
||||||
|
zTurn(actor, mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]));
|
||||||
|
smoothTurn(actor, mPathFinder.getXAngleToNext(pos.pos[0], pos.pos[1], pos.pos[2]), 0);
|
||||||
|
|
||||||
mObstacleCheck.update(actor, duration);
|
mObstacleCheck.update(actor, duration);
|
||||||
|
|
||||||
// handle obstacles on the way
|
// handle obstacles on the way
|
||||||
evadeObstacles(actor);
|
evadeObstacles(actor);
|
||||||
|
|
||||||
// turn to next path point by X,Z axes
|
|
||||||
zTurn(actor, mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]));
|
|
||||||
smoothTurn(actor, mPathFinder.getXAngleToNext(pos.pos[0], pos.pos[1], pos.pos[2]), 0);
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue