Browse Source

add grace hieght for pathshape snapping eval
leverage minFaceDistance plus current hieght to try and ensure stepping down into a pathshape/tsstatic within the 0.1 ot -1.0 detection range range doesn't snap you through another one.

AzaezelX 2 months ago
parent
commit
0f2e4b80e6
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Engine/source/T3D/player.cpp

+ 4 - 1
Engine/source/T3D/player.cpp

@@ -4763,8 +4763,11 @@ void Player::updateAttachment()
         Point3F(pos.x, pos.y, pos.z - 1.0f ),
        sCollisionMoveMask, &rInfo))
     {
+       Point3F setPos = rInfo.point;
+       setPos.z = mMax(setPos.z+sMinFaceDistance, pos.z);
+
        if ((mJumpSurfaceLastContact < JumpSkipContactsMax) && !mSwimming)
-          setPosition(rInfo.point, getRotation());
+          setPosition(setPos, getRotation());
 
        if( rInfo.object->getTypeMask() & PathShapeObjectType) //Ramen
        {