Exemple #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);
        }
Exemple #2
0
 public void EngineTorqueIsPositive(float rpm)
 {
     Assert.True(constants.GetEngineTorque(rpm) > 0);
 }