Game Development Reference
In-Depth Information
The ClearSteering() function clears the horizontal, vertical, and speed vehicle inputs to None. This
function is called when the steering object is first constructed. (See Listing 8-25.)
Listing 8-25. Clearing the Steering
void ClearSteering()
{
m_HoriontalSteering = HorizontalSteeringValues.None;
m_VerticalSteering = VerticalSteeringValues.None;
m_SpeedSteering = SpeedSteeringValues.None;
}
The SetSteeringHorizontal() function sets the horizontal value of the vehicle's steering input and
the turn rate or turn delta per vehicle update. (See Listing 8-26.)
Listing 8-26. Setting the Vehicle's Horizontal Steering Value
void SetSteeringHorizontal(HorizontalSteeringValues Horizontal, float TurnDelta)
{
m_HoriontalSteering = Horizontal;
m_TurnDelta = TurnDelta;
}
The SetSteeringVertical() function sets the vertical up/down value of the vehicle's steering input
and the maximum pitch up or down the vehicle can tilt. (See Listing 8-27.)
Listing 8-27. Setting the Vertical Steering Value
void SetSteeringVertical(VerticalSteeringValues Vertical, float MaxPitch)
{
m_VerticalSteering = Vertical;
m_MaxPitch = MaxPitch;
}
The SetSteeringSpeed() function sets the acceleration or deceleration input to the vehicle, the
maximum speed of the vehicle, the minimum speed of the vehicle, and the rate of change of
the speed or speed delta. (See Listing 8-28.)
Listing 8-28. Setting the Speed of the Vehicle
void SetSteeringSpeed(SpeedSteeringValues Speed, float MaxSpeed, float MinSpeed, float SpeedDelta)
{
m_SpeedSteering = Speed;
m_MaxSpeed = MaxSpeed;
m_MinSpeed = MinSpeed;
m_SpeedDelta = SpeedDelta;
}
 
Search WWH ::




Custom Search