Skip to content

Commit

Permalink
improving the time estimator
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbrubaker committed Sep 20, 2018
1 parent f1caf95 commit dc4cb0a
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions VectorMath/Estimator.cs
Expand Up @@ -44,19 +44,12 @@ public static class Estimator
Vector3 velocitySameAsStopPerS,
Vector3 speedMultiplier)
{
double longestTime = 0;
for(int i=0; i<3; i++)
{
longestTime = Math.Max(longestTime,
GetSecondsForMovement(delta[i],
ratePerSecond,
maxAccelerationPerS2[i],
maxVelocityPerS[i],
velocitySameAsStopPerS[i],
speedMultiplier[i]));
}

return longestTime;
return GetSecondsForMovement(delta.Length,
ratePerSecond,
maxAccelerationPerS2.X,
maxVelocityPerS.X,
velocitySameAsStopPerS.X,
speedMultiplier.X);
}


Expand All @@ -65,7 +58,7 @@ public static class Estimator
double maxAccelerationPerS2,
double maxVelocityPerS,
double velocitySameAsStopPerS,
double speedMultiplier)
double speedMultiplier = 1)
{
if (delta == 0)
{
Expand Down

0 comments on commit dc4cb0a

Please sign in to comment.