1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-30 07:21:12 +00:00

Make path point tolerance depending on actor half extents

This commit is contained in:
elsid 2019-03-08 20:01:50 +03:00
parent 1e4bbe8997
commit 8fd6b37e34
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

View File

@ -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);