mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-13 22:11:58 +03:00
Make path point tolerance depending on actor half extents
This commit is contained in:
parent
1e4bbe8997
commit
8fd6b37e34
1 changed files with 3 additions and 1 deletions
|
@ -167,7 +167,9 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const osg::Vec3f&
|
|||
mTimer = 0;
|
||||
}
|
||||
|
||||
const float pointTolerance = std::max(MIN_TOLERANCE, std::min(actor.getClass().getSpeed(actor), DEFAULT_TOLERANCE));
|
||||
const float actorTolerance = 2 * actor.getClass().getSpeed(actor) * duration
|
||||
+ 1.2 * std::max(halfExtents.x(), halfExtents.y());
|
||||
const float pointTolerance = std::max(MIN_TOLERANCE, actorTolerance);
|
||||
|
||||
mPathFinder.update(position, pointTolerance, DEFAULT_TOLERANCE);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue