Add files via upload

This commit is contained in:
Olezen
2019-08-02 17:18:15 +02:00
committed by GitHub
parent 76f9be0933
commit 4ee942e09d
2 changed files with 12 additions and 5 deletions

View File

@@ -74,9 +74,10 @@ namespace Fragsurf.Movement {
speed = _surfer.moveData.velocity.magnitude;
_surfer.moveData.velocity.y = yVel;
float maxDistPerFrame = 1f;
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);
SurfPhysics.ResolveCollisions (_surfer.collider, ref _surfer.moveData.origin, ref _surfer.moveData.velocity, _surfer.moveData.rigidbodyPushForce, amountThisLoop / velocityDist);
}