Truncate() public method

public Truncate ( double max ) : void
max double
return void
Ejemplo n.º 1
0
        /// <summary>
        ///  Calculates the overall steering force based on the currently active
        ///  steering behaviors.
        /// </summary>
        /// <returns></returns>
        public Vector2D CalculateSteeringForce()
        {
            //reset the force
            _steeringForce.Zero();

            //this will hold the value of each individual steering force
            _steeringForce = sumForces();

            //make sure the force doesn't exceed the vehicles maximum allowable
            _steeringForce.Truncate(_player.MaxForce);

            return(_steeringForce);
        }
        /// <summary>
        ///  Calculates the overall steering force based on the currently active
        ///  steering behaviors. 
        /// </summary>
        /// <returns></returns>
        public Vector2D CalculateSteeringForce()
        {
            //reset the force
            _steeringForce.Zero();

            //this will hold the value of each individual steering force
            _steeringForce = sumForces();

            //make sure the force doesn't exceed the vehicles maximum allowable
            _steeringForce.Truncate(_player.MaxForce);

            return _steeringForce;
        }