![]() |
DI-Guy SDK Documentation
13.8
|
The class that represents what parameters an agent is currently using to carry out their base behavior. More...
#include <diguyAgentParams.h>
Public Member Functions | |
Notes | |
The following functions return a pointer to an object of this type:
| |
| void | set_posture (diguyMotionPosture posture) |
| Sets the desired posture of agent actions. More... | |
| diguyMotionPosture | get_posture () |
| Returns the desired posture of agent actions. More... | |
| void | set_variant (diguyMotionVariant variant) |
| Sets the desired variant of agent actions. More... | |
| diguyMotionVariant | get_variant () |
| Returns the desired variant of agent actions. More... | |
Behavior Functions | |
| void | set_behavior (diguyAgentBehavior behavior) |
| Sets the desired behavior of the agent. More... | |
| diguyAgentBehavior | get_behavior () |
| Returns the desired behavior of the agent. More... | |
| void | set_behavior_path_shape (const char *behavior_path_shape_name) |
| Sets the behavior path shape of the agent. More... | |
| const char * | get_behavior_path_shape () |
| Returns the name of the behavior path shape of the agent. More... | |
| void | set_behavior_region (const char *behavior_region_name) |
| Sets the behavior region of the agent. More... | |
| const char * | get_behavior_region () |
| Returns the name of the behavior region of the agent. More... | |
| void | set_behavior_subregion (diguySubregionIndex area) |
| Sets the behavior subregion of the agent. More... | |
| diguySubregionIndex | get_behavior_subregion () |
| Returns the behavior subregion of the agent. More... | |
| void | set_behavior_region_border_is_solid (int is_solid) |
| Sets whether the walls of the region the agent is in are solid. More... | |
| int | get_behavior_region_border_is_solid () |
| Returns whether the walls of the region the agent is in are solid. More... | |
| void | set_focus_character (const char *focus_character_name) |
| Sets the focus character of this agent. More... | |
| const char * | get_focus_character () |
| Returns the name of the focus character of this agent, "" if there is none. More... | |
| void | set_focus_group (const char *focus_group_name) |
| Sets the focus group of this agent. More... | |
| const char * | get_focus_group () |
| Returns the name of the focus group of this agent, "" if there is none. More... | |
| void | set_focus_affects_gaze (int focus_affects_gaze) |
| Sets the whether the agent will gaze at its focus character, or whether setting the focus leaves gaze settings alone. More... | |
| int | get_focus_affects_gaze () |
| Returns whether agent changes gaze settings to gaze at focus character or group. More... | |
| void | set_max_focus_distance (float distance) |
| Sets the how far away characters in the focus group can be and still be considered as a focus character. More... | |
| float | get_max_focus_distance () |
| Returns the maximum focus distance for focus groups. More... | |
| void | set_move_on_t_min (float t_min) |
| Sets the minimum amount of time this agent will stay in one place before moving on to a new location. More... | |
| float | get_move_on_t_min () |
| Returns the minimum amount of time before an agent will move on to a new location in certain behaviors. More... | |
| void | set_move_on_t_max (float t_max) |
| Similar to set_move_on_t_min(), but sets the maximum amount of time. More... | |
| float | get_move_on_t_max () |
| Similar to get_move_on_t_min(), but returns the maximum amount of time. More... | |
Attack Behavior Functions | |
| void | set_attack_distance (float distance) |
| Sets the distance at which an attacking agent will stop and fire at its target. More... | |
| float | get_attack_distance () |
| Returns the distance at which an attacking agent will stop and fire at its target. More... | |
| void | set_attack_fire_interval (float time_interval) |
| Sets the interval in seconds at which an attacking agent will fire its weapon when its target is in range. More... | |
| float | get_attack_fire_interval () |
| Returns the interval in seconds at which an attacking agent will fire its weapon when its target is in range. More... | |
| void | set_attack_stands_ground (int value) |
| Sets whether agents in attack behavior will stay where they are and fire at targets of oppurtunity, or pursue targets. More... | |
| int | get_attack_stands_ground () |
| Returns the most recent setting made by set_attack_stands_ground(). More... | |
| void | set_attack_zone (float x, float y, float z, float radius) |
| If an agent is not designated to stand its ground (see set_attack_stands_ground()), and an attack zone is enabled (see set_attack_zone_enabled()), this function sets where and how far an agent can pursue its target. More... | |
| int | get_attack_zone (float *x, float *y, float *z, float *radius) |
| Returns position and radius of agent's attack zone. More... | |
| void | set_attack_zone_enabled (int use_attack_zone) |
| If an attacking agent is not designated to stand its ground (see set_attack_stands_ground()) and is therefore free to pursue its target, the attack zone can limit how far it will go in pursuit. More... | |
| int | get_attack_zone_enabled () |
| Returns 0 if zone is disabled and agents can pursue indefinitely. More... | |
Wander Behavior Functions | |
| void | set_wander_max_wander_dist (float distance) |
| Sets the maximum distance an agent will wander from its previous waiting point. More... | |
| void | set_wander_sets_desired_orientation (int sets_desired_orientation) |
| Sets whether the wander behavior can change the desired orientation. More... | |
Pursue Speed Match Functions | |
| void | set_pursue_speed_match_enabled (int enabled) |
| Sets whether the speed match functionality is enabled. More... | |
| int | get_pursue_speed_match_enabled () |
| Returns whether speed match functionality is enabled. More... | |
| void | set_pursue_speed_match_update_dt (float dt) |
| Sets how often the speed match speed is reevaluated. More... | |
| float | get_pursue_speed_match_update_dt () |
| Returns the frequency that the speed match speed is updated. More... | |
| void | set_pursue_speed_match_max_factor (float factor) |
| Sets the maximum multiplier that can be applied to the fastest motion when pursuing in order to match speeds with the pursued target. More... | |
| float | get_pursue_speed_match_max_factor () |
| Returns the maximum speed multiplier the speed match code will use. More... | |
| void | set_pursue_offset (float x, float y, float z) |
| Building block for setting up AI formations. More... | |
| int | get_pursue_offset (float *x, float *y, float *z) |
| Accessor for current values of set_pursue_offset. More... | |
Path Follow Behavior Functions | |
| void | set_path_follow_pause_t_when_off_path (int pause_t) |
| Sets whether time advancement on the path being followed should occur when the agent is in a different behavior. More... | |
| int | get_path_follow_pause_t_when_off_path () |
| Returns the path follow pause t flag. More... | |
| void | set_path_follow_unpause_t_at_radius (float radius) |
| Sets how close the agent must be before a paused path follow will resume. More... | |
| float | get_path_follow_unpause_t_at_radius () |
| Returns the resume distance of a paused path follow. More... | |
| void | set_path_follow_position_lookahead_distance (float distance) |
| Sets how far ahead on the path being followed the agent will look ahead for its desired orientation. More... | |
| float | get_path_follow_position_lookahead_distance () |
| Returns the lookahead distance of a path follow. More... | |
Trap Functions | |
| void | set_wedged_untrap_method (diguyAgentUntrapMethod untrap_method) |
| Sets the untrap method used when an agent becomes wedged in a corner. More... | |
| diguyAgentUntrapMethod | get_wedged_untrap_method () |
| Returns the wedged untrap method. More... | |
| void | set_wedged_trap_time_threshold (float threshold) |
| Sets the how long, in seconds, the agent will walk into a corner before it decides it is wedged and applies the wedged untrap method. More... | |
| float | get_wedged_trap_time_threshold () |
| Returns the how long the agent will walk into a corner before it decides it is wedged. More... | |
| void | set_first_no_progress_untrap_method (diguyAgentUntrapMethod untrap_method) |
| Sets the untrap method used when an agent has not made progress toward its desired position. More... | |
| diguyAgentUntrapMethod | get_first_no_progress_untrap_method () |
| Returns the first no progress untrap method. More... | |
| void | set_first_no_progress_trap_time_threshold (float threshold) |
| Sets the how long, in seconds, the agent is willing to make no progress toward its desired position before it applies the first no progress untrap method. More... | |
| float | get_first_no_progress_trap_time_threshold () |
| Returns the how long the agent can make no progress toward its desired position before it decides to apply an untrap method. More... | |
| void | set_second_no_progress_untrap_method (diguyAgentUntrapMethod untrap_method) |
| Similar to set_first_no_progress_untrap_method(), but the time threshold is longer before the second no progress untrap method is applied. More... | |
| diguyAgentUntrapMethod | get_second_no_progress_untrap_method () |
| Similar to get_first_no_progress_untrap_method(), but applied to the second no progress untrap method. More... | |
| void | set_second_no_progress_trap_time_threshold (float threshold) |
| Sets the how long, in seconds, the agent is willing to make no progress toward its desired position before it applies the second no progress untrap method. More... | |
| float | get_second_no_progress_trap_time_threshold () |
| Returns the how long the agent can make no progress toward its desired position before it decides to apply the second no progress untrap method. More... | |
| void | set_untrap_method_random_turn_max_tries (int max_tries) |
| Sets how many times the agent is willing to try applying the random turn untrap method before it gives up and moves on to the next untrap method. More... | |
| int | get_untrap_method_random_turn_max_tries () |
| Returns how many times the agent is willing to try applying the random turn untrap method. More... | |
| void | set_untrap_method_ghost_duration (float duration) |
| Sets how many seconds the agent will be intangible when it is applying the ghost untrap method. More... | |
| float | get_untrap_method_ghost_duration () |
| Returns how many seconds the agent will be intangible when it is applying the ghost untrap method. More... | |
Speed Type Parameters | |
| int | set_speed_type_enabled (diguyMotionSpeedType motion_speed_type, int enabled) |
| Sets whether the agent will make use of actions that have the specified speed type. More... | |
| int | get_speed_type_enabled (diguyMotionSpeedType motion_speed_type) |
| Returns whether the agent will make use of actions that have the specified speed type. More... | |
| int | set_speed_type_radius (diguyMotionSpeedType motion_speed_type, float radius) |
| Sets at what radius, in meters, the agent will begin to play actions with the specified speed type, if that type is enabled. More... | |
| float | get_speed_type_radius (diguyMotionSpeedType motion_speed_type) |
| Returns the radius of the specified speed type. More... | |
| void | set_speed_type_radius_hysteresis (float hysteresis_distance) |
| Sets the hysteresis of when the speed type changes based on how far the agent is from its desired position. More... | |
| float | get_speed_type_radius_hysteresis () |
| Returns the radius hysteresis as described in set_speed_type_radius_hysteresis(). More... | |
| int | set_speed_type_exact_action (diguyMotionSpeedType motion_speed_type, const char *action) |
| Sets the exact action the agent will use if it is to use the specified speed type. More... | |
| const char * | get_speed_type_exact_action (diguyMotionSpeedType motion_speed_type) |
| Returns the exact action the agent will use if it is to use the specified speed type. More... | |
| void | set_radius_variation (float distance) |
| Sets the radius variation that will be applied to speed type radii as set by set_speed_type_radius(). More... | |
| float | get_radius_variation () |
| Returns the radius variation for this agent as set by set_radius_variation(). More... | |
| int | set_turning_motions_enabled (int enabled) |
| Sets if the character should use turning motions when changing desired orientation. More... | |
| int | get_turning_motions_enabled () |
| Returns if the character is using turning motions when changing desired orientation. More... | |
Dynamic Avoidance Parameters | |
| void | set_repulsion_radius (diguyAgentRepulsionZone repulsion_zone, float radius) |
| Sets the radius, in meters, of the specified repulsion zone. More... | |
| float | get_repulsion_radius (diguyAgentRepulsionZone repulsion_zone) |
| Returns the radius, in meters, of the specified repulsion zone. More... | |
| void | set_repulsion_factor (diguyAgentRepulsionZone repulsion_zone, float factor) |
| Sets the repulsion factor of the specified repulsion zone. More... | |
| float | get_repulsion_factor (diguyAgentRepulsionZone repulsion_zone) |
| Returns the repulsion factor of the specified repulsion zone. More... | |
| void | set_repulsion_zone_enabled (diguyAgentRepulsionZone repulsion_zone, int enabled) |
| Sets whether the specified repulsion zone is enabled. More... | |
| int | get_repulsion_zone_enabled (diguyAgentRepulsionZone repulsion_zone) |
| Returns whether the specified repulsion zone is enabled. More... | |
| void | set_max_orientation_change_rate (float max_orientation_change_rate) |
| Sets the fastest the agent can turn, in degrees per second, in response to being repulsed by another agent. More... | |
| float | get_max_orientation_change_rate () |
| Returns the fastest the agent can turn, in degrees per second, in response to being repulsed by another agent. More... | |
| void | set_influence_center_shift (float x, float y, float z) |
| Sets the offset, in meters, that the low, medium, and high repulsion zones should have from the agent's position. More... | |
Vehicle-Specific Avoidance Parameters | |
| void | set_vehicle_base_influence_box (float min_x, float min_y, float min_z, float max_x, float max_y, float max_z) |
| Sets the base influence box, in meters, of a vehicle agent. More... | |
| void | get_vehicle_base_influence_box (float *min_x, float *min_y, float *min_z, float *max_x, float *max_y, float *max_z) |
| Returns the vehicle's base influence box. More... | |
| void | set_influence_box_enabled (int enabled=1) |
| Sets whether or not the influence box is active (true by default). More... | |
| int | get_influence_box_enabled () |
| Returns whether or not the influence box is active. More... | |
| void | set_influence_box_forward_multiplier (float value) |
| float | get_influence_box_forward_multiplier () |
| void | set_influence_box_sideways_multiplier (float value) |
| float | get_influence_box_sideways_multiplier () |
| void | set_influence_box_angular_multiplier (float value) |
| float | get_influence_box_angular_multiplier () |
Feeler Functions | |
| void | set_feeler_enabled (int feeler_index, int feeler_enabled) |
| Sets whether the specified feeler is enabled. More... | |
| int | get_feeler_enabled (int feeler_index) |
| Returns whether the specified feeler is enabled. More... | |
| void | set_feeler_rz_offset (int feeler_index, float feeler_rz_offset) |
| Sets, in degrees, how far counter-clockwise from forward the feeler is. More... | |
| float | get_feeler_rz_offset (int feeler_index) |
| Returns, in degrees, how far counter-clockwise from forward the feeler is. More... | |
| void | set_feeler_height (int feeler_index, float feeler_height) |
| Sets, in meters, how high the feeler is from the ground. More... | |
| float | get_feeler_height (int feeler_index) |
| Returns, in meters, how high the feeler is from the ground. More... | |
| void | set_feeler_collision_distance (int feeler_index, float collision_distance) |
| Sets, in meters, how far away from the agent the feeler will return collision results. More... | |
| float | get_feeler_collision_distance (int feeler_index) |
| Returns, in meters, how far away from the agent the feeler will return collision results. More... | |
| void | set_feeler_turn_distance (int feeler_index, float turn_distance) |
| Sets, in meters, how far away from the agent the feeler will return turn results. More... | |
| float | get_feeler_turn_distance (int feeler_index) |
| Returns, in meters, how far away from the agent the feeler will return turn results. More... | |
| void | set_feeler_turn_direction (int feeler_index, diguyCharacterFeelerTurnDirection turn_direction) |
| Sets which direction the feeler will turn the agent when it touches something within the turn distance. More... | |
| diguyCharacterFeelerTurnDirection | get_feeler_turn_direction (int feeler_index) |
| Returns which direction the feeler will turn the agent when it touches something within the turn distance. More... | |
Path Planner Parameter Functions | |
| void | set_path_planner_preferred_region_mask (int mask) |
| Sets the preferred traveling region mask. More... | |
| int | get_path_planner_preferred_region_mask () |
| Returns: More... | |
| void | set_path_planner_preferred_cost_bias (float value) |
| Sets how much less expensive it is to cross spaces that are in the desired subregion. More... | |
| float | get_path_planner_preferred_cost_bias () |
| Returns: the cost bias of preferred regions during A* searches; see set_path_planner_preferred_cost_bias() More... | |
| void | set_path_planner_neutral_cost_bias (float value) |
| Sets how much more expensive it is to cross spaces that are not in a desired subregion. More... | |
| float | get_path_planner_neutral_cost_bias () |
| Returns: the cost bias of neutral regions during A* searches; see set_path_planner_neutral_cost_bias() More... | |
| void | set_path_planner_repulsed_region_mask (int mask) |
| Sets the repulsive traveling region mask. More... | |
| int | get_path_planner_repulsed_region_mask () |
| Returns: the repulsed region mask; see set_path_planner_repulsed_region_mask() More... | |
| void | set_path_planner_repulsed_cost_bias (float value) |
| Sets how much more expensive it will be to cross spaces that are marked as repulsive. More... | |
| float | get_path_planner_repulsed_cost_bias () |
| Returns: the cost bias of repulsive regions during A* searches; see set_path_planner_repulsed_cost_bias() More... | |
| void | set_path_planner_fallback_region (const char *fallback_region_name) |
| Sets the name of the region to try to use if the path planner fails to work on the current behavior region. More... | |
| const char * | get_path_planner_fallback_region () |
| Returns: The name of the fallback region that the path planner will fall back to if a search on the behavior region fails. More... | |
| void | set_wander_uses_path_planner (int wander_uses_path_planner) |
| Sets whether the wander behavior will try to use the path planner when the agent can't see it's target location with a viability check. More... | |
| int | get_wander_uses_path_planner () |
| Returns: whether the wander behavior uses the path planner; see set_wander_uses_path_planner() More... | |
| void | set_pursue_uses_path_planner (int pursue_uses_path_planner) |
| Sets whether the pursue behavior will try to use the path planner when the agent can't see it's target with a viability check. More... | |
| int | get_pursue_uses_path_planner () |
| Returns: whether the pursue behavior uses the path planner; see set_wander_uses_path_planner() More... | |
| void | set_max_LOS_travel_distance (float distance) |
| Sets the maximum distance the wander behavior will travel without using the path planner, when the agent can see it's target location with a Line-Of-Sight viability check. More... | |
| float | get_max_LOS_travel_distance () |
| Returns: the Line-Of-Sight travel distance threshold; see set_max_LOS_travel_distance(). More... | |
| void | set_desired_navpath_distance_threshold (float threshold) |
| Sets the distance from the final point on a navpath that the guide algorithm will attempt to achieve before declaring that its destination has been reached. More... | |
| float | get_desired_navpath_distance_threshold () |
| Returns: distance from final point in navpath at which the desired position is considered acquired; see set_desired_navpath_distance_threshold() More... | |
Experimental Functions | |
| void | set_path_planner_cost_rule (int mask) |
| see diguyNavMeshPathPlannerCostMask for acceptable values. More... | |
| int | get_path_planner_cost_rule () |
| float | get_near_destination_distance () |
| void | set_near_destination_distance (float dist) |
| int | get_navpath_current_waypoint_index () |
| int | get_navpath_num_waypoints () |
| diguyPathShape * | get_navpath_path () |
| diguyNavPathDirection | get_navpath_travel_direction () |
| float | get_navpath_offset_y () |
| how far off a navigation path a character will attempt to travel 0 yields exactly on, negative values to the left, positive values to the right More... | |
| void | set_navpath_offset_y (float y) |
Private Functions | |
The functions and variables past this point are for internal use only. No external access to them is expected or necessary. | |
| bdiScenarioAgentParams * | m_scripted_object |
| A pointer to internal data. More... | |
| bdiScenarioAgent * | m_agent_object |
| class | bdiScenarioAgentParams |
| class | bdiScenarioAgent |
| bdiScenarioAgentParams * | get_scripted_object () |
| diguyAgentParams (bdiScenarioAgentParams *scripted_object) | |
| A private constructor. More... | |
| virtual | ~diguyAgentParams () |
| A private destructor. More... | |
The class that represents what parameters an agent is currently using to carry out their base behavior.
|
private |
A private constructor.
|
privatevirtual |
A private destructor.
| void diguyAgentParams::set_posture | ( | diguyMotionPosture | posture | ) |
Sets the desired posture of agent actions.
| diguyMotionPosture diguyAgentParams::get_posture | ( | ) |
Returns the desired posture of agent actions.
| void diguyAgentParams::set_variant | ( | diguyMotionVariant | variant | ) |
Sets the desired variant of agent actions.
| diguyMotionVariant diguyAgentParams::get_variant | ( | ) |
Returns the desired variant of agent actions.
| void diguyAgentParams::set_behavior | ( | diguyAgentBehavior | behavior | ) |
Sets the desired behavior of the agent.
For information on agent behaviors see the documentation for the enumeration diguyAgentBehavior, or the DI-Guy AI User Manual.
| diguyAgentBehavior diguyAgentParams::get_behavior | ( | ) |
Returns the desired behavior of the agent.
| void diguyAgentParams::set_behavior_path_shape | ( | const char * | behavior_path_shape_name | ) |
Sets the behavior path shape of the agent.
Pass the name of an existing path shape in the scenario, or pass "" to un-set the behavior path shape.
| const char* diguyAgentParams::get_behavior_path_shape | ( | ) |
Returns the name of the behavior path shape of the agent.
If there is no behavior path shape, the string "" will be returned.
| void diguyAgentParams::set_behavior_region | ( | const char * | behavior_region_name | ) |
Sets the behavior region of the agent.
Pass the name of an existing region in the scenario, "(crowd region)" to specify the region associated with the agent's crowd if it has one, or "" to un-set the behavior region.
| const char* diguyAgentParams::get_behavior_region | ( | ) |
Returns the name of the behavior region of the agent.
If there is no behavior region, the string "" will be returned.
| void diguyAgentParams::set_behavior_subregion | ( | diguySubregionIndex | area | ) |
Sets the behavior subregion of the agent.
| diguySubregionIndex diguyAgentParams::get_behavior_subregion | ( | ) |
Returns the behavior subregion of the agent.
| void diguyAgentParams::set_behavior_region_border_is_solid | ( | int | is_solid | ) |
Sets whether the walls of the region the agent is in are solid.
If they are, the agent will treat the walls as if they are solid walls in the environment. If not, the agent is free to walk through them.
Pass 1 to make border walls solid, 0 to make them freely passable.
| int diguyAgentParams::get_behavior_region_border_is_solid | ( | ) |
Returns whether the walls of the region the agent is in are solid.
| void diguyAgentParams::set_focus_character | ( | const char * | focus_character_name | ) |
Sets the focus character of this agent.
What this means depends on which behavior the agent is doing. For example, when in the wander behavior, when the agent is still it will turn to face the focus character.
Pass the name of an existing scenario character to set a new focus character. Pass "" to un-set the focus character.
| const char* diguyAgentParams::get_focus_character | ( | ) |
Returns the name of the focus character of this agent, "" if there is none.
| void diguyAgentParams::set_focus_group | ( | const char * | focus_group_name | ) |
Sets the focus group of this agent.
The focus group is similar to the focus character, except that characters the agent will focus on are selected from the focus group instead of being a single character.
Pass the name of an existing scenario group to set a new focus group. Pass "" to un-set the focus group.
| const char* diguyAgentParams::get_focus_group | ( | ) |
Returns the name of the focus group of this agent, "" if there is none.
| void diguyAgentParams::set_focus_affects_gaze | ( | int | focus_affects_gaze | ) |
Sets the whether the agent will gaze at its focus character, or whether setting the focus leaves gaze settings alone.
| int diguyAgentParams::get_focus_affects_gaze | ( | ) |
Returns whether agent changes gaze settings to gaze at focus character or group.
| void diguyAgentParams::set_max_focus_distance | ( | float | distance | ) |
Sets the how far away characters in the focus group can be and still be considered as a focus character.
| float diguyAgentParams::get_max_focus_distance | ( | ) |
Returns the maximum focus distance for focus groups.
| void diguyAgentParams::set_move_on_t_min | ( | float | t_min | ) |
Sets the minimum amount of time this agent will stay in one place before moving on to a new location.
This applies to the wander and mingle behaviors.
| float diguyAgentParams::get_move_on_t_min | ( | ) |
Returns the minimum amount of time before an agent will move on to a new location in certain behaviors.
| void diguyAgentParams::set_move_on_t_max | ( | float | t_max | ) |
Similar to set_move_on_t_min(), but sets the maximum amount of time.
| float diguyAgentParams::get_move_on_t_max | ( | ) |
Similar to get_move_on_t_min(), but returns the maximum amount of time.
| void diguyAgentParams::set_attack_distance | ( | float | distance | ) |
Sets the distance at which an attacking agent will stop and fire at its target.
| float diguyAgentParams::get_attack_distance | ( | ) |
Returns the distance at which an attacking agent will stop and fire at its target.
| void diguyAgentParams::set_attack_fire_interval | ( | float | time_interval | ) |
Sets the interval in seconds at which an attacking agent will fire its weapon when its target is in range.
| float diguyAgentParams::get_attack_fire_interval | ( | ) |
Returns the interval in seconds at which an attacking agent will fire its weapon when its target is in range.
| void diguyAgentParams::set_attack_stands_ground | ( | int | value | ) |
Sets whether agents in attack behavior will stay where they are and fire at targets of oppurtunity, or pursue targets.
If an agent is not told to stand its ground it can pursue its current target. The functions set_attack_zone_enabled() and set_attack_zone() might limit the extent that the agent can pursue.
Set to 1 for agents to stand their ground, 0 to allow them to pursue targets. Defaults to 0.
| int diguyAgentParams::get_attack_stands_ground | ( | ) |
Returns the most recent setting made by set_attack_stands_ground().
| void diguyAgentParams::set_attack_zone | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | radius | ||
| ) |
If an agent is not designated to stand its ground (see set_attack_stands_ground()), and an attack zone is enabled (see set_attack_zone_enabled()), this function sets where and how far an agent can pursue its target.
| int diguyAgentParams::get_attack_zone | ( | float * | x, |
| float * | y, | ||
| float * | z, | ||
| float * | radius | ||
| ) |
Returns position and radius of agent's attack zone.
| void diguyAgentParams::set_attack_zone_enabled | ( | int | use_attack_zone | ) |
If an attacking agent is not designated to stand its ground (see set_attack_stands_ground()) and is therefore free to pursue its target, the attack zone can limit how far it will go in pursuit.
Pass 1 to enable the attack zone, 0 to disable.
| int diguyAgentParams::get_attack_zone_enabled | ( | ) |
Returns 0 if zone is disabled and agents can pursue indefinitely.
| void diguyAgentParams::set_wander_max_wander_dist | ( | float | distance | ) |
Sets the maximum distance an agent will wander from its previous waiting point.
| void diguyAgentParams::set_wander_sets_desired_orientation | ( | int | sets_desired_orientation | ) |
Sets whether the wander behavior can change the desired orientation.
| void diguyAgentParams::set_pursue_speed_match_enabled | ( | int | enabled | ) |
Sets whether the speed match functionality is enabled.
| int diguyAgentParams::get_pursue_speed_match_enabled | ( | ) |
Returns whether speed match functionality is enabled.
If it is, agents are able to speed up their fastest animation to match their pursuit target.
| void diguyAgentParams::set_pursue_speed_match_update_dt | ( | float | dt | ) |
Sets how often the speed match speed is reevaluated.
The default is every two seconds.
| float diguyAgentParams::get_pursue_speed_match_update_dt | ( | ) |
Returns the frequency that the speed match speed is updated.
| void diguyAgentParams::set_pursue_speed_match_max_factor | ( | float | factor | ) |
Sets the maximum multiplier that can be applied to the fastest motion when pursuing in order to match speeds with the pursued target.
Example: If an agent's fastest action moves at 3 m/s, the pursue speed match functionality will allow the character to move up to 6 m/s.
The default is 2x. This allows a character with a fast movement motion to keep up with another individual that is moving faster then them, but not a fast moving vehicle.
| float diguyAgentParams::get_pursue_speed_match_max_factor | ( | ) |
Returns the maximum speed multiplier the speed match code will use.
| void diguyAgentParams::set_pursue_offset | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
Building block for setting up AI formations.
Sets an offset that is used by the AI to modify the pursue location. This offset is considered to be in local space of the target and then is periodically bread-crumbed as the pursue target moves. This avoids small movements wildly confusing the pursuer. Often this is used with the diguyFormation class to data drive this info.
The z argument is currently ignored.
| int diguyAgentParams::get_pursue_offset | ( | float * | x, |
| float * | y, | ||
| float * | z | ||
| ) |
Accessor for current values of set_pursue_offset.
| void diguyAgentParams::set_path_follow_pause_t_when_off_path | ( | int | pause_t | ) |
Sets whether time advancement on the path being followed should occur when the agent is in a different behavior.
| int diguyAgentParams::get_path_follow_pause_t_when_off_path | ( | ) |
Returns the path follow pause t flag.
| void diguyAgentParams::set_path_follow_unpause_t_at_radius | ( | float | radius | ) |
Sets how close the agent must be before a paused path follow will resume.
| float diguyAgentParams::get_path_follow_unpause_t_at_radius | ( | ) |
Returns the resume distance of a paused path follow.
| void diguyAgentParams::set_path_follow_position_lookahead_distance | ( | float | distance | ) |
Sets how far ahead on the path being followed the agent will look ahead for its desired orientation.
A value of 1.0 usually provides good results.
| float diguyAgentParams::get_path_follow_position_lookahead_distance | ( | ) |
Returns the lookahead distance of a path follow.
| void diguyAgentParams::set_wedged_untrap_method | ( | diguyAgentUntrapMethod | untrap_method | ) |
Sets the untrap method used when an agent becomes wedged in a corner.
For information on untrap methods see the documentation for the enumeration diguyAgentUntrapMethod, or the DI-Guy AI User Manual.
| diguyAgentUntrapMethod diguyAgentParams::get_wedged_untrap_method | ( | ) |
Returns the wedged untrap method.
| void diguyAgentParams::set_wedged_trap_time_threshold | ( | float | threshold | ) |
Sets the how long, in seconds, the agent will walk into a corner before it decides it is wedged and applies the wedged untrap method.
| float diguyAgentParams::get_wedged_trap_time_threshold | ( | ) |
Returns the how long the agent will walk into a corner before it decides it is wedged.
| void diguyAgentParams::set_first_no_progress_untrap_method | ( | diguyAgentUntrapMethod | untrap_method | ) |
Sets the untrap method used when an agent has not made progress toward its desired position.
For information on untrap methods see the documentation for the enumeration diguyAgentUntrapMethod, or the DI-Guy AI User Manual.
| diguyAgentUntrapMethod diguyAgentParams::get_first_no_progress_untrap_method | ( | ) |
Returns the first no progress untrap method.
| void diguyAgentParams::set_first_no_progress_trap_time_threshold | ( | float | threshold | ) |
Sets the how long, in seconds, the agent is willing to make no progress toward its desired position before it applies the first no progress untrap method.
| float diguyAgentParams::get_first_no_progress_trap_time_threshold | ( | ) |
Returns the how long the agent can make no progress toward its desired position before it decides to apply an untrap method.
| void diguyAgentParams::set_second_no_progress_untrap_method | ( | diguyAgentUntrapMethod | untrap_method | ) |
Similar to set_first_no_progress_untrap_method(), but the time threshold is longer before the second no progress untrap method is applied.
| diguyAgentUntrapMethod diguyAgentParams::get_second_no_progress_untrap_method | ( | ) |
Similar to get_first_no_progress_untrap_method(), but applied to the second no progress untrap method.
| void diguyAgentParams::set_second_no_progress_trap_time_threshold | ( | float | threshold | ) |
Sets the how long, in seconds, the agent is willing to make no progress toward its desired position before it applies the second no progress untrap method.
| float diguyAgentParams::get_second_no_progress_trap_time_threshold | ( | ) |
Returns the how long the agent can make no progress toward its desired position before it decides to apply the second no progress untrap method.
| void diguyAgentParams::set_untrap_method_random_turn_max_tries | ( | int | max_tries | ) |
Sets how many times the agent is willing to try applying the random turn untrap method before it gives up and moves on to the next untrap method.
| int diguyAgentParams::get_untrap_method_random_turn_max_tries | ( | ) |
Returns how many times the agent is willing to try applying the random turn untrap method.
| void diguyAgentParams::set_untrap_method_ghost_duration | ( | float | duration | ) |
Sets how many seconds the agent will be intangible when it is applying the ghost untrap method.
| float diguyAgentParams::get_untrap_method_ghost_duration | ( | ) |
Returns how many seconds the agent will be intangible when it is applying the ghost untrap method.
| int diguyAgentParams::set_speed_type_enabled | ( | diguyMotionSpeedType | motion_speed_type, |
| int | enabled | ||
| ) |
Sets whether the agent will make use of actions that have the specified speed type.
For information on speed types see the documentation for the enumeration diguyMotionSpeedType. or the DI-Guy AI User Manual.
| int diguyAgentParams::get_speed_type_enabled | ( | diguyMotionSpeedType | motion_speed_type | ) |
Returns whether the agent will make use of actions that have the specified speed type.
If the speed type is enabled, the character must be outside the the associated radius for the action to apply. If the character enters that radius, then the next radius down is considered. If all enabled speed types have been exhausted, then the character should stop
| int diguyAgentParams::set_speed_type_radius | ( | diguyMotionSpeedType | motion_speed_type, |
| float | radius | ||
| ) |
Sets at what radius, in meters, the agent will begin to play actions with the specified speed type, if that type is enabled.
See set_speed_type_radius_hysteresis() for how a hysteresis value can affect the final radius.
| float diguyAgentParams::get_speed_type_radius | ( | diguyMotionSpeedType | motion_speed_type | ) |
Returns the radius of the specified speed type.
| void diguyAgentParams::set_speed_type_radius_hysteresis | ( | float | hysteresis_distance | ) |
Sets the hysteresis of when the speed type changes based on how far the agent is from its desired position.
A hysteresis value can help prevent constant switching back and forth of actions if an agent is moving right along the radius separating two speed type zones.
Example: a hysteresis of 2.0 means that if an agent switches from speed type fast to speed type medium at 2 meters, it won't switch back to fast unless it goes back out to 4 meters.
| float diguyAgentParams::get_speed_type_radius_hysteresis | ( | ) |
Returns the radius hysteresis as described in set_speed_type_radius_hysteresis().
| int diguyAgentParams::set_speed_type_exact_action | ( | diguyMotionSpeedType | motion_speed_type, |
| const char * | action | ||
| ) |
Sets the exact action the agent will use if it is to use the specified speed type.
This is useful if a specific stand action is desired, for example, for the still speed type.
To use the default action, pass "".
| const char* diguyAgentParams::get_speed_type_exact_action | ( | diguyMotionSpeedType | motion_speed_type | ) |
Returns the exact action the agent will use if it is to use the specified speed type.
If the default action is to be used, returns "".
| void diguyAgentParams::set_radius_variation | ( | float | distance | ) |
Sets the radius variation that will be applied to speed type radii as set by set_speed_type_radius().
Each agent will have a different amount of variation added to its radii.
Value is in meters.
| float diguyAgentParams::get_radius_variation | ( | ) |
Returns the radius variation for this agent as set by set_radius_variation().
| int diguyAgentParams::set_turning_motions_enabled | ( | int | enabled | ) |
Sets if the character should use turning motions when changing desired orientation.
As of diguy-12 defaults to true.
| int diguyAgentParams::get_turning_motions_enabled | ( | ) |
Returns if the character is using turning motions when changing desired orientation.
As of diguy-12 defaults to true.
| void diguyAgentParams::set_repulsion_radius | ( | diguyAgentRepulsionZone | repulsion_zone, |
| float | radius | ||
| ) |
Sets the radius, in meters, of the specified repulsion zone.
| float diguyAgentParams::get_repulsion_radius | ( | diguyAgentRepulsionZone | repulsion_zone | ) |
Returns the radius, in meters, of the specified repulsion zone.
| void diguyAgentParams::set_repulsion_factor | ( | diguyAgentRepulsionZone | repulsion_zone, |
| float | factor | ||
| ) |
Sets the repulsion factor of the specified repulsion zone.
Higher repulsion factors will result in agents in the specified zone being pushed away harder.
| float diguyAgentParams::get_repulsion_factor | ( | diguyAgentRepulsionZone | repulsion_zone | ) |
Returns the repulsion factor of the specified repulsion zone.
| void diguyAgentParams::set_repulsion_zone_enabled | ( | diguyAgentRepulsionZone | repulsion_zone, |
| int | enabled | ||
| ) |
Sets whether the specified repulsion zone is enabled.
Zones that are not enabled will have no effect on agents in them.
| int diguyAgentParams::get_repulsion_zone_enabled | ( | diguyAgentRepulsionZone | repulsion_zone | ) |
Returns whether the specified repulsion zone is enabled.
| void diguyAgentParams::set_max_orientation_change_rate | ( | float | max_orientation_change_rate | ) |
Sets the fastest the agent can turn, in degrees per second, in response to being repulsed by another agent.
| float diguyAgentParams::get_max_orientation_change_rate | ( | ) |
Returns the fastest the agent can turn, in degrees per second, in response to being repulsed by another agent.
| void diguyAgentParams::set_influence_center_shift | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
Sets the offset, in meters, that the low, medium, and high repulsion zones should have from the agent's position.
The solid zone is not affected. Sometimes it is desirable for the repulsion zones to be moved slightly forward, to make it so that other agents approaching this agent from the side will prefer to move behind this agent rather than in front.
| void diguyAgentParams::set_vehicle_base_influence_box | ( | float | min_x, |
| float | min_y, | ||
| float | min_z, | ||
| float | max_x, | ||
| float | max_y, | ||
| float | max_z | ||
| ) |
Sets the base influence box, in meters, of a vehicle agent.
The default influence box is the vehicle's axis-aligned bounding box.
| void diguyAgentParams::get_vehicle_base_influence_box | ( | float * | min_x, |
| float * | min_y, | ||
| float * | min_z, | ||
| float * | max_x, | ||
| float * | max_y, | ||
| float * | max_z | ||
| ) |
Returns the vehicle's base influence box.
| void diguyAgentParams::set_influence_box_enabled | ( | int | enabled = 1 | ) |
Sets whether or not the influence box is active (true by default).
| int diguyAgentParams::get_influence_box_enabled | ( | ) |
Returns whether or not the influence box is active.
| void diguyAgentParams::set_influence_box_forward_multiplier | ( | float | value | ) |
| float diguyAgentParams::get_influence_box_forward_multiplier | ( | ) |
| void diguyAgentParams::set_influence_box_sideways_multiplier | ( | float | value | ) |
| float diguyAgentParams::get_influence_box_sideways_multiplier | ( | ) |
| void diguyAgentParams::set_influence_box_angular_multiplier | ( | float | value | ) |
| float diguyAgentParams::get_influence_box_angular_multiplier | ( | ) |
| void diguyAgentParams::set_feeler_enabled | ( | int | feeler_index, |
| int | feeler_enabled | ||
| ) |
Sets whether the specified feeler is enabled.
Feelers that are not enabled will have no effect on the agent.
| int diguyAgentParams::get_feeler_enabled | ( | int | feeler_index | ) |
Returns whether the specified feeler is enabled.
| void diguyAgentParams::set_feeler_rz_offset | ( | int | feeler_index, |
| float | feeler_rz_offset | ||
| ) |
Sets, in degrees, how far counter-clockwise from forward the feeler is.
Zero degrees is straight forward, 90 is to the left, etc. By default the eight feelers are located at 45 degree intervals around the agent.
| float diguyAgentParams::get_feeler_rz_offset | ( | int | feeler_index | ) |
Returns, in degrees, how far counter-clockwise from forward the feeler is.
| void diguyAgentParams::set_feeler_height | ( | int | feeler_index, |
| float | feeler_height | ||
| ) |
Sets, in meters, how high the feeler is from the ground.
In general feelers should be at about waist level for human characters.
| float diguyAgentParams::get_feeler_height | ( | int | feeler_index | ) |
Returns, in meters, how high the feeler is from the ground.
| void diguyAgentParams::set_feeler_collision_distance | ( | int | feeler_index, |
| float | collision_distance | ||
| ) |
Sets, in meters, how far away from the agent the feeler will return collision results.
Agents will be pushed away from the object collided with until they are not colliding anymore.
| float diguyAgentParams::get_feeler_collision_distance | ( | int | feeler_index | ) |
Returns, in meters, how far away from the agent the feeler will return collision results.
| void diguyAgentParams::set_feeler_turn_distance | ( | int | feeler_index, |
| float | turn_distance | ||
| ) |
Sets, in meters, how far away from the agent the feeler will return turn results.
Agents will turn left or right to try to move along the face of a felt obstacle, instead of walking straight into it.
| float diguyAgentParams::get_feeler_turn_distance | ( | int | feeler_index | ) |
Returns, in meters, how far away from the agent the feeler will return turn results.
| void diguyAgentParams::set_feeler_turn_direction | ( | int | feeler_index, |
| diguyCharacterFeelerTurnDirection | turn_direction | ||
| ) |
Sets which direction the feeler will turn the agent when it touches something within the turn distance.
| diguyCharacterFeelerTurnDirection diguyAgentParams::get_feeler_turn_direction | ( | int | feeler_index | ) |
Returns which direction the feeler will turn the agent when it touches something within the turn distance.
| void diguyAgentParams::set_path_planner_preferred_region_mask | ( | int | mask | ) |
Sets the preferred traveling region mask.
When an agent plans a path, the preferred areas will be considered the easiest to cross and the path should gravitate to them.
The mask argument should be an or'ed together list of diguySubregionMasks. In C++ or Perl masks can be combined with the '|' operator, in Lua the bit library can be used: bit.bor(MASK_A, MASK_B, ...)
| int diguyAgentParams::get_path_planner_preferred_region_mask | ( | ) |
Returns:
the preferred region mask; see set_path_planner_preferred_region_mask() and set_path_planner_neutral_cost_bias()
| void diguyAgentParams::set_path_planner_preferred_cost_bias | ( | float | value | ) |
Sets how much less expensive it is to cross spaces that are in the desired subregion.
(Repulsive and neutral regions have their own cost bias; see set_path_planner_repulsed_cost_bias().)
This value should be < 1. The default value is 0.25.
| float diguyAgentParams::get_path_planner_preferred_cost_bias | ( | ) |
Returns: the cost bias of preferred regions during A* searches; see set_path_planner_preferred_cost_bias()
| void diguyAgentParams::set_path_planner_neutral_cost_bias | ( | float | value | ) |
Sets how much more expensive it is to cross spaces that are not in a desired subregion.
(Repulsive regions have their own cost bias; see set_path_planner_repulsed_cost_bias().)
Defaults to 1.1, A value < 1 will cause the planner to run faster but explore fewer points, posibly missing preferred regions. Values greater then 1 will explore more points but will take more time to run.
Pass DIGUY_DEFAULT_FLOAT for the value to specify that neutral regions should be avoided completely. This can, however, cause path planning to fail more often.
| float diguyAgentParams::get_path_planner_neutral_cost_bias | ( | ) |
Returns: the cost bias of neutral regions during A* searches; see set_path_planner_neutral_cost_bias()
| void diguyAgentParams::set_path_planner_repulsed_region_mask | ( | int | mask | ) |
Sets the repulsive traveling region mask.
When an agent plans a path the repulsive areas will be considered the hardest to cross and the planner will try to avoid them.
The mask argument should be an or'ed together list of diguySubregionMasks. In C++ or Perl masks can be combined with the '|' operator, in Lua the bit library can be used: bit.bor(MASK_A, MASK_B, ...)
| int diguyAgentParams::get_path_planner_repulsed_region_mask | ( | ) |
Returns: the repulsed region mask; see set_path_planner_repulsed_region_mask()
| void diguyAgentParams::set_path_planner_repulsed_cost_bias | ( | float | value | ) |
Sets how much more expensive it will be to cross spaces that are marked as repulsive.
This value should generally be much larger then 1. The default value is 100.
Pass DIGUY_DEFAULT_FLOAT for the value to specify that repulsive regions should be avoided completely. This can, however, cause path planning to fail more often.
| float diguyAgentParams::get_path_planner_repulsed_cost_bias | ( | ) |
Returns: the cost bias of repulsive regions during A* searches; see set_path_planner_repulsed_cost_bias()
| void diguyAgentParams::set_path_planner_fallback_region | ( | const char * | fallback_region_name | ) |
Sets the name of the region to try to use if the path planner fails to work on the current behavior region.
This is often the name of a global navmesh.
| const char* diguyAgentParams::get_path_planner_fallback_region | ( | ) |
Returns: The name of the fallback region that the path planner will fall back to if a search on the behavior region fails.
| void diguyAgentParams::set_wander_uses_path_planner | ( | int | wander_uses_path_planner | ) |
Sets whether the wander behavior will try to use the path planner when the agent can't see it's target location with a viability check.
| int diguyAgentParams::get_wander_uses_path_planner | ( | ) |
Returns: whether the wander behavior uses the path planner; see set_wander_uses_path_planner()
| void diguyAgentParams::set_pursue_uses_path_planner | ( | int | pursue_uses_path_planner | ) |
Sets whether the pursue behavior will try to use the path planner when the agent can't see it's target with a viability check.
The agent will do a new visibility check at each waypoint in the navigation path.
| int diguyAgentParams::get_pursue_uses_path_planner | ( | ) |
Returns: whether the pursue behavior uses the path planner; see set_wander_uses_path_planner()
| void diguyAgentParams::set_max_LOS_travel_distance | ( | float | distance | ) |
Sets the maximum distance the wander behavior will travel without using the path planner, when the agent can see it's target location with a Line-Of-Sight viability check.
This value defaults to 1000 meters.
Adjusting it lower is meant for users that have an environment that is well tagged with preferred and repulsed regions.
For example, just because an agent can see the store across an eight lane highway doesn't mean it should run straight there.
| float diguyAgentParams::get_max_LOS_travel_distance | ( | ) |
Returns: the Line-Of-Sight travel distance threshold; see set_max_LOS_travel_distance().
| void diguyAgentParams::set_desired_navpath_distance_threshold | ( | float | threshold | ) |
Sets the distance from the final point on a navpath that the guide algorithm will attempt to achieve before declaring that its destination has been reached.
The default distance is 0.31 meters.
In general this value should only be changed if agent ends up "orbiting" the final desired position.
| float diguyAgentParams::get_desired_navpath_distance_threshold | ( | ) |
Returns: distance from final point in navpath at which the desired position is considered acquired; see set_desired_navpath_distance_threshold()
| void diguyAgentParams::set_path_planner_cost_rule | ( | int | mask | ) |
see diguyNavMeshPathPlannerCostMask for acceptable values.
| int diguyAgentParams::get_path_planner_cost_rule | ( | ) |
| float diguyAgentParams::get_near_destination_distance | ( | ) |
| void diguyAgentParams::set_near_destination_distance | ( | float | dist | ) |
| int diguyAgentParams::get_navpath_current_waypoint_index | ( | ) |
| int diguyAgentParams::get_navpath_num_waypoints | ( | ) |
| diguyPathShape* diguyAgentParams::get_navpath_path | ( | ) |
| diguyNavPathDirection diguyAgentParams::get_navpath_travel_direction | ( | ) |
| float diguyAgentParams::get_navpath_offset_y | ( | ) |
how far off a navigation path a character will attempt to travel 0 yields exactly on, negative values to the left, positive values to the right
| void diguyAgentParams::set_navpath_offset_y | ( | float | y | ) |
|
inline |
|
friend |
|
friend |
|
private |
A pointer to internal data.
|
private |