DI-Guy SDK Documentation  13.5
diguyVehicleController Class Reference

Attached to certain types of more complex vehicles, to manage their behavior. More...

#include <diguyVehicleController.h>

Public Member Functions

diguyCharacterget_vehicle_character ()
 
void set_speed (float speed, diguySpeedUnits units=DIGUY_SPEED_UNITS_METERS_PER_SECOND)
 This function sets the vehicle's speed. More...
 
float get_speed (diguySpeedUnits units=DIGUY_SPEED_UNITS_METERS_PER_SECOND)
 Returns vehicle's current speed. More...
 
void set_desired_speed_with_acceleration (float desired_speed, float acceleration, diguySpeedUnits units=DIGUY_SPEED_UNITS_METERS_PER_SECOND)
 Vehicle's speed will increase or decrease over time to match the desired speed. More...
 
void set_desired_speed_with_acceleration_time (float desired_speed, float acceleration_time, diguySpeedUnits units=DIGUY_SPEED_UNITS_METERS_PER_SECOND)
 An acceleration value is calculated from the time interval and the difference between current speed and desired speed. More...
 
float get_desired_speed (diguySpeedUnits units=DIGUY_SPEED_UNITS_METERS_PER_SECOND)
 Returns the desired speed, as currently set. More...
 
void set_default_acceleration (float acceleration, diguySpeedUnits units=DIGUY_SPEED_UNITS_METERS_PER_SECOND)
 Sets the default acceleration value that will be used whenever the vehicle needs to raise its speed. More...
 
float get_default_acceleration (diguySpeedUnits units=DIGUY_SPEED_UNITS_METERS_PER_SECOND)
 
void set_default_deceleration (float deceleration, diguySpeedUnits units=DIGUY_SPEED_UNITS_METERS_PER_SECOND)
 Sets the default deceleration value that will be used whenever the vehicle needs to lower its speed. More...
 
float get_default_deceleration (diguySpeedUnits units=DIGUY_SPEED_UNITS_METERS_PER_SECOND)
 
void set_vehicle_simulation_mode (diguyVehicleSimulationMode vsim_mode)
 Sets the simulation mode, which corresponds, roughly, to the degree of realism of the vehicle's movements. More...
 
diguyVehicleSimulationMode get_vehicle_simulation_mode ()
 Returns value set by set_vehicle_simulation_mode() More...
 
void set_front_wheels_steer_angle (float angle)
 Only works in DIGUY_VEHICLE_SIMULATION_MODE_STEERING. More...
 
float get_front_wheels_steer_angle ()
 See set_front_wheels_steer_angle() More...
 
void set_desired_front_wheels_steer_angle (float desired_angle, float angle_change_rate=DIGUY_DEFAULT_FLOAT)
 Similar to set_desired_front_wheels_steer_angle(), but sets the angle that the wheels will eventually move to, at the rate specified. More...
 
float get_desired_front_wheels_steer_angle ()
 See set_desired_front_wheels_steer_angle() More...
 

Private Functions

The functions and variables past this point are for internal use only.

No external access to them is expected or necessary.

bdiScenarioVehicleControllerm_scripted_object
 A pointer to internal data. More...
 
class bdiScenarioVehicleController
 
bdiScenarioVehicleControllerget_scripted_object ()
 
 diguyVehicleController (bdiScenarioVehicleController *vehicle_controller)
 A private constructor. More...
 

Detailed Description

Attached to certain types of more complex vehicles, to manage their behavior.

An instance of this class is attached to vehicles that are of the following character types.

vehicle_09 vehicle_wheels vehicle_turret

These vehicles might be wheeled vehicles, turreted vehicles, or "complete" vehicles. The set does not include vehicles that belong to the older character type, "vehicle"; this character type does not support rotating or turning wheels. Some vehicles in vehicle_09 are helicopters and support rotating blades. Some feature rotating gun turrets.

Constructor & Destructor Documentation

diguyVehicleController::diguyVehicleController ( bdiScenarioVehicleController vehicle_controller)
private

A private constructor.

Member Function Documentation

diguyCharacter* diguyVehicleController::get_vehicle_character ( )
void diguyVehicleController::set_speed ( float  speed,
diguySpeedUnits  units = DIGUY_SPEED_UNITS_METERS_PER_SECOND 
)

This function sets the vehicle's speed.

The speed becomes effective immediately; no acceleration or deceleration is applied.

Parameters
speednew speed of vehicle
unitsunits of speed

Callable From:

  • C++
  • Script
float diguyVehicleController::get_speed ( diguySpeedUnits  units = DIGUY_SPEED_UNITS_METERS_PER_SECOND)

Returns vehicle's current speed.

See set_speed().

void diguyVehicleController::set_desired_speed_with_acceleration ( float  desired_speed,
float  acceleration,
diguySpeedUnits  units = DIGUY_SPEED_UNITS_METERS_PER_SECOND 
)

Vehicle's speed will increase or decrease over time to match the desired speed.

If necessary, the acceleration value will be applied as deceleration instead.

void diguyVehicleController::set_desired_speed_with_acceleration_time ( float  desired_speed,
float  acceleration_time,
diguySpeedUnits  units = DIGUY_SPEED_UNITS_METERS_PER_SECOND 
)

An acceleration value is calculated from the time interval and the difference between current speed and desired speed.

float diguyVehicleController::get_desired_speed ( diguySpeedUnits  units = DIGUY_SPEED_UNITS_METERS_PER_SECOND)

Returns the desired speed, as currently set.

void diguyVehicleController::set_default_acceleration ( float  acceleration,
diguySpeedUnits  units = DIGUY_SPEED_UNITS_METERS_PER_SECOND 
)

Sets the default acceleration value that will be used whenever the vehicle needs to raise its speed.

float diguyVehicleController::get_default_acceleration ( diguySpeedUnits  units = DIGUY_SPEED_UNITS_METERS_PER_SECOND)
void diguyVehicleController::set_default_deceleration ( float  deceleration,
diguySpeedUnits  units = DIGUY_SPEED_UNITS_METERS_PER_SECOND 
)

Sets the default deceleration value that will be used whenever the vehicle needs to lower its speed.

float diguyVehicleController::get_default_deceleration ( diguySpeedUnits  units = DIGUY_SPEED_UNITS_METERS_PER_SECOND)
void diguyVehicleController::set_vehicle_simulation_mode ( diguyVehicleSimulationMode  vsim_mode)

Sets the simulation mode, which corresponds, roughly, to the degree of realism of the vehicle's movements.

Values:

  • DIGUY_VEHICLE_SIMULATION_MODE_NONE: the vehicle behaves simply as a moving box, with no wheel rotation or turning, or steering. The vehicle simply pivots around its origin.
  • DIGUY_VEHICLE_SIMULATION_MODE_WHEELS: like NONE, but the wheels rotate.
  • DIGUY_VEHICLE_SIMULATION_MODE_REAR_AXLE_FOLLOWING: like WHEELS, but the turning is more realistic. The front wheels turn in their wells, and the pivot axis is what it would be in a real car. The vehicle will try to only perform turns that fit its steering limits; thus, it might go through a series of turns to round a tight corner or to turn around.
  • DIGUY_VEHICLE_SIMULATION_MODE_STEERING: only applies in I-Guy mode, in Scenario. Allows the user to be given direct control over the vehicle.
  • DIGUY_VEHICLE_SIMULATION_MODE_FULL_PHYSICS: causes control of the vehicle to be taken over by the physics module. This mode is only useful for rigid body simulation purposes, such as when a vehicle is thrown through the air by an explosion, not for control of normal vehicle movements. All the modes above have some degree of "physics", in the sense that DI-Guy makes an effort to keep the wheels on the terrain.
diguyVehicleSimulationMode diguyVehicleController::get_vehicle_simulation_mode ( )

Returns value set by set_vehicle_simulation_mode()

void diguyVehicleController::set_front_wheels_steer_angle ( float  angle)

Only works in DIGUY_VEHICLE_SIMULATION_MODE_STEERING.

Sets the steering angle of the front wheels, with zero being straight ahead.

float diguyVehicleController::get_front_wheels_steer_angle ( )
void diguyVehicleController::set_desired_front_wheels_steer_angle ( float  desired_angle,
float  angle_change_rate = DIGUY_DEFAULT_FLOAT 
)

Similar to set_desired_front_wheels_steer_angle(), but sets the angle that the wheels will eventually move to, at the rate specified.

float diguyVehicleController::get_desired_front_wheels_steer_angle ( )
bdiScenarioVehicleController* diguyVehicleController::get_scripted_object ( )
inline

Friends And Related Function Documentation

friend class bdiScenarioVehicleController
friend

Member Data Documentation

bdiScenarioVehicleController* diguyVehicleController::m_scripted_object
private

A pointer to internal data.


The documentation for this class was generated from the following file: