コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MovementSpeed"/> struct.
 /// </summary>
 /// <param name="maxSpeed">The maximum speed in m/s.</param>
 /// <param name="acceleration">The acceleration in m/s².</param>
 /// <param name="deceleration">The deceleration in m/s².</param>
 public MovementSpeed(float maxSpeed, float acceleration, float deceleration)
 {
     this.MaximumSpeed = EngineMath.ForcePositive(maxSpeed);
     this.Acceleration = EngineMath.ForcePositive(acceleration);
     this.Decelration  = EngineMath.ForceNegative(deceleration);
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MovementSpeed"/> struct.
 /// </summary>
 /// <param name="maxSpeed">The maximum speed in m/s.</param>
 /// <param name="acceleration">The acceleration in m/s².</param>
 public MovementSpeed(float maxSpeed, float acceleration)
 {
     this.MaximumSpeed = maxSpeed;
     this.Acceleration = EngineMath.ForcePositive(acceleration);
     this.Decelration  = 0f;
 }