diguyCharacter Class Declaration

diguyCharacter.h

DI-Guy API Version 5.1.26

This file was automatically generated from comments in the C/C++ header file diguyCharacter.h. Do not edit this file directly; the changes will be lost. Please mail suggestions or corrections to diguy@bdi.com

Alphabetical Index

Includes: diguyCharacterPoseOverride.h | diguy_constants.h | declspec_diguy.h

Link against: libdiguy

class diguyCharacter

class BDI_DECLSPEC_diguy diguyCharacter
{
public:
    const char* get_name();
 
    const char* get_type_name();
    int get_index();
 
    diguyScenario* get_scenario();
 
    int get_enabled();
    int set_enabled(int enabled);
    int get_visible();
    int get_drawn_by_scenario_flag();
    int set_drawn_by_scenario_flag(int flag);
    const char* get_character_type_string();
    const char* get_appearance();
    int set_current_appearance(const char* appearance);
    const char* get_current_appearance();
    int set_current_head_appearance(const char* head_appearance);
    const char* get_current_head_appearance();
    int get_num_links();
    diguyGraphicsLink* get_link_at_index(int index);
    const char* get_link_name_at_index(int link_index);
    int get_num_link_shapes(const char* link_name);
    const char* get_link_shape_name_at_index(const char* link_name, int shape_index);
    int get_paused();
    int die_now(const char* preferred_dead_action_name = 0);
    int set_t(float t);
    int set_t_controlled_by_scenario_t(int t_controlled_by_scenario_t);
    int get_t_controlled_by_scenario_t();
    float get_current_tin();
    int set_current_tin(float tin);
    float get_current_tout();
    int set_current_tout(float tout);
    int set_careful_interpolation_threshold(float threshold);
    float get_careful_interpolation_threshold();
    int set_motion_interpolation_flag(int flag);
    int get_motion_interpolation_flag();
    int set_up_vector(char axis);
    int set_position(float tx, float ty, float tz);
    int set_position_relative_to_parent(float tx, float ty, float tz);
    int get_position(float* tx, float* ty, float* tz);
    int get_position_relative_to_parent(float* tx, float* ty, float* tz);
    int set_orientation(float rz, float rx, float ry);
    int set_orientation_relative_to_parent(float rz, float rx, float ry);
    int get_orientation(float* rz, float* rx, float* ry);
    int get_orientation_relative_to_parent(float* rz, float* rx, float* ry);
    int set_desired_position(float tx, float ty, float tz);
    int get_desired_position(float* tx, float* ty, float* tz);
    int set_desired_orientation(float rz, float rx, float ry);
    int get_desired_orientation(float* rz, float* rx, float* ry);
    int set_speed(float speed);
    float get_speed();
    int set_scale(float scale_x,
        float scale_y,
        float scale_z);
    int get_scale(float* scale_x,
        float* scale_y,
        float* scale_z);
    int get_link_position(const char* link_name,
        float* tx, float* ty, float* tz,
        float* rz, float* rx, float* ry);
    int get_link_position_with_offset(const char* link_name,
        float offset_tx, float offset_ty, float offset_tz,
        float* tx, float* ty, float* tz,
        float* rz, float* rx, float* ry);
    int get_link_relative_position(const char* beginning_link_name,
        const char* ending_link_name,
        float* tx, float* ty, float* tz,
        float* rz, float* rx, float* ry);
    int get_link_relative_position_with_offset(const char* beginning_link_name,
        const char* ending_link_name,
        float offset_tx, float offset_ty, float offset_tz,
        float* tx, float* ty, float* tz,
        float* rz, float* rx, float* ry);
    int set_parent(const char* parent_name,
        const char* parent_link_name = "");
    int unset_parent();
    int get_dead();
#ifdef CPLUSPLUS_ONLY
    void* get_graphics_ptr();
    int set_lod_ranges(float* ranges);
    int draw();
    int draw_pass1();
    int draw_pass2();
    int set_user_data(void* user_data);
    void* get_user_data();
#endif
    enum {
        CALLBACK_ID_CREATE = 1,
        CALLBACK_ID_DESTROY,
        CALLBACK_ID_PRE_UPDATE,
        CALLBACK_ID_POST_UPDATE,
        CALLBACK_ID_DONE_SPEAKING,
        CALLBACK_ID_GAZE_STATUS,
        CALLBACK_ID_LPOINT_STATUS,
        CALLBACK_ID_SHOW,
        CALLBACK_ID_HIDE
    };
#ifdef CPLUSPLUS_ONLY
    int add_callback(int callback_id,
        diguyCharacterCallback* callback,
        void* callback_params = 0,
        void* callback_user_data = 0);
    int remove_callback(int callback_id,
        diguyCharacterCallback* callback);
    int remove_callback_with_user_data(int callback_id,
        void* callback_user_data);
#endif
    int set_motion_lod(int lod);
    int get_motion_lod();
    int set_graphics_lod(int lod);
    int get_graphics_lod();
    const char* get_current_action();
    int set_desired_action(const char* action_name,
        float speed = DIGUY_DEFAULT_FLOAT,
        int retain_path_shape = 0);
    const char* get_desired_action();
    int force_action(const char* action_name,
        float speed = DIGUY_DEFAULT_FLOAT,
        int include_transition_arc = 1,
        float max_rampdown_interval = 0.5f,
        int retain_path_shape = 0);
    int force_action_with_duration(const char* action_name,
        float duration,
        int include_transition_arc = 1,
        float max_rampdown_interval = 0.5f);
    int force_action_and_path_shape(const char* action_name,
        const char* path_shape_name);
    int set_distance_along_path(float distance);
    float get_distance_along_path();
    int leave_path();
    float get_time_to_transition();
    diguyCharacterMode get_action_mode();
    diguyCharacterMode get_position_mode();
    diguyMuzzle get_default_weapon_muzzle();
    int set_default_weapon_muzzle(diguyMuzzle muzzle);
    const char* get_default_weapon_sound();
    int set_default_weapon_sound(const char* sound_name);
    void set_weapon_spread(float spread);
    void set_weapon_hit_ratio(float hit_ratio);
    int fire_weapon(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
    int fire_weapon_n_times(int count,
        float dt = 0.2f,
        const char* sound_name = 0,
        diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
    int get_weapon_fire_count(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
    int get_accessory1_state();
    int get_rifle_state();
    int play_sound(const char* sound_name);
    int set_t_scale_factor(float t_scale_factor);
    int unset_t_scale_factor();
    int is_within_distance_n_of_character(const char* character_name,
        float distance);
    int is_within_distance_n_of_member_of_group(const char* group_name,
        float distance);
    int get_num_paths();
    diguyCharacterPath* get_path_at_index(int index);
    const char* get_path_name_at_index(int index);
    int get_current_path_index();
    int push_path(const char* path_name);
    int force_path(const char* path_name,
        float max_rampdown_interval = 0.5f);
    int force_partial_path(const char* path_name,
        const char* beginning_action_bead_name,
        float max_rampdown_interval = 0.5f);
    int resume_interrupted_path(float max_rampdown_interval = 0.5f);
    int create_and_force_bridge_path(const char* destination_path_name,
        const char* destination_path_action_bead_name,
        const char* via_action_name);
#ifdef CPLUSPLUS_ONLY
    diguyCharacterPath* create_simple_path(const char* name,
        diguyWaypoint* waypoint0,
        diguyWaypoint* waypoint1,
        const char* transition_from_action_name,
        const char* fill_action_name,
        const char* transition_to_action_name);
    int destroy_path(diguyCharacterPath* path);
#endif
    int jump_to_action_bead(const char* bead_name,
        float max_rampdown_interval = 0.5f);
    diguyCharacterPath* find_path(const char* path_name);
#ifdef CPLUSPLUS_ONLY
    int set_altitude_function(diguyAltitudeFunction* altitude_function);
    diguyAltitudeFunction* get_altitude_function();
#endif
    int set_altitude_function_enabled_in_free_position_mode(int enabled);
    int get_altitude_function_enabled_in_free_position_mode();
    int set_altitude_function_enabled_in_path_position_mode(int value);
    int get_altitude_function_enabled_in_path_position_mode();
    int get_pose_in_radians(float* pose_array);
    int get_pose_array_size();
    diguyCharacterPoseOverride* create_pose_override(int override_stage = 2);
    int destroy_pose_override(diguyCharacterPoseOverride* po);
    int gaze_at_angle(float azimuth,
        float elevation,
        float distance,
        int is_new_gaze = 1);
    int gaze_at_angle_local(float azimuth,
        float elevation,
        float distance = 10000.0f,
        int is_new_gaze = 1);
    int gaze_at_point(float tx,
        float ty,
        float tz,
        int is_new_gaze = 1);
    int gaze_at_point_local(float tx,
        float ty,
        float tz,
        int is_new_gaze = 1);
    int gaze_at_character(const char* target_character_name,
        const char* target_character_link_name,
        float offset_tx,
        float offset_ty,
        float offset_tz);
    int get_gaze_point(float* x, float* y, float* z);
    int get_gaze_is_acquired();
    int get_gaze_is_steady();
    int end_gaze();
    int lpoint_at_angle(float azimuth,
        float elevation,
        float distance,
        int is_new_lpoint = 1,
        const char* base_gesture_name = 0);
    int lpoint_at_angle_local(float azimuth,
        float elevation,
        float distance = 10000.0f,
        int is_new_lpoint = 1,
        const char* base_gesture_name = 0);
    int lpoint_at_point(float tx,
        float ty,
        float tz,
        int is_new_lpoint = 1,
        const char* base_gesture_name = 0);
    int lpoint_at_point_local(float tx,
        float ty,
        float tz,
        int is_new_lpoint = 1,
        const char* base_gesture_name = 0);
    int lpoint_at_character(const char* target_character_name,
        const char* target_character_link_name,
        float offset_tx,
        float offset_ty,
        float offset_tz);
    int get_lpoint_point(float* x, float* y, float* z);
    const char* get_lpoint_base_gesture_name();
    int get_lpoint_is_acquired();
    int get_lpoint_is_steady();
    int end_lpoint();
    int set_gaze_params_to_defaults();
    int set_gaze_param_desired_locate_time(float t);
    float get_gaze_param_desired_locate_time();
    int set_gaze_link_uses_desired_locate_time(const char* link_name, int uses_desired_locate_time);
    int get_gaze_link_uses_desired_locate_time(const char* link_name);
    int set_gaze_link_azimuth_limits(const char* link_name, float min, float max);
    int get_gaze_link_azimuth_limits(const char* link_name, float* min, float* max);
    int set_gaze_link_elevation_limits(const char* link_name, float min, float max);
    int get_gaze_link_elevation_limits(const char* link_name, float* min, float* max);
    int set_gaze_link_azimuth_tolerance(const char* link_name, float min, float max);
    int get_gaze_link_azimuth_tolerance(const char* link_name, float* min, float* max);
    int set_gaze_link_elevation_tolerance(const char* link_name, float min, float max);
    int get_gaze_link_elevation_tolerance(const char* link_name, float* min, float* max);
    int set_gaze_link_max_angular_vel(const char* link_name, float angular_vel);
    int get_gaze_link_max_angular_vel(const char* link_name, float* angular_vel);
    int set_gaze_link_scale_factor(const char* link_name, float scale_factor);
    int get_gaze_link_scale_factor(const char* link_name, float* scale_factor);
    int set_link_enabled_for_gaze(const char* link_name, int enabled);
    int get_link_enabled_for_gaze(const char* link_name);
    int set_link_enabled_for_lpoint(const char* link_name, int enabled);
    int get_link_enabled_for_lpoint(const char* link_name);
    int set_nod(float azimuth,
        float elevation,
        float duration = 0.5f);
    int nod_head(float duration,
        float nod_count,
        float nod_elevation0 = 15.0f,
        float nod_elevation1 = 0.0f,
        float nod_elevation_out = 0.0f);
    int shake_head(float duration,
        float shake_count,
        float shake_azimuth0 = -20.0f,
        float shake_azimuth1 = 20.0f,
        float shake_azimuth_out = 0.0f);
    float get_nod_azimuth();
    float get_nod_elevation();
    int set_aim(float azimuth, float elevation);
    float get_aim_azimuth();
    float get_aim_elevation();
    int set_aim_interpolation_flag(int flag);
    int get_aim_interpolation_flag();
    int set_aim_smooth_flag(int flag);
    int get_aim_smooth_flag();
    int set_aim_divisions(int azimuth_divisions, int elevation_divisions);
    int set_face_expression(const char* facex_name, float duration);
    int set_viseme(const char* viseme_name, float weight);
    float get_viseme(const char* viseme_name);
    int set_orientation_eyes(float azimuth, float elevation);
    int set_orientation_eye_left(float azimuth, float elevation);
    int set_orientation_eye_right(float azimuth, float elevation);
    float get_azimuth_eye_left();
    float get_elevation_eye_left();
    float get_azimuth_eye_right();
    float get_elevation_eye_right();
    int set_eye_droop(float droop_amount);
    int blink(float duration_in = DIGUY_DEFAULT_FLOAT,
        float duration_out = DIGUY_DEFAULT_FLOAT,
        float target_in = DIGUY_DEFAULT_FLOAT,
        float target_out = DIGUY_DEFAULT_FLOAT,
        float tin = DIGUY_DEFAULT_FLOAT);
    float get_eye_droop();
    int speak(const char* string);
    int is_speaking();
    int is_reflected();
    int execute_gesture(const char* gesture_name,
        int reps = DIGUY_DEFAULT_INT,
        float overall_duration = DIGUY_DEFAULT_FLOAT,
        float channel_A_weight = DIGUY_DEFAULT_FLOAT);
    int execute_1stage_gesture(const char* gesture_name,
        int reps = DIGUY_DEFAULT_INT,
        float stage1_duration = DIGUY_DEFAULT_FLOAT,
        float channel_A_weight = DIGUY_DEFAULT_FLOAT);
    int execute_2stage_gesture(const char* gesture_name,
        int reps = DIGUY_DEFAULT_INT,
        float stage1_duration = DIGUY_DEFAULT_FLOAT,
        float stage2_duration = DIGUY_DEFAULT_FLOAT,
        float channel_A_weight = DIGUY_DEFAULT_FLOAT);
    int execute_3stage_gesture(const char* gesture_name,
        int reps = DIGUY_DEFAULT_INT,
        float stage1_duration = DIGUY_DEFAULT_FLOAT,
        float stage2_duration = DIGUY_DEFAULT_FLOAT,
        float stage3_duration = DIGUY_DEFAULT_FLOAT,
        float channel_A_weight = DIGUY_DEFAULT_FLOAT);
    diguyCharacterGesture* create_gesture(const char* gesture_name);
    int destroy_gesture(diguyCharacterGesture* gesture);
    int abort_all_gestures(float max_rampdown_interval);
    diguySoundInstance* create_sound_instance(const char* sound_name);
    int destroy_sound_instance(diguySoundInstance* sound_instance);
    int stop_all_sounds();
    int get_DIS_lifeform_state();
    int get_DIS_weapon_state(int which = 0);
    int set_network_marking(const char* network_marking);
    const char* get_network_marking();
    int set_is_network_published(int is_network_published);
    int get_is_network_published();
    int get_network_entity_number();
    int call_formation(const char* name, int snap_to=0);
    int break_formation();
    diguyCharacterGuide* add_guide(const char* guide_name,
        int automatically_disable_when_acquired = 0);
    diguyCharacterGuide* create_guide(const char* guide_name,
        const char* guide_algorithm,
        int automatically_disable_when_acquired = 0);
    int remove_guide_with_name(const char* guide_name);
    int remove_guide(diguyCharacterGuide* guide);
    int remove_all_guides();
    int add_motion_texture(const char* motex_name = "default",
        float texture_gain = 1.0f,
        int end_previous_motex = 1);
    int end_motion_texture(float rampdown_interval = 0.2f);
    int set_history_type(diguyHistoryType history_type);
    diguyHistoryType get_history_type();
    int set_history_size_t(float t);
    float get_history_size_t();
    int set_history_size_increment_t(float t);
    float get_history_size_increment_t();
    int add_callback_script(int callback_id,
        const char* callback_script,
        const char* callback_script_type = NULL);
    int remove_callback_script(int callback_id,
        const char* callback_script,
        const char* callback_script_type = NULL);
    int force_action_by_name(const char* action_name,
        int include_transition_arc,
        float max_rampdown_interval,
        int retain_path_shape = 0);
    const char* get_desired_action_name();
    int set_desired_action_by_name(const char* action_name,
        int retain_path_shape = 0);
    int force_partial_path_by_name(const char* path_name,
        const char* beginning_action_bead_name,
        float max_rampdown_interval = 0.5f);
    int force_path_by_name(const char* path_name,
        float max_rampdown_interval = 0.5f);
    int play_sound_by_name(const char* sound_name);
    int push_path_by_name(const char* path_name);
    int set_parent_by_name(const char* parent_name,
        const char* parent_link_name = "");
    bdiScenarioCharacter* get_scripted_object() {return m_character;}
};

function diguyCharacter::get_name

Prototype:

const char* get_name();
Description:

Returns the name of the object. This pointer will never be NULL.

Returns:

name of the object

Callable From:

function diguyCharacter::get_type_name

Prototype:

const char* get_type_name();
Description:

Returns the type name of the object. This pointer will never be NULL.

Returns:

type name of the object

Callable From:

function diguyCharacter::get_index

Prototype:

int get_index();
Description:

Returns the index of the object. This index may change if characters are created or destroyed, so it should not be considered a unique identifier for the character.

Returns:

index of the object

Callable From:

function diguyCharacter::get_scenario

Prototype:

diguyScenario* get_scenario();
Description:

Returns the scenario that this character is a part of.

Returns:

pointer to type diguyScenario

Callable From:

function diguyCharacter::get_enabled

Prototype:

int get_enabled();
Description:

Returns whether the character is enabled.

Returns:

True if the character is enabled, false if not.

Callable From:

function diguyCharacter::set_enabled

Prototype:

int set_enabled(int enabled);
Description:

Set whether a character is enabled. If the character is disabled, he will become invisible, both to the eye and to the scenario in which he lives.

Returns:

Always return 0.

Callable From:

function diguyCharacter::get_visible

Prototype:

int get_visible();
Description:

Returns whether the character is visible.

Returns:

True if the character is visible, false if not.

Callable From:

function diguyCharacter::get_drawn_by_scenario_flag

Prototype:

int get_drawn_by_scenario_flag();
Description:

Returns whether character drawing is done automatically by the scenario.

Returns:

1 if character drawing is done by the scenario; 0 if not

See Also:

set_drawn_by_scenario_flag()

Callable From:

function diguyCharacter::set_drawn_by_scenario_flag

Prototype:

int set_drawn_by_scenario_flag(int flag);
Description:

Sets whether this character is drawn automatically by the scenario.

Performer 2.x Version:

This function has no effect. These environments automatically draw all elements in their visual database.

OpenGL Version:

Direct3D Version:

If this flag is set to 0, it is up to the user to call the character draw_pass1() and draw_pass2() calls at the appropriate time.

Arguments:

flagpass 1 for character drawing to automatically be handled by scenario (this is the default); 0 for it not to be
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_character_type_string

Prototype:

const char* get_character_type_string();
Description:

Returns the type of the character. This pointer will never be NULL.

Returns:

type of the character

Callable From:

function diguyCharacter::get_appearance

Prototype:

const char* get_appearance();
Description:

Returns the base appearance of the character. This pointer will never be NULL.

Note that the current appearance (as returned by get_current_appearance()) may be different than the base appearance. This base appearance is the starting appearance of the character before any calls to set_current_appearance() have been made.

Returns:

name of base appearance of the character

Callable From:

function diguyCharacter::set_current_appearance

Prototype:

int set_current_appearance(const char* appearance);
Description:

This function sets the current appearance of this character.

Arguments:

appearancename of the new desired appearance
See Also:

get_current_appearance(), set_current_head_appearance()

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_current_appearance

Prototype:

const char* get_current_appearance();
Returns:

current appearance; see set_current_appearance()

Callable From:

function diguyCharacter::set_current_head_appearance

Prototype:

int set_current_head_appearance(const char* head_appearance);
Description:

This function sets the current head appearance of this character.

Arguments:

head_appearancename of the new desired head appearance
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_current_head_appearance

Prototype:

const char* get_current_head_appearance();
Returns:

current head appearance; see set_current_head_appearance()

Callable From:

function diguyCharacter::get_num_links

Prototype:

int get_num_links();
Returns:

number of links on this character

Callable From:

function diguyCharacter::get_link_at_index

Prototype:

diguyGraphicsLink* get_link_at_index(int index);
Returns:

pointer of type diguyGraphicsLink; NULL if no link at the specified index

Arguments:

indexindex of the link; indices start at 0
Callable From:

function diguyCharacter::get_link_name_at_index

Prototype:

const char* get_link_name_at_index(int link_index);
Returns:

the string identifying the link at the given index

Arguments:

link_indexindex of the link; indices start at 0
Callable From:

function diguyCharacter::get_num_link_shapes

Prototype:

int get_num_link_shapes(const char* link_name);
Returns:

the number of shapes on the specified link

Arguments:

link_namename of the link
Callable From:

function diguyCharacter::get_link_shape_name_at_index

Prototype:

const char* get_link_shape_name_at_index(const char* link_name, int shape_index);
Returns:

the name of the shape at the specified index on the link

Arguments:

link_name name of the link
shape_indexindex of the shape on the link; indices start at 0
Callable From:

function diguyCharacter::get_paused

Prototype:

int get_paused();
Description:

Returns whether this character is frozen in mid action.

Returns:

1 if paused, 0 if not paused.

Callable From:

function diguyCharacter::die_now

Prototype:

int die_now(const char* preferred_dead_action_name = 0);
Description:

This function sends this character a signal to die as soon as possible.

Mode Effects:

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::set_t

Prototype:

int set_t(float t);
Description:

This function sets the current t of the character. The character's position and pose will be set to be what it was (or will be) at the specified t.

If the scenario has control of t (return value of get_t_controlled_by_scenario_t() is false), then this function's effects will be overridden the next time diguyScenario::update() is called with a new t.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::set_t_controlled_by_scenario_t

Prototype:

int set_t_controlled_by_scenario_t(int t_controlled_by_scenario_t);
Description:

This function sets how the character's t (time) is controlled. If 1, the character's t will be set by the scenario on each call to diguyScenario::update(). If 0, the character's t should be set by calls to set_t() before calling diguyScenario::update().

Arguments:

t_controlled_by_scenario_t0 for false, 1 for true
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_t_controlled_by_scenario_t

Prototype:

int get_t_controlled_by_scenario_t();
Returns:

whether character's t is controlled by the scenario; see set_t_controlled_by_scenario_t()

Callable From:

function diguyCharacter::get_current_tin

Prototype:

float get_current_tin();
Description:

This function returns the current tin time of the character. The character will not be visible nor will it start traversing paths until the scenario reaches this time.

Returns:

Current tin time in seconds.

Callable From:

function diguyCharacter::set_current_tin

Prototype:

int set_current_tin(float tin);
Description:

This function sets the current tin time of the character. See get_current_tin().

Arguments:

tinnew value of current tin in seconds
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_current_tout

Prototype:

float get_current_tout();
Description:

This function returns the current tout time of the character. The character will become visible and will stop traversing paths when the scenario reaches this time.

Returns:

Current tout time in seconds.

Callable From:

function diguyCharacter::set_current_tout

Prototype:

int set_current_tout(float tout);
Description:

This function sets the current tin time of the character. See get_current_tout().

Arguments:

toutnew value of current tout in seconds
Callable From:

function diguyCharacter::set_careful_interpolation_threshold

Prototype:

int set_careful_interpolation_threshold(float threshold);
Description:

When the motion data of a character is interpolated, a quick interpolation method can be used which may yield incorrect results, or an expensive interpolation method can be used which will yield correct results at the expense of time.

Arguments:

thresholdfloat between 0 (careful never) and 1 (careful always);
default is 0.4

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_careful_interpolation_threshold

Prototype:

float get_careful_interpolation_threshold();
Returns:

most recent setting of the careful interpolation threshold; see set_careful_interpolation_threshold()

Callable From:

function diguyCharacter::set_motion_interpolation_flag

Prototype:

int set_motion_interpolation_flag(int flag);
Description:

Sets whether the motion data of the character is interpolated. Interpolation is disabled by default for better performance. For applications achieving high frame rates, smoother motion may be achieved by turning interpolation on.

Arguments:

flag0 by default
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_motion_interpolation_flag

Prototype:

int get_motion_interpolation_flag();
Returns:

most recent setting of the motion interpolation flag; see set_motion_interpolation_flag()

Callable From:

function diguyCharacter::set_up_vector

Prototype:

int set_up_vector(char axis);
Description:

This function sets how the character should be oriented relative to its surroundings.

Arguments:

axisthe up vector the character should use; legal values shown below:
Having an up vector of 'z' effectively zeroes out the rx and ry values of the character's orientation.

Having an up vector of 'n' may override rx and ry values of the character's orientation with values derived from the character's path shape

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::set_position

Prototype:

int set_position(float tx, float ty, float tz);
Description:

Sets the position of the character relative to the origin of the BDI global coordinate system. The new settings will take effect immediately, possibly causing the character to "teleport" if the new values are significantly different than the old.

Mode Effects:

Arguments:

tx, ty, tzposition in meters from the origin
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::set_position_relative_to_parent

Prototype:

int set_position_relative_to_parent(float tx, float ty, float tz);
Description:

Sets the position of the character relative to its parent or the origin of the BDI global coordinate system if this character is not parented. The new settings will take effect immediately, possibly causing the character to "teleport" if the new values are significantly different than the old.

Mode Effects:

Arguments:

tx, ty, tzposition in meters from the origin
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_position

Prototype:

int get_position(float* tx, float* ty, float* tz);
Description:

Retrieves the position of the character in the BDI global coordinate system

Arguments:

tx, ty, tzposition in meters from the origin
Pass NULL for any values that are not needed.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_position_relative_to_parent

Prototype:

int get_position_relative_to_parent(float* tx, float* ty, float* tz);
Description:

Retrieves the position of the character relative to its parent or the origin of the BDI global coordinate system if this character is not parented.

Arguments:

tx, ty, tzposition in meters from the origin
Pass NULL for any values that are not needed.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::set_orientation

Prototype:

int set_orientation(float rz, float rx, float ry);
Description:

Sets the position of the character relative to the origin of the BDI global coordinate system. The new settings will take effect immediately, possibly causing the character to "teleport" if the new values are significantly different than the old.

Note that if the character has an up vector of 'z' or 'n' or even sometimes 'd' (as set by the set_up_vector() call) the rx and ry values will not have any effect. To be able to set rx and ry values, set the up vector of the character to 'c', for "custom".

Mode Effects:

Arguments:

rz, rx, ryorientations in degrees
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::set_orientation_relative_to_parent

Prototype:

int set_orientation_relative_to_parent(float rz, float rx, float ry);
Description:

Sets the orientation of the character relative to its parent or the origin of the BDI global coordinate system if this character is not parented. The new settings will take effect immediately, possibly causing the character to "teleport" if the new values are significantly different than the old.

Mode Effects:

Arguments:

rz, rx, ryorientations in degrees
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_orientation

Prototype:

int get_orientation(float* rz, float* rx, float* ry);
Description:

Retrieves the orientation of the character in the BDI global coordinate system

Arguments:

rz, rx, ryorientations in degrees counter-clockwise from the positive X axis
Pass NULL for any values that are not needed.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_orientation_relative_to_parent

Prototype:

int get_orientation_relative_to_parent(float* rz, float* rx, float* ry);
Description:

Retrieves the orientation of the character relative to its parent or the origin of the BDI global coordinate system if this character is not parented.

Arguments:

rz, rx, ryorientations in degrees counter-clockwise from the positive X axis
Pass NULL for any values that are not needed.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::set_desired_position

Prototype:

int set_desired_position(float tx, float ty, float tz);
Description:

Sets the desired position of the character. How the character moves toward the desired position is determined by its current guides; see add_guide() and create_guide().

Mode Effects:

Arguments:

tx, ty, tzdesired position in meters from the origin
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_desired_position

Prototype:

int get_desired_position(float* tx, float* ty, float* tz);
Description:

Retrieves the desired position of the character.

Mode Restrictions:

Arguments:

tx, ty, tzdesired position in meters from the origin
Pass NULL for any values that are not needed.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::set_desired_orientation

Prototype:

int set_desired_orientation(float rz, float rx, float ry);
Description:

Sets the desired orientation of the character. See set_desired_position().

Mode Effects:

Arguments:

rz, rx, ryorientations in degrees counter-clockwise from the positive X axis
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_desired_orientation

Prototype:

int get_desired_orientation(float* rz, float* rx, float* ry);
Description:

Retrieves the desired orientation of the character.

Mode Restrictions:

Arguments:

rz, rx, ryorientations in degrees counter-clockwise from the positive X axis
Pass NULL for any values that are not needed.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::set_speed

Prototype:

int set_speed(float speed);
Description:

Sets the speed the character should attempt to move, in meters per second.

This setting takes effect immediately. To set a desired action and a desired speed at the same time, use the speed argument of the set_desired_action() call.

This desired speed setting can be undone in a couple of ways:

Arguments:

speeddesired speed in meters per second
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_speed

Prototype:

float get_speed();
Returns:

the approximate speed at which the character is moving, in meters per second

Callable From:

function diguyCharacter::set_scale

Prototype:

int set_scale(float scale_x,
		float scale_y,
		float scale_z);
Description:

Sets the scale of the character on each of the three major axes.

Arguments:

scale_x, scale_y, scale_zthe factor by which to scale along the given axis
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_scale

Prototype:

int get_scale(float* scale_x,
		float* scale_y,
		float* scale_z);
Description:

Returns the scale of the character.

Arguments:

sx, sy, szscale of the character along each axis
Pass NULL for any values that are not needed.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_link_position

Prototype:

int get_link_position(const char* link_name,
		float* tx, float* ty, float* tz,
		float* rz, float* rx, float* ry);
Description:

Returns the location and orientation of a specific link of the character.

Arguments:

link_name name of the link; links are named after their inbound joint name
tx, ty, tzposition in meters from the origin
rz, rx, ryorientations in degrees counter-clockwise from the positive X axis
Pass NULL for any values that are not needed.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_link_position_with_offset

Prototype:

int get_link_position_with_offset(const char* link_name,
		float offset_tx, float offset_ty, float offset_tz,
		float* tx, float* ty, float* tz,
		float* rz, float* rx, float* ry);
Description:

Similar to get_link_position(), but allows specification of offset into ending link.

Arguments:

link_name name of the link
offset_tx, offset_ty, offset_tzoffset in link
tx, ty, tzposition in meters from the origin
rz, rx, ryorientations in degrees counter-clockwise from the positive X axis
Pass NULL for any values that are not needed.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_link_relative_position

Prototype:

int get_link_relative_position(const char* beginning_link_name,
		const char* ending_link_name,
		float* tx, float* ty, float* tz,
		float* rz, float* rx, float* ry);
Description:

Returns the location and orientation of a specific link of the character relative to the position of another link.

Arguments:

beginning_link_namename of the first link; send NULL to to specify the base link
ending_link_namename of the last link; send NULL to to specify the base link
tx, ty, tzposition in meters from the origin
rz, rx, ryorientations in degrees counter-clockwise from the positive X axis
Pass NULL for any values that are not needed.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_link_relative_position_with_offset

Prototype:

int get_link_relative_position_with_offset(const char* beginning_link_name,
		const char* ending_link_name,
		float offset_tx, float offset_ty, float offset_tz,
		float* tx, float* ty, float* tz,
		float* rz, float* rx, float* ry);
Description:

Similar to get_link_relative_position(), but allows specification of offset into ending link.

Arguments:

beginning_link_namename of the first link; send NULL to to specify the base link
ending_link_namename of the last link; send NULL to to specify the base link
offset_tx, offset_ty, offset_tzoffset in ending link
tx, ty, tzposition in meters from the origin
rz, rx, ryorientations in degrees counter-clockwise from the positive X axis
Pass NULL for any values that are not needed.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::set_parent

Prototype:

int set_parent(const char* parent_name,
		const char* parent_link_name = "");
Description:

Sets the parent of this character to be the passed character. This means that the coordinate system of this character will be local to the parent character rather than the world coordinate system.

Arguments:

parent_name character to which this character should be attached; pass NULL to have no parent and be attached to the world
parent_link_namename of the link to which this character's base link should attach; pass "" to attach to the parent's base link
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::unset_parent

Prototype:

int unset_parent();
Description:

Detaches a character from its parent and reattches it to the world. This is equivalent to diguyCharacter::set_parent(NULL)

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::get_dead

Prototype:

int get_dead();
Returns:

1 if character is dead (die_now() function has been called), 0 if not.

Callable From:

function diguyCharacter::get_graphics_ptr

Prototype:

void* get_graphics_ptr();
Returns:

A pointer to the character's graphics.

Performer 2.x Version:

The return pointer may be cast to point to a pfNode.

Vega 3.x Version:

The return pointer may be cast to point to a vgObject.

Vega Prime Version:

The return pointer may be cast to point to a vpDiguyCharacter, which is derived from vpObject.

OpenGL Version:

This function returns NULL.

DirectX 8 Version:

This function returns NULL.

Callable From:

function diguyCharacter::set_lod_ranges

Prototype:

int set_lod_ranges(float* ranges);
Description:

Sets the graphics Level of Detail (LOD) ranges for this character. Compare with diguyScenario::set_default_lod_ranges(), which sets the LOD ranges for newly created characters of a particular type. In both cases, ranges must be a static array of 8 floats, each larger than the one before.

This function sets graphics LOD ranges only. Motion levels of detain can be set by calling set_motion_lod().

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacter::draw

Prototype:

int draw();
Description:

This function draws this character in immediate mode graphics environments (see below). This is the equivalent of calling draw_pass1() immediately followed by draw_pass2().

Callable From:

Returns:

0 on success, -1 on failure

Performer 2.x Version:

This function has no effect. These environments automatically draw all elements in their visual database.

OpenGL Version:

Direct3D Version:

This function immediately draws this character. Either this