DI-Guy SDK Documentation  13.8
diguyAgentParams.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2024 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 /*********************************************************************
7  **
8  *t diguyAgentParams
9  **
10  */
11 
12 #pragma once
13 
14 #ifdef SWIG
15 %module diguyAgentParams
16 #else
17 #define CPLUSPLUS_ONLY
18 #endif
19 
20 #ifdef CPLUSPLUS_ONLY
21 #include <diguyMotionPosture.h>
22 #include <diguyMotionSpeedType.h>
23 #include <diguyMotionVariant.h>
24 
25 class bdiScenarioAgentParams;
26 class bdiScenarioAgent;
27 class diguyPathShape;
28 #endif
29 
30 #include <declspec_diguy.h>
31 #include <diguy_constants.h>
32 
39 class BDI_DECLSPEC_diguy diguyAgentParams
40 {
41 
42 /*****************************************************************************/
65 public:
66 
67  /*l
68  *b Description:
69  **
70  ** Sets the desired posture of agent actions.
71  */
72  void set_posture(diguyMotionPosture posture);
73 
74  /*l
75  *b Description:
76  **
77  ** Returns the desired posture of agent actions.
78  */
79  diguyMotionPosture get_posture();
80 
81  /*l
82  *b Description:
83  **
84  ** Sets the desired variant of agent actions.
85  */
86  void set_variant( diguyMotionVariant variant );
87 
88  /*l
89  *b Description:
90  **
91  ** Returns the desired variant of agent actions.
92  */
93  diguyMotionVariant get_variant();
94 
95 
96  /*****************************************************************************/
102  /*l
103  *b Description:
104  **
105  ** Sets the desired behavior of the agent.
106  **
107  ** For information on agent behaviors see the documentation for the
108  ** enumeration diguyAgentBehavior, or the DI-Guy AI User Manual.
109  */
110  void set_behavior( diguyAgentBehavior behavior );
111 
112  /*l
113  *b Description:
114  **
115  ** Returns the desired behavior of the agent.
116  */
117  diguyAgentBehavior get_behavior();
118 
119  /*l
120  *b Description:
121  **
122  ** Sets the behavior path shape of the agent.
123  **
124  ** Pass the name of an existing path shape in the scenario,
125  ** or pass "" to un-set the behavior path shape.
126  */
127  void set_behavior_path_shape( const char* behavior_path_shape_name );
128 
129  /*l
130  *b Description:
131  **
132  ** Returns the name of the behavior path shape of the agent.
133  ** If there is no behavior path shape, the string "" will be
134  ** returned.
135  */
136  const char* get_behavior_path_shape();
137 
138  /*l
139  *b Description:
140  **
141  ** Sets the behavior region of the agent.
142  **
143  ** Pass the name of an existing region in the scenario,
144  ** "(crowd region)" to specify the region associated with the
145  ** agent's crowd if it has one, or "" to un-set the behavior
146  ** region.
147  */
148  void set_behavior_region(const char* behavior_region_name);
149 
150  /*l
151  *b Description:
152  **
153  ** Returns the name of the behavior region of the agent.
154  ** If there is no behavior region, the string "" will be
155  ** returned.
156  */
157  const char* get_behavior_region();
158 
159  /*l
160  *b Description:
161  **
162  ** Sets the behavior subregion of the agent.
163  */
164  void set_behavior_subregion(diguySubregionIndex area);
165 
166  /*l
167  *b Description:
168  **
169  ** Returns the behavior subregion of the agent.
170  */
171  diguySubregionIndex get_behavior_subregion();
172 
173  /*l
174  *b Description:
175  **
176  ** Sets whether the walls of the region the agent is in
177  ** are solid. If they are, the agent will treat the walls
178  ** as if they are solid walls in the environment. If not,
179  ** the agent is free to walk through them.
180  **
181  ** Pass 1 to make border walls solid, 0 to make them
182  ** freely passable.
183  */
184  void set_behavior_region_border_is_solid(int is_solid);
185 
186  /*l
187  *b Description:
188  **
189  ** Returns whether the walls of the region the agent is in
190  ** are solid.
191  */
192  int get_behavior_region_border_is_solid();
193 
194  /*l
195  *b Description:
196  **
197  ** Sets the focus character of this agent. What this means
198  ** depends on which behavior the agent is doing. For example,
199  ** when in the wander behavior, when the agent is still it
200  ** will turn to face the focus character.
201  **
202  ** Pass the name of an existing scenario character to set
203  ** a new focus character. Pass "" to un-set the focus
204  ** character.
205  */
206  void set_focus_character(const char* focus_character_name);
207 
208  /*l
209  *b Description:
210  **
211  ** Returns the name of the focus character of this agent,
212  ** "" if there is none.
213  */
214  const char* get_focus_character();
215 
216  /*l
217  *b Description:
218  **
219  ** Sets the focus group of this agent. The focus group is
220  ** similar to the focus character, except that characters the
221  ** agent will focus on are selected from the focus group
222  ** instead of being a single character.
223  **
224  ** Pass the name of an existing scenario group to set
225  ** a new focus group. Pass "" to un-set the focus
226  ** group.
227  */
228  void set_focus_group(const char* focus_group_name);
229 
230  /*l
231  *b Description:
232  **
233  ** Returns the name of the focus group of this agent,
234  ** "" if there is none.
235  */
236  const char* get_focus_group();
237 
238  /*l
239  *b Description:
240  **
241  ** Sets the whether the agent will gaze at its focus character, or
242  ** whether setting the focus leaves gaze settings alone.
243  */
244  void set_focus_affects_gaze(int focus_affects_gaze);
245 
246  /*l
247  *b Description:
248  **
249  ** Returns whether agent changes gaze settings to gaze at focus
250  ** character or group.
251  */
252  int get_focus_affects_gaze();
253 
254  /*l
255  *b Description:
256  **
257  ** Sets the how far away characters in the focus group can be
258  ** and still be considered as a focus character.
259  */
260  void set_max_focus_distance(float distance);
261 
262  /*l
263  *b Description:
264  **
265  ** Returns the maximum focus distance for focus groups.
266  */
267  float get_max_focus_distance();
268 
269  /*l
270  *b Description:
271  **
272  ** Sets the minimum amount of time this agent will stay in one
273  ** place before moving on to a new location. This applies to
274  ** the wander and mingle behaviors.
275  */
276  void set_move_on_t_min(float t_min);
277 
278  /*l
279  *b Description:
280  **
281  ** Returns the minimum amount of time before an agent will move on
282  ** to a new location in certain behaviors.
283  */
284  float get_move_on_t_min();
285 
286  /*l
287  *b Description:
288  **
289  ** Similar to set_move_on_t_min(), but sets the maximum amount of
290  ** time.
291  */
292  void set_move_on_t_max(float t_max);
293 
294  /*l
295  *b Description:
296  **
297  ** Similar to get_move_on_t_min(), but returns the maximum amount of
298  ** time.
299  */
300  float get_move_on_t_max();
301 
302 
303 /*****************************************************************************/
309  /*l
310  *b Description:
311  **
312  ** Sets the distance at which an attacking agent will stop and
313  ** fire at its target.
314  */
315  void set_attack_distance(float distance);
316 
317  /*l
318  *b Description:
319  **
320  ** Returns the distance at which an attacking agent will stop and
321  ** fire at its target.
322  */
323  float get_attack_distance();
324 
325  /*l
326  *b Description:
327  **
328  ** Sets the interval in seconds at which an attacking agent will
329  ** fire its weapon when its target is in range.
330  */
331  void set_attack_fire_interval(float time_interval);
332 
333  /*l
334  *b Description:
335  **
336  ** Returns the interval in seconds at which an attacking agent will
337  ** fire its weapon when its target is in range.
338  */
339  float get_attack_fire_interval();
340 
341  /*l
342  *b Description:
343  **
344  ** Sets whether agents in attack behavior will stay where they are and
345  ** fire at targets of oppurtunity, or pursue targets.
346  **
347  ** If an agent is not told to stand its ground it can pursue its
348  ** current target. The functions set_attack_zone_enabled() and
349  ** set_attack_zone() might limit the extent that the agent can pursue.
350  **
351  ** Set to 1 for agents to stand their ground, 0 to allow them to
352  ** pursue targets. Defaults to 0.
353  */
354  void set_attack_stands_ground(int value);
355 
356  /*l
357  *b Description:
358  **
359  ** Returns the most recent setting made by set_attack_stands_ground().
360  */
361  int get_attack_stands_ground();
362 
363  /*l
364  *b Description:
365  **
366  ** If an agent is not designated to stand its ground (see
367  ** set_attack_stands_ground()), and an attack zone is enabled (see
368  ** set_attack_zone_enabled()), this function sets where and how far an
369  ** agent can pursue its target.
370  */
371  void set_attack_zone(float x, float y, float z, float radius);
372 
373  /*l
374  *b Description:
375  **
376  ** Returns position and radius of agent's attack zone.
377  */
378  int get_attack_zone(float* x, float* y, float* z, float* radius);
379 
380  /*l
381  *b Description:
382  **
383  ** If an attacking agent is not designated to stand its ground (see
384  ** set_attack_stands_ground()) and is therefore free to pursue its
385  ** target, the attack zone can limit how far it will go in pursuit.
386  **
387  ** Pass 1 to enable the attack zone, 0 to disable.
388  */
389  void set_attack_zone_enabled(int use_attack_zone);
390 
391  /*l
392  *b Description:
393  **
394  ** Returns 0 if zone is disabled and agents can pursue indefinitely.
395  */
396  int get_attack_zone_enabled();
397 
398 
399 /*****************************************************************************/
405  /*l
406  *b Description:
407  **
408  ** Sets the maximum distance an agent will wander from its previous
409  ** waiting point.
410  */
411  void set_wander_max_wander_dist(float distance);
412 
413  /*l
414  *b Description:
415  **
416  ** Sets whether the wander behavior can change the desired
417  ** orientation.
418  */
419  void set_wander_sets_desired_orientation(int sets_desired_orientation);
420 
421 
422 /*****************************************************************************/
428  /*l
429  *b Description:
430  **
431  ** Sets whether the speed match functionality is enabled.
432  */
433  void set_pursue_speed_match_enabled(int enabled);
434 
435  /*l
436  *b Description:
437  **
438  ** Returns whether speed match functionality is enabled. If it is,
439  ** agents are able to speed up their fastest animation to match
440  ** their pursuit target.
441  */
442  int get_pursue_speed_match_enabled();
443 
444  /*l
445  *b Description:
446  **
447  ** Sets how often the speed match speed is reevaluated. The default
448  ** is every two seconds.
449  */
450  void set_pursue_speed_match_update_dt(float dt);
451 
452  /*l
453  *b Description:
454  **
455  ** Returns the frequency that the speed match speed is updated.
456  */
457  float get_pursue_speed_match_update_dt();
458 
459  /*l
460  *b Description:
461  **
462  ** Sets the maximum multiplier that can be applied to the fastest
463  ** motion when pursuing in order to match speeds with the pursued
464  ** target.
465  **
466  ** Example: If an agent's fastest action moves at 3 m/s, the pursue
467  ** speed match functionality will allow the character to move up
468  ** to 6 m/s.
469  **
470  ** The default is 2x. This allows a character with a fast
471  ** movement motion to keep up with another individual that is moving
472  ** faster then them, but not a fast moving vehicle.
473  */
474  void set_pursue_speed_match_max_factor(float factor);
475 
476  /*l
477  *b Description:
478  **
479  ** Returns the maximum speed multiplier the speed match code will
480  ** use.
481  */
482  float get_pursue_speed_match_max_factor();
483 
484  /*l
485  *b Description:
486  **
487  ** Building block for setting up AI formations. Sets an offset that
488  ** is used by the AI to modify the pursue location. This offset is
489  ** considered to be in local space of the target and then is
490  ** periodically bread-crumbed as the pursue target moves. This avoids
491  ** small movements wildly confusing the pursuer. Often this is used
492  ** with the diguyFormation class to data drive this info.
493  **
494  ** The z argument is currently ignored.
495  */
496  void set_pursue_offset(float x, float y, float z);
497 
498  /*l
499  *b Description:
500  **
501  ** Accessor for current values of set_pursue_offset.
502  */
503  int get_pursue_offset(float* x, float* y, float* z);
504 
505 
506 /*****************************************************************************/
512  /*l
513  *b Description:
514  **
515  ** Sets whether time advancement on the path being followed should
516  ** occur when the agent is in a different behavior.
517  */
518  void set_path_follow_pause_t_when_off_path(int pause_t);
519 
520  /*l
521  *b Description:
522  **
523  ** Returns the path follow pause t flag.
524  */
525  int get_path_follow_pause_t_when_off_path();
526 
527  /*l
528  *b Description:
529  **
530  ** Sets how close the agent must be before a paused path follow will
531  ** resume.
532  */
533  void set_path_follow_unpause_t_at_radius(float radius);
534 
535  /*l
536  *b Description:
537  **
538  ** Returns the resume distance of a paused path follow.
539  */
540  float get_path_follow_unpause_t_at_radius();
541 
542  /*l
543  *b Description:
544  **
545  ** Sets how far ahead on the path being followed the agent will look
546  ** ahead for its desired orientation. A value of 1.0 usually
547  ** provides good results.
548  */
549  void set_path_follow_position_lookahead_distance(float distance);
550 
551  /*l
552  *b Description:
553  **
554  ** Returns the lookahead distance of a path follow.
555  */
556  float get_path_follow_position_lookahead_distance();
557 
558 
559 /*****************************************************************************/
565  /*l
566  *b Description:
567  **
568  ** Sets the untrap method used when an agent becomes wedged in a
569  ** corner.
570  **
571  ** For information on untrap methods see the documentation
572  ** for the enumeration diguyAgentUntrapMethod, or the
573  ** DI-Guy AI User Manual.
574  */
575  void set_wedged_untrap_method(diguyAgentUntrapMethod untrap_method);
576 
577  /*l
578  *b Description:
579  **
580  ** Returns the wedged untrap method.
581  */
582  diguyAgentUntrapMethod get_wedged_untrap_method();
583 
584  /*l
585  *b Description:
586  **
587  ** Sets the how long, in seconds, the agent will walk into a
588  ** corner before it decides it is wedged and applies the
589  ** wedged untrap method.
590  */
591  void set_wedged_trap_time_threshold(float threshold);
592 
593  /*l
594  *b Description:
595  **
596  ** Returns the how long the agent will walk into a corner before
597  ** it decides it is wedged.
598  */
599  float get_wedged_trap_time_threshold();
600 
601  /*l
602  *b Description:
603  **
604  ** Sets the untrap method used when an agent has not made progress
605  ** toward its desired position.
606  **
607  ** For information on untrap methods see the documentation
608  ** for the enumeration diguyAgentUntrapMethod, or the
609  ** DI-Guy AI User Manual.
610  */
611  void set_first_no_progress_untrap_method(diguyAgentUntrapMethod untrap_method);
612 
613  /*l
614  *b Description:
615  **
616  ** Returns the first no progress untrap method.
617  */
618  diguyAgentUntrapMethod get_first_no_progress_untrap_method();
619 
620  /*l
621  *b Description:
622  **
623  ** Sets the how long, in seconds, the agent is willing to make
624  ** no progress toward its desired position before it applies
625  ** the first no progress untrap method.
626  */
627  void set_first_no_progress_trap_time_threshold(float threshold);
628 
629  /*l
630  *b Description:
631  **
632  ** Returns the how long the agent can make no progress toward
633  ** its desired position before it decides to apply an untrap
634  ** method.
635  */
636  float get_first_no_progress_trap_time_threshold();
637 
638  /*l
639  *b Description:
640  **
641  ** Similar to set_first_no_progress_untrap_method(), but the
642  ** time threshold is longer before the second no progress
643  ** untrap method is applied.
644  */
645  void set_second_no_progress_untrap_method(diguyAgentUntrapMethod untrap_method);
646 
647  /*l
648  *b Description:
649  **
650  ** Similar to get_first_no_progress_untrap_method(), but
651  ** applied to the second no progress untrap method.
652  */
653  diguyAgentUntrapMethod get_second_no_progress_untrap_method();
654 
655  /*l
656  *b Description:
657  **
658  ** Sets the how long, in seconds, the agent is willing to make
659  ** no progress toward its desired position before it applies
660  ** the second no progress untrap method.
661  */
662  void set_second_no_progress_trap_time_threshold(float threshold);
663 
664  /*l
665  *b Description:
666  **
667  ** Returns the how long the agent can make no progress toward
668  ** its desired position before it decides to apply the
669  ** second no progress untrap method.
670  */
671  float get_second_no_progress_trap_time_threshold();
672 
673  /*l
674  *b Description:
675  **
676  ** Sets how many times the agent is willing to try applying
677  ** the random turn untrap method before it gives up and
678  ** moves on to the next untrap method.
679  */
680  void set_untrap_method_random_turn_max_tries(int max_tries);
681 
682  /*l
683  *b Description:
684  **
685  ** Returns how many times the agent is willing to try applying
686  ** the random turn untrap method.
687  */
688  int get_untrap_method_random_turn_max_tries();
689 
690  /*l
691  *b Description:
692  **
693  ** Sets how many seconds the agent will be intangible when
694  ** it is applying the ghost untrap method.
695  */
696  void set_untrap_method_ghost_duration(float duration);
697 
698  /*l
699  *b Description:
700  **
701  ** Returns how many seconds the agent will be intangible when
702  ** it is applying the ghost untrap method.
703  */
704  float get_untrap_method_ghost_duration();
705 
706 
707 /*****************************************************************************/
713  /*l
714  *b Description:
715  **
716  ** Sets whether the agent will make use of actions that have the
717  ** specified speed type.
718  **
719  ** For information on speed types see the documentation
720  ** for the enumeration diguyMotionSpeedType. or the
721  ** DI-Guy AI User Manual.
722  */
723  int set_speed_type_enabled(diguyMotionSpeedType motion_speed_type,
724  int enabled);
725 
726  /*l
727  *b Description:
728  **
729  ** Returns whether the agent will make use of actions that have the
730  ** specified speed type.
731  **
732  ** If the speed type is enabled, the character must be outside the
733  ** the associated radius for the action to apply. If the character
734  ** enters that radius, then the next radius down is considered. If
735  ** all enabled speed types have been exhausted, then the character
736  ** should stop
737  **
738  */
739  int get_speed_type_enabled(diguyMotionSpeedType motion_speed_type);
740 
741  /*l
742  *b Description:
743  **
744  ** Sets at what radius, in meters, the agent will begin to play
745  ** actions with the specified speed type, if that type is enabled.
746  **
747  ** See set_speed_type_radius_hysteresis() for how a hysteresis value
748  ** can affect the final radius.
749  */
750  int set_speed_type_radius(diguyMotionSpeedType motion_speed_type,
751  float radius);
752 
753  /*l
754  *b Description:
755  **
756  ** Returns the radius of the specified speed type.
757  */
758  float get_speed_type_radius(diguyMotionSpeedType motion_speed_type);
759 
760  /*l
761  *b Description:
762  **
763  ** Sets the hysteresis of when the speed type changes based on how far
764  ** the agent is from its desired position. A hysteresis value can
765  ** help prevent constant switching back and forth of actions if an
766  ** agent is moving right along the radius separating two speed type
767  ** zones.
768  **
769  ** Example: a hysteresis of 2.0 means that if an agent switches from
770  ** speed type fast to speed type medium at 2 meters, it won't switch
771  ** back to fast unless it goes back out to 4 meters.
772  **/
773  void set_speed_type_radius_hysteresis(float hysteresis_distance);
774 
775  /*l
776  *b Description:
777  **
778  ** Returns the radius hysteresis as described in
779  ** set_speed_type_radius_hysteresis().
780  **/
781  float get_speed_type_radius_hysteresis();
782 
783  /*l
784  *b Description:
785  **
786  ** Sets the exact action the agent will use if it is to use
787  ** the specified speed type. This is useful if a specific
788  ** stand action is desired, for example, for the still speed
789  ** type.
790  **
791  ** To use the default action, pass "".
792  */
793  int set_speed_type_exact_action(diguyMotionSpeedType motion_speed_type,
794  const char* action);
795 
796  /*l
797  *b Description:
798  **
799  ** Returns the exact action the agent will use if it is to use
800  ** the specified speed type.
801  **
802  ** If the default action is to be used, returns "".
803  */
804  const char* get_speed_type_exact_action(diguyMotionSpeedType motion_speed_type);
805 
806  /*l
807  *b Description:
808  **
809  ** Sets the radius variation that will be applied to speed type radii
810  ** as set by set_speed_type_radius(). Each agent will have a
811  ** different amount of variation added to its radii.
812  **
813  ** Value is in meters.
814  */
815  void set_radius_variation(float distance);
816 
817  /*l
818  *b Description:
819  **
820  ** Returns the radius variation for this agent as set by
821  ** set_radius_variation().
822  */
823  float get_radius_variation();
824 
825 
826  /*l
827  *b Description:
828  **
829  ** Sets if the character should use turning motions when changing desired orientation.
830  ** As of diguy-12 defaults to true.
831  */
832  int set_turning_motions_enabled(int enabled);
833 
834  /*l
835  *b Description:
836  **
837  ** Returns if the character is using turning motions when changing desired orientation.
838  ** As of diguy-12 defaults to true.
839  */
840  int get_turning_motions_enabled();
841 
842 /*****************************************************************************/
848  /*l
849  *b Description:
850  **
851  ** Sets the radius, in meters, of the specified repulsion zone.
852  */
853  void set_repulsion_radius(diguyAgentRepulsionZone repulsion_zone,
854  float radius);
855 
856  /*l
857  *b Description:
858  **
859  ** Returns the radius, in meters, of the specified repulsion zone.
860  */
861  float get_repulsion_radius(diguyAgentRepulsionZone repulsion_zone);
862 
863  /*l
864  *b Description:
865  **
866  ** Sets the repulsion factor of the specified repulsion zone.
867  ** Higher repulsion factors will result in agents in the
868  ** specified zone being pushed away harder.
869  */
870  void set_repulsion_factor(diguyAgentRepulsionZone repulsion_zone,
871  float factor);
872 
873  /*l
874  *b Description:
875  **
876  ** Returns the repulsion factor of the specified repulsion zone.
877  */
878  float get_repulsion_factor(diguyAgentRepulsionZone repulsion_zone);
879 
880  /*l
881  *b Description:
882  **
883  ** Sets whether the specified repulsion zone is enabled.
884  ** Zones that are not enabled will have no effect on agents
885  ** in them.
886  */
887  void set_repulsion_zone_enabled(diguyAgentRepulsionZone repulsion_zone,
888  int enabled);
889 
890  /*l
891  *b Description:
892  **
893  ** Returns whether the specified repulsion zone is enabled.
894  */
895  int get_repulsion_zone_enabled(diguyAgentRepulsionZone repulsion_zone);
896 
897  /*l
898  *b Description:
899  **
900  ** Sets the fastest the agent can turn, in degrees per second,
901  ** in response to being repulsed by another agent.
902  */
903  void set_max_orientation_change_rate(float max_orientation_change_rate);
904 
905  /*l
906  *b Description:
907  **
908  ** Returns the fastest the agent can turn, in degrees per second,
909  ** in response to being repulsed by another agent.
910  */
911  float get_max_orientation_change_rate();
912 
913  /*l
914  *b Description:
915  **
916  ** Sets the offset, in meters, that the low, medium, and high
917  ** repulsion zones should have from the agent's position.
918  ** The solid zone is not affected. Sometimes it is desirable
919  ** for the repulsion zones to be moved slightly forward, to
920  ** make it so that other agents approaching this agent from the
921  ** side will prefer to move behind this agent rather than in front.
922  */
923  void set_influence_center_shift(float x, float y, float z);
924 
925 
926 /*****************************************************************************/
932  /*l
933  *b Description:
934  **
935  ** Sets the base influence box, in meters, of a vehicle agent.
936  ** The default influence box is the vehicle's axis-aligned bounding
937  ** box.
938  */
939  void set_vehicle_base_influence_box(float min_x, float min_y, float min_z,
940  float max_x, float max_y, float max_z);
941 
942  /*l
943  *b Description:
944  **
945  ** Returns the vehicle's base influence box.
946  */
947  void get_vehicle_base_influence_box(float* min_x, float* min_y, float* min_z,
948  float* max_x, float* max_y, float* max_z);
949 
950  /*l
951  *b Description:
952  **
953  ** Sets whether or not the influence box is active (true by default).
954  */
955  void set_influence_box_enabled(int enabled = 1);
956 
957  /*l
958  *b Description:
959  **
960  ** Returns whether or not the influence box is active
961  */
962  int get_influence_box_enabled();
963 
964  // defaults to 4.0
965  void set_influence_box_forward_multiplier(float value);
966  float get_influence_box_forward_multiplier();
967 
968  // defaults to .30
969  void set_influence_box_sideways_multiplier(float value);
970  float get_influence_box_sideways_multiplier();
971 
972  // defaults to .10
973  void set_influence_box_angular_multiplier(float value);
974  float get_influence_box_angular_multiplier();
975 
976 /*****************************************************************************/
982  /*l
983  *b Description:
984  **
985  ** Sets whether the specified feeler is enabled. Feelers that
986  ** are not enabled will have no effect on the agent.
987  */
988  void set_feeler_enabled(int feeler_index,
989  int feeler_enabled);
990 
991  /*l
992  *b Description:
993  **
994  ** Returns whether the specified feeler is enabled.
995  */
996  int get_feeler_enabled(int feeler_index);
997 
998  /*l
999  *b Description:
1000  **
1001  ** Sets, in degrees, how far counter-clockwise from forward
1002  ** the feeler is. Zero degrees is straight forward, 90 is to the
1003  ** left, etc. By default the eight feelers are located at 45
1004  ** degree intervals around the agent.
1005  */
1006  void set_feeler_rz_offset(int feeler_index,
1007  float feeler_rz_offset);
1008 
1009  /*l
1010  *b Description:
1011  **
1012  ** Returns, in degrees, how far counter-clockwise from forward
1013  ** the feeler is.
1014  */
1015  float get_feeler_rz_offset(int feeler_index);
1016 
1017  /*l
1018  *b Description:
1019  **
1020  ** Sets, in meters, how high the feeler is from the ground.
1021  ** In general feelers should be at about waist level for human
1022  ** characters.
1023  */
1024  void set_feeler_height(int feeler_index,
1025  float feeler_height);
1026 
1027  /*l
1028  *b Description:
1029  **
1030  ** Returns, in meters, how high the feeler is from the ground.
1031  */
1032  float get_feeler_height(int feeler_index);
1033 
1034  /*l
1035  *b Description:
1036  **
1037  ** Sets, in meters, how far away from the agent the feeler will
1038  ** return collision results. Agents will be pushed away from
1039  ** the object collided with until they are not colliding
1040  ** anymore.
1041  */
1042  void set_feeler_collision_distance(int feeler_index,
1043  float collision_distance);
1044 
1045  /*l
1046  *b Description:
1047  **
1048  ** Returns, in meters, how far away from the agent the feeler will
1049  ** return collision results.
1050  */
1051  float get_feeler_collision_distance(int feeler_index);
1052 
1053  /*l
1054  *b Description:
1055  **
1056  ** Sets, in meters, how far away from the agent the feeler will
1057  ** return turn results. Agents will turn left or right to try
1058  ** to move along the face of a felt obstacle, instead of walking
1059  ** straight into it.
1060  */
1061  void set_feeler_turn_distance(int feeler_index,
1062  float turn_distance);
1063 
1064  /*l
1065  *b Description:
1066  **
1067  ** Returns, in meters, how far away from the agent the feeler will
1068  ** return turn results.
1069  */
1070  float get_feeler_turn_distance(int feeler_index);
1071 
1072  /*l
1073  *b Description:
1074  **
1075  ** Sets which direction the feeler will turn the agent when
1076  ** it touches something within the turn distance.
1077  */
1078  void set_feeler_turn_direction(int feeler_index,
1079  diguyCharacterFeelerTurnDirection turn_direction);
1080 
1081  /*l
1082  *b Description:
1083  **
1084  ** Returns which direction the feeler will turn the agent when
1085  ** it touches something within the turn distance.
1086  */
1087  diguyCharacterFeelerTurnDirection get_feeler_turn_direction(int feeler_index);
1088 
1089 
1090 /*****************************************************************************/
1096  /*l
1097  *b Description:
1098  **
1099  ** Sets the preferred traveling region mask.
1100  **
1101  ** When an agent plans a path, the preferred areas will be considered
1102  ** the easiest to cross and the path should gravitate to them.
1103  **
1104  ** The mask argument should be an or'ed together list of
1105  ** diguySubregionMasks. In C++ or Perl masks can be combined with
1106  ** the '|' operator, in Lua the bit library can be used:
1107  ** bit.bor(MASK_A, MASK_B, ...)
1108  **/
1109  void set_path_planner_preferred_region_mask(int mask);
1110 
1111  /*l
1112  *b Description:
1113  **
1114  *b Returns:
1115  **
1116  ** the preferred region mask; see
1117  ** set_path_planner_preferred_region_mask() and
1118  ** set_path_planner_neutral_cost_bias()
1119  */
1120  int get_path_planner_preferred_region_mask();
1121 
1122  /*l
1123  *b Description:
1124  **
1125  ** Sets how much less expensive it is to cross spaces that are
1126  ** in the desired subregion. (Repulsive and neutral regions have
1127  ** their own cost bias; see set_path_planner_repulsed_cost_bias().)
1128  **
1129  ** This value should be < 1. The default value is 0.25.
1130  **/
1131  void set_path_planner_preferred_cost_bias(float value);
1132 
1133  /*l
1134  *b Returns:
1135  **
1136  ** the cost bias of preferred regions during A* searches;
1137  ** see set_path_planner_preferred_cost_bias()
1138  */
1139  float get_path_planner_preferred_cost_bias();
1140 
1141  /*l
1142  *b Description:
1143  **
1144  ** Sets how much more expensive it is to cross spaces that are
1145  ** not in a desired subregion. (Repulsive regions have their own
1146  ** cost bias; see set_path_planner_repulsed_cost_bias().)
1147  **
1148  ** Defaults to 1.1, A value < 1 will cause the planner to run faster
1149  ** but explore fewer points, posibly missing preferred regions.
1150  ** Values greater then 1 will explore more points but will take more
1151  ** time to run.
1152  **
1153  ** Pass DIGUY_DEFAULT_FLOAT for the value to specify that neutral
1154  ** regions should be avoided completely. This can, however, cause
1155  ** path planning to fail more often.
1156  **/
1157  void set_path_planner_neutral_cost_bias(float value);
1158 
1159  /*l
1160  *b Returns:
1161  **
1162  ** the cost bias of neutral regions during A* searches;
1163  ** see set_path_planner_neutral_cost_bias()
1164  **/
1165  float get_path_planner_neutral_cost_bias();
1166 
1167  /*l
1168  *b Description:
1169  **
1170  ** Sets the repulsive traveling region mask.
1171  **
1172  ** When an agent plans a path the repulsive areas will be considered
1173  ** the hardest to cross and the planner will try to avoid them.
1174  **
1175  ** The mask argument should be an or'ed together list of
1176  ** diguySubregionMasks. In C++ or Perl masks can be combined with
1177  ** the '|' operator, in Lua the bit library can be used:
1178  ** bit.bor(MASK_A, MASK_B, ...)
1179  **/
1180  void set_path_planner_repulsed_region_mask(int mask);
1181 
1182  /*l
1183  *b Returns:
1184  **
1185  ** the repulsed region mask; see
1186  ** set_path_planner_repulsed_region_mask()
1187  */
1188  int get_path_planner_repulsed_region_mask();
1189 
1190  /*l
1191  *b Description:
1192  **
1193  ** Sets how much more expensive it will be to cross spaces that are
1194  ** marked as repulsive.
1195  **
1196  ** This value should generally be much larger then 1. The default
1197  ** value is 100.
1198  **
1199  ** Pass DIGUY_DEFAULT_FLOAT for the value to specify that repulsive
1200  ** regions should be avoided completely. This can, however, cause
1201  ** path planning to fail more often.
1202  **/
1203  void set_path_planner_repulsed_cost_bias(float value);
1204 
1205  /*l
1206  *b Returns:
1207  **
1208  ** the cost bias of repulsive regions during A* searches;
1209  ** see set_path_planner_repulsed_cost_bias()
1210  **/
1211  float get_path_planner_repulsed_cost_bias();
1212 
1213  /*l
1214  *b Description:
1215  **
1216  ** Sets the name of the region to try to use if the path planner
1217  ** fails to work on the current behavior region. This is often the
1218  ** name of a global navmesh.
1219  **/
1220  void set_path_planner_fallback_region(const char* fallback_region_name);
1221 
1222  /*l
1223  *b Returns:
1224  **
1225  ** The name of the fallback region that the path planner will
1226  ** fall back to if a search on the behavior region fails.
1227  **/
1228  const char* get_path_planner_fallback_region();
1230  /*l
1231  *b Description:
1232  **
1233  ** Sets whether the wander behavior will try to use the path planner
1234  ** when the agent can't see it's target location with a viability
1235  ** check.
1236  **/
1237  void set_wander_uses_path_planner(int wander_uses_path_planner);
1238 
1239  /*l
1240  *b Returns:
1241  **
1242  ** whether the wander behavior uses the path planner; see
1243  ** set_wander_uses_path_planner()
1244  **/
1245  int get_wander_uses_path_planner();
1246 
1247  /*l
1248  *b Description:
1249  **
1250  ** Sets whether the pursue behavior will try to use the path planner
1251  ** when the agent can't see it's target with a viability check.
1252  **
1253  ** The agent will do a new visibility check at each waypoint in
1254  ** the navigation path.
1255  **/
1256  void set_pursue_uses_path_planner(int pursue_uses_path_planner);
1257 
1258  /*l
1259  *b Returns:
1260  **
1261  ** whether the pursue behavior uses the path planner; see
1262  ** set_wander_uses_path_planner()
1263  **/
1264  int get_pursue_uses_path_planner();
1265 
1266  /*l
1267  *b Description:
1268  **
1269  ** Sets the maximum distance the wander behavior will travel without
1270  ** using the path planner, when the agent can see it's target location
1271  ** with a Line-Of-Sight viability check.
1272  **
1273  ** This value defaults to 1000 meters.
1274  **
1275  ** Adjusting it lower is meant for users that have an environment
1276  ** that is well tagged with preferred and repulsed regions.
1277  **
1278  ** For example, just because an agent can see the store across an
1279  ** eight lane highway doesn't mean it should run straight there.
1280  **/
1281  void set_max_LOS_travel_distance(float distance);
1282 
1283  /*l
1284  *b Returns:
1285  **
1286  ** the Line-Of-Sight travel distance threshold; see
1287  ** set_max_LOS_travel_distance().
1288  **/
1289  float get_max_LOS_travel_distance();
1290 
1291  /*l
1292  *b Description:
1293  **
1294  ** Sets the distance from the final point on a navpath that the guide
1295  ** algorithm will attempt to achieve before declaring that its
1296  ** destination has been reached.
1297  **
1298  ** The default distance is 0.31 meters.
1299  **
1300  ** In general this value should only be changed if agent ends up
1301  ** "orbiting" the final desired position.
1302  */
1303  void set_desired_navpath_distance_threshold(float threshold);
1304 
1305  /*l
1306  *b Returns:
1307  **
1308  ** distance from final point in navpath at which the desired
1309  ** position is considered acquired; see
1310  ** set_desired_navpath_distance_threshold()
1311  */
1312  float get_desired_navpath_distance_threshold();
1313 
1314 
1315 
1316 
1317 /*****************************************************************************/
1323  /*l
1324  ** see diguyNavMeshPathPlannerCostMask for acceptable values.
1325  */
1326  void set_path_planner_cost_rule(int mask);
1327  int get_path_planner_cost_rule();
1328 
1329  float get_near_destination_distance();
1330  void set_near_destination_distance(float dist);
1331 
1332  int get_navpath_current_waypoint_index();
1333  int get_navpath_num_waypoints();
1334 
1335  diguyPathShape * get_navpath_path();
1336  diguyNavPathDirection get_navpath_travel_direction();
1337 
1340  float get_navpath_offset_y();
1341  void set_navpath_offset_y(float y);
1342 
1347 #ifdef CPLUSPLUS_ONLY
1348 
1349  bdiScenarioAgentParams* get_scripted_object() {return m_scripted_object;}
1350 
1351 private:
1352 
1353  /*l
1354  ** A private constructor.
1355  */
1356  diguyAgentParams(bdiScenarioAgentParams* scripted_object);
1357 
1358  /*l
1359  ** A private destructor.
1360  */
1361  virtual ~diguyAgentParams();
1362 
1363  /*l
1364  ** A pointer to internal data.
1365  */
1366  bdiScenarioAgentParams* m_scripted_object;
1367  bdiScenarioAgent* m_agent_object;
1368 
1369  friend class bdiScenarioAgentParams;
1370  friend class bdiScenarioAgent;
1371 
1372 #endif
1373 
1374 };
The class that represents what parameters an agent is currently using to carry out their base behavio...
Definition: diguyAgentParams.h:38
diguySubregionIndex
DI-Guy subregions.
Definition: diguy_constants.h:1519
Represents a scriptable api wrapping a diguy path shape, a curve defined by with a number of waypoint...
Definition: diguyPathShape.h:36
diguyAgentRepulsionZone
DI-Guy agent repulsion zones for characters with dynamic avoidance method DIGUY_DYNAMIC_AVOIDANCE_MET...
Definition: diguy_constants.h:1253
Contains the diguyMotionVariant enumeration and utility function declarations.
diguyAgentUntrapMethod
DI-Guy agent untrap methods.
Definition: diguy_constants.h:1383
Contains the diguyMotionPosture enumeration and utility function declarations.
diguyNavPathDirection
Directions a character can be traveling on a navigation path (nav path).
Definition: diguy_constants.h:1165
diguyMotionVariant
Definition: diguyMotionVariant.h:28
diguyCharacterFeelerTurnDirection
This enumeration lists the turn directions a feeler can use when its status is DIGUY_CHARACTER_FEELER...
Definition: diguy_constants.h:1147
int diguyMotionSpeedType
DI-Guy character speed types.
Definition: diguyMotionSpeedType.h:66
diguyMotionPosture
Definition: diguyMotionPosture.h:28
diguyAgentBehavior
DI-Guy agent behaviors.
Definition: diguy_constants.h:1324