Пример #1
0
        private Vector2 CalculateTractiveForce(float gasPedal, Vector2 wheelDirection, float gearRatio)
        {
            var engineTorque           = vehicleConstants.GetEngineTorque(vehicleConstants.GetCrankshaftSpeed(gasPedal));
            var differentialRatio      = vehicleConstants.DifferentialRatio;
            var transmissionEfficiency = vehicleConstants.TransmissionEfficiency;
            var wheelRadius            = vehicleConstants.OverallWheelRadius;

            return(wheelDirection * engineTorque * gearRatio * differentialRatio * transmissionEfficiency / wheelRadius);
        }
Пример #2
0
 public void CrankshaftSpeedIsPositive(float gasPedal)
 {
     Assert.True(constants.GetCrankshaftSpeed(gasPedal) >= 0);
 }