Game Development Reference
In-Depth Information
The
SpeedSteeringValues
enumeration (see Listing 8-24) holds the acceleration control values for
the vehicle. The values are
None
: There is no value for the acceleration. Tells the vehicle to keep the
same speed
Accelerate
: Tells the vehicle to increase its speed
Decelerate
: Tells the vehicle to decrease its speed
Listing 8-24. Acceleration Values
enum SpeedSteeringValues
{
None,
Accelerate,
Deccelerate
}
The
m_HoriontalSteering
variable holds the left/right vehicle steering value.
private HorizontalSteeringValues m_HoriontalSteering;
The
m_VerticalSteering
variables hold the up/down steering values of a vehicle, if applicable.
private VerticalSteeringValues m_VerticalSteering;
The
m_SpeedSteering
variable holds the acceleration steering value of the vehicle.
private SpeedSteeringValues m_SpeedSteering;
The
m_MaxPitch
variable holds the maximum amount of tilt in degrees of the vehicle up or down,
if applicable.
private float m_MaxPitch = 45; // degrees
The
m_TurnDelta
variable holds the amount in degrees the vehicle turns in one update.
private float m_TurnDelta = 1; // degrees
The
m_MaxSpeed
variable holds the maximum speed or change in position per update.
private float m_MaxSpeed = 0.1f;
The
m_MinSpeed
variable holds the minimum speed or change in position per update.
private float m_MinSpeed = 0.05f;
The
m_SpeedDelta
variable holds the amount the speed will change per vehicle update.
private float m_SpeedDelta = 0.01f;