![]() |
DI-Guy SDK Documentation
13.5
|
A class that gives access to IGuy's parameters. More...
#include <diguyIGuyController.h>
Public Member Functions | |
Character Functions | |
Unless otherwise specified, all functions callable from:
| |
| void | set_iguy_character (const char *name, diguyMotionPosture initial_posture=DIGUY_MOTION_POSTURE_ANY, diguyMotionVariant initial_variant=DIGUY_MOTION_VARIANT_ANY) |
| This function sets the interactive character (I-Guy). More... | |
| diguyCharacter * | get_iguy_character () |
| Returns: pointer of type diguyCharacter* to the current I-Guy character. More... | |
Interaction Functions | |
| diguyCharacter * | get_interaction_subject () |
| This function returns the character clicked on when in I-Guy Input Mode. More... | |
Camera Functions | |
Unless otherwise specified, all functions callable from:
| |
| void | set_camera_change_enabled (int enabled) |
| This function sets whether the I-Guy controller should update the primary view's camera to keep the I-Guy in view. More... | |
| int | get_camera_change_enabled () |
| Returns: 1 if I-Guy affects camera, 0 if not. More... | |
| void | set_camera_use_1st_person_flag (int flag) |
| This function sets whether the I-Guy controlled camera should be 1st person (from-the-eyes view), or 3rd person (over the shoulder). More... | |
| int | get_camera_use_1st_person_flag () |
| Returns: 1 if I-Guy controlled camera is 1st person, 0 if 3rd. More... | |
| void | set_camera_attachment_link (const char *attachment_link) |
| This function sets which link the I-Guy controlled camera will be attached to. More... | |
| const char * | get_camera_attachment_link () |
| Returns: the name of the current camera attachment link, or the empty string ("") if there is none. More... | |
| void | set_camera_3rd_person_look_from_offset (float x, float y, float z) |
| This function sets the offset that is used from the attachment link's position for the 3rd person camera's position. More... | |
| void | get_camera_3rd_person_look_from_offset (float *x, float *y, float *z) |
| This function retrieves the offset that is used from the attachment link's position for the 3rd person camera's position. More... | |
| void | set_camera_3rd_person_look_at_offset (float x, float y, float z) |
| This function is similar to set_camera_3rd_person_look_from_offset(), but affects the look-at point instead. More... | |
| void | get_camera_3rd_person_look_at_offset (float *x, float *y, float *z) |
| This function is similar to get_camera_3rd_person_look_from_offset(), but affects the look-at point instead. More... | |
Mouse Functions | |
Unless otherwise specified, all functions callable from:
| |
| void | set_mouse_input_enabled (int enabled) |
| This function sets whether mouse input will affect the I-Guy character. More... | |
| int | get_mouse_input_enabled () |
| Returns: 1 if mouse input is enabled, 0 if not. More... | |
| void | set_input_capture_enabled (int enabled) |
| This function sets whether mouse input should be "captured". More... | |
| int | get_input_capture_enabled () |
| Returns: 1 if input is captured, 0 if not. More... | |
Keyboard Functions | |
Unless otherwise specified, all functions callable from:
| |
| void | set_keyboard_input_enabled (int enabled) |
| This function sets whether keyboard input will affect the I-Guy character. More... | |
| int | get_keyboard_input_enabled () |
| Returns: 1 if keyboard input is enabled, 0 if not. More... | |
Joystick Functions | |
Unless otherwise specified, all functions callable from:
| |
| void | set_joystick_input_enabled (int enabled) |
| This function sets whether joystick input will affect the I-Guy character. More... | |
| int | get_joystick_input_enabled () |
| Returns: 1 if joystick input is enabled, 0 if not. More... | |
Posture and Variant Functions | |
Unless otherwise specified, all functions callable from:
| |
| void | set_posture_change_enabled (int enabled) |
| This function sets whether the I-Guy controller can affect the posture of the character. More... | |
| int | get_posture_change_enabled () |
| Returns: 1 if posture changes enabled, 0 if not. More... | |
| void | set_posture (diguyMotionPosture posture) |
| This function sets the desired posture of the I-Guy character. More... | |
| diguyMotionPosture | get_posture () |
| Returns: the desired posture of the I-Guy character. More... | |
| void | set_variant_change_enabled (int enabled) |
| This function sets whether the I-Guy controller can affect the variant of the character. More... | |
| int | get_variant_change_enabled () |
| Returns: 1 if variant changes enabled, 0 if not. More... | |
| void | set_variant (diguyMotionVariant variant) |
| This function sets the desired variant of the I-Guy character. More... | |
| diguyMotionVariant | get_variant () |
| Returns: the desired variant of the I-Guy character. More... | |
Misc Enable and Disable Functions | |
Unless otherwise specified, all functions callable from:
| |
| void | set_gaze_change_enabled (int enabled) |
| This function sets whether the I-Guy controller can affect the gaze state of the character. More... | |
| int | get_gaze_change_enabled () |
| Returns: 1 if gaze changes enabled, 0 if not. More... | |
| void | set_orientation_change_enabled (int enabled) |
| This function sets whether the I-Guy controller can affect the orientation of the character. More... | |
| int | get_orientation_change_enabled () |
| Returns: 1 if gaze orientation enabled, 0 if not. More... | |
| void | set_position_change_enabled (int enabled) |
| This function sets whether the I-Guy controller can affect the position of the character. More... | |
| int | get_position_change_enabled () |
| Returns: 1 if position changes enabled, 0 if not. More... | |
Performance Functions | |
Unless otherwise specified, all functions callable from:
| |
| void | set_use_force_action_flag (int use_force_action_flag) |
| This function sets whether the I-Guy controller will change the controlled character's action abruptly or allow action changes to take place smoothly. More... | |
| int | get_use_force_action_flag () |
| Returns: whether actions are forced (returns 1) or not (returns 0) More... | |
| void | set_skip_transitions_flag (int skip_transitions_flag) |
| This function sets whether the I-Guy controller will, when new actions are forced, the transition motions from the current to the new action are skipped. More... | |
| int | get_skip_transitions_flag () |
| Returns: whether transitions between actions are skipped (returns 1) or not (returns 0) More... | |
Misc Functions | |
Unless otherwise specified, all functions callable from:
| |
| void | set_always_run_flag (int always_run_flag) |
| This function sets whether the I-Guy character will always try to run, or move at its top speed. More... | |
| int | get_always_run_flag () |
| Returns: whether the I-Guy character will always try to run (returns 1), or not (returns 0) More... | |
| int | get_is_colliding () |
| Returns: whether the I-Guy character is currently bumping into something in the world limiting its motion. More... | |
Facing Functions | |
Unless otherwise specified, all functions callable from:
| |
| float | get_face_rz () |
| This function returns the current azimiuth (left/right) facing angle of the I-Guy character. More... | |
| float | get_face_ry () |
| This function returns the current elevation (down/up) facing angle of the I-Guy character. More... | |
| void | set_face_rz_desired (float face_rz_desired) |
| This function sets the desired azimiuth (left/right) facing angle of the I-Guy character. More... | |
| float | get_face_rz_desired () |
| Returns: desired rz facing angle, in degrees. More... | |
| void | set_face_ry_desired (float face_ry_desired) |
| This function sets the desired elevation (down/up) facing angle of the I-Guy character. More... | |
| float | get_face_ry_desired () |
| Returns: desired ry facing angle, in degrees. More... | |
| void | face_character (const char *character_name, const char *link, float offset_rz=0.0f, float offset_ry=0.0f) |
| This function sets the desired rz and ry facing angles of the I-Guy controlled character toward the specified character. More... | |
Deprecated Functions | |
The following functions are deprecated. As these functions may disappear in a future version of DI-Guy, it is recommended that you remove calls to these functions from your application. | |
| void | set_mouse_look_changes_orientation (int val) |
| Deprecated; use set_orientation_change_enabled() instead. More... | |
| int | get_mouse_look_changes_orientation () |
| Deprecated; use get_orientation_change_enabled() instead. More... | |
Private Functions | |
The functions and variables past this point are for internal use only. No external access to them is expected or necessary. | |
| bdiScenarioIGuy * | m_scripted_object |
| A pointer to internal data. More... | |
| class | bdiScenarioIGuy |
| bdiScenarioIGuy * | get_scripted_object () |
| diguyIGuyController (bdiScenarioIGuy *iguy) | |
| A private constructor. More... | |
A class that gives access to IGuy's parameters.
|
private |
A private constructor.
| void diguyIGuyController::set_iguy_character | ( | const char * | name, |
| diguyMotionPosture | initial_posture = DIGUY_MOTION_POSTURE_ANY, |
||
| diguyMotionVariant | initial_variant = DIGUY_MOTION_VARIANT_ANY |
||
| ) |
This function sets the interactive character (I-Guy).
The I-Guy character's actions, position, and orientation can be 'driven' by input from the mouse, keyboard, or a joystick.
There can be at most one I-Guy at a time.
| name | name of character to become I-Guy |
| initial_posture | this argument is not currently used, but will be implemented in a future |
| version | of DI Guy |
| initial_variant | the initial motion variant the |
| I | Guy character should assume |
Passing DIGUY_MOTION_VARIANT_ANY as the initial variant will cause DI-Guy to select a default initial variant. Passing DIGUY_MOTION_VARIANT_NORMAL will cause the character to start in a non-aiming action. Passing DIGUY_MOTION_VARIANT_AIM will cause the character to start in an aiming action, if available. Other variants will be supported in a future version.
| diguyCharacter* diguyIGuyController::get_iguy_character | ( | ) |
Returns: pointer of type diguyCharacter* to the current I-Guy character.
| diguyCharacter* diguyIGuyController::get_interaction_subject | ( | ) |
This function returns the character clicked on when in I-Guy Input Mode.
The pointer is valid during CALLBACK_ID_IGUY_INTERACT_WITH_SUBJECT callbacks.
Returns:
pointer to type diguyCharacter; NULL if there is no interaction subject
Callable From:
| void diguyIGuyController::set_camera_change_enabled | ( | int | enabled | ) |
This function sets whether the I-Guy controller should update the primary view's camera to keep the I-Guy in view.
| enabled | pass 1 to enable camera changes, 0 to disable |
| int diguyIGuyController::get_camera_change_enabled | ( | ) |
Returns: 1 if I-Guy affects camera, 0 if not.
| void diguyIGuyController::set_camera_use_1st_person_flag | ( | int | flag | ) |
This function sets whether the I-Guy controlled camera should be 1st person (from-the-eyes view), or 3rd person (over the shoulder).
| flag | pass 1 for 1st person, 0 for 3rd |
| int diguyIGuyController::get_camera_use_1st_person_flag | ( | ) |
Returns: 1 if I-Guy controlled camera is 1st person, 0 if 3rd.
| void diguyIGuyController::set_camera_attachment_link | ( | const char * | attachment_link | ) |
This function sets which link the I-Guy controlled camera will be attached to.
For human characters, the best link is typically "cervical" (the neck), or NULL (to use the base position of the character). The default is "cervical".
This setting affects both 1st person and 3rd person cameras.
| attachment_link | name of the link to attach to |
Pass NULL to have the camera be attached to the I-Guy character's base position.
| const char* diguyIGuyController::get_camera_attachment_link | ( | ) |
Returns: the name of the current camera attachment link, or the empty string ("") if there is none.
| void diguyIGuyController::set_camera_3rd_person_look_from_offset | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
This function sets the offset that is used from the attachment link's position for the 3rd person camera's position.
Typically this has a slightly negative x value, to move the camera behind the I-Guy character, and a positive z value, to move the camera up so it can see over the character's head.
The default is x=-2.0, y=0.0f, z=0.35.
This setting affects only 3rd person cameras.
| x,y,z | offset of camera position from attachment link |
| void diguyIGuyController::get_camera_3rd_person_look_from_offset | ( | float * | x, |
| float * | y, | ||
| float * | z | ||
| ) |
This function retrieves the offset that is used from the attachment link's position for the 3rd person camera's position.
The offset values should be put into the variables pointed to.
| x,y,z | pointers to variables in which offset should be returned |
| void diguyIGuyController::set_camera_3rd_person_look_at_offset | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
This function is similar to set_camera_3rd_person_look_from_offset(), but affects the look-at point instead.
The default is x=0.0, y=0.0, z=0.3.
| x,y,z | offset of camera look-at point from attachment link |
| void diguyIGuyController::get_camera_3rd_person_look_at_offset | ( | float * | x, |
| float * | y, | ||
| float * | z | ||
| ) |
This function is similar to get_camera_3rd_person_look_from_offset(), but affects the look-at point instead.
| x,y,z | pointers to variables in which offset should be returned |
| void diguyIGuyController::set_mouse_input_enabled | ( | int | enabled | ) |
This function sets whether mouse input will affect the I-Guy character.
| enabled | pass 1 to enable mouse input, 0 to disable |
| int diguyIGuyController::get_mouse_input_enabled | ( | ) |
Returns: 1 if mouse input is enabled, 0 if not.
| void diguyIGuyController::set_input_capture_enabled | ( | int | enabled | ) |
This function sets whether mouse input should be "captured".
A captured mouse's cursor doesn't move, but stays in the middle of the view. This mode is common in first-person shooter (FPS) style games.
A non-captured mouse's cursor is free to move anywhere on the screen.
The setting only has an effect in DI-Guy Scenario.
| enabled | pass 1 to enable input capture, 0 to disable |
| int diguyIGuyController::get_input_capture_enabled | ( | ) |
Returns: 1 if input is captured, 0 if not.
| void diguyIGuyController::set_keyboard_input_enabled | ( | int | enabled | ) |
This function sets whether keyboard input will affect the I-Guy character.
| enabled | pass 1 to enable keyboard input, 0 to disable |
| int diguyIGuyController::get_keyboard_input_enabled | ( | ) |
Returns: 1 if keyboard input is enabled, 0 if not.
| void diguyIGuyController::set_joystick_input_enabled | ( | int | enabled | ) |
This function sets whether joystick input will affect the I-Guy character.
| enabled | pass 1 to enable joystick input, 0 to disable |
| int diguyIGuyController::get_joystick_input_enabled | ( | ) |
Returns: 1 if joystick input is enabled, 0 if not.
| void diguyIGuyController::set_posture_change_enabled | ( | int | enabled | ) |
This function sets whether the I-Guy controller can affect the posture of the character.
The default is 1, posture change enabled.
| enabled | pass 1 to enable posture changes, 0 to disable |
| int diguyIGuyController::get_posture_change_enabled | ( | ) |
Returns: 1 if posture changes enabled, 0 if not.
| void diguyIGuyController::set_posture | ( | diguyMotionPosture | posture | ) |
This function sets the desired posture of the I-Guy character.
Note that the character may not be able to maintain this posture. For example, if the desired posture is prone but the character type has no moving prone actions, a crouched action may be used for moving instead.
This function will have no effect if posture changes are disabled, as set by set_posture_change_enabled().
| posture | desired posture |
| diguyMotionPosture diguyIGuyController::get_posture | ( | ) |
Returns: the desired posture of the I-Guy character.
| void diguyIGuyController::set_variant_change_enabled | ( | int | enabled | ) |
This function sets whether the I-Guy controller can affect the variant of the character.
The default is 1, variant change enabled.
| enabled | pass 1 to enable variant changes, 0 to disable |
| int diguyIGuyController::get_variant_change_enabled | ( | ) |
Returns: 1 if variant changes enabled, 0 if not.
| void diguyIGuyController::set_variant | ( | diguyMotionVariant | variant | ) |
This function sets the desired variant of the I-Guy character.
This function will have no effect if variant changes are disabled, as set by set_variant_change_enabled().
Most often the variant of an I-Guy character should be one of:
| variant | desired variant |
| diguyMotionVariant diguyIGuyController::get_variant | ( | ) |
Returns: the desired variant of the I-Guy character.
| void diguyIGuyController::set_gaze_change_enabled | ( | int | enabled | ) |
This function sets whether the I-Guy controller can affect the gaze state of the character.
The default is 1, gaze change enabled.
| enabled | pass 1 to enable gaze changes, 0 to disable |
| int diguyIGuyController::get_gaze_change_enabled | ( | ) |
Returns: 1 if gaze changes enabled, 0 if not.
| void diguyIGuyController::set_orientation_change_enabled | ( | int | enabled | ) |
This function sets whether the I-Guy controller can affect the orientation of the character.
The default is 1, orientation change enabled.
| enabled | pass 1 to enable orientation changes, 0 to disable |
| int diguyIGuyController::get_orientation_change_enabled | ( | ) |
Returns: 1 if gaze orientation enabled, 0 if not.
| void diguyIGuyController::set_position_change_enabled | ( | int | enabled | ) |
This function sets whether the I-Guy controller can affect the position of the character.
The default is 1, position change enabled.
| enabled | pass 1 to enable position changes, 0 to disable |
| int diguyIGuyController::get_position_change_enabled | ( | ) |
Returns: 1 if position changes enabled, 0 if not.
| void diguyIGuyController::set_use_force_action_flag | ( | int | use_force_action_flag | ) |
This function sets whether the I-Guy controller will change the controlled character's action abruptly or allow action changes to take place smoothly.
Forced action changes provide better responsiveness, but don't look as nice.
See the functions diguyCharacter::force_action() and diguyCharacter::set_desired_action().
The set_skip_transitions_flag() also has an effect on responsiveness and how nice the action transitions look.
The default is 1, force actions.
| use_force_action_flag | pass 1 to force quick action changes, 0 to smooth action changes |
| int diguyIGuyController::get_use_force_action_flag | ( | ) |
Returns: whether actions are forced (returns 1) or not (returns 0)
| void diguyIGuyController::set_skip_transitions_flag | ( | int | skip_transitions_flag | ) |
This function sets whether the I-Guy controller will, when new actions are forced, the transition motions from the current to the new action are skipped.
Skipping transitions provides better responsiveness, but doesn't look as nice.
This setting only has an effect if the force action flag is set to 1 (see set_use_force_action_flag()).
The default is 1, skip transitions.
| skip_transitions_flag | pass 1 to skip transition motions, 0 to play them |
| int diguyIGuyController::get_skip_transitions_flag | ( | ) |
Returns: whether transitions between actions are skipped (returns 1) or not (returns 0)
| void diguyIGuyController::set_always_run_flag | ( | int | always_run_flag | ) |
This function sets whether the I-Guy character will always try to run, or move at its top speed.
The default is 0, don't always run.
| always_run_flag | pass 1 to always run, 0 to be able to walk and/or jog when moving slower |
| int diguyIGuyController::get_always_run_flag | ( | ) |
Returns: whether the I-Guy character will always try to run (returns 1), or not (returns 0)
| int diguyIGuyController::get_is_colliding | ( | ) |
Returns: whether the I-Guy character is currently bumping into something in the world limiting its motion.
| float diguyIGuyController::get_face_rz | ( | ) |
This function returns the current azimiuth (left/right) facing angle of the I-Guy character.
This value will change as the character is moved around by the I-Guy controller.
Returns:
current rz facing angle, in degrees
| float diguyIGuyController::get_face_ry | ( | ) |
This function returns the current elevation (down/up) facing angle of the I-Guy character.
This value will change as the character is moved around by the I-Guy controller.
Returns:
current ry facing angle, in degrees
| void diguyIGuyController::set_face_rz_desired | ( | float | face_rz_desired | ) |
This function sets the desired azimiuth (left/right) facing angle of the I-Guy character.
Most often this value is changed via mouse, keyboard, or joystick input, not by this function.
| float diguyIGuyController::get_face_rz_desired | ( | ) |
Returns: desired rz facing angle, in degrees.
| void diguyIGuyController::set_face_ry_desired | ( | float | face_ry_desired | ) |
This function sets the desired elevation (down/up) facing angle of the I-Guy character.
Most often this value is changed via mouse, keyboard, or joystick input, not by this function.
| float diguyIGuyController::get_face_ry_desired | ( | ) |
Returns: desired ry facing angle, in degrees.
| void diguyIGuyController::face_character | ( | const char * | character_name, |
| const char * | link, | ||
| float | offset_rz = 0.0f, |
||
| float | offset_ry = 0.0f |
||
| ) |
This function sets the desired rz and ry facing angles of the I-Guy controlled character toward the specified character.
| void diguyIGuyController::set_mouse_look_changes_orientation | ( | int | val | ) |
Deprecated; use set_orientation_change_enabled() instead.
| int diguyIGuyController::get_mouse_look_changes_orientation | ( | ) |
Deprecated; use get_orientation_change_enabled() instead.
|
inline |
|
friend |
|
private |
A pointer to internal data.