mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 16:20:21 +00:00
re-introduce short circuiting, but only under certain circumstances
This commit is contained in:
parent
784b1888a9
commit
20cbf941fb
@ -322,6 +322,18 @@ namespace MWPhysics
|
|||||||
newPosition = (newPosition + tracer.mEndPos)/2.0;
|
newPosition = (newPosition + tracer.mEndPos)/2.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// short circuit if we went backwards, but only if it was mostly horizontal and we're on the ground
|
||||||
|
if (seenGround && newVelocity * origVelocity <= 0.0f)
|
||||||
|
{
|
||||||
|
auto perpendicular = newVelocity ^ origVelocity;
|
||||||
|
if (perpendicular.length2() > 0.0f)
|
||||||
|
{
|
||||||
|
perpendicular.normalize();
|
||||||
|
if (std::abs(perpendicular.z()) > 0.7071f)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Do not allow sliding up steep slopes if there is gravity.
|
// Do not allow sliding up steep slopes if there is gravity.
|
||||||
// The purpose of this is to prevent air control from letting you slide up tall, unwalkable slopes.
|
// The purpose of this is to prevent air control from letting you slide up tall, unwalkable slopes.
|
||||||
// For that purpose, it is not necessary to do it when trying to slide along acute seams/crevices (i.e. usedSeamLogic)
|
// For that purpose, it is not necessary to do it when trying to slide along acute seams/crevices (i.e. usedSeamLogic)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user