mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 17:59:56 +00:00
Merge branch 'water_walking_evasion' into 'master'
Adjust initial distance when destination is changed for obstacle check (#6860) Closes #6860 See merge request OpenMW/openmw!2440
This commit is contained in:
commit
b1cf4ace3c
4 changed files with 15 additions and 18 deletions
|
@ -170,6 +170,7 @@
|
|||
Bug #6794: Light sources are attached to mesh bounds centers instead of mesh origins when AttachLight NiNode is missing
|
||||
Bug #6799: Game crashes if an NPC has no Class attached
|
||||
Bug #6849: ImageButton texture is not scaled properly
|
||||
Bug #6860: Sinnammu randomly strafes while running on water
|
||||
Bug #6869: Hits queue stagger during swing animation
|
||||
Bug #6890: SDL_PeepEvents errors are not handled
|
||||
Bug #6895: Removing a negative number of items from a script, makes the script terminate with an error
|
||||
|
|
|
@ -139,11 +139,18 @@ namespace MWMechanics
|
|||
mStateDuration = 0;
|
||||
mPrev = position;
|
||||
mInitialDistance = (destination - position).length();
|
||||
mDestination = destination;
|
||||
return;
|
||||
}
|
||||
|
||||
if (mWalkState != WalkState::Evade)
|
||||
{
|
||||
if (mDestination != destination)
|
||||
{
|
||||
mInitialDistance = (destination - mPrev).length();
|
||||
mDestination = destination;
|
||||
}
|
||||
|
||||
const float distSameSpot = DIST_SAME_SPOT * actor.getClass().getCurrentSpeed(actor) * duration;
|
||||
const float prevDistance = (destination - mPrev).length();
|
||||
const float currentDistance = (destination - position).length();
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace MWMechanics
|
|||
|
||||
private:
|
||||
osg::Vec3f mPrev;
|
||||
osg::Vec3f mDestination;
|
||||
|
||||
// directions to try moving in when get stuck
|
||||
static const float evadeDirections[NUM_EVADE_DIRECTIONS][2];
|
||||
|
|
|
@ -188,27 +188,15 @@ namespace DetourNavigator
|
|||
const RecastParams& params, rcHeightfield& solid)
|
||||
{
|
||||
const std::array vertices{
|
||||
rectangle.mBounds.mMin.x(),
|
||||
rectangle.mHeight,
|
||||
rectangle.mBounds.mMin.y(),
|
||||
rectangle.mBounds.mMin.x(),
|
||||
rectangle.mHeight,
|
||||
rectangle.mBounds.mMax.y(),
|
||||
rectangle.mBounds.mMax.x(),
|
||||
rectangle.mHeight,
|
||||
rectangle.mBounds.mMax.y(),
|
||||
rectangle.mBounds.mMax.x(),
|
||||
rectangle.mHeight,
|
||||
rectangle.mBounds.mMin.y(),
|
||||
rectangle.mBounds.mMin.x(), rectangle.mHeight, rectangle.mBounds.mMin.y(), // vertex 0
|
||||
rectangle.mBounds.mMin.x(), rectangle.mHeight, rectangle.mBounds.mMax.y(), // vertex 1
|
||||
rectangle.mBounds.mMax.x(), rectangle.mHeight, rectangle.mBounds.mMax.y(), // vertex 2
|
||||
rectangle.mBounds.mMax.x(), rectangle.mHeight, rectangle.mBounds.mMin.y(), // vertex 3
|
||||
};
|
||||
|
||||
const std::array indices{
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
3,
|
||||
0, 1, 2, // triangle 0
|
||||
0, 2, 3, // triangle 1
|
||||
};
|
||||
|
||||
const std::array<unsigned char, 2> areas{ areaType, areaType };
|
||||
|
|
Loading…
Reference in a new issue