mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-30 08:06:51 +00:00
Merge pull request #2213 from elsid/min_path_point_tolerance
Use min point tolerance to prevent face wrong direction (bug #4814)
This commit is contained in:
commit
41d1521f1d
2 changed files with 2 additions and 2 deletions
|
@ -167,7 +167,7 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const osg::Vec3f&
|
||||||
mTimer = 0;
|
mTimer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const float pointTolerance = std::min(actor.getClass().getSpeed(actor), DEFAULT_TOLERANCE);
|
const float pointTolerance = std::max(MIN_TOLERANCE, std::min(actor.getClass().getSpeed(actor), DEFAULT_TOLERANCE));
|
||||||
|
|
||||||
mPathFinder.update(position, pointTolerance, DEFAULT_TOLERANCE);
|
mPathFinder.update(position, pointTolerance, DEFAULT_TOLERANCE);
|
||||||
|
|
||||||
|
|
|
@ -46,10 +46,10 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
|
|
||||||
const float PATHFIND_Z_REACH = 50.0f;
|
const float PATHFIND_Z_REACH = 50.0f;
|
||||||
//static const float sMaxSlope = 49.0f; // duplicate as in physicssystem
|
|
||||||
// distance after which actor (failed previously to shortcut) will try again
|
// distance after which actor (failed previously to shortcut) will try again
|
||||||
const float PATHFIND_SHORTCUT_RETRY_DIST = 300.0f;
|
const float PATHFIND_SHORTCUT_RETRY_DIST = 300.0f;
|
||||||
|
|
||||||
|
const float MIN_TOLERANCE = 1.0f;
|
||||||
const float DEFAULT_TOLERANCE = 32.0f;
|
const float DEFAULT_TOLERANCE = 32.0f;
|
||||||
|
|
||||||
// cast up-down ray with some offset from actor position to check for pits/obstacles on the way to target;
|
// cast up-down ray with some offset from actor position to check for pits/obstacles on the way to target;
|
||||||
|
|
Loading…
Reference in a new issue