Add files via upload

This commit is contained in:
Olezen
2019-08-15 13:42:42 +02:00
committed by GitHub
parent 6159ba4f6e
commit 69ee0deb38
4 changed files with 105 additions and 15 deletions

View File

@@ -76,7 +76,8 @@ namespace Fragsurf.Movement {
float maxDistPerFrame = 0.05f;
Vector3 velocityThisFrame = _surfer.moveData.velocity * _deltaTime;
float velocityDistLeft = velocityThisFrame.magnitude;
float velocityDist = velocityThisFrame.magnitude;
float velocityDistLeft = velocityDist;
float initialVel = velocityDistLeft;
while (velocityDistLeft > 0f) {
@@ -88,7 +89,7 @@ namespace Fragsurf.Movement {
_surfer.moveData.origin += velThisLoop;
// don't penetrate walls
SurfPhysics.ResolveCollisions (_surfer.collider, ref _surfer.moveData.origin, ref _surfer.moveData.velocity, _surfer.moveData.rigidbodyPushForce, amountThisLoop / initialVel);
SurfPhysics.ResolveCollisions (_surfer.collider, ref _surfer.moveData.origin, ref _surfer.moveData.velocity, _surfer.moveData.rigidbodyPushForce, amountThisLoop / velocityDist, _surfer.moveData.useStepOffset ? _surfer.moveData.stepOffset : 0f, _surfer);
}