public void Accelerate(float value) { Motor.Throttle = value; Motor.Update(Speed); float motorTorque = Motor.CurrentPowerOutput; _currentTorque = motorTorque; if (motorTorque > 0.0001f) { if (Backwards) { _motorTorque = 0f; _brakeTorque = Math.Max(700, _brakeTorque + 0.7f); } else { _motorTorque = motorTorque; _brakeTorque = 0.0f; } } else { _motorTorque = 0.0f; _brakeTorque = Motor.CurrentFriction; } UpdateTorque(); _physXActor.WakeUp(); }
public void Brake(float value) { Motor.Throttle = -value; Motor.Update(Speed); float motorTorque = Motor.CurrentPowerOutput; _currentTorque = motorTorque; if (Backwards) { _motorTorque = motorTorque; _brakeTorque = 0f; } else { _motorTorque = 0.0f; _brakeTorque = Math.Max(870, _brakeTorque + 0.9f); } UpdateTorque(); //_physXActor.WakeUp(); }