Example #1
0
        private float GetCorneringFactor(float angle, CarSpecification specs)
        {
            angle = MathF.NormalizeAngle(angle);

            if (angle > MathF.Pi)
            {
                angle -= MathF.Pi;
            }

            var threshold = MathF.DegToRad(specs.CorneringThreshold);

            if (angle < threshold)
            {
                return(angle / threshold);
            }

            if (angle > MathF.Pi - threshold)
            {
                return((MathF.Pi - angle) / threshold);
            }

            return(1);
        }
Example #2
0
 private void ApplyCorneringForce(Car car, CarSpecification specs, RigidBody physics,
                                  Transform transform, Vector2 localVel)
 {
 }