mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-02 07:21:07 +00:00
Make path point tolerance depending on actor half extents
This commit is contained in:
parent
1e4bbe8997
commit
8fd6b37e34
@ -167,7 +167,9 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const osg::Vec3f&
|
|||||||
mTimer = 0;
|
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);
|
mPathFinder.update(position, pointTolerance, DEFAULT_TOLERANCE);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user