BulletSim: add ToString override to BSVMotor.

connector_plugin^2
Robert Adams 2012-11-25 19:05:42 -08:00
parent 319ec3235c
commit f977131fe0
1 changed files with 6 additions and 1 deletions

View File

@ -75,7 +75,7 @@ public class BSVMotor : BSMotor
Vector3 origTarget = TargetValue; // DEBUG Vector3 origTarget = TargetValue; // DEBUG
Vector3 origCurrVal = CurrentValue; // DEBUG Vector3 origCurrVal = CurrentValue; // DEBUG
// Add (desiredVector - currentAppliedVector) / howLongItShouldTakeToComplete // Addition = (desiredVector - currentAppliedVector) / secondsItShouldTakeToComplete
Vector3 addAmount = (TargetValue - CurrentValue)/TimeScale * timeStep; Vector3 addAmount = (TargetValue - CurrentValue)/TimeScale * timeStep;
CurrentValue += addAmount; CurrentValue += addAmount;
returnCurrent = CurrentValue; returnCurrent = CurrentValue;
@ -109,6 +109,11 @@ public class BSVMotor : BSMotor
} }
return returnCurrent; return returnCurrent;
} }
public override string ToString()
{
return String.Format("<{0},curr={1},targ={2},decayTS={3},frictTS={4}>",
UseName, CurrentValue, TargetValue, TargetValueDecayTimeScale, FrictionTimescale);
}
} }
public class BSFMotor : BSMotor public class BSFMotor : BSMotor