DI-Guy SDK Documentation  13.9
diguyCharacter.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 /*********************************************************************
7  **
8  *t diguyCharacter
9  **
10  *b Link against: libdiguy
11  */
12 
13 #pragma once
14 
15 #ifdef SWIG
16 %module diguyCharacter
17 #else
18 #define CPLUSPLUS_ONLY
19 #endif
20 
21 #ifdef CPLUSPLUS_ONLY
22 #include <declspec_diguy.h>
23 #include <diguy_constants.h>
24 #include <diguy_typedefs.h>
25 #include <diguy_vector_classes.h>
28 #include <diguyCharacterTypeMap.h>
29 #include <diguyMotionDirection.h>
30 #include <diguyMotionPosture.h>
31 #include <diguyMotionVariant.h>
32 
33 class bdiScenarioCharacter;
34 class diguyAgentParams;
36 class diguyCharacter;
40 class diguyCharacterPath;
45 class diguyCrowd;
46 class diguyGraphicsLink;
49 class diguyImpact;
52 class diguyPathShape;
53 class diguyScenario;
54 class diguySoundInstance;
55 class diguyVariable;
57 class diguyView;
58 class diguyViewLabel;
59 class diguyWaypoint;
60 
63 
65 
66 class DtEntityStateRepository;
67 
68 #endif
69 
70 
83 class BDI_DECLSPEC_diguy diguyCharacter
84 {
85 public:
86 
87 /*****************************************************************************/
97  /*l
98  *b Description:
99  **
100  ** Returns the name of the object. This pointer will never be NULL.
101  */
102  const char* get_name();
103 
104  /*l
105  *b Description:
106  **
107  ** This function sets the name of this object.
108  **
109  *b Returns:
110  **
111  ** 0 on success, -1 on failure
112  */
113  int set_name(const char* name);
114 
115  /*l
116  *b Description:
117  **
118  ** Returns the type name of the object, should be 'character'. This pointer will never be
119  ** NULL.
120  */
121  const char* get_type_name();
122 
123  /*l
124  *b Description:
125  **
126  ** All characters are assigned a unique identifier, or uid. This
127  ** function returns this character's uid.
128  **
129  ** *Note*: unique identifiers will change between DI-Guy runs!
130  **
131  */
132  long get_uid();
133 
134  /*l
135  *b Description:
136  **
137  ** Returns the index of the object. This index may change if
138  ** characters are created or destroyed, so it should not be considered
139  ** a unique identifier for the character. See get_uid().
140  */
141  int get_index();
142 
143  /*l
144  *b Description:
145  **
146  ** This function updates the character. The character's position and
147  ** pose will be set to be what it will be (or was) at the specified t.
148  **
149  ** If the scenario has control of t (return value of
150  ** get_t_controlled_by_scenario_t() is 0), then this function's
151  ** effects will be overridden the next time diguyScenario::update() is
152  ** called with a new t.
153  **
154  ** Note: diguyScenario::update() must be called as or more frequently
155  ** than diguyCharacter::update() for proper DI-Guy operation.
156  ** diguyCharacter::update() is intended for load management use, where
157  ** the user intends to update far away or out-of-frustum characters
158  ** less frequently than the overall scenario. This is done in con-
159  ** junction with set_t_controlled_by_scenario_t(0) for the character.
160  ** diguyCharacter::update() is not intended as a replacement for
161  ** diguyScenario::update().
162  **
163  *b Returns:
164  **
165  ** 0 on success, -1 on failure
166  **
167  *b Arguments:
168  **
169  *a t - new time for the character
170  *a full_update - set to 1 to cause full update of character
171  */
172  int update(float t, int full_update = 1);
173 
174  /*l
175  *b Description:
176  **
177  ** This function sets the current type of this character.
178  **
179  *b Arguments:
180  **
181  *a type - name of the new desired type
182  **
183  *b See Also:
184  **
185  ** get_character_type_string()
186  */
187  void set_character_type(const char* type);
188 
189  /*l
190  *b Description:
191  **
192  ** Returns the type of the character (never NULL).
193  **
194  ** Character types specify the types of motions the character will be
195  ** able to perform. Some characters can move like soldiers, others
196  ** can move like civilians, still others can move like specific
197  ** animals.
198  **
199  ** The character type is explicitly specified in the call to
200  ** diguyScenario::create_character().
201  **
202  ** Examples of character types are:
203  *>
204  *- - soldier
205  *- - male_pedestrian
206  *- - horse
207  *- - prop
208  *<
209  */
210  const char* get_character_type_string();
211 
212  /*l
213  *b Description:
214  **
215  ** Returns the class of the character (never NULL).
216  **
217  ** Character classes are a higher level description than character
218  ** types, and allow for more generalized logic. For example, instead
219  ** of having something happen when one of a large set of specific
220  ** character types enters a region, something can happen when any
221  ** human enters the region.
222  **
223  ** Character classes are not specified directly, but are instead
224  ** derived from the character type. (In DI-Guy, all soldiers are
225  ** humans, for example.)
226  **
227  ** Examples of character classes are:
228  *>
229  *- - human
230  *- - vehicle
231  *- - object
232  *- - animal
233  *<
234  */
235  const char* get_character_class();
236 
238  diguyCharacterClass get_character_class_type();
239 
240  /*l
241  *b Description:
242  **
243  ** Returns the scenario that this character is a part of.
244  */
245  diguyScenario* get_scenario();
246 
247  /*l
248  *b Description:
249  **
250  ** This is the top-level on/off switch for the character. A character
251  ** that is not enabled has very little processing overhead: it is
252  ** neither updated during an update() call, nor is it drawn during a
253  ** draw() call. A disabled character will remain disabled until
254  ** set_enabled(1) is called on it; nothing else implicitly re-enables
255  ** the character.
256  **
257  ** There are several other diguyCharacter functions that have somewhat
258  ** similar effects that may be more appropriate at times:
259  **
260  *- - set_current_tin() and set_current_tout(): These functions
261  *- show and animate the character starting at time tin ("T In"),
262  *- and ending at time tout ("T Out")
263  *- - set_invisible_flag(): This function disables drawing of
264  *- the character, but the character still updates and changes
265  *- position.
266  **
267  ** Refer to the documentation of these functions for more information.
268  **
269  *b Returns:
270  **
271  ** always return 0
272  */
273  int set_enabled(int enabled);
274 
275  /*l
276  *b Description:
277  **
278  ** Returns whether the character is enabled, as set by the
279  ** set_enabled() call. New characters are enabled by default.
280  **
281  *b Returns:
282  **
283  ** 1 if the character is enabled, 0 if not
284  */
285  int get_enabled();
286 
287  /*l
288  *b Description:
289  **
290  ** Sets whether this character is drawn automatically by the scenario.
291  **
292  ** Note depending on the rendering environment if this flag is set to 0,
293  ** it is up to the user to call the character draw_pass1() and draw_pass2()
294  ** calls at the appropriate time.
295  **
296  *b Arguments:
297  **
298  *a flag - pass 1 for character drawing to automatically be
299  *a handled by scenario (this is the default);
300  *a 0 for it not to be
301  */
302  void set_drawn_by_scenario_flag( bool flag );
303 
304  /*l
305  *b Description:
306  **
307  ** Returns whether character drawing is done automatically by the
308  ** scenario.
309  **
310  *b Returns:
311  **
312  ** true if character drawing is done by the scenario;
313  ** false if not
314  **
315  *b See Also:
316  **
317  ** set_drawn_by_scenario_flag()
318  */
319  bool get_drawn_by_scenario_flag() const;
320 
321  /*l
322  *b Description:
323  **
324  ** This function makes the character invisible; i.e., draw() calls
325  ** for the character will have no effect. Note that the character
326  ** will still update its position and pose during update() calls. To
327  ** more thoroughly disable a character, consider the functions
328  ** set_enabled() and set_current_tout().
329  **
330  *b Arguments:
331  **
332  *a invisible_flag - pass 1 to make character invisible, 0 to
333  *a make it visible
334  **
335  *b Available as Decision Bead/Event
336  */
337  void set_invisible_flag(int invisible_flag);
338 
340  int get_invisible_flag();
341 
342  /*l
343  *b Description:
344  **
345  ** Returns whether the character is active. A character is
346  ** active if:
347  **
348  *- - it is enabled as per the set_enabled() call
349  *- - it is within its tin/tout interval as set by the
350  *- set_current_tin() and set_current_tout() calls
351  *- - it is not "network paused" (get_is_network_paused()
352  *- returns 0)
353  **
354  *b Returns:
355  **
356  ** 1 if the character is active, 0 if not
357  **
358  *b Available as Decision Bead
359  */
360  int get_is_active();
361 
362  /*l
363  *b Description:
364  **
365  ** Returns whether the character will be drawn during scenario and
366  ** character draw() calls. A character will be drawn if:
367  **
368  *- - it is enabled as per the set_enabled() call
369  *- - it is within its tin/tout interval as set by the
370  *- set_current_tin() and set_current_tout() calls
371  *- - its invisible flag is 0, as set by the
372  *- set_invisible_flag() call
373  **
374  ** There is no corresponding set_is_drawn() function; use
375  ** set_invisible_flag() to explicitly make a character not be drawn.
376  **
377  *b Returns:
378  **
379  ** 1 if the character will be drawn, 0 if not
380  */
381  int get_is_drawn();
382 
387  void set_was_drawn_last_frame( bool drawn );
388 
392  bool get_was_drawn_last_frame() const;
393 
399  void set_is_culled( bool culled );
400 
402  bool get_is_culled() const;
403 
404  /*l
405  *b Returns:
406  **
407  ** 1 if the character is temporary (created by diguyScenario::create_temporary_character()
408  ** call; 0 if not
409  */
410  int get_is_temporary();
411 
412  /*l
413  *b Description:
414  **
415  ** This function returns 1 if the character has been recycled from the
416  ** character recycle bin, 0 if not.
417  **
418  ** See diguyScenario::send_character_to_recycle_bin()
419  ** and diguyScenario::retrieve_character_from_recycle_bin().
420  */
421  int get_is_recycled();
422 
423  /*l
424  *b Description:
425  **
426  ** This function sets how the character's t (time) is controlled. If
427  ** 1, the character's t will be set by the scenario on each call to
428  ** diguyScenario::update(). If 0, the character should be updated by
429  ** calls to update().
430  **
431  *b Arguments:
432  **
433  *a t_controlled_by_scenario_t - 1 for controlled by scenario, 0 for
434  *a manual update
435  **
436  *b Returns:
437  **
438  ** 0 on success, -1 on failure
439  */
440  int set_t_controlled_by_scenario_t(int t_controlled_by_scenario_t);
441 
442  /*l
443  *b Returns:
444  **
445  ** whether character's t is controlled by the scenario;
446  ** see set_t_controlled_by_scenario_t()
447  */
448  int get_t_controlled_by_scenario_t();
449 
450  /*l
451  *b Description:
452  **
453  ** This function sets the initial tin ("T In") time of the character.
454  ** See set_current_tin() for a discussion of how tin and tout times
455  ** affect the character.
456  **
457  ** When the scenario is reset or loaded from a .dss file, the current
458  ** tin value will be set to this initial tin value.
459  **
460  ** Note that if the scenario is running (diguyScenario::get_t() returns > 0),
461  ** tin can be set only if override_time_warning is set.
462  **
463  ** Note that both tin and tout times are scenario-relative times, not
464  ** character-relative.
465  **
466  ** This call makes an implicit call to set_current_tin() with the
467  ** same value.
468  **
469  *b Arguments:
470  **
471  *a tin - new value of initial tin in seconds
472  *a override_time_warning - if set, initial_tin can be set at any time
473  **
474  *b Returns:
475  **
476  ** 0 on success, -1 on failure
477  */
478  int set_initial_tin(float tin, int override_time_warning = 0);
479 
480  /*l
481  *b Description:
482  **
483  ** This function sets the initial tout ("T Out") time of the
484  ** character. See set_current_tin() for a discussion of how tin and
485  ** tout times affect the character.
486  **
487  ** When the scenario is reset or loaded from a .dss file, the current
488  ** tout value will be set to this initial tout value.
489  **
490  ** Note that this function cannot be called once the scenario has
491  ** begun running (diguyScenario::get_t() returns > 0).
492  **
493  ** Note that both tin and tout times are scenario-relative times, not
494  ** character-relative.
495  **
496  ** This call makes an implicit call to set_current_tout() with the
497  ** same value.
498  **
499  *b Arguments:
500  **
501  *a tout - new value of initial tout in seconds
502  **
503  *b Returns:
504  **
505  ** 0 on success, -1 on failure
506  */
507  int set_initial_tout(float tout);
508 
509  /*l
510  *b Description:
511  **
512  ** This function sets the current tin ("T In") time of the character.
513  ** The character will not be visible nor will it start moving or
514  ** animating until the scenario reaches this time.
515  **
516  ** There are two ways the tin and tout times of the character can be
517  ** used:
518  **
519  ** The first is to set them to their desired values when the scenario
520  ** begins. If, for example, it is known that this character should
521  ** only be visible and active from 60 seconds to 80 seconds, the tin
522  ** and tout times can be set to 60 and 80, respectively. The
523  ** scenario will then spend very little time for character updates
524  ** and draws outside of these limits.
525  **
526  ** The second is to use them to quickly "trigger" a character to
527  ** become visible and start moving. This is done by setting the
528  ** initial values of tin and tout to very high values, and then
529  ** changing them to lower values when the character should become
530  ** active. Consider the following example: This character is
531  ** waiting just inside a doorway, and should emerge when another
532  ** character comes close. If the tin time of the character is very
533  ** high, very little time will be taken for this character's updates
534  ** and draws. When the other character does come close, this
535  ** character's tin time can be set to "now" (the scenario's current
536  ** t, as returned by diguyScenario::get_t()). This character will
537  ** then become visible and start moving out of the doorway.
538  **
539  ** The default current tin time is the current time of the scenario
540  ** when the character is created.
541  **
542  ** Note that both tin and tout times are scenario-relative times, not
543  ** character-relative.
544  **
545  *b Arguments:
546  **
547  *a tin - new value of current tin in seconds
548  **
549  *b Returns:
550  **
551  ** 0 on success, -1 on failure
552  */
553  int set_current_tin(float tin);
554 
555  /*l
556  *b Description:
557  **
558  ** Same as set_current_tin(), but time is set to current scenario time.
559  **
560  *b Returns:
561  **
562  ** 0 on success, -1 on failure
563  **
564  *b Available as Decision Bead/Event
565  */
566  int set_current_tin_to_now();
567 
568  /*l
569  *b Description:
570  **
571  ** This function returns the current tin time of the character. See
572  ** set_current_tin().
573  **
574  *b Returns:
575  **
576  ** Current tin time in seconds.
577  */
578  float get_current_tin();
579 
580  /*l
581  *b Description:
582  **
583  ** This function sets the current tout ("T Out") time of the
584  ** character. If tout is enabled the character will become invisible
585  ** and will stop moving and animating when the scenario reaches this
586  ** time.
587  **
588  ** Note that both tin and tout times are scenario-relative times, not
589  ** character-relative.
590  **
591  ** Default tout time is 60000 seconds.
592  **
593  *b Arguments:
594  **
595  *a tout - new value of current tout in seconds
596  *a disable_character_at_tout - this argument is present to keep
597  *a the function prototype will remain
598  *a backward compatible; it has no effect
599  */
600  int set_current_tout(float tout,
601  int disable_character_at_tout = 0);
602 
603  /*l
604  *b Description:
605  **
606  ** Same as set_current_tout(), but time is set to current scenario
607  ** time.
608  **
609  *b Returns:
610  **
611  ** 0 on success, -1 on failure
612  **
613  *b Available as Decision Bead
614  */
615  int set_current_tout_to_now();
616 
617  /*l
618  *b Description:
619  **
620  ** This function returns the current tout ("T Out") time of the
621  ** character in seconds. See set_current_tout().
622  */
623  float get_current_tout();
624 
625  /*l
626  *b Description:
627  **
628  ** This function sets what will happen when the character reaches its
629  ** tout time. If set to 0, the character will ignore the tout time
630  ** and continue indefinitely.
631  */
632  void set_tout_enabled(int tout_enabled);
633 
634  /*l
635  *b Description:
636  **
637  ** This function returns the whether tout is enabled.
638  **
639  ** See set_tout_enabled().
640  **
641  *b Returns:
642  **
643  ** 1 if tout enabled, 0 if not
644  */
645  int get_tout_enabled();
646 
648  float get_char_time();
649 
650  /*l
651  *b Description:
652  **
653  ** When the motion data of a character is interpolated a quick
654  ** interpolation method can be used which may yield incorrect results,
655  ** or an expensive interpolation method can be used which will yield
656  ** correct results at the expense of time. The threshold at which
657  ** the interpolation method changes is specified by this function.
658  **
659  *b Arguments:
660  **
661  *a threshold - float between 0 (careful never) and 1 (careful always);
662  ** default is 0.7
663  **
664  ** DI-Guy compares the careful interpolation threshold to the cosine
665  ** of an angle. Both the threshold and the cosine are dimensionless
666  ** and thus have no units.
667  **
668  *b Returns:
669  **
670  ** 0 on success, -1 on failure
671  */
672  int set_careful_interpolation_threshold(float threshold);
673 
674  /*l
675  *b Returns:
676  **
677  ** most recent setting of the careful interpolation threshold;
678  ** see set_careful_interpolation_threshold()
679  */
680  float get_careful_interpolation_threshold();
681 
682  /*l
683  *b Description:
684  **
685  ** Sets whether the motion data of the character is interpolated.
686  ** Interpolation is disabled by default for better performance. For
687  ** applications achieving high frame rates, smoother motion may be
688  ** achieved by turning interpolation on.
689  **
690  *b Arguments:
691  **
692  *a flag - 0 by default
693  **
694  *b Returns:
695  **
696  ** 0 on success, -1 on failure
697  */
698  int set_motion_interpolation_flag(int flag);
699 
700  /*l
701  *b Returns:
702  **
703  ** most recent setting of the motion interpolation flag; see
704  ** set_motion_interpolation_flag()
705  */
706  int get_motion_interpolation_flag();
707 
708  /*l
709  *b Description:
710  **
711  ** Sets the scale of the character on each of the three major axes.
712  **
713  *b Arguments:
714  **
715  *a scale_x, scale_y, scale_z - the factor by which to scale along
716  *a the given axis
717  **
718  *b Returns:
719  **
720  ** 0 on success, -1 on failure
721  */
722  int set_scale(float scale_x, float scale_y, float scale_z);
723 
724  /*l
725  *b Description:
726  **
727  ** Returns the scale of the character.
728  **
729  *b Arguments:
730  **
731  *a sx, sy, sz - scale of the character along each axis
732  **
733  ** Pass NULL for any values that are not needed.
734  **
735  *b Returns:
736  **
737  ** 0 on success, -1 on failure
738  */
739  int get_scale(float* scale_x, float* scale_y, float* scale_z);
740 
741  /*l
742  *b Description:
743  **
744  ** Sets the parent of this character to be the passed character.
745  ** This means that the coordinate system of this character will be
746  ** local to the parent character rather than the world coordinate
747  ** system.
748  **
749  *b Arguments:
750  **
751  *a parent_name - character to which this character should
752  *a be attached; pass NULL to have no parent
753  *a and be attached to the world
754  *a parent_link_name - name of the link or connection point to which this character's
755  *a position link should attach; pass "" to attach
756  *a to the parent's position link
757  **
758  *b Returns:
759  **
760  ** 0 on success, -1 on failure
761  **
762  *b Available as Decision Bead/Event
763  */
764  int set_parent(const char* parent_name, const char* parent_link_name = "");
765 
766  /*l
767  *b Description:
768  **
769  ** Gets the parent of this character.
770  **
771  *b Returns:
772  **
773  ** pointer to type diguyCharacter; NULL if no parent
774  **
775  *b Available as Decision Bead/Event
776  */
777  diguyCharacter* get_parent();
778 
779  /*l
780  *b Description:
781  **
782  ** Gets the link name that the character is parented to, if any.
783  **
784  *b Returns:
785  **
786  ** name of link, NULL if no parent
787  */
788  const char* get_parent_link_name();
789 
790  /*l
791  *b Description:
792  **
793  ** Detaches a character from its parent and reattaches it to the
794  ** world. This is equivalent to diguyCharacter::set_parent(NULL).
795  **
796  *b Returns:
797  **
798  ** 0 on success, -1 on failure
799  **
800  *b Available as Decision Bead/Event
801  */
802  int unset_parent();
803 
804  /*l
805  *b Description:
806  **
807  ** Gets the number of children the character has.
808  */
809  int get_num_children();
810 
811  /*l
812  *b Description:
813  **
814  ** This function returns a pointer to the nth child of the character.
815  **
816  *b Returns:
817  **
818  ** pointer of type diguyCharacter; NULL if no
819  ** child at the specified index
820  **
821  *b Arguments:
822  **
823  *a index - index of the child; indices start at 0
824  */
825  diguyCharacter* get_child_at_index(int index);
826 
827  /*l
828  *b Description:
829  **
830  ** Gets if a character is a static object, by default any blitzed .
831  ** in props are.
832  **
833  *b Returns:
834  **
835  ** 1 if true, 0 if false
836  */
837  int get_is_scene_object();
838 
839  /*l
840  *b Description:
841  **
842  ** Sets if a character is a static object. By default any blitzed
843  ** in props are.
844  **
845  *b Arguments:
846  **
847  *a is_scene_object - pass 1 to make the object a scene object,
848  *a 0 to not
849  **
850  *b Returns:
851  **
852  ** 0 on success, -1 on failure
853  */
854  int set_is_scene_object(int is_scene_object);
855 
856  /*l
857  *b Description:
858  **
859  ** Gets the bounding radius currently used for this character
860  ** for purposes of culling it from the draw operation.
861  **
862  *b Returns:
863  **
864  ** The current draw-culling bounding radius for the character, in
865  ** meters.
866  */
867  float get_bounding_radius();
868 
869  /*l
870  *b Description:
871  **
872  ** Gets the default draw-culling bounding radius for this
873  ** character, as specified in its actor cfg file. See
874  ** actor_vehicle.cfg for an example.
875  **
876  *b Returns:
877  **
878  ** The default draw-culling bounding radius for the character.
879  */
880  float get_default_bounding_radius();
881 
882  /*l
883  *b Description:
884  **
885  ** Sets the current draw-culling bounding radius to be used for
886  ** this character.
887  */
888  void set_bounding_radius(float f);
889 
890  /*l
891  *b Description:
892  **
893  ** This function returns the number of seconds before the blend
894  ** into the next motion begins. If the character is already
895  ** in a blend between motions the function returns 0.
896  **
897  ** Note that this function is of limited practical use; in most
898  ** cases get_time_to_reach_desired_action() returns
899  ** information that is more useful.
900  **
901  *b Returns:
902  **
903  ** time to next blend, in seconds
904  **
905  *b Mode Restrictions:
906  **
907  *- - This function can only be called in free action mode.
908  */
909  float get_time_to_transition();
910 
912  float get_character_local_time();
913 
914  /*l
915  *b Returns:
916  **
917  ** the action mode of the character
918  */
919  diguyCharacterMode get_action_mode();
920 
921  /*l
922  *b Returns:
923  **
924  ** the position mode of the character
925  */
926  diguyCharacterMode get_position_mode();
927 
928  /*l
929  *b Description:
930  **
931  ** This function speeds up or slows down the character. Setting
932  ** this value greater than 1 will cause character actions to
933  ** be played back at a slower pace, setting to less that 1 will
934  ** cause character actions to be played at a faster pace.
935  **
936  ** This will override other factors that may scale the time
937  ** scale factor of a character. (For example, smaller scale
938  ** characters will generally move faster.)
939  **
940  ** Call unset_t_scale_factor() to allow other factors such
941  ** as scale or desired speed to determine the time scale factor.
942  **
943  *b Mode Restrictions:
944  **
945  *- - This function can only be called in free action mode.
946  **
947  *b Arguments:
948  **
949  *a t_scale_factor - time scale factor
950  **
951  *b Returns:
952  **
953  ** 0 on success, -1 on failure
954  */
955  int set_t_scale_factor(float t_scale_factor);
956 
957  /*l
958  *b Description:
959  **
960  ** This function removes the manual setting of the time
961  ** scale factor as set by set_t_scale_factor().
962  **
963  *b Mode Restrictions:
964  **
965  *- - This function can only be called in free action mode.
966  **
967  *b Returns:
968  **
969  ** 0 on success, -1 on failure
970  */
971  int unset_t_scale_factor();
972 
973  /*l
974  *b Description:
975  **
976  ** This function determines whether this character is within the
977  ** specified distance of another.
978  **
979  *b Arguments:
980  **
981  *a character - character to be checked
982  *a distance - distance to character in meters
983  **
984  *b Returns:
985  **
986  ** 1 if within distance; 0 if not
987  */
988  int is_within_distance_n_of_character(const char* character_name,
989  float distance);
990 
991  /*l
992  *b Description:
993  **
994  ** This function determines whether this character is within the
995  ** specified distance of any members of the specified group.
996  **
997  *b Arguments:
998  **
999  *a group_name - name of group to be checked
1000  *a distance - distance in meters
1001  **
1002  *b Returns:
1003  **
1004  ** 1 if member of group is within distance; 0 if not
1005  */
1006  int is_within_distance_n_of_member_of_group(const char* group_name,
1007  float distance);
1008 
1009  /*l
1010  *b Description:
1011  **
1012  ** This function determines whether a character is a member of
1013  ** a particular group.
1014  **
1015  ** Also see diguyCharacterGroup::is_member().
1016  **
1017  *b Arguments:
1018  **
1019  *a group_name - name of group to be checked
1020  **
1021  *b Returns:
1022  **
1023  ** 1 if character is in group, 0 if not
1024  */
1025  int is_group_member(const char* group_name);
1026 
1027  /*l
1028  *b Description:
1029  **
1030  ** This function returns the number of groups that a character is a
1031  ** member of.
1032  **
1033  ** Also see diguyCharacterGroup::is_member().
1034  */
1035  int get_num_group_memberships();
1036 
1037  /*l
1038  *b Description:
1039  **
1040  ** This function returns a pointer to the nth group that this
1041  ** character is a member of.
1042  **
1043  ** Also see diguyCharacterGroup::is_member().
1044  **
1045  *b Returns:
1046  **
1047  ** pointer of type diguyCharacterGroup; NULL if no
1048  ** group at the specified index
1049  **
1050  *b Arguments:
1051  **
1052  *a index - index of the group; indices start at 0
1053  */
1054  diguyCharacterGroup* get_group_membership_at_index(int index);
1055 
1056  /*l
1057  *b Description:
1058  **
1059  ** This function will check all characters in the scenario and return
1060  ** the nearest character that is both alive and enabled. An optional
1061  ** argument specifies whether to skip characters that are invisible
1062  ** to the caller because a scene object is in the way. Checking
1063  ** visibility is only an option if an octtree is generated from scene
1064  ** objects. Typically only DI-Guy Scenario does this.
1065  **
1066  *b Arguments:
1067  **
1068  *a check_visibility - whether to check that characters are
1069  *a visible to calling character; pass 1
1070  *a to check, 0 to not check
1071  *a xy_distance - whether to include the z component
1072  *a in distance calculations; pass 1 to
1073  *a check only XY distance, 0 to check
1074  *a XYZ distance
1075  **
1076  *b Returns:
1077  **
1078  ** pointer of type diguyCharacter; may be NULL
1079  */
1080  diguyCharacter* get_nearest_active_character(int check_visibility,
1081  int xy_distance = 0,
1082  float max_distance_to_check = 100000);
1083 
1084  /*l
1085  *b Description:
1086  **
1087  ** This function will check all characters in a group and return the
1088  ** nearest character that is both alive and enabled. An optional
1089  ** argument specifies whether to skip characters that are invisible
1090  ** to the caller because a scene object is in the way. Checking
1091  ** visibility is only an option if an octtree is generated from scene
1092  ** objects. Typically only DI-Guy Scenario does this.
1093  **
1094  *b Arguments:
1095  **
1096  *a group_name - name of group to check
1097  *a check_visibility - whether to check that characters are
1098  *a visible to calling character; pass 1
1099  *a to check, 0 to not check
1100  *a xy_distance - whether to include the z component
1101  *a in distance calculations; pass 1 to
1102  *a check only XY distance, 0 to check
1103  *a XYZ distance
1104  **
1105  *b Returns:
1106  **
1107  ** pointer of type diguyCharacter; may be NULL
1108  */
1109  diguyCharacter* get_nearest_active_character_in_group(const char* group_name,
1110  int check_visibility = 1,
1111  int xy_distance = 0,
1112  float max_distance_to_check = 100000);
1113 
1114  /*l
1115  *b Description:
1116  **
1117  ** This function will check all characters in the scenario and return
1118  ** a random character within max_distance that is both alive and
1119  ** enabled. An optional argument specifies whether to skip characters
1120  ** that are invisible to the caller because a scene object is in the
1121  ** way. Checking visibility is only an option if an octtree is
1122  ** generated from scene objects. Typically only DI-Guy Scenario does
1123  ** this.
1124  **
1125  *b Arguments:
1126  **
1127  *a check_visibility - whether to check that characters are
1128  *a visible to calling character; pass 1
1129  *a to check, 0 to not check
1130  *a max_distance - how far away the search cut off should be pass
1131  *a in -1.0f to use all characters
1132  *a xy_distance - whether to include the z component
1133  *a in distance calculations; pass 1 to
1134  *a check only XY distance, 0 to check
1135  *a XYZ distance
1136  **
1137  *b Returns:
1138  **
1139  ** pointer of type diguyCharacter; may be NULL
1140  */
1141  diguyCharacter* get_random_active_character(float max_distance = 10.0f,
1142  int check_visibility = 1,
1143  int xy_distance = 0);
1144 
1145  /*l
1146  *b Description:
1147  **
1148  ** This function will check all characters in a group and return a
1149  ** random character within max_distance that is both alive and
1150  ** enabled. An optional argument specifies whether to skip characters
1151  ** that are invisible to the caller because a scene object is in the
1152  ** way. Checking visibility is only an option if an octtree is
1153  ** generated from scene objects. Typically only DI-Guy Scenario does
1154  ** this.
1155  **
1156  *b Arguments:
1157  **
1158  *a group_name - name of group to check
1159  *a max_distance - how far away the search cut off should be, pass
1160  *a in -1.0f to use all characters
1161  *a check_visibility - whether to check that characters are
1162  *a visible to calling character; pass 1
1163  *a to check, 0 to not check
1164  *a xy_distance - whether to include the z component
1165  *a in distance calculations; pass 1 to
1166  *a check only XY distance, 0 to check
1167  *a XYZ distance
1168  **
1169  *b Returns:
1170  **
1171  ** pointer of type diguyCharacter; may be NULL
1172  */
1173  diguyCharacter* get_random_active_character_in_group(const char* group_name,
1174  float max_distance = 10,
1175  int check_visibility = 1,
1176  int xy_distance = 0);
1177 
1178  /*l
1179  *b Description:
1180  **
1181  ** This function returns the 3D distance from this character to the
1182  ** specified character, in meters. The distance is calculated from
1183  ** the characters' idealized positions.
1184  */
1185  float get_distance_to_character(diguyCharacter* character);
1186 
1187  /*l
1188  *b Description:
1189  **
1190  ** This function returns the 2D distance in X and Y coordinates only
1191  ** from this character to the specified character, in meters. The
1192  ** distance is calculated from the characters' idealized positions.
1193  */
1194  float get_distance_xy_to_character(diguyCharacter* character);
1195 
1196  /*l
1197  *b Description:
1198  **
1199  ** This function returns the 3D distance from this character to the
1200  ** specified impact, in meters. The distance is calculated from the
1201  ** characters' idealized positions.
1202  */
1203  float get_distance_to_impact(diguyImpact* impact);
1204 
1205  /*l
1206  *b Description:
1207  **
1208  ** Each character has a "random factor" between 0 and 1. This value
1209  ** is persistent with the character; i.e., the random factor will
1210  ** stay constant for the entire lifetime of the character.
1211  **
1212  ** This random factor can be used to add some variability between
1213  ** different characters.
1214  **
1215  ** Though each character has a random factor that has a very good
1216  ** chance of being different from all other characters' in the
1217  ** scenario, this is not guaranteed and so should not be used as a
1218  ** unique identifier.
1219  **
1220  ** An example of use: Instead of all characters beginning an action
1221  ** or behavior at the same time, have each one begin (random_factor *
1222  ** 2.0) seconds from the current time. This will result in more
1223  ** natural looking behavior as characters one by one begin the new
1224  ** behavior in the next two seconds, rather than all beginning at
1225  ** once.
1226  **
1227  *b Returns:
1228  **
1229  ** the character's random factor, a value between 0 and 1
1230  */
1231  float get_random_factor();
1232 
1233 
1234 /*****************************************************************************/
1239  /*l
1240  *b Description:
1241  **
1242  ** This function draws this character in immediate mode graphics
1243  ** environments (see below). This is the equivalent of calling
1244  ** draw_pass1() immediately followed by draw_pass2().
1245  **
1246  *b Returns:
1247  **
1248  ** 0 on success, -1 on failure
1249  **
1250  *i OpenGL Version:
1251  **
1252  ** This function immediately draws this character. Either this
1253  ** function or draw_pass1() and draw_pass2() should be called once per
1254  ** frame.
1255  */
1256  int draw();
1257 
1258  /*l
1259  *b Description:
1260  **
1261  ** This function, along with draw_pass2(), allows the drawing of
1262  ** opaque and transparent polygons to be separated. This function
1263  ** draws all opaque polygons of this character.
1264  **
1265  *b Returns:
1266  **
1267  ** 0 on success, -1 on failure
1268  **
1269  *i OpenGL Version:
1270  **
1271  ** This function immediately draws the opaque character parts. Either
1272  ** this function or draw() should be called once per frame.
1273  */
1274  int draw_pass1();
1275 
1276  /*l
1277  *b Description:
1278  **
1279  ** Same as draw_pass1(), but draws transparent character parts.
1280  */
1281  int draw_pass2();
1282 
1283 #ifdef CPLUSPLUS_ONLY
1284 
1285  /*l
1286  *b Returns:
1287  **
1288  ** A pointer to the character's graphics.
1289  **
1290  *i Vega Prime Version:
1291  **
1292  ** The return pointer may be cast to point to a vpDiguyCharacter,
1293  ** which is derived from vpObject.
1294  **
1295  *i OpenGL Version:
1296  **
1297  ** This function returns NULL.
1298  **
1299  *i DI-Guy Graphics API:
1300  **
1301  ** This function returns the pointer set from the most recent
1302  ** set_graphics_ptr() call.
1303  */
1304  void* get_graphics_ptr();
1305 
1306  /*l
1307  *b Description:
1308  **
1309  ** Sets a graphics environment-specific pointer to graphics data.
1310  ** The pointer can be retrieved using get_graphics_ptr().
1311  **
1312  *b Arguments:
1313  **
1314  *a graphics_ptr - pointer to graphics data
1315  **
1316  *b Returns:
1317  **
1318  ** 0 on success, -1 on failure
1319  **
1320  *i OpenGL Version:
1321  **
1322  *b This function should not be called for these environments.
1323  **
1324  *i DI-Guy Graphics API Version:
1325  **
1326  ** This function allows graphics environment-specific data to be
1327  ** stored for later retrieval by get_graphics_ptr(). DI-Guy does
1328  ** not directly use the pointer, beyond returning it using the
1329  ** get_graphics_ptr() function.
1330  */
1331  int set_graphics_ptr(void* graphics_ptr);
1332 
1333  /*l
1334  *b Description:
1335  **
1336  ** This function sets a generic node pointer that can later be
1337  ** retrieved by the get_graphics_api_node_ptr() call. The pointer is
1338  ** otherwise not used.
1339  **
1340  *i Callback Info:
1341  **
1342  ** This function can be safely be called in the
1343  ** CALLBACK_ID_SET_GRAPHICS_API_NODE_PTR callback.
1344  **
1345  *b Arguments:
1346  **
1347  *a node_ptr - generic void* pointer
1348  */
1349  void set_graphics_api_node_ptr(void* node_ptr);
1350 
1351  /*l
1352  *b Returns:
1353  **
1354  ** pointer set by most recent call to set_graphics_api_node_ptr
1355  */
1356  void* get_graphics_api_node_ptr();
1357 
1358  /*l
1359  *b Description:
1360  **
1361  ** This function stores a pointer to user data.
1362  **
1363  *b Arguments:
1364  **
1365  *a user_data - pointer for user's own use; DI-Guy will
1366  *a do nothing to the contents of this pointer
1367  *a beyond passing it back when requested
1368  *a by get_user_data()
1369  **
1370  *b Returns:
1371  **
1372  ** 0 on success, -1 on failure
1373  */
1374  int set_user_data(void* user_data);
1375 
1376  /*l
1377  *b Returns:
1378  **
1379  ** The user data pointer set by set_user_data()
1380  */
1381  void* get_user_data();
1382 
1383 #endif
1384 
1385 /*****************************************************************************/
1395  /*l
1396  *b Description:
1397  **
1398  ** This function sets the desired action of the character.
1399  **
1400  ** This function will put the character into free action mode. If
1401  ** the character was in path action mode, actions will no longer be
1402  ** set by action beads on the path.
1403  **
1404  ** If the character is in path position mode and 1 is passed for
1405  ** retain_path_shape, the character will stay in path position mode.
1406  ** If 0 is passed for retain_path_shape, the character will be put
1407  ** into free position mode.
1408  **
1409  ** If the character is in free position mode the retain_path_shape
1410  ** argument will have no effect.
1411  **
1412  ** If this call is interrupting a character in path action mode
1413  ** and path position mode, the character will not be able to resume
1414  ** the interrupted path unless retain_path_shape is set to 1.
1415  ** See resume_interrupted_path().
1416  **
1417  ** This function will have no effect on a dead character (see
1418  ** die_now() and get_dead()).
1419  **
1420  *b Mode Effects:
1421  **
1422  *- - This function will put the character into free action mode.
1423  *- - This function may change the position mode; see Description.
1424  **
1425  *b Arguments:
1426  **
1427  *a action_name - name of the desired action to be performed by
1428  *a the character
1429  *a speed - the speed at which the character should travel
1430  *a while performing the action; pass
1431  *a DIGUY_DEFAULT_FLOAT for the optimal speed to
1432  *a be used
1433  *a retain_path_shape - pass 1 to remain in path position mode; pass
1434  *a 0 to change to free position mode
1435  **
1436  *b Returns:
1437  **
1438  ** 0 on success, -1 on failure
1439  */
1440  int set_desired_action( const char* action_name, float speed = DIGUY_DEFAULT_FLOAT,
1441  int retain_path_shape = 0 );
1442 
1443  /*l
1444  *b Description:
1445  **
1446  ** This function sets the desired action of the character. This function replaces
1447  ** the legacy set_desired_action(const char*,float,int), function. All arguments
1448  ** to the legacy function can be specified using the action parameters.
1449  **
1450  ** This function will have no effect on a dead character (see
1451  ** die_now() and get_dead()).
1452  **
1453  *b Mode Effects:
1454  **
1455  *- - This function will put the character into free action mode.
1456  *- - This function may change the position mode; see Description.
1457  **
1458  *b Arguments:
1459  **
1460  *a action_name - name of the desired action to be performed by the character
1461  *a action_parameters - parameters for setting the action (eg. speeds, path mode retention)
1462  **
1463  *b Returns:
1464  **
1465  ** 0 on success, -1 on failure
1466  */
1467  int set_desired_action( const char* action_name, const diguyActionParameters& action_parameters );
1468 
1473  const char* get_desired_action();
1474 
1476  int get_desired_action_index();
1477 
1479  const char* get_current_action();
1480 
1482  int get_current_action_index();
1483 
1485  diguyMotionDirection get_desired_action_direction();
1486 
1488  diguyMotionDirection get_current_action_direction();
1489 
1490  /*l
1491  *b Description:
1492  **
1493  ** This function returns the transition state of the action
1494  ** of a character. When commanding an action, DI-Guy may
1495  ** transition the character through one or more intermediate
1496  ** actions to reach the final action. For example, a character
1497  ** with the action "walk" that is commanded to "prone" would
1498  ** transition through the intermediate action "stand".
1499  **
1500  *b Returns:
1501  **
1502  ** 1 if the character is transitioning between actions
1503  ** 0 otherwise
1504  */
1505  int get_is_in_action_transition();
1506 
1507  /*l
1508  *b Description:
1509  **
1510  ** This function forces the current action of the character to be the
1511  ** action identified by action_name.
1512  **
1513  ** See set_desired_action() for a discussion of the effects on
1514  ** position mode.
1515  **
1516  ** This function will have no effect on a dead character (see
1517  ** die_now() and get_dead()).
1518  **
1519  ** By passing a value greater than 0 for t_offset_into_new_action,
1520  ** the character can be made to begin the action partway in. This is
1521  ** useful when forcing actions for a lot of characters at the same
1522  ** time; without the offset, the characters would move in lockstep. In
1523  ** general, the offset shouldn't be more than half the blend interval.
1524  **
1525  ** The most recent forced action, the time at which it was forced,
1526  ** and any time offset can be queried using the functions
1527  ** get_most_recent_forced_action(),
1528  ** get_most_recent_forced_action_t(), and
1529  ** get_most_recent_forced_action_t_offset().
1530  **
1531  *b Mode Effects:
1532  **
1533  *- - This function will put the character into free action mode.
1534  *- - This function may change the position mode; see Description.
1535  **
1536  *b Arguments:
1537  **
1538  *a action_name - name of the action to be performed by
1539  *a the character
1540  *a speed - the speed at which the character should
1541  *a travel while performing the action; pass
1542  *a DIGUY_DEFAULT_FLOAT for the optimal speed
1543  *a to be used
1544  *a include_transition_arc - flag for whether the transition
1545  *a motion from the current action to
1546  *a the new action is included;
1547  *a pass 1 for best chance of good looking
1548  *a transition;
1549  *a pass 0 for fastest response
1550  *a max_rampdown_interval - max amount of time spent trying to
1551  *a smooth over any motion seams; set
1552  *a to 0.5 for a smooth transition, set
1553  *a to 0 for a potentially rough transition
1554  *a retain_path_shape - pass 1 to remain in path position mode;
1555  *a pass 0 to change to free position mode
1556  *a t_offset_into_new_action - how much to shift time forward into
1557  *a new action; must be >= 0; see comment
1558  *a above for more info
1559  **
1560  *b Returns:
1561  **
1562  ** 0 on success, -1 on failure
1563  */
1564  int force_action(const char* action_name,
1565  float speed = DIGUY_DEFAULT_FLOAT,
1566  int include_transition_arc = 1,
1567  float max_rampdown_interval = 0.5f,
1568  int retain_path_shape = 0,
1569  float t_offset_into_new_action = 0.0f);
1570 
1571  /*l
1572  *b Description:
1573  **
1574  ** This function is similar to force_action(), but allows the
1575  ** specification of how long the interruption should last.
1576  **
1577  ** This function will have no effect on a dead character (see
1578  ** die_now() and get_dead()).
1579  **
1580  *b Mode Restrictions:
1581  **
1582  *- - This function can only be called if the character is in
1583  *- path action mode *and* path position mode.
1584  **
1585  *b Mode Effects:
1586  **
1587  *- - This function will put the character into free action mode.
1588  *- - This function will not change the position mode.
1589  **
1590  *b Arguments:
1591  **
1592  *a duration - how long the action should be performed before
1593  *a an automatic resume_interrupted_path() call is
1594  *a made
1595  **
1596  *b Returns:
1597  **
1598  ** 0 on success, -1 on failure
1599  */
1600  int force_action_with_duration(const char* action_name,
1601  float duration,
1602  int include_transition_arc = 1,
1603  float max_rampdown_interval = 0.5f);
1604 
1605  /*l
1606  *b Description:
1607  **
1608  ** This function is similar to force_action(), but allows the
1609  ** specification of an offset to apply to the character's position.
1610  **
1611  *b Mode Effects:
1612  **
1613  *- - This function will put the character into free action mode.
1614  *- - This function may change the position mode; see Description.
1615  **
1616  *b Arguments:
1617  **
1618  *a x, y, z - Offset to apply to character's position when transitioning
1619  *a to given action.
1620  **
1621  *b Returns:
1622  **
1623  ** 0 on success, -1 on failure
1624  **
1625  */
1626  int force_action_with_offset( const char* action_name,
1627  float speed = DIGUY_DEFAULT_FLOAT,
1628  int include_transition_arc = 1,
1629  float max_rampdown_interval = 0.5f,
1630  int retain_path_shape = 0,
1631  float t_offset_into_new_action = 0.0f,
1632  float x = 0, float y = 0, float z = 0 );
1633 
1634  /*l
1635  *b Description:
1636  **
1637  ** This function forces the current action of the character to be the
1638  ** action identified by action_name, to be executed along the path
1639  ** shape specified by path_shape_name.
1640  **
1641  ** This function will have no effect on a dead character (see
1642  ** die_now() and get_dead()).
1643  **
1644  *b Mode Effects:
1645  **
1646  *- - This function will put the character into free action mode.
1647  *- - This function will put the character into path position mode.
1648  **
1649  *b Arguments:
1650  **
1651  *a action_name - name of the action to be performed by
1652  *a the character
1653  *a path_shape_name - name of the path shape on which action
1654  *a should be performed
1655  *a waypoint_name - name of waypoint on path shape to begin at;
1656  *a default of NULL will start at first waypoint
1657  *a distance_into_path - distance into path shape to start at, if
1658  *a waypoint_name isn't specified
1659  **
1660  *b Returns:
1661  **
1662  ** 0 on success, -1 on failure
1663  */
1664  int force_action_and_path_shape(const char* action_name,
1665  const char* path_shape_name,
1666  const char* waypoint_name = NULL,
1667  float distance_into_path = 0.0f);
1668 
1669  /*l
1670  *b Description:
1671  **
1672  ** This function forces the current action of the character to be the
1673  ** action identified by action_name. This function replaces the legacy
1674  ** force_action, force_action_with_offset, and force_action_with_duration
1675  ** functions, which each make use of different subsets of the action parameters.
1676  **
1677  ** This function will have no effect on a dead character (see
1678  ** die_now() and get_dead()).
1679  **
1680  ** See set_desired_action() for a discussion of the effects on
1681  ** position mode.
1682  **
1683  *b Mode Effects:
1684  **
1685  *- - This function will put the character into free action mode.
1686  *- - This function will put the character into path position mode.
1687  **
1688  *b Arguments:
1689  **
1690  *a action_name - name of the action to be performed by the character
1691  *a action_parameters - parameters for setting the action (eg. speeds, offset, path)
1692  **
1693  *b Returns:
1694  **
1695  ** 0 on success, -1 on failure
1696  */
1697  int force_action( const char* action_name, const diguyActionParameters& action_parameters );
1698 
1699  /*l
1700  *b Description:
1701  **
1702  ** This function returns the most recently forced action as set by
1703  ** by force_action(), force_action_with_duration(), or
1704  ** force_action_and_path_shape().
1705  **
1706  *b Returns:
1707  **
1708  ** the name of the most recent forced action, or NULL if no action
1709  ** has been forced
1710  */
1711  const char* get_most_recent_forced_action();
1712 
1713  /*l
1714  *b Description:
1715  **
1716  ** This function returns the time at which the most recently forced
1717  ** action occurred.
1718  **
1719  *b Returns:
1720  **
1721  ** time at which force action occurred; -1.0 if no action has been
1722  ** forced
1723  */
1724  float get_most_recent_forced_action_t();
1725 
1726  /*l
1727  *b Description:
1728  **
1729  ** This function returns the action time offset of the most recently
1730  ** forced action. This is typically value of the
1731  ** t_offset_into_new_action argument of the force_action() call.
1732  **
1733  *b Returns:
1734  **
1735  ** time at which force action occurred; -1.0 if no action has been
1736  ** forced
1737  */
1738  float get_most_recent_forced_action_t_offset();
1739 
1740 
1741  /*l
1742  *b Description:
1743  **
1744  ** This function adds a "pending action" to the character. This is
1745  ** essentially a delayed set_desired_action() call. The desired
1746  ** action will be set at the passed scenario t, just as if
1747  ** set_desired_action() is called at that time.
1748  **
1749  ** *Note:* Any call to set_desired_action() or force_action(), or
1750  ** their related variants, will clear any pending actions.
1751  **
1752  *b Arguments:
1753  **
1754  *a action - name of pending desired action
1755  *a scenario_t - time at which to set desired action
1756  *a remove_existing_pending_actions - pass 1 to remove any previously
1757  *a added pending actions, 0 to leave them
1758  *a speed - as passed to set_desired_action()
1759  *a retain_path_shape - as passed to set_desired_action()
1760  **
1761  *b Returns:
1762  **
1763  ** 0 on success, -1 on failure
1764  */
1765  int add_pending_desired_action(const char* action,
1766  float scenario_t,
1767  int remove_existing_pending_actions = 0,
1768  float speed = DIGUY_DEFAULT_FLOAT,
1769  int retain_path_shape = 1);
1770 
1771  /*l
1772  *b Description:
1773  **
1774  ** Similar to add_pending_desired_action(), but will do a
1775  ** force_action() at the passed scenario_t instead of a
1776  ** set_desired_action().
1777  **
1778  ** *Note:* Any call to set_desired_action() or force_action(), or
1779  ** their related variants, will clear any pending actions.
1780  **
1781  *b Returns:
1782  **
1783  ** 0 on success, -1 on failure
1784  */
1785  int add_pending_force_action(const char* action,
1786  float scenario_t,
1787  int remove_existing_pending_actions = 0,
1788  float speed = DIGUY_DEFAULT_FLOAT,
1789  int include_transition_arc = 1,
1790  float max_rampdown_interval = 0.5f,
1791  int retain_path_shape = 1,
1792  float first_arc_time_shift = 0.0f);
1793 
1794  /*l
1795  *b Returns:
1796  **
1797  ** 1 if the passed action name is an action available to this
1798  ** character, 0 if not
1799  */
1800  int is_valid_action(const char* action);
1801 
1802  /*l
1803  *b Description:
1804  **
1805  ** This function sends this character a signal to die as soon as
1806  ** possible. The character will transition to a dead action.
1807  **
1808  ** The following side-effects will also happen:
1809  *>
1810  *- - all aiming is ended
1811  *- - all gazing is ended
1812  *- - all pointing is ended
1813  *- - head nodding and shaking are stopped
1814  *- - all gestures are aborted
1815  *- - all sounds originated by the character are stopped
1816  *- - Destroyed appearance might be switched to.
1817  *<
1818  ** Many function calls will have no effect on dead characters;
1819  ** see individual function descriptions for limitations.
1820  **
1821  ** Use the get_dead() call to retrieve the dead state of a
1822  ** character.
1823  **
1824  *b Mode Effects:
1825  **
1826  *- - This function will put the character into free action mode.
1827  *- - This function will not change the position mode.
1828  **
1829  *b Returns:
1830  **
1831  ** 0 on success, -1 on failure
1832  **
1833  *b Available as Decision Bead/Event
1834  */
1835  int die_now(const char* preferred_dead_action_name = "(default)");
1836 
1837  /*l
1838  *b Description:
1839  **
1840  ** This function revives a dead character. The limitations of dead
1841  ** characters will be lifted from the revived character; e.g., the
1842  ** character will be able to gaze, execute gestures, etc.
1843  **
1844  *b Returns:
1845  **
1846  ** 0 on success, -1 on failure
1847  **
1848  *b Available as Decision Bead/Event
1849  */
1850  int revive_now(const char* preferred_revive_action_name = "(default)");
1851 
1852  /*l
1853  *b Description:
1854  **
1855  ** This function returns whether or not the character is dead.
1856  ** Characters can be killed by die_now() function calls, as well as
1857  ** by being hit by weapon fire.
1858  **
1859  *b Returns:
1860  **
1861  ** 1 if character is dead (die_now() function has been called),
1862  ** 0 if not.
1863  */
1864  int get_dead();
1865 
1866  /*l
1867  *b Description:
1868  **
1869  ** Sets the speed the character should attempt to move, in meters per
1870  ** second.
1871  **
1872  ** This setting takes effect immediately. To set a desired action
1873  ** and a desired speed at the same time, use the speed argument of
1874  ** the set_desired_action() call.
1875  **
1876  ** This desired speed setting can be undone in a couple of ways:
1877  **
1878  *- 1. by calling set_speed() with an argument of
1879  *- DIGUY_DEFAULT_FLOAT, or
1880  *- 2. by calling set_desired_action(), or
1881  *- 3. by calling one of the force_action() functions
1882  **
1883  *b Arguments:
1884  **
1885  *a speed - desired speed in meters per second
1886  **
1887  *b Returns:
1888  **
1889  ** 0 on success, -1 on failure
1890  */
1891  int set_speed(float speed);
1892 
1893  /*l
1894  *b Returns:
1895  **
1896  ** the approximate speed at which the character is moving, in meters
1897  ** per second
1898  */
1899  float get_speed();
1900 
1901  /*l
1902  *b Returns:
1903  **
1904  ** The desired speed of the character, in meters per second. Calls to
1905  ** set_speed(), set_desired_action(), or force_action() assign
1906  ** the character a desired speed, to which it transitions over some
1907  ** amount of time. If the speed-setting was instantaneous, the current
1908  ** speed will be returned.
1909  */
1910  float get_desired_speed();
1911 
1912 /*****************************************************************************/
1929  /*l
1930  *b Description:
1931  **
1932  ** Sets a generic parameter that can be mapped to a blend tree driver.
1933  ** Useful for creating animations that can play back at different vertical angles.
1934  */
1935  int set_animation_target_el(float elevation, float ramp_time = .25f);
1936 
1938  float get_animation_target_el();
1939 
1940  /*l
1941  *b Description:
1942  **
1943  ** Sets a generic parameter that can be mapped to a blend tree driver.
1944  ** Useful for creating animations that can play back at different horizontal angles.
1945  */
1946  int set_animation_target_az(float azimuth, float ramp_time = .25f);
1947 
1949  float get_animation_target_az();
1950 
1951  /*l
1952  *b Description:
1953  **
1954  ** Sets a generic parameter in world space that can be mapped to a blend tree driver.
1955  ** The locomotion actions are driven by these values allowing one action to go
1956  ** many different direction.
1957  ** Internally this is mapped to local space.
1958  **
1959  ** In practical terms, this means that a character with the appropriate animation blend
1960  ** tree can be made to move at an arbitrary speed in an arbitrary direction, provided
1961  ** that the blend tree supports these motions. One example would be a soldier who can
1962  ** "strafe" from side to side while pointing his weapon in a certain direction. Another
1963  ** example would be a car that can travel forwards or backwards at a speed within a
1964  ** continuous range.
1965  **
1966  ** Users can see a demonstration of this feature in the character view by selecting an
1967  ** appropriate character type (e.g. vehicle_09), appearance (e.g. taxi_2013), and
1968  ** action ("movement"). The exercise blend tree widget will allow adjustments.
1969  **
1970  */
1971  void set_animation_velocity(float vel_x, float vel_y, float vel_z, float ramp_time = 0.10f);
1972 
1974  void get_animation_velocity(float *vel_x, float *vel_y, float *vel_z);
1975 
1976  /*l
1977  *b Description:
1978  **
1979  ** Sets a generic parameter in local space that can be mapped to a blend tree driver.
1980  ** The locomotion actions are driven by these values allowing one action to go
1981  ** many different directions.
1982  **
1983  ** Similar to set_animation_velocity() in terms of overall practical details.
1984  ** Note that the local velocity setting will affect the character's world velocity.
1985  */
1986  void set_animation_local_velocity(float vel_x, float vel_y, float vel_z, float ramp_time = 0.10f);
1987 
1989  void get_animation_local_velocity(float *vel_x, float *vel_y, float *vel_z);
1990 
1991  /*l
1992  *b Description:
1993  **
1994  ** Sets a generic parameter in that can be mapped to a blend tree driver.
1995  ** The locomotion actions are driven by these values allowing one action to turn
1996  */
1997  void set_animation_angular_velocity(float vel_rz, float ramp_time = .25f);
1998 
2000  float get_animation_angular_velocity();
2001 
2002 
2003 /*****************************************************************************/
2013  /*l
2014  *b Description:
2015  **
2016  ** Sets the position of the character relative to the origin of the
2017  ** DI-Guy global coordinate system.
2018  **
2019  ** The new settings will take effect immediately, possibly causing
2020  ** the character to "teleport" if the new values are significantly
2021  ** different than the old.
2022  **
2023  ** The DI-Guy global coordinate system is right-handed, with
2024  ** X forward, Z up, and Y to the left. Rotation directions follow
2025  ** standard right-handed coordinate system conventions:
2026  **
2027  *- - positive rotations about X cause a counter-clockwise roll
2028  *- - position rotations about Y cause a forward pitch
2029  *- - positive rotations about Z cause a yaw to the left
2030  **
2031  ** Note that if the character has an altitude function (see
2032  ** set_altitude_function()), the tz argument will effectively be
2033  ** ignored as the altitude function will override it.
2034  **
2035  ** If the magnitude of the numbers is large (say 32000 or higher),
2036  ** the function set_position_double() should be used instead.
2037  **
2038  *b Mode Effects:
2039  **
2040  *- - This function will put the character into free position mode.
2041  *- - This function will put the character into free action mode.
2042  **
2043  *b Arguments:
2044  **
2045  *a tx, ty, tz - position in meters from the origin
2046  **
2047  *b Returns:
2048  **
2049  ** 0 on success, -1 on failure
2050  */
2051  int set_position(float tx, float ty, float tz);
2052 
2053  /*l
2054  *b Description:
2055  **
2056  ** Similar to set_position(), but using double-precision rather than
2057  ** single-precision numbers. If the magnitude of the numbers is large
2058  ** (say 32000 or higher), this function should be used.
2059  **
2060  *b Mode Effects:
2061  **
2062  *- - This function will put the character into free position mode.
2063  *- - This function will put the character into free action mode.
2064  **
2065  *b Arguments:
2066  **
2067  *a tx, ty, tz - position in meters from the origin
2068  **
2069  *b Returns:
2070  **
2071  ** 0 on success, -1 on failure
2072  */
2073  int set_position_double(double tx, double ty, double tz);
2074 
2075  /*l
2076  *b Description:
2077  **
2078  ** Retrieves the position of the character in the DI-Guy
2079  ** global coordinate system.
2080  **
2081  ** See set_position() for a description of the coordinate system.
2082  **
2083  *b Arguments:
2084  **
2085  *a tx, ty, tz - position in meters from the origin
2086  **
2087  ** Pass NULL for any values that are not needed.
2088  **
2089  *b Returns:
2090  **
2091  ** 0 on success, -1 on failure
2092  */
2093  int get_position(float* tx, float* ty, float* tz);
2094 
2095  /*l
2096  *b Description:
2097  **
2098  ** Retrieves the position of the character in the DI-Guy
2099  ** global coordinate system.
2100  **
2101  ** See set_position() for a description of the coordinate system.
2102  **
2103  ** Unlike get_position(), this function returns higher-precision
2104  ** values for the position, which is important when the character is
2105  ** far from the coordinate system origin.
2106  **
2107  *b Arguments:
2108  **
2109  *a tx, ty, tz - position in meters from the origin
2110  **
2111  ** Pass NULL for any values that are not needed.
2112  **
2113  *b Returns:
2114  **
2115  ** 0 on success, -1 on failure
2116  */
2117  int get_position_double(double* tx, double* ty, double* tz);
2118 
2119  /*l
2120  *b Description:
2121  **
2122  ** Sets the position of the character relative to its parent or the
2123  ** origin of the DI-Guy global coordinate system if this
2124  ** character is not parented.
2125  **
2126  ** See set_position() for a description of the coordinate system.
2127  **
2128  ** The new settings will take effect immediately, possibly causing the
2129  ** character to "teleport" if the new values are significantly
2130  ** different than the old.
2131  **
2132  *b Mode Effects:
2133  **
2134  *- - This function will put the character into free position mode.
2135  *- - This function will put the character into free action mode.
2136  **
2137  *b Arguments:
2138  **
2139  *a tx, ty, tz - position in meters from the origin
2140  **
2141  *b Returns:
2142  **
2143  ** 0 on success, -1 on failure
2144  */
2145  int set_position_relative_to_parent(float tx, float ty, float tz);
2146 
2147  /*l
2148  *b Description:
2149  **
2150  ** Retrieves the position of the character relative to its parent, or
2151  ** relative to the origin of the DI-Guy global coordinate
2152  ** system if this character is not parented.
2153  **
2154  ** See set_position() for a description of the coordinate system.
2155  **
2156  *b Arguments:
2157  **
2158  *a tx, ty, tz - position in meters from the origin
2159  **
2160  ** Pass NULL for any values that are not needed.
2161  **
2162  *b Returns:
2163  **
2164  ** 0 on success, -1 on failure
2165  */
2166  int get_position_relative_to_parent(float* tx, float* ty, float* tz);
2167 
2168  /*l
2169  *b Description:
2170  **
2171  ** Similar to set_position_relative_to_parent(), but the position is
2172  ** either from the other character's overall position (if
2173  ** other_link_name is NULL), or the position of the other character's
2174  ** link (if other_link_name specifies a link on the other character).
2175  **
2176  ** The position that is set is relative to this character's parent.
2177  **
2178  *b Mode Effects:
2179  **
2180  *- - This function will put the character into free position mode.
2181  *- - This function will put the character into free action mode.
2182  **
2183  *b Arguments:
2184  **
2185  *a other_character_name - other character from which to read
2186  *a position
2187  *a other_link_name - optional link on other character; if
2188  *a NULL, other character's base position is
2189  *a used
2190  *a offset_x, offset_y, offset_z - offset to apply to position
2191  *a read from other character
2192  *a also_set_orientation - pass 1 to also set this character's
2193  *a orientation from the other character's
2194  *a orientation
2195  **
2196  *b Returns:
2197  **
2198  ** 0 on success, -1 on failure
2199  */
2200  int set_position_to_other_character_position(const char* other_character_name,
2201  const char* other_link_name = NULL,
2202  float offset_x = 0.0f, float offset_y = 0.0f, float offset_z = 0.0f,
2203  int also_set_orientation = 1);
2204 
2205  /*l
2206  *b Description:
2207  **
2208  ** Sets the desired position of the character. How the character
2209  ** moves toward the desired position is determined by its current
2210  ** guides; see add_guide() and create_guide().
2211  **
2212  *b Mode Effects:
2213  **
2214  *- - This function will put the character into free position mode.
2215  *- - This function will put the character into free action mode.
2216  **
2217  *b Arguments:
2218  **
2219  *a tx, ty, tz - desired position in meters from the origin
2220  *a force_guide_unacquired - this optional argument will set any guides
2221  *a the character has to be unacquired
2222  *b Returns:
2223  **
2224  ** 0 on success, -1 on failure
2225  */
2226  int set_desired_position(float tx, float ty, float tz,
2227  int force_guide_unacquired = 0);
2228 
2229  int set_desired_position_double(double tx, double ty, double tz,
2230  int force_guide_unacquired = 0);
2231  /*l
2232  *b Description:
2233  **
2234  ** Like set_desired_position(), but uses the character's current
2235  ** position as the desired position.
2236  **
2237  *b Mode Effects:
2238  **
2239  *- - This function will put the character into free position mode.
2240  *- - This function will put the character into free action mode.
2241  **
2242  *b Arguments:
2243  **
2244  *a also_set_orientation - pass 1 to also set this character's
2245  *a orientation to its current orientation
2246  **
2247  *b Returns:
2248  **
2249  ** 0 on success, -1 on failure
2250  */
2251  int set_desired_position_to_current_position(int also_set_orientation = 1);
2252 
2253  /*l
2254  *b Description:
2255  **
2256  ** Like set_desired_position(), but sets the character's desired
2257  ** position to passed waypoint's position.
2258  **
2259  ** The passed waypoint can be one created by
2260  ** diguyScenario::create_waypoint, a waypoint from a character's
2261  ** diguyCharacterPath, or waypoint from a diguyPathShape.
2262  **
2263  *b Mode Effects:
2264  **
2265  *- - This function will put the character into free position mode.
2266  *- - This function will put the character into free action mode.
2267  **
2268  *b Arguments:
2269  **
2270  *a waypoint - pointer to diguyWaypoint object
2271  *a offset_x, offset_y, offset_z - offset to apply to waypoint
2272  *a position
2273  *a offset_in_world_coords - 1 if offset is to be in world
2274  *a coordinates, 0 if it is to be
2275  *a in waypoint-local coordinates
2276  **
2277  *b Returns:
2278  **
2279  ** 0 on success, -1 on failure
2280  */
2281  int set_desired_position_to_waypoint(diguyWaypoint* waypoint,
2282  float offset_x = 0.0f, float offset_y = 0.0f, float offset_z = 0.0f,
2283  int offset_in_world_coords = 0);
2284 
2285  /*l
2286  *b Description:
2287  **
2288  ** Like set_desired_position(), but finds the specified waypoint on
2289  ** the specified path and sets the character's desired position to the
2290  ** waypoint's position.
2291  **
2292  *b Mode Effects:
2293  **
2294  *- - This function will put the character into free position mode.
2295  *- - This function will put the character into free action mode.
2296  **
2297  *b Arguments:
2298  **
2299  *a path_name - name of path on which to find waypoint
2300  *a waypoint_name - name of waypoint
2301  **
2302  *b Returns:
2303  **
2304  ** 0 on success, -1 on failure
2305  */
2306  int set_desired_position_to_path_waypoint(const char* path_name,
2307  const char* waypoint_name);
2308 
2309  /*l
2310  *b Description:
2311  **
2312  ** Like set_desired_position(), but finds the specified waypoint on
2313  ** the specified path shape and sets the character's desired position
2314  ** to the waypoint's position.
2315  **
2316  *b Mode Effects:
2317  **
2318  *- - This function will put the character into free position mode.
2319  *- - This function will put the character into free action mode.
2320  **
2321  *b Arguments:
2322  **
2323  *a path_shape_name - name of path shape on which to find waypoint
2324  *a waypoint_name - name of waypoint
2325  **
2326  *b Returns:
2327  **
2328  ** 0 on success, -1 on failure
2329  */
2330  int set_desired_position_to_path_shape_waypoint(const char* path_shape_name,
2331  const char* waypoint_name);
2332 
2333  /*l
2334  *b Description:
2335  **
2336  ** Retrieves the desired position of the character.
2337  **
2338  *b Mode Restrictions:
2339  **
2340  *- - This function can only be called in free position mode.
2341  **
2342  *b Arguments:
2343  **
2344  *a tx, ty, tz - desired position in meters from the origin
2345  **
2346  ** Pass NULL for any values that are not needed.
2347  **
2348  *b Returns:
2349  **
2350  ** 0 on success, -1 on failure
2351  */
2352  int get_desired_position(float* tx, float* ty, float* tz);
2353  int get_desired_position_double(double* tx, double* ty, double* tz);
2354 
2355  /*l
2356  *b Description:
2357  **
2358  ** Retrieves the delta vector from current position to desired one.
2359  **
2360  *b Mode Restrictions:
2361  **
2362  *- - This function can only be called in free position mode.
2363  **
2364  *b Arguments:
2365  **
2366  *a tx, ty, tz - delta in meters
2367  **
2368  ** Pass NULL for any values that are not needed.
2369  **
2370  *b Returns:
2371  **
2372  ** 0 on success, -1 on failure
2373  */
2374  int get_delta_to_desired_position(float* tx, float* ty, float* tz);
2375 
2376  /*l
2377  *b Description:
2378  **
2379  ** Sets the initial position the character should move to on a call to
2380  ** diguyScenario::reset().
2381  **
2382  ** If the character has an initial path, that path, not this function
2383  ** call, will determine its initial position.
2384  **
2385  *b Arguments:
2386  **
2387  *a tx, ty, tz - initial position in meters from the origin
2388  **
2389  *b Returns:
2390  **
2391  ** 0 on success, -1 on failure
2392  */
2393  int set_initial_position(float tx, float ty, float tz);
2394 
2395  /*l
2396  *b Description:
2397  **
2398  ** Retrieves the initial position of the character.
2399  **
2400  ** If the character is in free position mode or has no initial path,
2401  ** this will be the position set by set_initial_position().
2402  **
2403  ** Otherwise this will be the position of the first waypoint of the
2404  ** initial path.
2405  **
2406  *b Arguments:
2407  **
2408  *a tx, ty, tz - initial position in meters from the origin
2409  **
2410  ** Pass NULL for any values that are not needed.
2411  **
2412  *b Returns:
2413  **
2414  ** 0 on success, -1 on failure
2415  */
2416  int get_initial_position(float* tx, float* ty, float* tz);
2417 
2418  /*l
2419  *b Description:
2420  **
2421  ** Sets the orientation of the character relative to the origin of the
2422  ** DI-Guy global coordinate system.
2423  **
2424  ** See set_position() for a description of the coordinate system.
2425  **
2426  ** The new settings will take effect immediately, possibly causing the
2427  ** character to "teleport" if the new values are significantly
2428  ** different than the old.
2429  **
2430  ** Note that if the character has an up vector type of 'z' or 'n' or even
2431  ** sometimes 'd' (as set by the set_up_vector_type() call) the rx and ry
2432  ** values will not have any effect. To be able to set rx and ry
2433  ** values, set the up vector type of the character to 'c', for "custom".
2434  **
2435  *b Mode Effects:
2436  **
2437  *- - This function will put the character into free position mode.
2438  *- - This function will put the character into free action mode.
2439  **
2440  *b Arguments:
2441  **
2442  *a rz, rx, ry - orientations in degrees
2443  **
2444  *b Returns:
2445  **
2446  ** 0 on success, -1 on failure
2447  */
2448  int set_orientation(float rz, float rx, float ry);
2449 
2450  /*l
2451  *b Description:
2452  **
2453  ** Retrieves the orientation of the character in the DI-Guy
2454  ** global coordinate system. See set_position() for a description of
2455  ** the coordinate system.
2456  **
2457  *i Note:
2458  **
2459  ** For vehicles, you may want to use the function
2460  ** get_vehicle_body_orientation(). See that function for more
2461  ** information.
2462  **
2463  *b Arguments:
2464  **
2465  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2466  *a positive X axis
2467  **
2468  ** Pass NULL for any values that are not needed.
2469  **
2470  *b Returns:
2471  **
2472  ** 0 on success, -1 on failure
2473  */
2474  int get_orientation(float* rz, float* rx, float* ry);
2475 
2476  /*l
2477  *b Description:
2478  **
2479  ** Sets the orientation of the character relative to its parent or the
2480  ** origin of the DI-Guy global coordinate system if this
2481  ** character is not parented.
2482  **
2483  ** See set_position() for a description of the coordinate system.
2484  **
2485  ** The new settings will take effect immediately, possibly causing the
2486  ** character to "teleport" if the new values are significantly
2487  ** different than the old.
2488  **
2489  *b Mode Effects:
2490  **
2491  *- - This function will put the character into free position mode.
2492  *- - This function will put the character into free action mode.
2493  **
2494  *b Arguments:
2495  **
2496  *a rz, rx, ry - orientations in degrees
2497  **
2498  *b Returns:
2499  **
2500  ** 0 on success, -1 on failure
2501  */
2502  int set_orientation_relative_to_parent(float rz, float rx, float ry);
2503 
2504  /*l
2505  *b Description:
2506  **
2507  ** Retrieves the orientation of the character relative to its parent,
2508  ** or the origin of the DI-Guy global coordinate system if
2509  ** this character does not have a parent.
2510  **
2511  ** See set_position() for a description of the coordinate system.
2512  **
2513  *b Arguments:
2514  **
2515  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2516  *a positive X axis
2517  **
2518  ** Pass NULL for any values that are not needed.
2519  **
2520  *b Returns:
2521  **
2522  ** 0 on success, -1 on failure
2523  */
2524  int get_orientation_relative_to_parent(float* rz, float* rx, float* ry);
2525 
2526  /*l
2527  *b Description:
2528  **
2529  ** This function sets how the character should be oriented relative
2530  ** to its surroundings.
2531  **
2532  ** This function changes the current up vector type, and the up vector type
2533  ** that will be set when the character is reset. To change only the
2534  ** current up vector type (a temporary change that goes away on reset),
2535  ** call set_up_vector_type()).
2536  **
2537  *b Arguments:
2538  **
2539  *a axis - the up vector type the character should use; legal
2540  *a values shown below:
2541  **
2542  *- - 'd' - use default settings; character will change
2543  *- up vector type depending on current action and
2544  *- path shape parameters
2545  *- - 'z' - Z axis is up; character will be oriented
2546  *- so that positive Z in character coordinates is
2547  *- always oriented along the positive world Z axis
2548  *- - 'n' - normal to path; character will be oriented
2549  *- so that positive Z in character coordinates is
2550  *- normal to the path shape the character is on
2551  *- - 'g' - ground-clamped; the vehicle will attempt to cling
2552  *- to the terrain, in an approximation of real rigid
2553  *- body physics
2554  *- - 'c' - custom; character's rx and ry orientation values
2555  *- will not be modified
2556  **
2557  ** Having an up vector type of 'z' effectively zeroes out the rx and ry
2558  ** values of the character's orientation.
2559  **
2560  ** Having an up vector type of 'n' may override rx and ry values of the
2561  ** character's orientation with values derived from the character's
2562  ** path shape.
2563  **
2564  ** Having an up vector type of 'c' allows the pitch and roll of the
2565  ** character to be changed without taking it off the path it in on by
2566  ** calling set_custom_orientation_rx_and_ry(). Calling
2567  ** set_orientation() has the side-effect of putting the character
2568  ** into free position mode, taking it off of any path it's on.
2569  **
2570  *b Returns:
2571  **
2572  ** 0 on success, -1 on failure
2573  */
2574  int set_initial_up_vector_type(char axis);
2575 
2576  /*l
2577  *b Description:
2578  **
2579  ** This function is being deprecated, but remains for backwards compatibility.
2580  ** It does the same thing as set_initial_up_vector_type()
2581  **
2582  */
2583  int set_initial_up_vector(char axis);
2584 
2585  /*l
2586  *b Returns:
2587  **
2588  ** current up vector type; see set_initial_up_vector_type()
2589  */
2590  char get_initial_up_vector_type();
2591 
2592  /*l
2593  *b Description:
2594  **
2595  ** This function is being deprecated, but remains for backwards compatibility.
2596  ** It does the same thing as get_initial_up_vector_type()
2597  **
2598  */
2599  char get_initial_up_vector();
2600 
2601  /*l
2602  *b Description:
2603  **
2604  ** This function sets how the character should be oriented relative
2605  ** to its surroundings.
2606  **
2607  ** This function changes only the current up vector type. To change the
2608  ** up vector type that will be used when the character is reset, call
2609  ** set_initial_up_vector_type().
2610  **
2611  *b Arguments:
2612  **
2613  *a axis - the up vector type the character should use; see
2614  *a set_initial_up_vector_type() for description
2615  **
2616  *b Returns:
2617  **
2618  ** 0 on success, -1 on failure
2619  **
2620  *b Available as Decision Bead/Event
2621  */
2622  int set_up_vector_type(char axis);
2623 
2624  /*l
2625  *b Description:
2626  **
2627  ** This function is being deprecated, but remains for backwards compatibility.
2628  ** It does the same thing as set_up_vector_type()
2629  **
2630  */
2631  int set_up_vector(char axis);
2632 
2633  /*l
2634  *b Returns:
2635  **
2636  ** current up vector type; see set_up_vector_type()
2637  */
2638  char get_up_vector_type();
2639 
2640  /*l
2641  *b Description:
2642  **
2643  ** This function is being deprecated, but remains for backwards compatibility.
2644  ** It does the same thing as get_up_vector_type()
2645  **
2646  */
2647  char get_up_vector();
2648 
2649  /*l
2650  *b Description:
2651  **
2652  ** This function sets the rx and ry components of the character's
2653  ** orientation. Unlike set_orientation(), this function does not
2654  ** put the character into free position mode if it is currently in
2655  ** path position mode.
2656  **
2657  ** Note that if the character has an up vector type of 'z' or 'n' or even
2658  ** sometimes 'd' (as set by the set_up_vector_type() call) this function
2659  ** will not have any effect. To be able to set rx and ry values,
2660  ** set the up vector type of the character to 'c', for "custom".
2661  **
2662  ** The passed rx and ry values are in character-local coordinates,
2663  ** not parent coordinates if the character has a parent.
2664  **
2665  *b Mode Effects:
2666  **
2667  *- - None.
2668  **
2669  *b Arguments:
2670  **
2671  *a rx, ry - orientations in degrees
2672  **
2673  *b Returns:
2674  **
2675  ** 0 on success, -1 on failure
2676  */
2677  int set_custom_orientation_rx_and_ry(float rx,
2678  float ry);
2679 
2680  /*l
2681  *b Description:
2682  **
2683  ** Sets the desired orientation of the character. See
2684  ** set_desired_position().
2685  **
2686  *b Mode Effects:
2687  **
2688  *- - This function will put the character into free position mode.
2689  *- - This function will put the character into free action mode.
2690  **
2691  *b Arguments:
2692  **
2693  *a rz, rx, ry - orientations in degrees counter-clockwise from
2694  *a the positive X axis
2695  **
2696  *b Returns:
2697  **
2698  ** 0 on success, -1 on failure
2699  */
2700  int set_desired_orientation(float rz, float rx, float ry,
2701  int force_guide_unacquired = 0);
2702 
2703  /*l
2704  *b Description:
2705  **
2706  ** Retrieves the desired orientation of the character.
2707  **
2708  *b Mode Restrictions:
2709  **
2710  *- - This function can only be called in free position mode.
2711  **
2712  *b Arguments:
2713  **
2714  *a rz, rx, ry - orientations in degrees counter-clockwise from
2715  *a the positive X axis
2716  **
2717  ** Pass NULL for any values that are not needed.
2718  **
2719  *b Returns:
2720  **
2721  ** 0 on success, -1 on failure
2722  */
2723  int get_desired_orientation(float* rz, float* rx, float* ry);
2724 
2725  /*l
2726  *b Description:
2727  **
2728  ** Retrieves the delta from current orientation of the character
2729  ** to the desired one.
2730  **
2731  *b Mode Restrictions:
2732  **
2733  *- - This function can only be called in free position mode.
2734  **
2735  *b Arguments:
2736  **
2737  *a rz, rx, ry - orientation deltas in degrees counter-clockwise from
2738  *a the positive X axis
2739  **
2740  ** Pass NULL for any values that are not needed.
2741  **
2742  *b Returns:
2743  **
2744  ** 0 on success, -1 on failure
2745  */
2746  int get_delta_to_desired_orientation(float* rz, float* rx, float* ry);
2747 
2748  /*l
2749  *b Description:
2750  **
2751  ** Like set_desired_orientation(), but uses the character's current
2752  ** orientation as the desired orientation.
2753  **
2754  *b Mode Effects:
2755  **
2756  *- - This function will put the character into free position mode.
2757  *- - This function will put the character into free action mode.
2758  **
2759  *b Returns:
2760  **
2761  ** 0 on success, -1 on failure
2762  */
2763  int set_desired_orientation_to_current_orientation();
2764 
2765  /*l
2766  *b Description:
2767  **
2768  ** Like set_desired_orientation(), but orients the character towards
2769  ** the position specified.
2770  **
2771  *b Mode Effects:
2772  **
2773  *- - This function will put the character into free position mode.
2774  *- - This function will put the character into free action mode.
2775  **
2776  *b Returns:
2777  **
2778  ** 0 on success, -1 on failure
2779  */
2780  int set_desired_orientation_towards_position(float x, float y, float z,
2781  int force_guide_unacquired = 0);
2782 
2783  /*l
2784  *b Description:
2785  **
2786  ** Sets the initial orientation the character should move
2787  ** to on a call to diguyScenario::reset().
2788  **
2789  ** If the character is on a path the path, not this function
2790  ** call, will determine its initial orientation.
2791  **
2792  *b Arguments:
2793  **
2794  *a rz, rx, ry - orientations in degrees counter-clockwise from
2795  *a the positive X axis
2796  **
2797  *b Returns:
2798  **
2799  ** 0 on success, -1 on failure
2800  */
2801  int set_initial_orientation(float rz, float rx, float ry);
2802 
2803  /*l
2804  *b Description:
2805  **
2806  ** Retrieves the initial orientation of the character.
2807  **
2808  ** If the character is in free position mode or has no
2809  ** initial path, this will be the orientation set by
2810  ** set_initial_orientation().
2811  **
2812  ** Otherwise this will be the orientation of the first
2813  ** waypoint of the initial path.
2814  **
2815  *b Arguments:
2816  **
2817  *a rz, rx, ry - orientations in degrees counter-clockwise from
2818  *a the positive X axis
2819  **
2820  ** Pass NULL for any values that are not needed.
2821  **
2822  *b Returns:
2823  **
2824  ** 0 on success, -1 on failure
2825  */
2826  int get_initial_orientation(float* rz, float* rx, float* ry);
2827 
2828  /*l
2829  *b Description:
2830  **
2831  ** Returns the location and orientation of a specific link of the
2832  ** character.
2833  **
2834  *b Arguments:
2835  **
2836  *a link_name - name of the link or connection point; links are named after their inbound
2837  *a joint name
2838  *a tx, ty, tz - position in meters from the origin of the world
2839  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2840  *a positive X axis
2841  **
2842  ** Pass NULL for any values that are not needed.
2843  **
2844  *b Returns:
2845  **
2846  ** 0 on success, -1 on failure
2847  */
2848  int get_link_position(const char* link_name,
2849  float* tx, float* ty, float* tz,
2850  float* rz, float* rx, float* ry);
2851 
2852  /*l
2853  *b Description:
2854  **
2855  ** Returns the location and orientation of a specific link
2856  ** of the character.
2857  **
2858  *b Arguments:
2859  **
2860  *a link_name - name of the link or connection point; links are named after their inbound
2861  *a joint name
2862  *a tx, ty, tz - position in meters from the origin of the world
2863  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2864  *a positive X axis
2865  **
2866  ** Pass NULL for any values that are not needed.
2867  **
2868  *b Returns:
2869  **
2870  ** 0 on success, -1 on failure
2871  */
2872  int get_link_position_double(const char* link_name,
2873  double* tx, double* ty, double* tz,
2874  double* rz, double* rx, double* ry);
2875 
2876  /*l
2877  *b Description:
2878  **
2879  ** Similar to get_link_position(), but allows specification
2880  ** of offset into ending link.
2881  **
2882  *b Arguments:
2883  **
2884  *a link_name - name of the link or connection point
2885  *a offset_tx, offset_ty, offset_tz - offset in link
2886  *a tx, ty, tz - position in meters from the origin
2887  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2888  *a positive X axis
2889  **
2890  ** Pass NULL for any values that are not needed.
2891  **
2892  *b Returns:
2893  **
2894  ** 0 on success, -1 on failure
2895  */
2896  int get_link_position_with_offset(const char* link_name,
2897  float offset_tx, float offset_ty, float offset_tz,
2898  float* tx, float* ty, float* tz,
2899  float* rz, float* rx, float* ry);
2900 
2901  /*l
2902  *b Description:
2903  **
2904  ** Similar to get_link_position(), but allows specification
2905  ** of offset into ending link.
2906  **
2907  *b Arguments:
2908  **
2909  *a link_name - name of the link or connection point
2910  *a offset_tx, offset_ty, offset_tz - offset in link
2911  *a tx, ty, tz - position in meters from the origin
2912  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2913  *a positive X axis
2914  **
2915  ** Pass NULL for any values that are not needed.
2916  **
2917  *b Returns:
2918  **
2919  ** 0 on success, -1 on failure
2920  */
2921  int get_link_position_with_offset_double(const char* link_name,
2922  double offset_tx, double offset_ty, double offset_tz,
2923  double* tx, double* ty, double* tz,
2924  double* rz, double* rx, double* ry);
2925 
2926  /*l
2927  *b Description:
2928  **
2929  ** Returns the location and orientation of a specific link
2930  ** of the character relative to the position of another link.
2931  **
2932  *b Arguments:
2933  **
2934  *a beginning_link_name - name of the first link; send NULL to
2935  *a to specify the position link
2936  *a ending_link_name - name of the last link; send NULL to
2937  *a to specify the position link
2938  *a tx, ty, tz - position in meters from the origin
2939  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2940  *a positive X axis
2941  **
2942  ** Pass NULL for any values that are not needed.
2943  **
2944  *b Returns:
2945  **
2946  ** 0 on success, -1 on failure
2947  */
2948  int get_link_relative_position(const char* beginning_link_name,
2949  const char* ending_link_name,
2950  float* tx, float* ty, float* tz,
2951  float* rz, float* rx, float* ry);
2952 
2953  /*l
2954  *b Description:
2955  **
2956  ** Similar to get_link_relative_position(), but allows specification
2957  ** of offset into ending link.
2958  **
2959  *b Arguments:
2960  **
2961  *a beginning_link_name - name of the first link; send NULL to
2962  *a to specify the position link
2963  *a ending_link_name - name of the last link; send NULL to
2964  *a to specify the position link
2965  *a offset_tx, offset_ty, offset_tz - offset in ending link
2966  *a tx, ty, tz - position in meters from the origin
2967  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2968  *a positive X axis
2969  **
2970  ** Pass NULL for any values that are not needed.
2971  **
2972  *b Returns:
2973  **
2974  ** 0 on success, -1 on failure
2975  */
2976  int get_link_relative_position_with_offset(const char* beginning_link_name,
2977  const char* ending_link_name,
2978  float offset_tx, float offset_ty, float offset_tz,
2979  float* tx, float* ty, float* tz,
2980  float* rz, float* rx, float* ry);
2981 
2982  /*l
2983  *b Description:
2984  **
2985  ** By default characters on a path will scale their movement speed
2986  ** and velocity based on the scale of the actor the character is
2987  ** based on. For example, if a tall character and short character
2988  ** are both playing the exact same walk motion, the tall character
2989  ** will move further per motion repetition than the short character.
2990  **
2991  ** Scaling the travel in this way leads to more realistic looking
2992  ** motion, but can cause different characters using the same actions
2993  ** and underlying motions to move at different speeds. At times it
2994  ** is convenient to not scale the travel.
2995  **
2996  ** If actor scaling is disabled, characters of different sizes will
2997  ** all move the same distance, and at the same speed, if they have
2998  ** the same path shapes and action beads. Note that in cases of
2999  ** extreme differences between the actor the motion is based on
3000  ** and the actor the character's current appearance is based on,
3001  ** the characters feet may slip on the ground more than normal.
3002  **
3003  *b Arguments:
3004  **
3005  *a apply_scale_flag - pass 1 to apply actor scale to travel;
3006  *a 0 to not
3007  */
3008  void set_apply_actor_scale_to_action_bead_travel(int apply_scale_flag);
3009 
3010  /*l
3011  *b Returns:
3012  **
3013  ** 1 if actor scale is being applied to travel, 0 if not
3014  */
3015  int get_apply_actor_scale_to_action_bead_travel();
3016 
3017  /*l
3018  *b Description:
3019  **
3020  ** This function transforms a point that is in the local space of the
3021  ** character into a location in the world. Useful for things like
3022  ** navigating AIs to a location near a prop. Or moving to a spot
3023  ** in front of someone else.
3024  **
3025  ** This code presumes up_axis is 'z' and that there is only rotation
3026  ** about that axis.
3027  */
3028  int local_to_global(float x, float y, float z,
3029  float* res_x, float* res_y, float* res_z);
3030 
3031  /*l
3032  *b Description:
3033  **
3034  ** This function transforms a point that is in world space into the
3035  ** local space of a character. Useful for figuring out if something
3036  ** was seen.
3037  **
3038  ** This code presumes up_axis is 'z' and that there is only rotation
3039  ** about that axis.
3040  **
3041  */
3042  int global_to_local(float x, float y, float z,
3043  float* res_x, float* res_y, float* res_z);
3044 
3045  /*l
3046  *b Description:
3047  **
3048  ** Retrieves the current estimated velocity of the character. Note
3049  ** this value may not be valid in environments where characters are
3050  ** transformed independent of DI-Guy function calls. Teleporting
3051  ** characters can also temporarily make this calculation incorrect.
3052  **
3053  *b Arguments:
3054  **
3055  *a vel_x, vel_y, vel_z - meters/sec
3056  **
3057  ** Pass NULL for any values that are not needed.
3058  **
3059  */
3060  void get_velocity(float* vel_x, float* vel_y, float* vel_z);
3061 
3064  void get_acceleration(float* accel_x, float* accel_y, float* accel_z);
3065 
3066  /*l
3067  *b Description:
3068  **
3069  ** Used by the Drift and Adaptive guide
3070  **
3071  *b Arguments:
3072  **
3073  *a vel_x, vel_y, vel_z - meters/sec
3074  */
3075  void set_desired_velocity(float vel_x, float vel_y, float vel_z, float ramp_time = 0.0);
3076  void get_desired_velocity(float *vel_x, float *vel_y, float *vel_z);
3077 
3078  /*l
3079  *b Description:
3080  **
3081  ** Retrieves the current estimated angular velocity of the character.
3082  ** As above, changes made to characters independent of DI-Guy
3083  ** function calls will temporarily make this value incorrect.
3084  **
3085  ** Currently only the angular velocity in yaw is measured.
3086  **
3087  *b Arguments:
3088  **
3089  *a vel_rz - degrees/sec
3090  **
3091  */
3092  void get_angular_velocity(float* vel_rz);
3093 
3094  /*l
3095  ** Used by the Drift and Adaptive guide -- see diguyCharacterGuide.
3096  **
3097  ** The guide attempts to rotate the character at the desired angular
3098  ** velocity.
3099  */
3100  void set_desired_angular_velocity(float vel_rz);
3101  void get_desired_angular_velocity(float* vel_rz);
3102 
3103 /*****************************************************************************/
3109  /*l
3110  *b Description:
3111  **
3112  ** Returns the base appearance of the character, as passed to
3113  ** the function diguyScenario::create_character(). This pointer will
3114  ** never be NULL.
3115  **
3116  ** Note that the current appearance (as returned by
3117  ** get_current_appearance()) may be different than the base
3118  ** appearance. This base appearance is the starting appearance
3119  ** of the character before any calls to set_current_appearance()
3120  ** have been made.
3121  **
3122  *b Returns:
3123  **
3124  ** name of base appearance of the character
3125  */
3126  const char* get_appearance();
3127 
3128  /*l
3129  *b Description:
3130  **
3131  ** This function sets the base appearance of the character.
3132  ** The base appearance is the appearance the character will take
3133  ** if the scenario is reset, undoing any appearance changes made
3134  ** by calls to set_current_appearance().
3135  **
3136  ** Calling this function also makes an implicit call to
3137  ** set_current_appearance().
3138  **
3139  *b Arguments:
3140  **
3141  *a appearance - name of new base appearance
3142  **
3143  *b Returns:
3144  **
3145  ** 0 on success, -1 on failure
3146  */
3147  int set_appearance(const char* appearance);
3148 
3149  /*l
3150  *b Description:
3151  **
3152  ** This function sets the current appearance of this character.
3153  **
3154  ** Note that different appearances may be based on different actors.
3155  ** Different actors represent people of different sizes, so
3156  ** changing to an appearance that has a different actor can
3157  ** cause a pronounced change in character size.
3158  **
3159  ** Also, changing actors can take some time, as more internal
3160  ** character state needs to be updated to support the new size
3161  ** of the character.
3162  **
3163  *b Arguments:
3164  **
3165  *a appearance - name of new desired appearance
3166  *a allow_actor_change - pass 1 to allow the appearance change
3167  *a even if the actor changes, 0 to not
3168  **
3169  *b See Also:
3170  **
3171  ** get_current_appearance(), set_current_head_appearance()
3172  **
3173  *b Returns:
3174  **
3175  ** 0 on success, -1 on failure
3176  **
3177  *b Available as Decision Bead/Event
3178  */
3179  int set_current_appearance(const char* appearance,
3180  int allow_actor_change = 1);
3181 
3183  const char* get_current_appearance();
3184 
3185  /*l
3186  *b Description:
3187  **
3188  ** This function can be used to see if the current appearance
3189  ** has the passed name. This is primarily useful for decisions
3190  ** and other limited logic applications.
3191  **
3192  *b Returns:
3193  **
3194  ** 1 if current appearance has passed name; 0 if not
3195  **
3196  *b Available as Decision Bead/Event
3197  */
3198  int get_current_appearance_is( const char* appearance );
3199 
3200  /*l
3201  *b Description:
3202  **
3203  ** This function sets the head appearance of this character.
3204  ** This will persist past reseting the scenario, see set_appearance()
3205  ** for conceptual similarities.
3206  **
3207  *b Arguments:
3208  **
3209  *a head_appearance - name of the new desired head appearance
3210  **
3211  *b Returns:
3212  **
3213  ** 0 on success, -1 on failure
3214  */
3215  int set_head_appearance(const char* head_appearance);
3216 
3217  /*l
3218  *b Description:
3219  **
3220  ** This function sets the current head appearance of this character.
3221  ** On failure head appearance will be set to "default". see set_head_appearance()
3222  ** for more details
3223  **
3224  *b Available as Decision Bead/Event
3225  */
3226  int set_current_head_appearance(const char* head_appearance);
3227 
3229  const char* get_current_head_appearance();
3230 
3232  int get_num_compatible_head_appearances();
3233 
3235  const char* get_compatible_head_appearance_at_index(int index);
3236 
3238  int get_num_compatible_facefx_head_appearances();
3239 
3241  const char* get_compatible_facefx_head_appearance_at_index(int index);
3242 
3243 
3244  /*l
3245  *b Description:
3246  **
3247  ** Similar to get_current_appearance_is(), but for head appearance.
3248  **
3249  *b Returns:
3250  **
3251  ** 1 if current head appearance has passed name; 0 if not
3252  **
3253  *b Available as Decision Bead/Event
3254  */
3255  int get_current_head_appearance_is(const char* head_appearance);
3256 
3257 
3258  /*b Description:
3259  **
3260  ** This function sets both the base and current hand item appearance
3261  ** of this character. The base hand item is the one it will have upon
3262  ** reset.
3263  **
3264  *b Arguments:
3265  **
3266  *a hand_item_appearance -- name of the desired hand item or "default"
3267  **
3268  *b Returns:
3269  **
3270  ** 0 on success, -1 on failure
3271  **
3272  *b Available as Decision Bead/Event
3273  */
3274  int set_hand_item( const char* hand_item_appearance );
3275 
3276  /*l
3277  *b Returns:
3278  **
3279  ** Hand item appearance; see set_hand_item()
3280  **
3281  ** Might return "default"
3282  */
3283  const char* get_hand_item();
3284 
3285  /*b Description:
3286  **
3287  ** This function sets the current hand item appearance of this character.
3288  ** The base hand item will remain unaffected.
3289  **
3290  *b Arguments:
3291  **
3292  *a hand_item_appearance -- name of the desired hand item or "default"
3293  **
3294  *b Returns:
3295  **
3296  ** 0 on success, -1 on failure
3297  **
3298  *b Available as Decision Bead/Event
3299  */
3300  int set_current_hand_item(const char* hand_item_appearance);
3301 
3302  /*l
3303  *b Returns:
3304  **
3305  ** Current hand item appearance. Will be the actual appearance
3306  ** displayed, not "default"
3307  */
3308  const char* get_current_hand_item();
3309 
3310  /*l
3311  *b Returns:
3312  **
3313  ** generic catagory of the hand item appearance.
3314  */
3315  const char* get_current_hand_item_type();
3316 
3318  const char* get_actor();
3319 
3322  int add_equipment_appearance( const char* equipment_appearance );
3323 
3325  int reset_equipment_appearance( const char* class_type );
3326 
3328  int reset_equipment_appearance();
3329 
3331  int get_num_equipment();
3332 
3334  const char* get_equipment_name_at_index( int index );
3335 
3337  const char* get_equipment_type_at_index( int index );
3338 
3340  int get_equipment_index_at_index( int index );
3341 
3343  int add_equipment_by_index( int index );
3344 
3345  /*l
3346  *b Description:
3347  **
3348  ** Turns on texture modulation system that tries to make all characters look
3349  ** unique. Only supported by some appearances. See diguyGraphicsShape Texture Variation API
3350  ** for fine grained control of this feature
3351  */
3352  int set_use_texture_variations(int value);
3353 
3354  /*l
3355  *b Returns:
3356  ** If texture variations have been enabled for this character. Note: only some
3357  ** appearances support this feature
3358  */
3359  int get_use_texture_variations();
3360 
3363  void set_texture_variation_seed(float seed);
3364 
3366  int get_supports_texture_variations();
3367 
3370  int get_supports_weight_variations();
3371 
3375  void set_weight_scale( float weight );
3376 
3378  float get_weight_scale();
3379 
3382  int set_blend_shape_weight(const char * name, float weight);
3383 
3387 
3388  bool set_unit_patch_by_name( const char* name, bool set_personal_patch = false );
3389  const char* get_unit_patch_name() const;
3390 
3391  bool set_personal_unit_patch_by_name( const char* name );
3392  const char* get_personal_unit_patch_name() const;
3393 
3395 
3400 
3401  bool set_unit_patch( const diguyPatchIdentifier& patch_id, bool set_personal_patch = false );
3402  const diguyPatchIdentifier& get_unit_patch() const;
3403 
3404  bool set_personal_unit_patch( const diguyPatchIdentifier& patch_id );
3405  const diguyPatchIdentifier& get_personal_unit_patch() const;
3406 
3408 
3412 
3413  bool set_rank_patch_by_name( const char* name );
3414  const char* get_rank_patch_name() const;
3415 
3417 
3421 
3422  bool set_rank_patch( const diguyPatchIdentifier& patch_id );
3423  const diguyPatchIdentifier& get_rank_patch() const;
3424 
3426 
3429 
3430  bool set_uniform_label_text( const char* name );
3431  const char* get_uniform_label_text() const;
3432 
3434 
3435  /*l
3436  *b Arguments:
3437  **
3438  *a appearance_type - a value indicating the type of supplementary appearance of concern,
3439  ** ie DIGUY_APPEARANCE_BODY, DIGUY_APPEARANCE_HEAD, DIGUY_APPEARANCE_EXPRESSIVE_HEAD,
3440  ** DIGUY_APPEARANCE_HAND_ITEM
3441  *b Returns:
3442  **
3443  ** The number of available supplementary appearances of given type
3444  */
3445  int get_num_appearances_of_type( diguyCharacterAppearanceTypes appearance_type );
3446 
3447  /*l
3448  *b Returns:
3449  **
3450  ** The name of the supplementary appearance (body, head, expressive head, hand item) or NULL
3451  **
3452  *b Arguments:
3453  **
3454  *a appearance_type - a value indicating the type of appearance of concern
3455  *a index - a value indicating the type of supplementary appearance of concern
3456  **
3457  */
3458  const char* get_appearance_name_at_index(diguyCharacterAppearanceTypes appearance_type, int index);
3459 
3460  /*****************************************************************************/
3483  /*l
3484  *b Description:
3485  **
3486  ** Sets the graphics level of detail (LOD) ranges for this character.
3487  ** Compare with diguyScenario::set_default_lod_ranges(), which sets
3488  ** the LOD ranges for newly created characters of a particular type.
3489  ** In both cases, ranges must be a static array of 8 floats,
3490  ** each larger than the one before.
3491  **
3492  ** This function sets graphics LOD ranges only. Motion levels of
3493  ** detail can be set by calling set_motion_lod().
3494  **
3495  *b Arguments:
3496  **
3497  *a lod_ranges - new lod ranges for this character;
3498  **
3499  ** See diguyScenario::set_default_lod_ranges() for a description
3500  ** of what to pass in lod_ranges.
3501  **
3502  *b Returns:
3503  **
3504  ** 0 on success, -1 on failure
3505  **
3506  *b Callable From:
3507  **
3508  *- - C++
3509  */
3510  int set_lod_ranges(float* lod_ranges);
3511 
3512 #ifdef CPLUSPLUS_ONLY
3513  float* get_lod_ranges();
3515 
3516 #endif
3517 
3519  int get_num_lods();
3520 
3521  /*l
3522  *b Description:
3523  **
3524  ** Set the desired graphics level of detail (LOD) for this character.
3525  ** This may be overridden if this character uses automatic LOD
3526  ** switching. See diguyScenario::set_automatic_graphics_lod_switching().
3527  **
3528  ** DI-Guy graphics LODs are numbered 1 (most detail) through 7 (least detail).
3529  **
3530  *b Arguments:
3531  **
3532  *a lod - an float between 1 and 7... fractional part represent percentage through the lod
3533  **
3534  *b Returns:
3535  **
3536  ** 0 on success, -1 on failure
3537  */
3538  int set_graphics_lod(float lod);
3539 
3541  int get_graphics_lod();
3542 
3544  float get_graphics_lod_fraction();
3545 
3548  int set_allow_instancing(int value);
3549 
3551  int get_allow_instancing() const;
3552 
3553  // informs the internals that this character wasn't instanced, can cause an update if set_is_culled(false) is called
3554  void set_is_instanced( int val );
3555 
3558  int get_is_instanced() const;
3559 
3561  int can_lod_be_instanced( int lod );
3562 
3563  /*l
3564  *b Description:
3565  **
3566  ** For scene graph renderers it can be necessary to patch the texture buffer object after
3567  ** the scene graph finishes updating various post processes (ground clamping for instance),
3568  ** or modifying the TBO with a local space camera.
3569  **
3570  ** This function allows the end user to pre-multiply the matrix in the TBO for each shape
3571  ** the character has. It requires diguyScenario::set_use_user_position_matrices() is called
3572  ** so that DI-Guy knows to keep track of TBO shape index data.
3573  */
3574  int set_final_tbo_position_matrix(int include_local_to_global_transform,
3575  float a0, float a1, float a2, float a3,
3576  float b0, float b1, float b2, float b3,
3577  float c0, float c1, float c2, float c3);
3578 
3579  /*l
3580  *b Description:
3581  **
3582  ** Set the desired shader level of detail (LOD) for this character.
3583  ** By default this is -1 and the shader is automatically picked by distance.
3584  **
3585  ** DI-Guy shaders LODs are numbered 1 (most quality) through the number of shaders in the
3586  ** current technique.
3587  **
3588  *b Arguments:
3589  **
3590  *a lod - an integer between 1 and the number of shaders in the current technique
3591  **
3592  *b Returns:
3593  **
3594  ** 0 on success, -1 on failure
3595  */
3596  int set_shader_lod(int lod);
3597 
3599  int get_shader_lod();
3600 
3603  int get_has_bump_maps();
3604 
3605  /*l
3606  *b Description:
3607  **
3608  *b Note: As of DI-Guy 12.5 we strongly recommend using the
3609  ** multi-threaded pipeline for increasing performance.
3610  **
3611  ** Sets the motion level of detail (LOD) for this character.
3612  ** LOD 1 animates all joints of a character. Higher LODs
3613  ** animate fewer joints.
3614  **
3615  ** For LOD 6, *nothing* in the pose is updated. The character's
3616  ** pose will remain whatever it was the last time pose data
3617  ** was changed.
3618  **
3619  *a LOD - Effect
3620  *a 1 - animate all joints
3621  *a 2 - stop animating wrists and ankles
3622  *a 3 - stop animating elbows and knees
3623  *a 4 - stop animating everything but pelvis and position
3624  *a 5 - stop animating everything but position
3625  *a 6 - stop animating everything but position
3626  **
3627  ** Note that characters that are load managed
3628  ** (get_is_load_managed() returns 1) have this parameter managed
3629  ** automatically. The corresponding function for load managed
3630  ** characters is diguyLoadManager::set_zone_motion_lod().
3631  **
3632  *b Arguments:
3633  **
3634  *a motion_lod - an integer between 1 and 6
3635  **
3636  *b Returns:
3637  **
3638  ** 0 on success, -1 on failure
3639  */
3640  int set_motion_lod(int motion_lod);
3641 
3643  int get_motion_lod();
3644 
3646  int get_current_motion_lod();
3647 
3648  /*l
3649  *b Description:
3650  **
3651  *b Note: As of DI-Guy 12.5 we strongly recommend using the
3652  ** multi-threaded pipeline for increasing performance.
3653  **
3654  ** This function sets the minimum CPL (character performance
3655  ** level) of the character.
3656  **
3657  ** A higher CPL will limit the types of operations that the character
3658  ** can perform, but will allow for more optimized update() calls.
3659  **
3660  ** The following CPL limitations are cumulative:
3661  **
3662  *- - CPL 1: all character function calls are available
3663  *- - CPL 2: the character cannot save history
3664  *- - CPL 3: no advanced pose operations that alter the basic pose
3665  *- of the character, including:
3666  *>
3667  *- - gazing
3668  *- - pointing
3669  *- - aiming
3670  *- - gestures
3671  *- - head nodding and shaking
3672  *- - pose overrides
3673  *- - features relying on link matrices
3674  *- - wheel rolling and turning on vehicles
3675  **
3676  ** Since link matrices are not computed, the DI-Guy Graphics API
3677  ** function diguyGraphicsLink::get_transformation_matrix() will
3678  ** not return valid results.
3679  *<
3680  *- - CPL 4: no blends between motions
3681  *- - CPL 5: (not currently implemented)
3682  **
3683  ** Note that characters that are load managed (get_is_load_managed()
3684  ** returns 1) have this parameter managed automatically. The
3685  ** corresponding function for load managed characters is
3686  ** diguyLoadManager::set_zone_minimum_cpl().
3687  **
3688  ** The passed minimum_cpl may not be achievable if the character
3689  ** is already in the process of doing something not allowed by the
3690  ** new CPL. For example, if the character is already gazing, trying
3691  ** to set the minimum CPL to 3 will fail, as CPL 3 would disable
3692  ** gazing. In this case the minimum CPL will be set to the current
3693  ** highest possible CPL based on what the character is already doing.
3694  ** In this example the minimum CPL would be set to 2, as gazing is
3695  ** allowed at that CPL.
3696  **
3697  ** Conversely, if the minimum CPL has been successfully been set to
3698  ** 3 or higher, any gaze calls such as diguyCharacter::gaze_at_point()
3699  ** will fail.
3700  **
3701  *b Arguments:
3702  **
3703  *a cpl - minimum CPL allowed for this character
3704  **
3705  *b Returns:
3706  **
3707  ** 0 on success, -1 on failure
3708  */
3709  int set_minimum_cpl(int minimum_cpl);
3710 
3712  int get_minimum_cpl();
3713 
3714  /*l
3715  *b Description:
3716  **
3717  ** This function returns that maximum possible CPL the character
3718  ** can attain based on what it is currently doing. Advanced pose
3719  ** operations like gazing and pose overrides will limit the maximum
3720  ** CPL that can be achieved.
3721  **
3722  ** See diguyCharacter::set_minimum_cpl() for a description of
3723  ** what is possible under the different CPL levels.
3724  **
3725  *b Returns:
3726  **
3727  ** maximum possible current CPL
3728  */
3729  int get_maximum_possible_current_cpl();
3730 
3731  /*l
3732  *b Description:
3733  **
3734  ** This function puts the character into the maximum possible CPL
3735  ** that can be achieved based on what the character is currently
3736  ** doing.
3737  **
3738  ** This current CPL does not prevent the character from starting
3739  ** operations that will potentially lower the CPL. e.g., if the
3740  ** character starts gazing, the CPL will potentially go down.
3741  ** Use set_minimum_cpl() to prevent that character from starting
3742  ** such operations.
3743  **
3744  ** See diguyCharacter::set_minimum_cpl() for a description of
3745  ** what is possible under the different CPL levels.
3746  **
3747  *b Returns:
3748  **
3749  ** 0 on success, -1 on failure
3750  */
3751  int maximize_current_cpl();
3752 
3753  /*l
3754  *b Description:
3755  **
3756  ** This function sets a flag that determines whether the character
3757  ** should raise and lower its CPL automatically. If automatic
3758  ** CPL switching is enabled then any time a potential CPL-changing
3759  ** operation is performed, the character will check the maximum
3760  ** possible current CPL (as per a call to maximize_current_cpl())
3761  ** and set its current CPL to the maximum possible.
3762  **
3763  *b Arguments:
3764  **
3765  *a enabled - pass 1 to enable automatic CPL switching, 0 to
3766  *a disable it
3767  **
3768  *b Returns:
3769  **
3770  ** 0 on success, -1 on failure
3771  */
3772  int set_automatic_cpl_switching_enabled(int enabled);
3773 
3775  int get_automatic_cpl_switching_enabled();
3776 
3777  /*l
3778  *b Description:
3779  **
3780  ** This function sets the current CPL of the character. Trying
3781  ** to set the CPL lower than the minimum (as set by
3782  ** set_minimum_cpl()) of higher than the maximum (as returned by
3783  ** get_maximum_possible_current_cpl()) will fail.
3784  **
3785  ** Note that characters that have automatic CPL switching enabled
3786  ** (get_automatic_cpl_switching_enabled() returns 1) will override
3787  ** this value.
3788  **
3789  ** See diguyCharacter::set_minimum_cpl() for a description of
3790  ** what is possible under the different CPL levels.
3791  **
3792  *b Arguments:
3793  **
3794  *a cpl - new current CPL
3795  **
3796  *b Returns:
3797  **
3798  ** 0 on success, -1 on failure
3799  */
3800  int set_current_cpl(int current_cpl);
3801 
3803  int get_current_cpl();
3804 
3805  /*l
3806  *b Description:
3807  **
3808  ** This function sets the position update rate of the character. If
3809  ** the character's position is not updated on a particular update
3810  ** tick, its position will not change for that tick. This can
3811  ** result is a modest performance increase.
3812  **
3813  ** The default value for new characters is 100.
3814  **
3815  ** This value may be overridden by the minimum full update period, as
3816  ** set by set_minimum_full_update_period().
3817  **
3818  ** Note that if the character's pose is updated, (see
3819  ** diguyCharacter::set_pose_update_rate()) its position will be
3820  ** updated as well.
3821  **
3822  ** Note that characters that are load managed
3823  ** (get_is_load_managed() returns 1) have this parameter managed
3824  ** automatically. The corresponding function for load managed
3825  ** characters is diguyLoadManager::set_zone_position_update_rate().
3826  **
3827  *b Arguments:
3828  **
3829  *a update_rate - percentage of scenario ticks for which
3830  *a position should update; can be between
3831  *a 1 and 100
3832  **
3833  ** Passing 100 means position will update every tick.
3834  ** Passing 50 means position will update every other tick.
3835  **
3836  *b Returns:
3837  **
3838  ** 0 on success, -1 on failure
3839  */
3840  int set_position_update_rate(int update_rate);
3841 
3843  int get_position_update_rate();
3844 
3845  /*l
3846  *b Description:
3847  **
3848  ** This function is very similar to set_position_update_rate(), but
3849  ** sets the percentage of ticks for which the character's pose is
3850  ** updated.
3851  **
3852  ** The default value for new characters is 100.
3853  **
3854  ** This value may be overridden by the minimum full update period,
3855  ** as set by set_minimum_full_update_period().
3856  **
3857  ** Note that if the character's pose is updated, its position will
3858  ** be updated as well.
3859  **
3860  ** Note that characters that are load managed (get_is_load_managed()
3861  ** returns 1) have this parameter managed automatically. The
3862  ** corresponding function for load managed characters is
3863  ** diguyLoadManager::set_zone_pose_update_rate().
3864  **
3865  *b Arguments:
3866  **
3867  *a update_rate - percentage of scenario ticks for which
3868  *a pose should update; can be between
3869  *a 1 and 100
3870  **
3871  ** Passing 100 means pose will update every tick.
3872  ** Passing 50 means pose will update every other tick.
3873  **
3874  *b Returns:
3875  **
3876  ** 0 on success, -1 on failure
3877  */
3878  int set_pose_update_rate(int update_rate);
3879 
3881  int get_pose_update_rate();
3882 
3883  /*l
3884  *b Description:
3885  **
3886  ** This function sets the minimum period for position or pose
3887  ** updates. If the passed amount of time passes with no position or
3888  ** pose update (see set_position_update_rate() and
3889  ** set_pose_update_rate()), the character's position and potentially
3890  ** pose will be updated.
3891  **
3892  ** Note that characters that are load managed (get_is_load_managed()
3893  ** returns 1) have this parameter managed automatically. The
3894  ** corresponding function for load managed characters is
3895  ** diguyLoadManager::set_minimum_full_update_period().
3896  **
3897  ** The default for new characters is 1.0 seconds.
3898  **
3899  *b Arguments:
3900  **
3901  *a min_period - in seconds
3902  **
3903  *b Returns:
3904  **
3905  ** 0 on success, -1 on failure
3906  */
3907  int set_minimum_full_update_period(float min_period);
3908 
3910  float get_minimum_full_update_period();
3911 
3912  /*l
3913  *b Description:
3914  **
3915  ** This function disables position accumulation due to played
3916  ** actions. The character will stay in whatever position has most
3917  ** recently been set by set_position(), regardless of action.
3918  ** Because of this the character will, for example, walk in place.
3919  ** It is up to the user application to correctly set and update the
3920  ** character's position.
3921  **
3922  ** This function can be used when a host application provides
3923  ** absolute control over character positions.
3924  **
3925  ** Disabling position accumulation will result in a modest
3926  ** performance increase.
3927  **
3928  *b Arguments:
3929  **
3930  *a disabled_flag - pass 1 to disable position accumulation, 0
3931  *a to enable it
3932  **
3933  *b Returns:
3934  **
3935  ** 0 on success, -1 on failure
3936  */
3937  int set_position_accumulation_disabled(int disabled_flag);
3938 
3940  int get_position_accumulation_disabled();
3941 
3942  /*l
3943  *b Description:
3944  **
3945  ** This function disables all blends between motions of the
3946  ** character. This will speed up performance at the expense of
3947  ** visual quality of the motions. If the character is far from the
3948  ** current camera position, however, the lack of blends may be
3949  ** visually acceptable.
3950  **
3951  ** Note that characters that are load managed (get_is_load_managed()
3952  ** returns 1) have this parameter managed automatically.
3953  **
3954  *b Arguments:
3955  **
3956  *a disabled_flag - pass 1 to disable all blends, 0
3957  *a to enable them
3958  **
3959  *b Returns:
3960  **
3961  ** 0 on success, -1 on failure
3962  */
3963  int set_all_blends_disabled(int disabled_flag);
3964 
3966  int get_all_blends_disabled();
3967 
3968 
3969  /*l
3970  *b Description:
3971  **
3972  *b Note: This function is not recommended. There is minimal perf gain.
3973  ** This function disables all shape callbacks. Shape callbacks are
3974  ** used internally for updating some advanced visual effects.
3975  **
3976  ** Shape callbacks currently control:
3977  **
3978  *- - expressive faces
3979  *- - particle systems
3980  **
3981  ** Disabling shape callbacks will make these visual effects work
3982  ** incorrectly but will result in a performance increase for
3983  ** characters that do not use them.
3984  **
3985  ** Note that characters that are load managed (get_is_load_managed()
3986  ** returns 1) have this parameter managed automatically.
3987  **
3988  *b Arguments:
3989  **
3990  *a disabled_flag - pass 1 to disable shape callbacks, 0
3991  *a to enable them
3992  **
3993  *b Returns:
3994  **
3995  ** 0 on success, -1 on failure
3996  */
3997  int set_shape_callbacks_disabled(int disabled_flag);
3998 
4000  int get_shape_callbacks_disabled();
4001 
4002  /*l
4003  *b Description:
4004  **
4005  *b Note: This function is not recommend. There is minimal perf gain.
4006  ** This function disables all calls to the virtual diguyGraphicsShape::update()
4007  ** function.
4008  **
4009  ** Note that characters that are load managed (get_is_load_managed()
4010  ** returns 1) have this parameter managed automatically.
4011  **
4012  *b Arguments:
4013  **
4014  *a disabled_flag - pass 1 to disable update calls, 0
4015  *a to enable them
4016  **
4017  *b Returns:
4018  **
4019  ** 0 on success, -1 on failure
4020  */
4021  int set_graphics_api_shape_update_disabled(int disabled_flag);
4022 
4024  int get_graphics_api_shape_update_disabled();
4025 
4026  /*l
4027  *b Description:
4028  **
4029  ** This function is a stripped-down version of the normal update()
4030  ** function. This function is for high performance applications that
4031  ** are willing to sacrifice advanced character functionality in
4032  ** exchange for faster performance.
4033  **
4034  ** Characters using optimized_update() must not do any of the
4035  ** following:
4036  **
4037  *- - change character types (e.g., set_character_type())
4038  *- - play sounds (e.g., play_sound())
4039  *- - use history (e.g., set_history_type())
4040  *- - use paths (e.g., push_path())
4041  *- - weapon firing (e.g., fire_weapon())
4042  *- - advanced pose operations (as per CPL 3)
4043  *- - be a DI-Guy Network Module character
4044  *- - need to use character callbacks
4045  *- - use advanced visual effects, such as expressive faces and particle systems
4046  **
4047  ** Like update(), the scenario must not call the character's update()
4048  ** function (return value of get_t_controlled_by_scenario_t() is 0)
4049  ** for this function to work properly.
4050  **
4051  ** In some cases the regular update() call can be used for a time in
4052  ** place of optimized_update() if one of the above operations is
4053  ** desired.
4054  **
4055  *b Arguments:
4056  **
4057  *a t - new time for the character
4058  **
4059  *b Returns:
4060  **
4061  ** 0 on success, -1 on failure
4062  */
4063  int optimized_update(float t);
4064 
4065  /*l
4066  *b Description:
4067  **
4068  ** This function sets whether many of the performance tuning
4069  ** functions above are automatically managed by a diguyLoadManager
4070  ** object, which can be obtained by calling
4071  ** diguyApp::create_load_manager().
4072  **
4073  ** Note that this function will have no effect if the load manager has
4074  ** not been enabled.
4075  **
4076  ** The default for new characters is to be load managed if the load
4077  ** manager has been enabled.
4078  **
4079  *b Arguments:
4080  **
4081  *a is_load_managed - pass 1 to have character automatically
4082  *a load managed, 0 for manual management
4083  **
4084  *b Returns:
4085  **
4086  ** 0 on success, -1 on failure
4087  */
4088  int set_is_load_managed(int is_load_managed);
4089 
4091  int get_is_load_managed();
4092 
4095  void get_load_manager_current_update_rates(float & zone, int & pose_update_rate,
4096  int & position_update_rate, int & alt_update_rate);
4097 
4098 /*****************************************************************************/
4104  /*l
4105  *b Description:
4106  **
4107  ** This is an enumeration of the different callbacks that can be
4108  ** registered with add_callback() and add_callback_script().
4109  **
4110  ** Callbacks return a value of type diguyCallbackReturn, which will
4111  ** be DIGUY_CALLBACK_STOP or DIGUY_CALLBACK_CONTINUE. If the
4112  ** callback returns DIGUY_CALLBACK_STOP, in some cases the default
4113  ** handler of the function will not be called; the callback is
4114  ** asserting that it has done everything necessary for the function
4115  ** call. If the callback returns DIGUY_CALLBACK_CONTINUE, the default
4116  ** handler for the function will be called after the callback.
4117  **
4118  *b Usable From:
4119  **
4120  *- - C++
4121  *- - Script
4122  **
4123  *************************************************************************
4124  *4 Callback Enums:
4125  **
4126  *i CALLBACK_ID_CREATE
4127  **
4128  ** This callback will be called when a new character is created,
4129  ** *after* the character is fully initialized.
4130  **
4131  ** Note that this callback can only be added by calling
4132  ** diguyScenario::add_default_character_callback(); adding it with
4133  ** diguyCharacter::add_callback() will have no effect, as by that
4134  ** time the character has already been created.
4135  **
4136  *i CALLBACK_ID_DESTROY
4137  **
4138  ** This callback will be called when a character is
4139  ** destroyed.
4140  **
4141  *i CALLBACK_ID_PRE_CREATE
4142  **
4143  ** Like CALLBACK_ID_CREATE, this callback will be called when a
4144  ** new character is created; however, it is called *before* the
4145  ** character is fully initialized.
4146  **
4147  *b NOTE: Care must be taken when using this callback!
4148  ** As mentioned above, the character is not fully initialized,
4149  ** meaning that most member functions of the diguyCharacter object
4150  ** should not be called. Those member functions that are safe
4151  ** to call will be mentioned in the documentation for the function;
4152  ** e.g., set_graphics_api_node_ptr().
4153  **
4154  ** Note that this callback can only be added by calling
4155  ** diguyScenario::add_default_character_callback(); adding it
4156  ** with diguyCharacter::add_callback() will have no effect, as
4157  ** by that time the character has already been created.
4158  **
4159  *i CALLBACK_ID_CURRENT_APPEARANCE_CHANGED
4160  **
4161  ** This callback will be called when a character's current
4162  ** appearance is changed.
4163  **
4164  *i CALLBACK_ID_CURRENT_HEAD_APPEARANCE_CHANGED
4165  **
4166  ** This callback will be called when a character's current head
4167  ** appearance is changed.
4168  **
4169  *i CALLBACK_ID_PRE_UPDATE
4170  **
4171  ** This callback will be called before the character is updated as
4172  ** a result of the diguyScenario::update() function.
4173  **
4174  *i CALLBACK_ID_POST_UPDATE
4175  **
4176  ** This callback will be called after the character is updated as a
4177  ** result of the diguyScenario::update() function.
4178  **
4179  *i CALLBACK_ID_DONE_SPEAKING
4180  **
4181  ** This callback will be called when the character has finished
4182  ** speaking the contents of a speak() function call.
4183  **
4184  *i CALLBACK_ID_GAZE_STATUS
4185  **
4186  ** This callback will be called after the character's gaze has
4187  ** experienced a status change.
4188  **
4189  *i CALLBACK_ID_LPOINT_STATUS
4190  **
4191  ** This callback will be called after the character's lpoint (left
4192  ** arm pointing) has experienced a status change.
4193  **
4194  *i CALLBACK_ID_SHOW
4195  **
4196  ** This callback will be called when the character is being shown
4197  ** for any reason.
4198  **
4199  *i CALLBACK_ID_HIDE
4200  **
4201  ** This callback will be called when the character is being hidden
4202  ** for any reason.
4203  **
4204  *i CALLBACK_ID_PRE_DIE
4205  **
4206  ** This callback will be called when the character has been told to
4207  ** die, before a die action has been selected and initiated.
4208  **
4209  ** If the returned diguyCallbackReturn value is
4210  ** DIGUY_CALLBACK_STOP, the character will not die.
4211  **
4212  *i CALLBACK_ID_POST_DIE
4213  **
4214  ** This callback will be called when the character has been told to
4215  ** die, after a die action has been selected and initiated.
4216  **
4217  *i CALLBACK_ID_PRE_FIRE_WEAPON
4218  **
4219  ** This callback will be called when the character has been told to
4220  ** fire its weapon, before a final decision has been made to fire.
4221  **
4222  ** If the returned diguyCallbackReturn value is
4223  ** DIGUY_CALLBACK_STOP, the character will not fire.
4224  **
4225  *i CALLBACK_ID_IMPACT
4226  **
4227  ** This callback will be called when the character has been hit.
4228  ** diguyCharacter::get_last_impact_record() contains a pointer to
4229  ** the impact information. If a character has this callback the
4230  ** standard behavior (killing the character) is skipped and the
4231  ** system assumes the end user has handled the impact.
4232  **
4233  ** Similar behavior results if
4234  ** diguyCrowd::CALLBACK_ID_CROWD_MEMBER_IMPACT is registered.
4235  **
4236  *i CALLBACK_ID_POST_FIRE_WEAPON
4237  **
4238  ** This callback will be called when the character has been told to
4239  ** fire its weapon, after a final decision has been made to fire.
4240  **
4241  *i CALLBACK_ID_CURRENT_ARC_CHANGED
4242  **
4243  ** This callback will be called whenever the character's current
4244  ** motion arc changes, typically after a call to set_desired_action()
4245  ** or force_action(), or when transitioning to the next motion arc.
4246  **
4247  *i CALLBACK_ID_CURRENT_ACTION_CHANGED
4248  **
4249  ** This callback will be called whenever the character's current
4250  ** action changes, typically after a call to set_desired_action()
4251  ** or force_action().
4252  **
4253  *i CALLBACK_ID_DESIRED_ACTION_CHANGED
4254  **
4255  ** This callback will be called whenever the character's desired
4256  ** action changes, typically after a call to set_desired_action().
4257  **
4258  *i CALLBACK_ID_DESIRED_ACTION_REACHED
4259  **
4260  ** This callback will be called when the character reaches its
4261  ** desired action as set by a call to set_desired_action().
4262  **
4263  *i CALLBACK_ID_MANUALLY_INVOKED
4264  **
4265  ** This callback id will be supplied to event handlers invoked by a
4266  ** call to manually_invoke_event_handler().
4267  **
4268  *i CALLBACK_ID_USER_SELECTED
4269  **
4270  ** This callback will be called when the character is selected in DI-Guy Scenario.
4271  **
4272  *i CALLBACK_ID_USER_UNSELECTED
4273  **
4274  ** This callback will be called on a currently selected character when a different
4275  ** character is selected in DI-Guy Scenario.
4276  **
4277  *i CALLBACK_ID_IGUY_INTERACT
4278  **
4279  ** This callback will be called when the character has been clicked
4280  ** on while DI-Guy Scenario is in I-Guy Input Mode. Note that this
4281  ** is called on the character clicked, not the I-Guy character.
4282  **
4283  *i CALLBACK_ID_IGUY_INTERACT_WITH_SUBJECT
4284  **
4285  ** This callback will be called when the character, as the I-Guy
4286  ** character, has clicked another character in I-Guy Input Mode.
4287  ** Note that this is called for the I-Guy character, not the
4288  ** clicked character.
4289  **
4290  *i CALLBACK_ID_GUIDE_POSITION_ACQUIRED
4291  **
4292  ** This callback will be called when the character has reached its
4293  ** desired position as set by set_desired_position(). The
4294  ** diguyCharacterGuide is responsible for moving the character towards
4295  ** this position.
4296  **
4297  *i CALLBACK_ID_GUIDE_POSITION_UNACQUIRED
4298  **
4299  ** This callback will be called if the character moves too far away
4300  ** from its desired position after it has been previously reached.
4301  **
4302  *i CALLBACK_ID_GUIDE_ORIENTATION_ACQUIRED
4303  **
4304  ** This callback will be called when the character has reached its
4305  ** desired orientation as set by set_desired_orientation(). The
4306  ** diguyCharacterGuide is responsible for moving the character towards
4307  ** this orientation.
4308  **
4309  *i CALLBACK_ID_GUIDE_ORIENTATION_UNACQUIRED
4310  **
4311  ** This callback will be called if the character turns too far away
4312  ** from its desired orientation after it has been previously
4313  ** reached.
4314  **
4315  *i CALLBACK_ID_GUIDE_ALTITUDE_ACQUIRED
4316  **
4317  ** This callback will be called when the character has reached its
4318  ** desired altitude as set by set_desired_orientation() or other functions.
4319  ** The callback is most meaningful for vehicles that need to achieve
4320  ** some sort "cruising altitude" while moving to a destination.
4321  **
4322  *i CALLBACK_ID_GUIDE_ALTITUDE_UNACQUIRED
4323  **
4324  ** This callback will be called if the character turns too far away
4325  ** from its desired orientation after it has been previously
4326  ** reached.
4327  **
4328  *i CALLBACK_ID_GUIDE_TARGET_LOST
4329  **
4330  ** This callback will be called when the character guide has determined
4331  ** that the character can't reach its desired position/orientation. An
4332  ** example would be a missile that has flown past its target
4333  **
4334  *i CALLBACK_ID_CURRENT_TOUT_REACHED
4335  **
4336  ** This callback will be called when scenario time reaches this
4337  ** character's tout time as set by set_current_tout().
4338  **
4339  *i CALLBACK_ID_POST_CREATE_GEOMETRY
4340  **
4341  ** This callback will be called just after the character's geometry
4342  ** has been created.
4343  **
4344  *i CALLBACK_ID_PRE_DESTROY_GEOMETRY
4345  **
4346  ** This callback will be called just before the character's
4347  ** geometry is broken down and destroyed.
4348  **
4349  *i CALLBACK_ID_END_OF_PATH_REACHED
4350  **
4351  ** This callback will be called when a character reaches the end of
4352  ** their current path. Note the path must finish, forcing to other
4353  ** paths will not trigger this callback.
4354  **
4355  **
4356  *************************************************************************
4357  *4 DI-Guy Scenario UI Callback enums:
4358  **
4359  *i CALLBACK_ID_UI_PRE_TRANSLATION
4360  **
4361  ** This callback will be called when the user interface starts
4362  ** moving a character.
4363  **
4364  *i CALLBACK_ID_UI_POST_TRANSLATION
4365  **
4366  ** This callback will be called when the user interface finishes
4367  ** moving a character.
4368  **
4369  *i CALLBACK_ID_UI_MOUSE_DOWN
4370  **
4371  ** This callback will be called when the user interface gets a
4372  ** mouse click in the DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT input
4373  ** mode.
4374  **
4375  *i CALLBACK_ID_UI_MOUSE_UP
4376  **
4377  ** This callback will be called when the user interface gets a
4378  ** mouse release in the DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT
4379  ** input mode.
4380  **
4381  *************************************************************************
4382  *4 DI-Guy AI Agent Callback enums:
4383  **
4384  *i CALLBACK_ID_AGENT_NEW_BEHAVIOR
4385  **
4386  ** This callback will be called when an agent changes its current
4387  ** behavior.
4388  **
4389  *i CALLBACK_ID_AGENT_NEW_FOCUS_CHARACTER
4390  **
4391  ** This callback will be called when an agent changes its current
4392  ** focus character; this happens most frequently when it is focused
4393  ** on a group.
4394  **
4395  *i CALLBACK_ID_AGENT_ATTACK_OUT_OF_TARGETS
4396  **
4397  ** This callback will be called when an agent in attack behavior
4398  ** evaluates the group it's focused on and cannot find an
4399  ** appropriate target. This can happen if all group members are
4400  ** dead.
4401  **
4402  *i CALLBACK_ID_AGENT_ATTACK_NO_VISIBLE_TARGETS
4403  **
4404  ** This callback will be called when an agent in attack behavior
4405  ** can't see any potential members of the group it's focused on.
4406  **
4407  *i CALLBACK_ID_AGENT_PURSUE_TARGET_REACHED
4408  **
4409  ** This callback will be called when an agent in pursue behavior
4410  ** has come within the pursuit distance of its pursuit target.
4411  **
4412  *i CALLBACK_ID_AGENT_PURSUE_TARGET_LOST
4413  **
4414  ** This callback will be called when an agent in pursue behavior
4415  ** is no longer within the pursuit distance of its pursuit target.
4416  **
4417  *i CALLBACK_ID_AGENT_MINGLE_TARGET_REACHED
4418  **
4419  ** This callback will be called when an agent in mingle behavior
4420  ** has reached its mingle target.
4421  **
4422  *i CALLBACK_ID_AGENT_MINGLE_TARGET_LOST
4423  **
4424  ** This callback will be called when an agent in mingle behavior
4425  ** is no longer is range of its mingle target.
4426  **
4427  *i CALLBACK_ID_AGENT_WANDER_TARGET_REACHED
4428  **
4429  ** This callback will be called when an agent in wander behavior
4430  ** has reached its wander target.
4431  **
4432  *i CALLBACK_ID_AGENT_WANDER_TARGET_LOST
4433  **
4434  ** This callback will be called when an agent in wander behavior
4435  ** is no longer is range of its wander target.
4436  **
4437  *i CALLBACK_ID_AGENT_FLEE_AREA_LEFT
4438  **
4439  ** This callback will be called when an agent in flee behavior has
4440  ** successfully moved out range of all fled characters or
4441  ** locations. This will only be called when the agent is
4442  ** transitioning from inside the flee area to outside of it.
4443  **
4444  *i CALLBACK_ID_AGENT_FLEE_AREA_ENTERED
4445  **
4446  ** This callback will be called when an agent in flee behavior has
4447  ** moved inside of the range of any fled characters or locations.
4448  ** This will only be called when the agent is transitioning from
4449  ** outside the flee area to inside of it.
4450  **
4451  *i CALLBACK_ID_AGENT_TRAVEL_WAYPOINT_REACHED
4452  **
4453  ** This callback will be called when an agent in travel behavior
4454  ** has reached in intermediate waypoint and is about to move
4455  ** on to the next.
4456  **
4457  *i CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED
4458  **
4459  ** This callback will be called when an agent in travel behavior
4460  ** has reached the end of its travel path when moving forward
4461  ** along the path.
4462  **
4463  *i CALLBACK_ID_AGENT_TRAVEL_BACKWARD_DEST_REACHED
4464  **
4465  ** This callback will be called when an agent in travel behavior
4466  ** has reached the beginning of its travel path when moving
4467  ** backward along the path.
4468  **
4469  *i CALLBACK_ID_AGENT_TRAVEL_NEAR_FORWARD_DEST
4470  **
4471  ** This callback will be called when an agent gets within a specified
4472  ** distance of the end of the travel path
4473  **
4474  *i CALLBACK_ID_AGENT_CROWD_MEMBER_KILLED
4475  **
4476  ** This callback will be called when fellow member of the crowd is
4477  ** killed.
4478  **
4479  *- - This is the character version of
4480  *- diguyCrowd::CALLBACK_ID_CROWD_MEMBER_KILLED
4481  *- - The crowd's callback character is the crowd member that was
4482  *- killed.
4483  *- - The crowd's callback impact contains the impact information.
4484  **
4485  *i CALLBACK_ID_AGENT_CROWD_MEMBER_IMPACT
4486  **
4487  ** This callback will be called when a fellow member of the crowd
4488  ** is hit by a detonation. This callback does not replace
4489  ** diguyCharacter::CALLBACK_ID_IMPACT, which still needs to be
4490  ** handled to implement damage models.
4491  **
4492  *- - The crowd's callback character is the crowd member that was
4493  *- hit.
4494  *- - The crowd's callback impact contains the impact information.
4495  **
4496  *i CALLBACK_ID_AGENT_NEARBY_SCENE_OBJECT_IMPACT
4497  **
4498  ** This callback will be called when a detonation occurs within the
4499  ** awareness radius (as set by set_awareness_radius()) of the
4500  ** crowd's current bounds.
4501  **
4502  *- - This is the character version of
4503  *- diguyCrowd::CALLBACK_ID_NEARBY_SCENE_OBJECT_IMPACT
4504  *- - The crowd's callback character is the character that caused
4505  *- the detonation.
4506  *- - The crowd's callback impact contains the impact information.
4507  **
4508  *i CALLBACK_ID_AGENT_NEARBY_WEAPON_FIRED
4509  **
4510  ** This callback will be called when a weapon is fired within the
4511  ** awareness radius (as set by set_awareness_radius()) of the
4512  ** crowd's current bounds.
4513  **
4514  *- - The crowd's callback character is the character that fired the
4515  *- weapon.
4516  **
4517  *i CALLBACK_ID_AGENT_VEHICLE_COLLISION
4518  **
4519  ** This callback will be called on a vehicle agent when it hits a
4520  ** member of a companion crowd.
4521  **
4522  *i CALLBACK_ID_AGENT_VEHICLE_NEAR_COLLISION
4523  **
4524  ** This callback will be called on a vehicle agent when it
4525  ** approaches another vehicle.
4526  **
4527  *i CALLBACK_ID_AGENT_NON_ZERO_REPULSION
4528  **
4529  ** This callback will be called when an agent character's repulsion
4530  ** forces become non-zero.
4531  **
4532  *i CALLBACK_ID_AGENT_ZERO_REPULSION
4533  **
4534  ** This callback will be called when an agent character's repulsion
4535  ** forces become zero.
4536  **
4537  *i CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED
4538  **
4539  ** This callback will be called when a character who's requested a
4540  ** path plan via the background path planner
4541  ** (agent_move_to_point_bg) gets a path result. Call
4542  ** diguyCharacter::get_path_planning_result() to get the status of
4543  ** the result.
4544  **
4545  *i CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED
4546  **
4547  ** This callback will be called when the current state the agent's
4548  ** mind, if it has one, has changed. Call
4549  ** diguyCharacter::get_mind_current_state_name() to get the new
4550  ** state name.
4551  */
4552  enum {
4553  CALLBACK_ID_CREATE = 1,
4554  CALLBACK_ID_DESTROY,
4555  CALLBACK_ID_PRE_CREATE,
4556  CALLBACK_ID_CURRENT_APPEARANCE_CHANGED,
4557  CALLBACK_ID_CURRENT_HEAD_APPEARANCE_CHANGED,
4558  CALLBACK_ID_CURRENT_HAND_ITEM_APPEARANCE_CHANGED,
4559  CALLBACK_ID_CURRENT_EQUIPMENT_APPEARANCE_CHANGED,
4560  CALLBACK_ID_SHAPE_VARIATIONS_CHANGED,
4561  CALLBACK_ID_SHAPE_VISIBILITY_CHANGED,
4562  CALLBACK_ID_PRE_UPDATE,
4563  CALLBACK_ID_POST_UPDATE,
4564  CALLBACK_ID_DONE_SPEAKING,
4565  CALLBACK_ID_GAZE_STATUS,
4566  CALLBACK_ID_LPOINT_STATUS,
4567  CALLBACK_ID_SHOW,
4568  CALLBACK_ID_HIDE,
4569  CALLBACK_ID_PRE_DIE,
4570  CALLBACK_ID_POST_DIE,
4571  CALLBACK_ID_PRE_FIRE_WEAPON,
4572  CALLBACK_ID_POST_FIRE_WEAPON,
4573  CALLBACK_ID_IMPACT,
4574  CALLBACK_ID_FIRE_WEAPON_SUCCESS,
4575  CALLBACK_ID_CURRENT_ARC_CHANGED,
4576  CALLBACK_ID_CURRENT_ACTION_CHANGED,
4577  CALLBACK_ID_DESIRED_ACTION_CHANGED,
4578  CALLBACK_ID_DESIRED_ACTION_REACHED,
4579  CALLBACK_ID_MANUALLY_INVOKED,
4580  CALLBACK_ID_USER_SELECTED,
4581  CALLBACK_ID_USER_UNSELECTED,
4582  CALLBACK_ID_IGUY_INTERACT,
4583  CALLBACK_ID_IGUY_INTERACT_WITH_SUBJECT,
4584  CALLBACK_ID_GUIDE_POSITION_ACQUIRED,
4585  CALLBACK_ID_GUIDE_POSITION_UNACQUIRED,
4586  CALLBACK_ID_GUIDE_ORIENTATION_ACQUIRED,
4587  CALLBACK_ID_GUIDE_ORIENTATION_UNACQUIRED,
4588  CALLBACK_ID_GUIDE_ALTITUDE_ACQUIRED,
4589  CALLBACK_ID_GUIDE_ALTITUDE_UNACQUIRED,
4590  CALLBACK_ID_GUIDE_TARGET_LOST,
4591  CALLBACK_ID_CURRENT_TOUT_REACHED,
4592  CALLBACK_ID_POST_CREATE_GEOMETRY,
4593  CALLBACK_ID_PRE_DESTROY_GEOMETRY,
4594  CALLBACK_ID_END_OF_PATH_REACHED,
4595  CALLBACK_ID_CHARACTER_CLICKED,
4596 
4597  // DI-Guy Scenario UI callbacks:
4598  CALLBACK_ID_UI_PRE_TRANSLATION,
4599  CALLBACK_ID_UI_POST_TRANSLATION,
4600  CALLBACK_ID_UI_MOUSE_DOWN,
4601  CALLBACK_ID_UI_MOUSE_UP,
4602  CALLBACK_ID_UI_RIGHT_MOUSE_DOWN,
4603  CALLBACK_ID_UI_RIGHT_MOUSE_UP,
4604  CALLBACK_ID_UI_LEFT_CLICK,
4605  CALLBACK_ID_UI_RIGHT_CLICK,
4606  CALLBACK_ID_UI_DOUBLE_CLICK,
4607  CALLBACK_ID_UI_MIDDLE_CLICK,
4608  CALLBACK_ID_UI_SCROLL_UP,
4609  CALLBACK_ID_UI_SCROLL_DOWN,
4610  //CALLBACK_ID_UI_DRAG,
4611 
4612  // DI-Guy AI agent callbacks:
4613  CALLBACK_ID_AGENT_NEW_BEHAVIOR,
4614  CALLBACK_ID_AGENT_NEW_PATH_SHAPE,
4615  CALLBACK_ID_AGENT_NEW_FOCUS_CHARACTER,
4616  CALLBACK_ID_AGENT_ATTACK_OUT_OF_TARGETS,
4617  CALLBACK_ID_AGENT_ATTACK_NO_VISIBLE_TARGETS,
4618  CALLBACK_ID_AGENT_PURSUE_TARGET_REACHED,
4619  CALLBACK_ID_AGENT_PURSUE_TARGET_LOST,
4620  CALLBACK_ID_AGENT_MINGLE_TARGET_REACHED,
4621  CALLBACK_ID_AGENT_MINGLE_TARGET_LOST,
4622  CALLBACK_ID_AGENT_WANDER_TARGET_REACHED,
4623  CALLBACK_ID_AGENT_WANDER_TARGET_LOST,
4624  CALLBACK_ID_AGENT_FLEE_AREA_LEFT,
4625  CALLBACK_ID_AGENT_FLEE_AREA_ENTERED,
4626  CALLBACK_ID_AGENT_TRAVEL_WAYPOINT_REACHED,
4627  CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED,
4628  CALLBACK_ID_AGENT_TRAVEL_BACKWARD_DEST_REACHED,
4629  CALLBACK_ID_AGENT_TRAVEL_NEAR_FORWARD_DEST,
4630  CALLBACK_ID_AGENT_CROWD_MEMBER_KILLED,
4631  CALLBACK_ID_AGENT_CROWD_MEMBER_IMPACT,
4632  CALLBACK_ID_AGENT_NEARBY_SCENE_OBJECT_IMPACT,
4633  CALLBACK_ID_AGENT_NEARBY_WEAPON_FIRED,
4634  CALLBACK_ID_AGENT_VEHICLE_COLLISION,
4635  CALLBACK_ID_AGENT_VEHICLE_NEAR_COLLISION,
4636  CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED,
4637  CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED,
4638  CALLBACK_ID_AGENT_NON_ZERO_REPULSION,
4639  CALLBACK_ID_AGENT_ZERO_REPULSION
4640  };
4641 
4642 #ifdef CPLUSPLUS_ONLY
4643 /*****************************************************************************/
4649  /*l
4650  *b Description:
4651  **
4652  ** This function adds a user callback. Callbacks can be removed
4653  ** with remove_callback() or remove_callback_with_user_data().
4654  **
4655  *b Arguments:
4656  **
4657  *a callback - pointer to function with prototype
4658  *a diguyCharacterCallback (typedefed above)
4659  *a callback_id - integer id of when this callback is to be called
4660  *a callback_params - not currently used; pass NULL
4661  *a callback_user_data - pointer for user's own use; DI-Guy will
4662  *a do nothing to the contents of this pointer
4663  *a beyond passing it back when the callback is
4664  *a invoked
4665  **
4666  *b Returns:
4667  **
4668  ** 0 on success, -1 on failure
4669  */
4670  int add_callback(int callback_id,
4671  diguyCharacterCallback* callback,
4672  void* callback_params = 0,
4673  void* callback_user_data = 0);
4674 
4675  /*l
4676  *b Description:
4677  **
4678  ** This function removes a user callback. All callbacks matching
4679  ** the specified callback_id and callback function will be removed.
4680  **
4681  *b Arguments:
4682  **
4683  *a callback_id - integer id of when this callback is to be called
4684  *a callback - pointer to function with prototype
4685  *a diguyCharacterCallback (typedefed above)
4686  **
4687  *b Returns:
4688  **
4689  ** 0 on success, -1 on failure
4690  */
4691  int remove_callback(int callback_id,
4692  diguyCharacterCallback* callback);
4693 
4694  /*l
4695  *b Description:
4696  **
4697  ** This function removes a user callback. All callbacks matching
4698  ** the specified callback_id and callback_user_data pointer will
4699  ** be removed.
4700  **
4701  *b Arguments:
4702  **
4703  *a callback_id - integer id of when this callback is to be
4704  *a called
4705  *a callback_user_data - pointer for user's own use
4706  **
4707  *b Returns:
4708  **
4709  ** 0 on success, -1 on failure
4710  */
4711  int remove_callback_with_user_data(int callback_id,
4712  void* callback_user_data);
4713 
4714 #endif
4715 /*****************************************************************************/
4721  /*l
4722  *b Description:
4723  **
4724  ** This function adds a user callback script. Callback scripts can
4725  ** be removed with remove_callback_script().
4726  **
4727  *b Arguments:
4728  **
4729  *a callback_id - integer id of the callback
4730  *a callback_script - script text of callback to be added
4731  *a callback_script_type - the type of script contained in
4732  *a callback_script
4733  **
4734  ** If NULL is passed for callback_script_type, a default script type
4735  ** will be derived based on the default script interpreter of the
4736  ** scenario.
4737  **
4738  *i lua specific:
4739  **
4740  ** When the script is called, the object for which it is being called
4741  ** will be in the callback_object global.
4742  **
4743  ** To pass NULL when calling from a lua script, use nil.
4744  **
4745  *b Returns:
4746  **
4747  ** 0 on success, -1 on failure
4748  **
4749  *b Lua Example:
4750  **
4751  *e -------------------------------------------------------------------
4752  *e local pre_fire_weapon_callback = [[
4753  *e
4754  *e local ch_name = callback_object:get_name();
4755  *e bdi_log_print(BDI_LOG_WARN, "Calling pre_fire_weapon_callback for character ".. ch_name .. ".\n");
4756  *e
4757  *e ]]
4758  *e -------------------------------------------------------------------
4759  *e
4760  *e character:add_callback_script(diguyCharacter_CALLBACK_ID_PRE_FIRE_WEAPON,
4761  *e pre_fire_weapon_callback,
4762  *e "lua");
4763  */
4764  int add_callback_script(int callback_id,
4765  const char* callback_script,
4766  const char* callback_script_type = NULL);
4767 
4768  /*l
4769  *b Description:
4770  **
4771  ** This function removes a user callback script previously added with
4772  ** add_callback_script().
4773  **
4774  *b Arguments:
4775  **
4776  *a callback_id - integer id of the callback
4777  *a callback_script - script text of callback previously added
4778  *a callback_script_type - the type of script contained in
4779  *a callback_script
4780  **
4781  ** If NULL is passed for callback_script, all callback
4782  ** scripts whose ids match callback_id and whose types match
4783  ** callback_script_type will be removed.
4784  **
4785  ** If NULL is passed for callback_script_type, a default script type
4786  ** will be derived based on the default script interpreter of the
4787  ** scenario.
4788  **
4789  *i lua specific:
4790  **
4791  ** To pass NULL when calling from a lua script, use nil.
4792  **
4793  *b Returns:
4794  **
4795  ** 0 on success, -1 on failure
4796  **
4797  *b lua Example:
4798  **
4799  *e #
4800  *e # Remove all callback scripts with id
4801  *e # diguyCharacter_CALLBACK_ID_PRE_FIRE_WEAPON
4802  *e #
4803  *e character:remove_callback_script(diguyCharacter_CALLBACK_ID_PRE_FIRE_WEAPON,
4804  *e nil,
4805  *e "lua");
4806  */
4807  int remove_callback_script(int callback_id,
4808  const char* callback_script,
4809  const char* callback_script_type = NULL);
4810 
4811 
4812 /*****************************************************************************/
4822  /*l
4823  *b Description:
4824  **
4825  ** This function maps the event handler with the given name
4826  ** to a callback id. This mapping will be saved in the .dss
4827  ** file and restored when the .dss file is loaded.
4828  **
4829  ** Mappings can also be made via the DI-Guy Scenario UI.
4830  **
4831  ** The event handler is one of the following:
4832  **
4833  *- - a character callback function registered by
4834  *- diguyScenario::register_character_event_handler() or
4835  *- diguyScenario::register_character_event_handler_from_library()
4836  *- - a script registered by
4837  *- diguyScenario::register_character_event_handler_script()
4838  *- - a Script, Decision, or Library Function in the scenario
4839  *- whose "Event Type" is "Character"
4840  **
4841  *b Arguments:
4842  **
4843  *a callback_id - integer id of callback
4844  *a handler_name - name of the event handler to map
4845  **
4846  *b Returns:
4847  **
4848  ** 0 on success, -1 on failure
4849  */
4850  int map_event_handler_to_callback_id(int callback_id,
4851  const char* handler_name);
4852 
4853  /*l
4854  *b Description:
4855  **
4856  ** This function unmaps the event handler with the given name
4857  ** from a callback id.
4858  **
4859  *b Arguments:
4860  **
4861  *a callback_id - integer id of callback
4862  *a handler_name - name of the event handler to unmap
4863  *a unmap_all_matches - pass 0 to unmap only the first match,
4864  *a pass 1 to unmap all matches
4865  **
4866  *b Returns:
4867  **
4868  ** 0 on success, -1 on failure
4869  */
4870  int unmap_event_handler_from_callback_id(int callback_id,
4871  const char* handler_name,
4872  int unmap_all_matches = 0);
4873 
4874  /*l
4875  *b Description:
4876  **
4877  ** This function manually invokes the named character event
4878  ** handler. The callback_id that will be passed to the event
4879  ** handler will be CALLBACK_ID_MANUALLY_INVOKED.
4880  **
4881  ** See diguyCharacter::map_event_handler_to_callback_id() for
4882  ** a description of what comprises a character event handler.
4883  **
4884  ** Note that care should be taken not to end up in an
4885  ** infinite loop of event calls. In general an event handler
4886  ** should not end up directly or indirectly invoking itself.
4887  **
4888  *b Arguments:
4889  **
4890  *a handler_name - name of the event handler to invoke
4891  **
4892  *b Returns:
4893  **
4894  ** DIGUY_CALLBACK_CONTINUE or DIGUY_CALLBACK_STOP
4895  **
4896  *b Available as Decision Bead/Event
4897  */
4898  diguyCallbackReturn manually_invoke_event_handler(const char* handler_name);
4899 
4900 
4901 /*****************************************************************************/
4907  /*l
4908  *b Description:
4909  **
4910  ** This function creates a new path. The created path has no
4911  ** waypoints and no actions. Waypoints can be added using
4912  ** diguyCharacterPath::create_waypoint() or
4913  ** diguyCharacterPath::add_waypoint(). Action beads should be added
4914  ** using diguyCharacterPath::create_action_bead().
4915  **
4916  ** To create a simple path that has a few waypoints and actions, use
4917  ** create_simple_path().
4918  **
4919  ** The waypoints for the path should be created using the function
4920  ** diguyScenario::create_waypoint(). They should be deleted using the
4921  ** function diguyScenario::destroy_waypoint(). Copies of the
4922  ** waypoints are made during the function call, so it is safe to
4923  ** destroy them immediately after this function call returns, or use
4924  ** the waypoints again for another path.
4925  **
4926  ** The returned diguyCharacterPath pointer should be destroyed using
4927  ** destroy_path().
4928  **
4929  *b Arguments:
4930  **
4931  ** The path makes internal copies of all arguments.
4932  **
4933  *a name - name of the new path
4934  **
4935  *b Returns:
4936  **
4937  ** pointer to type diguyCharacterPath
4938  **
4939  */
4940  diguyCharacterPath* create_path(const char* name);
4941 
4942  /*l
4943  *b Description:
4944  **
4945  ** This function creates a new simple path. The path is simple
4946  ** because it has only two waypoints and three specified actions.
4947  **
4948  ** The waypoints for the path should be created using the function
4949  ** diguyScenario::create_waypoint(). They should be deleted using the
4950  ** function diguyScenario::destroy_waypoint(). Copies of the
4951  ** waypoints are made during the function call, so it is safe to
4952  ** destroy them immediately after this function call returns, or use
4953  ** the waypoints again for another path.
4954  **
4955  ** The returned diguyCharacterPath pointer should be destroyed using
4956  ** destroy_path().
4957  **
4958  *b Arguments:
4959  **
4960  ** The path makes internal copies of all arguments.
4961  **
4962  *a name - name of the new path
4963  *a waypoint0 - beginning waypoint
4964  *a waypoint1 - ending waypoint
4965  *a transition_from_action_name - name of the action the character
4966  *a should be transitioning from at the
4967  *a beginning of the path; can be NULL
4968  *a fill_action_name - name of the action that should fill
4969  *a the majority of the path; can be
4970  *a NULL, but see below
4971  *a transition_to_action_name - name of the action the character
4972  *a should transition into at the end of
4973  *a the path
4974  **
4975  ** If transition_from_action_name is NULL, an initial action bead that
4976  ** transitions to the fill action will not be created.
4977  **
4978  ** If fill_action_name is NULL, no action beads will be created for
4979  ** the path, even if transition_from_action_name and/or
4980  ** transition_to_action_name are non-NULL.
4981  **
4982  ** If transition_to_action_name is NULL, a final action bead that
4983  ** transitions from the fill action will not be created.
4984  **
4985  *b Returns:
4986  **
4987  ** pointer to type diguyCharacterPath
4988  */
4989  diguyCharacterPath* create_simple_path(const char* name,
4990  diguyWaypoint* waypoint0,
4991  diguyWaypoint* waypoint1,
4992  const char* transition_from_action_name,
4993  const char* fill_action_name,
4994  const char* transition_to_action_name);
4995 
4996  /*l
4997  *b Description:
4998  **
4999  ** This function is similar to create_simple_path(), but creates its
5000  ** waypoints based on waypoints from the passed path shape.
5001  **
5002  *b Arguments:
5003  **
5004  ** The path makes internal copies of all arguments.
5005  **
5006  *a name - name of the new path
5007  *a source_path_shape - path shape whose waypoints are used
5008  *a to define shape of new path
5009  *a transition_from_action_name - same as for create_simple_path()
5010  *a fill_action_name - same as for create_simple_path()
5011  *a transition_to_action_name - same as for create_simple_path()
5012  **
5013  *b Returns:
5014  **
5015  ** pointer to type diguyCharacterPath
5016  */
5017  diguyCharacterPath* create_path_from_path_shape(const char* name,
5018  diguyPathShape* source_path_shape,
5019  const char* transition_from_action_name,
5020  const char* fill_action_name,
5021  const char* transition_to_action_name);
5022 
5023  /*l
5024  *b Description:
5025  **
5026  ** This function creates a temporary path and immediately forces it as
5027  ** the character's current path. Once it has been traversed it will
5028  ** be automatically deleted.
5029  **
5030  ** The beginning waypoint of this path is at the character's current
5031  ** position; the ending waypoint is at the specified action bead on
5032  ** the specified path (or the first action bead of the specified path
5033  ** if no action bead is specified). The character will use the
5034  ** specified action to move from the beginning waypoint to the ending
5035  ** waypoint.
5036  **
5037  ** This function is useful for getting a free position mode character
5038  ** back onto a path.
5039  **
5040  ** This function will have no effect on a dead character (see
5041  ** die_now() and get_dead()).
5042  **
5043  *b Mode Effects:
5044  **
5045  *- - This function will put the character into path position mode.
5046  *- - This function will put the character into path action mode.
5047  **
5048  *b Arguments:
5049  **
5050  *a destination_path_name - the path the character is trying to
5051  *a reach
5052  *a via_action_name - the action used over the majority of
5053  *a the bridge path
5054  *a destination_path_action_bead_name - the target action bead on the
5055  *a destination path; pass NULL
5056  *a to start at the beginning
5057  *a of the path
5058  **
5059  *b Returns:
5060  **
5061  ** 0 on success, -1 on failure
5062  */
5063  int create_and_force_bridge_path(const char* destination_path_name,
5064  const char* destination_path_action_bead_name,
5065  const char* via_action_name);
5066 
5067  /*l
5068  *b Description:
5069  **
5070  ** This function creates a temporary path and immediately forces it as
5071  ** the character's current path. Once the path has been traversed it
5072  ** will be automatically deleted. The character then begins the local
5073  ** path specified by path_to_push.
5074  **
5075  ** The beginning waypoint of this path is at the character's current
5076  ** position; the ending waypoint is at the specified x, y, z. A
5077  ** path_offset is available to shorten the distance to the end point
5078  ** along the vector to the destination. The character will use the
5079  ** specified action to move from the beginning waypoint to the ending
5080  ** waypoint.
5081  **
5082  ** An optional follow-on path can be specified that the character will
5083  ** move onto once the end position is reached. This must be the name
5084  ** of an existing path for the character. A local path copy of the
5085  ** specified path will be created, and will be pushed to occur after
5086  ** this bridge path completes.
5087  **
5088  ** This function is useful for branching from one location to another
5089  ** in the world.
5090  **
5091  ** This function will have no effect on a dead character (see
5092  ** die_now() and get_dead()).
5093  **
5094  *b Mode Effects:
5095  **
5096  *- - This function will put the character into path position mode.
5097  *- - This function will put the character into path action mode.
5098  **
5099  *b Arguments:
5100  **
5101  *a x, y, z - location in world space the bridge path
5102  *a should aim for
5103  *a path_offset - the amount to shorten the bridge path
5104  *a via_action_name - the action used over the majority of the
5105  *a bridge path
5106  *a next_local_path - local path to push when the character
5107  *a arrives at it's destination; pass NULL
5108  *a to not push a local path
5109  *a orientation - amount to rotate the local path
5110  **
5111  *b Returns:
5112  **
5113  ** 0 on success, -1 on failure
5114  */
5115  int create_and_force_bridge_path_to_point(float x, float y, float z,
5116  float path_offset,
5117  const char* via_action_name,
5118  const char* next_local_path = NULL,
5119  float orientation = 0.0f);
5120 
5121  /*l
5122  *b Description:
5123  **
5124  ** This function destroys a path created by create_path(),
5125  ** create_simple_path(), or a path from a loaded scenario.
5126  **
5127  ** The path the character is currently traveling, as returned by
5128  ** get_current_traveled_path(), cannot be destroyed. Attempting to
5129  ** destroy it will result in a warning, and the path won't be deleted.
5130  **
5131  *b Arguments:
5132  **
5133  *a path - path to be destroyed
5134  **
5135  *b Returns:
5136  **
5137  ** 0 on success, -1 on failure
5138  */
5139  int destroy_path(diguyCharacterPath* path);
5140 
5141  /*l
5142  *b Returns:
5143  **
5144  ** the number of paths belonging to this character
5145  */
5146  int get_num_paths();
5147 
5148  /*l
5149  *b Returns:
5150  **
5151  ** pointer of type diguyCharacterPath; NULL if no
5152  ** path at the specified index
5153  **
5154  *b Arguments:
5155  **
5156  *a index - index of the path; indices start at 0
5157  */
5158  diguyCharacterPath* get_path_at_index(int index);
5159 
5160  /*l
5161  *b Returns:
5162  **
5163  ** the name of the path at the given index; NULL if no
5164  ** path at the specified index
5165  */
5166  const char* get_path_name_at_index(int index);
5167 
5168  /*l
5169  *b Description:
5170  **
5171  ** This function returns the index of the path the character
5172  ** is currently following. If the character is not following
5173  ** a path the returned index will be -1. (i.e., the character
5174  ** must be in path action mode *and* path position mode.)
5175  **
5176  *b Mode Restrictions:
5177  **
5178  *- - This function will only return a 0 or greater index if the
5179  ** character is in path action mode *and* path position mode.
5180  **
5181  *b Returns:
5182  **
5183  ** the index of the current path; -1 if not on a path
5184  */
5185  int get_current_path_index();
5186 
5187  /*l
5188  *b Description:
5189  **
5190  ** This function returns the path the character is currently
5191  ** traveling.
5192  **
5193  *b Mode Restrictions:
5194  **
5195  *- - This function can only be called in path position mode.
5196  **
5197  *b Returns:
5198  **
5199  ** pointer of type diguyCharacterPath; NULL if no path is currently
5200  ** being traveled
5201  */
5202  diguyCharacterPath* get_current_traveled_path();
5203 
5204  /*l
5205  *b Description:
5206  **
5207  ** This function can be used to see if the current traveled has the
5208  ** passed name. This is primarily useful for decisions and other
5209  ** limited logic applications.
5210  **
5211  *b Returns:
5212  **
5213  ** 1 if currently traveled path has the passed name; 0 if the name
5214  ** doesn't match, or no path is currently being traveled
5215  **
5216  *b Available as Decision Bead/Event
5217  */
5218  int get_current_traveled_path_is(const char* path_name);
5219 
5220  /*l
5221  *b Description:
5222  **
5223  ** This function pushes the path with the specified name
5224  ** onto the queue of paths this character will follow.
5225  **
5226  ** This function will have no effect on a dead character (see
5227  ** die_now() and get_dead()).
5228  **
5229  *b Arguments:
5230  **
5231  *a name - name of the path to be pushed
5232  **
5233  *b Returns:
5234  **
5235  ** 0 on success, -1 on failure
5236  **
5237  *b Available as Decision Bead/Event
5238  */
5239  int push_path(const char* path_name);
5240 
5241  /*l
5242  *b Description:
5243  **
5244  ** This function clears the queue of paths the character will follow
5245  ** and then pushes the path with the specified name.
5246  **
5247  ** This function will have no effect on a dead character (see
5248  ** die_now() and get_dead()).
5249  **
5250  *b Arguments:
5251  **
5252  *a name - name of the path to be pushed
5253  *a max_rampdown_interval - max amount of time spent trying to
5254  *a smooth over any motion seams; set
5255  *a to 0.5 for a smooth transition, set
5256  *a to 0 for a potentially rough transition
5257  **
5258  *b Returns:
5259  **
5260  ** 0 on success, -1 on failure
5261  **
5262  *b Available as Decision Bead/Event
5263  */
5264  int force_path(const char* path_name,
5265  float max_rampdown_interval = 0.5f);
5266 
5267  /*l
5268  *b Description:
5269  **
5270  ** Same as force_path(), but only motions at or after the specified
5271  ** action bead are added.
5272  **
5273  ** This function will have no effect on a dead character (see
5274  ** die_now() and get_dead()).
5275  **
5276  *b Available as Decision Bead/Event
5277  */
5278  int force_partial_path(const char* path_name,
5279  const char* beginning_action_bead_name,
5280  float max_rampdown_interval = 0.5f);
5281 
5282  /*l
5283  *b Description:
5284  **
5285  ** Resumes a path that was interrupted with a call such as
5286  ** set_desired_action() or force_action(). Note that the
5287  ** retain_path_shape argument to these functions must have been 1 for
5288  ** the path to be resumable.
5289  **
5290  ** This function will have no effect on a dead character (see
5291  ** die_now() and get_dead()).
5292  **
5293  *b Mode Restrictions:
5294  **
5295  *- - This function can only be called if the character is in
5296  *- free action mode *and* path position mode.
5297  **
5298  *b Mode Effects:
5299  **
5300  *- - This function will put the character into path position mode.
5301  *- - This function will put the character into path action mode.
5302  **
5303  *b Arguments:
5304  **
5305  *a max_rampdown_interval - max amount of time spent trying to
5306  *a smooth over any motion seams; set
5307  *a to 0.5 for a smooth transition, set
5308  *a to 0 for a potentially rough transition
5309  **
5310  *b Returns:
5311  **
5312  ** 0 on success, -1 on failure
5313  **
5314  *b Available as Decision Bead/Event
5315  */
5316  int resume_interrupted_path(float max_rampdown_interval = 0.5f);
5317 
5318  /*l
5319  *b Description:
5320  **
5321  ** This function creates a temporary path that is a copy of path_name
5322  ** but transformed so that the starting point is the same as where
5323  ** the character currently is. It then forces it as the character's
5324  ** current path.
5325  **
5326  *b Arguments:
5327  **
5328  *a path_name - path to copy
5329  *a use_character_orientation - whether the character's orientation be
5330  *a incorporated into the transform of the
5331  *a path
5332  *a rotation - additional amount to rotate the path,
5333  *a in degrees
5334  *a clamp_path - whether the path be ground clamped
5335  **
5336  *b Returns:
5337  **
5338  ** pointer to type diguyCharacterPath
5339  */
5340  diguyCharacterPath* force_local_path(const char* path_name,
5341  int use_character_orientation,
5342  float rotation = 0.0f,
5343  int clamp_path = 1);
5344 
5345  /*l
5346  *b Description:
5347  **
5348  ** This function sets which path the character will start on when the
5349  ** scenario is reset.
5350  **
5351  *b Arguments:
5352  **
5353  *a name - name of the path that will be the initial path
5354  **
5355  *b Returns:
5356  **
5357  ** 0 on success, -1 on failure
5358  */
5359  int set_initial_path(const char* name);
5360 
5361  /*l
5362  *b Description:
5363  **
5364  ** This function returns the name of the path the character will start
5365  ** on when the scenario is reset.
5366  **
5367  ** See set_initial_path().
5368  **
5369  *b Returns:
5370  **
5371  ** name of initial path; NULL if there is none
5372  */
5373  const char* get_initial_path();
5374 
5375  /*l
5376  *b Description:
5377  **
5378  ** This function translates all of the paths of this character.
5379  **
5380  *b Arguments:
5381  **
5382  *a tx, ty, tz - distance in meters to move all waypoints
5383  *a reclamp_waypoints - pass 1 to reclamp waypoints to ground
5384  */
5385  void translate_all_paths(float tx, float ty, float tz,
5386  int reclamp_waypoints = 1);
5387 
5388  /*l
5389  *b Description:
5390  **
5391  ** This function rotates all of the paths of this character.
5392  ** The rotation will occur about the specified point.
5393  **
5394  ** *Note:* It is currently recommended that only rotations
5395  ** about the Z axis be done. (i.e., only rz should be non-zero.)
5396  **
5397  *b Arguments:
5398  **
5399  *a rz, rx, ry - amount of rotation, in degrees
5400  *a rotation_pt_x, rotation_pt_y, rotation_pt_z - point around
5401  *a which rotation should occur
5402  *a reclamp_waypoints - pass 1 to reclamp waypoints to ground
5403  */
5404  int rotate_all_paths_about_point(float rz, float rx, float ry,
5405  float rotation_pt_x, float rotation_pt_y, float rotation_pt_z,
5406  int reclamp_waypoints = 1);
5407 
5408  /*l
5409  *b Description:
5410  **
5411  ** This function is similar to rotate_all_paths_about_point(),
5412  ** but rotates around the character's current waypoint instead
5413  ** of an explicitly specified point.
5414  **
5415  ** *Note:* It is currently recommended that only rotations
5416  ** about the Z axis be done. (i.e., only rz should be non-zero.)
5417  **
5418  *b Arguments:
5419  **
5420  *a rz, rx, ry - amount of rotation, in degrees
5421  *a reclamp_waypoints - pass 1 to reclamp waypoints to ground
5422  */
5423  int rotate_all_paths_about_current_waypoint(float rz, float rx, float ry,
5424  int reclamp_waypoints = 1);
5425 
5426  /*l
5427  *b Description:
5428  **
5429  ** This function causes the character to jump forward along
5430  ** its current path to the specified action bead. Motions
5431  ** and beads that would have otherwise been played or processed
5432  ** will be skipped.
5433  **
5434  *b Arguments:
5435  **
5436  *a bead_name - name of the bead to jump to
5437  *a max_rampdown_interval - max amount of time spent trying to
5438  *a smooth over any motion seams; set
5439  *a to 0.5 for a smooth transition, set
5440  *a to 0 for a potentially rough transition
5441  **
5442  *b Returns:
5443  **
5444  ** 0 on success, -1 on failure
5445  */
5446  int jump_to_action_bead(const char* bead_name,
5447  float max_rampdown_interval = 0.5f);
5448 
5449  /*l
5450  *b Description:
5451  **
5452  ** This function finds and returns a pointer to the specified path.
5453  **
5454  *b Arguments:
5455  **
5456  *a name - name of the path to be found
5457  **
5458  *b Returns:
5459  **
5460  ** Pointer to object of type diguyCharacterPath;
5461  ** NULL if path not found.
5462  */
5463  diguyCharacterPath* find_path(const char* path_name);
5464 
5465  /*l
5466  *b Description:
5467  **
5468  ** This function causes the effects of the given aim bead to be
5469  ** applied to this character, regardless of whether the
5470  ** bead belongs to the character or whether character is within
5471  ** the bead's time interval.
5472  **
5473  *b Arguments:
5474  **
5475  *a how_far - how far into the bead the call should be; should
5476  *a be between 0 (beginning of bead time interval) and
5477  *a 1 (end of bead time interval)
5478  **
5479  *b Returns:
5480  **
5481  ** 0 on success, -1 on failure
5482  */
5483  int apply_aim_bead(diguyCharacterPathAimBead* bead,
5484  float how_far = 0.0f);
5485 
5486  /*l
5487  *b Description:
5488  **
5489  ** This function causes the effects of the given decision bead to be
5490  ** applied to this character, regardless of whether the
5491  ** bead belongs to the character or whether character is within
5492  ** the bead's time interval.
5493  **
5494  *b Arguments:
5495  **
5496  *a how_far - how far into the bead the call should be; should
5497  *a be between 0 (beginning of bead time interval) and
5498  *a 1 (end of bead time interval)
5499  **
5500  *b Returns:
5501  **
5502  ** 0 on success, -1 on failure
5503  */
5504  int apply_decision_bead(diguyCharacterPathDecisionBead* bead,
5505  float how_far = 0.0f);
5506 
5507  /*l
5508  *b Description:
5509  **
5510  ** This function causes the effects of the given gaze bead to be
5511  ** applied to this character, regardless of whether the
5512  ** bead belongs to the character or whether character is within
5513  ** the bead's time interval.
5514  **
5515  *b Arguments:
5516  **
5517  *a how_far - how far into the bead the call should be; should
5518  *a be between 0 (beginning of bead time interval) and
5519  *a 1 (end of bead time interval)
5520  **
5521  *b Returns:
5522  **
5523  ** 0 on success, -1 on failure
5524  */
5525  int apply_gaze_bead(diguyCharacterPathGazeBead* bead,
5526  float how_far = 0.0f);
5527 
5528  /*l
5529  *b Description:
5530  **
5531  ** This function causes the effects of the given script bead to be
5532  ** applied to this character, regardless of whether the
5533  ** bead belongs to the character or whether character is within
5534  ** the bead's time interval.
5535  **
5536  *b Arguments:
5537  **
5538  *a how_far - how far into the bead the call should be; should
5539  *a be between 0 (beginning of bead time interval) and
5540  *a 1 (end of bead time interval)
5541  **
5542  *b Returns:
5543  **
5544  ** 0 on success, -1 on failure
5545  */
5546  int apply_script_bead(diguyCharacterPathScriptBead* bead,
5547  float how_far = 0.0f);
5548 
5549  /*l
5550  *b Description:
5551  **
5552  ** This function sets how far along the current path shape
5553  ** the character will be.
5554  **
5555  *b Mode Restrictions:
5556  **
5557  *- - This function can only be called if the character is in
5558  *- free action mode *and* path position mode. i.e., the
5559  *- character is following a path shape, and is not on a
5560  *- diguyCharacterPath.
5561  **
5562  *b Arguments:
5563  **
5564  *a distance - distance in meters; 0.0 is the beginning of the
5565  *a path shape
5566  **
5567  *b Returns:
5568  **
5569  ** 0 on success, -1 on failure
5570  */
5571  int set_distance_along_path(float distance);
5572 
5573  /*l
5574  *b Returns:
5575  **
5576  ** the distance in meters along the path shape; see
5577  ** set_distance_along_path()
5578  **
5579  *b Mode Restrictions:
5580  **
5581  *- - This function can only be called in path position mode.
5582  */
5583  float get_distance_along_path();
5584 
5585  /*l
5586  *b Description:
5587  **
5588  ** This function takes the character off of its current path
5589  ** or path shape.
5590  **
5591  *b Mode Restrictions:
5592  **
5593  *- - This function can only be called in path position mode.
5594  **
5595  *b Mode Effects:
5596  **
5597  *- - This function will put the character into free position mode.
5598  *- - This function will put the character into free action mode.
5599  **
5600  *b Returns:
5601  **
5602  ** 0 on success, -1 on failure
5603  */
5604  int leave_path();
5605 
5606  /*l
5607  *b Description:
5608  **
5609  ** This function returns the index of the nearest waypoint in a path,
5610  ** the path argument is looked up in both the character's path list
5611  ** and the scenario's paths.
5612  **
5613  *b Returns:
5614  **
5615  ** waypoint index
5616  */
5617  int get_nearest_waypoint_index_in_path(const char* path_name);
5618 
5619  /*l
5620  *b Returns:
5621  **
5622  ** Distance to action bead or first waypoint, 100000000.0 on failure
5623  */
5624  float get_distance_to_path(const char* path_name,
5625  const char* action_bead_name = NULL);
5626 
5627 
5628 /*****************************************************************************/
5636  /*l
5637  *b Description:
5638  **
5639  ** This function gets the position link of the character skeleton.
5640  ** The rest of the skeleton can then be traversed by recursively
5641  ** calling the diguyGraphicsLink::get_num_child_links() and
5642  ** diguyGraphicsLink::get_child_link_at_index() functions.
5643  **
5644  ** Alternatively, the links of the character can be traversed
5645  ** by calling the get_num_links() and get_link_at_index()
5646  ** functions below.
5647  **
5648  *b Returns:
5649  **
5650  ** pointer of type diguyGraphicsLink; NULL if there is no
5651  ** position link
5652  */
5653  diguyGraphicsLink* get_position_link();
5654 
5655  /*l
5656  *b Returns:
5657  **
5658  ** number of links on this character
5659  */
5660  int get_num_links();
5661 
5662  /*l
5663  *b Returns:
5664  **
5665  ** pointer of type diguyGraphicsLink; NULL if no
5666  ** link at the specified index
5667  **
5668  *b Arguments:
5669  **
5670  *a index - index of the link; indices start at 0
5671  */
5672  diguyGraphicsLink* get_link_at_index(int index);
5673 
5674  /*l
5675  *b Description:
5676  **
5677  ** This function returns a pointer to the specified link.
5678  **
5679  *b Arguments:
5680  **
5681  *a name - name of link to be found
5682  **
5683  *b Returns:
5684  **
5685  ** pointer of type diguyGraphicsLink; NULL if not found
5686  */
5687  diguyGraphicsLink* find_link(const char* name);
5688 
5689  /*l
5690  *b Returns:
5691  **
5692  ** the string identifying the link at the given index
5693  **
5694  *b Arguments:
5695  **
5696  *a link_index - index of the link; indices start at 0
5697  */
5698  const char* get_link_name_at_index(int link_index);
5699 
5700  /*l
5701  *b Returns:
5702  **
5703  ** the number of shapes on the specified link
5704  **
5705  *b Arguments:
5706  **
5707  *a link_name - name of the link
5708  */
5709  int get_num_link_shapes(const char* link_name);
5710 
5711  /*l
5712  *b Returns:
5713  **
5714  ** the name of the shape at the specified index on the link
5715  **
5716  *b Arguments:
5717  **
5718  *a link_name - name of the link
5719  *a shape_index - index of the shape on the link; indices start at 0
5720  */
5721  const char* get_link_shape_name_at_index(const char* link_name,
5722  int shape_index);
5723 
5725  void set_link_visibility(const char* link_or_connection_name, int visible, int shape_index = -1);
5726 
5728  int get_num_connection_points();
5729 
5732  const char * get_connection_point_name_at_index(int index);
5733 
5735  bool get_connection_point_info_at_index(int index, diguyGraphicsLink** link, float* matrix_offset, int transpose);
5736 
5739  int get_num_connection_points_with_type(diguyConnectionPointType type);
5740 
5743  const char * get_connection_point_name_with_type(diguyConnectionPointType type, int index);
5744 
5746  bool find_connection_point(const char* name, diguyGraphicsLink** link, float* matrix_offset, int transpose);
5747 
5749  diguyGraphicsShape* find_shape(const char* shape_name);
5750 
5752  int remove_shape(const char* shape_name);
5753 
5754 /*****************************************************************************/
5763  diguyLinkController * get_link_controller(const char * link_name);
5766 
5769  int set_link_translation_override(const char * link_name, float x, float y, float z, float ramp_time = .25f);
5770 
5773  int set_link_translation_override(const char * link_name, float x, float y, float z, float vx, float vy, float vz, float ramp_time = .25f);
5774 
5776  int end_link_translation_override(const char * link_name, float ramp_time = .25f);
5777 
5779  int set_link_rotation_override(const char * link_name, float rz, float rx, float ry, float ramp_time = .25f);
5780  int set_link_rotation_override(const char * link_name, float rz, float rx, float ry, float vrx, float vry, float vrz, float ramp_time = .25f);
5781 
5783  int end_link_rotation_override(const char * link_name, float ramp_time = .25f);
5784 
5785 
5786 /*****************************************************************************/
5797  int get_num_articulated_parts();
5799 
5801  const char* get_articulated_part_link_name( int index );
5802 
5804  int get_articulated_part_id( int index );
5805 
5807  const char* map_articulated_part_id_to_link( int id );
5808 
5809 
5810 /*****************************************************************************/
5832 #ifdef CPLUSPLUS_ONLY
5833 
5834  /*l
5835  *b Description:
5836  **
5837  ** The following prototype should be used for the altitude
5838  ** function:
5839  **
5840  *e float altitude_func(diguyCharacter* character,
5841  *e float x,
5842  *e float y,
5843  *e float old_z);
5844  **
5845  ** When a character needs new altitude info, DI-Guy calls this
5846  ** function with a pointer to the diguyCharacter in question,
5847  ** the character's current (x, y) coordinates, and its previous
5848  ** altitude in old_z.
5849  **
5850  ** The altitude function should then compute and return the new
5851  ** altitude based on this information. This can be done in a
5852  ** number of ways; a typical approach is to do an intersection
5853  ** test with the visual scene. Some users might want to implement
5854  ** fairly complex behavior, such as attempting to make all four
5855  ** wheels of a vehicle touch the terrain, or causing a character
5856  ** to drift slowly towards the ground.
5857  **
5858  ** A default altitude function that should be set for all
5859  ** characters can be set by calling
5860  ** diguyScenario::set_default_character_altitude_function().
5861  **
5862  ** This function is normally called for all characters if the flags
5863  ** for enabling it in free movement or path-following mode are
5864  ** set (see below). Some character systems, such as certain kinds
5865  ** of vehicle control code, will also use the scenario altitude
5866  ** function.
5867  **
5868  *b Callable From:
5869  **
5870  *- - C++
5871  */
5872  int set_altitude_function(diguyAltitudeFunction* altitude_function);
5873 
5874  /*l
5875  *b Returns:
5876  **
5877  ** current altitude function; see set_altitude_function()
5878  **
5879  *b Callable From:
5880  **
5881  *- - C++
5882  */
5883  diguyAltitudeFunction* get_altitude_function();
5884 
5885 #endif
5886 
5887  /*l
5888  *b Description:
5889  **
5890  ** This function sets whether the character's altitude function is
5891  ** enabled in free position mode. Altitude functions are set by the
5892  ** functions set_altitude_function() or
5893  ** diguyScenario::set_default_character_altitude_function().
5894  **
5895  *b Arguments:
5896  **
5897  *a enabled - pass 1 to enable, 0 to disable
5898  **
5899  *b Mode Effects:
5900  **
5901  *- - This function will not change the position mode.
5902  **
5903  *b Mode Restrictions:
5904  **
5905  *- - This function will only affect characters in free position mode.
5906  **
5907  *b Returns:
5908  **
5909  ** 0 on success, -1 on failure
5910  */
5911  int set_altitude_function_enabled_in_free_position_mode(int enabled);
5912 
5913  /*l
5914  *b Returns:
5915  **
5916  ** whether the character's altitude function is enabled in free
5917  ** position mode; see
5918  ** set_altitude_function_enabled_in_free_position_mode()
5919  */
5920  int get_altitude_function_enabled_in_free_position_mode();
5921 
5922  /*l
5923  *b Description:
5924  **
5925  ** This function sets whether the character's altitude function is
5926  ** enabled in path position mode. Altitude functions are set by
5927  ** the functions set_altitude_function() or
5928  ** diguyScenario::set_default_character_altitude_function().
5929  **
5930  *b Arguments:
5931  **
5932  *a enabled - pass 1 to enable, 0 to disable
5933  **
5934  *b Mode Effects:
5935  **
5936  *- - This function will not change the position mode.
5937  **
5938  *b Mode Restrictions:
5939  **
5940  *- - This function will only affect characters in path position mode.
5941  **
5942  *b Returns:
5943  **
5944  ** 0 on success, -1 on failure
5945  */
5946  int set_altitude_function_enabled_in_path_position_mode(int value);
5947 
5948  /*l
5949  *b Returns:
5950  **
5951  ** whether the character's altitude function is enabled in path
5952  ** position mode;
5953  ** see set_altitude_function_enabled_in_path_position_mode()
5954  */
5955  int get_altitude_function_enabled_in_path_position_mode();
5956 
5957  /*l
5958  *b Description
5959  **
5960  ** This function sets the altitude update rate of the character.
5961  **
5962  ** The default value for new characters is 100.
5963  **
5964  ** Note that characters that are load managed (get_is_load_managed()
5965  ** returns 1) have this parameter managed automatically. The
5966  ** corresponding function for load managed characters is
5967  ** diguyLoadManager::set_zone_altitude_update_rate().
5968  **
5969  *b Arguments:
5970  **
5971  *a update_rate - percentage of scenario ticks for which altitude
5972  *a should update; can be between 1 and 100
5973  **
5974  ** Passing 100 means altitude will update every tick.
5975  ** Passing 50 means altitude will update every other tick.
5976  **
5977  *b Returns:
5978  **
5979  ** 0 on success, -1 on failure
5980  */
5981  int set_altitude_update_rate(int update_rate);
5982 
5984  int get_altitude_update_rate();
5985 
5986  /*l
5987  *b Description
5988  **
5989  ** This function sets the altitude interpolation rate of the
5990  ** character. This function only has an effect if the character's
5991  ** altitude function is enabled.
5992  **
5993  ** When the altitude function determines that the character's Z
5994  ** position should be updated to bring it closer to the ground, the
5995  ** altitude interpolation rate determines how quickly the Z height
5996  ** is adjusted.
5997  **
5998  ** The default value is 10.
5999  **
6000  *b Arguments:
6001  **
6002  *a interpolation_rate - how much of the error will be made up
6003  *a each second
6004  **
6005  ** An interpolation_rate of 100 means that all error will be made
6006  ** up each frame.
6007  */
6008  void set_altitude_interpolation_rate(float interpolation_rate);
6009 
6011  float get_altitude_interpolation_rate();
6012 
6013 /*****************************************************************************/
6125  /*l
6126  *b Description:
6127  **
6128  ** Returns the number of variables in this character's pose array.
6129  ** See get_pose_in_radians() for an example of use.
6130  **
6131  *b Returns:
6132  **
6133  ** size of this character's pose array
6134  */
6135  int get_pose_array_size();
6136 
6137 #ifdef CPLUSPLUS_ONLY
6138 
6139  /*l
6140  *b Description:
6141  **
6142  ** Fills an array of floats with the character's current joint angles.
6143  ** Angles are expressed in radians. The size of the float array must
6144  ** be at least as large as that returned by get_pose_array_size().
6145  **
6146  *b Arguments:
6147  **
6148  *a pose_array - an array of floats
6149  **
6150  *b Returns:
6151  **
6152  ** 0 on success, -1 on failure
6153  **
6154  *b Callable From:
6155  **
6156  *- - C++
6157  **
6158  *b C++ Example:
6159  **
6160  *e diguyCharacter* ch = scenario->get_character_at_index(0);
6161  *e float* pose_array;
6162  *e
6163  *e // allocate a float array of the proper size
6164  *e int n = ch->get_pose_array_size();
6165  *e pose_array = new float[n];
6166  *e
6167  *e // get the pose array
6168  *e ch->get_pose_in_radians(pose_array);
6169  */
6170  int get_pose_in_radians(float* pose_array);
6171 
6173  int get_pose_in_quaternions(float* pose_array);
6174 
6175 #endif
6176 
6177  /*l
6178  *b Description:
6179  **
6180  ** Creates and returns a pose override object. The newly created
6181  ** pose override object is added to the character's previously
6182  ** created override objects, if any.
6183  **
6184  ** How the pose override interacts with other effects that affect
6185  ** the pose of the character depends on the override stage. See
6186  ** the section "Pose Override Stages" for a discussion of pose
6187  ** override stages.
6188  **
6189  *b Arguments:
6190  **
6191  *a override_stage - the stage in the DI-Guy motion engine at
6192  *a which the override should be applied
6193  **
6194  *b Returns:
6195  **
6196  ** object of type diguyCharacterPoseOverride
6197  */
6198  diguyCharacterPoseOverride* create_pose_override(int override_stage = 3);
6199 
6200  /*l
6201  *b Description:
6202  **
6203  ** Destroys a pose override object, ending its influence on the
6204  ** character.
6205  **
6206  *b Arguments:
6207  **
6208  *a po - pose override object to be destroyed
6209  **
6210  *b Returns:
6211  **
6212  ** 0 on success, -1 on failure
6213  */
6214  int destroy_pose_override(diguyCharacterPoseOverride* po);
6215 
6216  /*l
6217  *b Returns:
6218  **
6219  ** the number of pose overrides belonging to this character
6220  */
6221  int get_num_pose_overrides();
6222 
6223  /*l
6224  *b Returns:
6225  **
6226  ** pointer of type diguyCharacterPoseOverride; NULL if no
6227  ** pose override at the specified index
6228  **
6229  *b Arguments:
6230  **
6231  *a index - index of the pose override; indices start at 0
6232  */
6233  diguyCharacterPoseOverride* get_pose_override_at_index(int index);
6234 
6235  /*l
6236  *b Description:
6237  **
6238  ** Creates and returns a pose override object that completely
6239  ** overrides all other character pose operations, including motions,
6240  ** aiming, gazing, gestures, other pose overrides, etc. The values
6241  ** set in the complete pose override object will be the values used
6242  ** to animate the character.
6243  **
6244  ** Having only one thing that affects a character's pose allows for
6245  ** much faster updating of the character.
6246  **
6247  ** There can only be one complete pose override object per character.
6248  **
6249  ** To remove the complete pose override, call
6250  ** destroy_complete_pose_override().
6251  **
6252  *b Returns:
6253  **
6254  ** object of type diguyCharacterPoseOverride
6255  */
6256  diguyCharacterPoseOverride* create_complete_pose_override();
6257 
6258  /*l
6259  *b Description:
6260  **
6261  ** Removes and destroys the complete pose override created by
6262  ** create_complete_pose_override().
6263  */
6264  void destroy_complete_pose_override();
6265 
6266 
6267 /*****************************************************************************/
6273  /*l
6274  *b Description:
6275  **
6276  ** This function sets the current azimuth, elevation, and
6277  ** distance of the character's gaze. A fixed point in 3D space
6278  ** is then found using the two angles and the given distance
6279  ** from the DI-Guy coordinate system origin. Angles are
6280  ** given with respect to the DI-Guy coordinate system.
6281  **
6282  ** See set_position() for a description of the coordinate
6283  ** system.
6284  **
6285  ** Gazing will continue until end_gaze() is called.
6286  **
6287  ** This function will have no effect on a dead character (see
6288  ** die_now() and get_dead()).
6289  **
6290  *b Arguments:
6291  **
6292  *a azimuth - rotation in degrees about up (vertical) axis;
6293  *a positive rotates to character's left
6294  *a elevation - rotation in degrees about forward (horizontal) axis;
6295  *a positive rotates down
6296  *a distance - deprecated as of 13.2
6297  *a is_new_gaze - set to 1 if this is a new gaze;
6298  *a set to 0 if this is continuing an already started
6299  *a gaze
6300  **
6301  *b Returns:
6302  **
6303  ** 0 on success, -1 on failure
6304  */
6305  int gaze_at_angle(float azimuth,
6306  float elevation,
6307  float distance,
6308  int is_new_gaze = 1);
6309 
6310  /*l
6311  *b Description:
6312  **
6313  ** This function is identical to gaze_at_angle() except that it uses
6314  ** body local coordinates for the character. The angles
6315  ** are given with respect to the idealized position of the
6316  ** character. Use get_position() to learn the idealized position.
6317  ** The distance is between the idealized position of the character
6318  ** and the fixation point.
6319  **
6320  ** This function will have no effect on a dead character (see
6321  ** die_now() and get_dead()).
6322  ** distance argument - deprecated as of 13.2
6323  */
6324  int gaze_at_angle_local(float azimuth,
6325  float elevation,
6326  float distance = 10000.0f,
6327  int is_new_gaze = 1);
6328 
6329  /*l
6330  *b Description:
6331  **
6332  ** This function sets the current fixation point of the character's
6333  ** gaze. Point coordinates are given in meters in the DI-Guy
6334  ** global coordinate system. The function uses default gaze behavior
6335  ** settings. Gazing will continue until end_gaze() is called.
6336  **
6337  ** This function will have no effect on a dead character (see
6338  ** die_now() and get_dead()).
6339  **
6340  *b Arguments:
6341  **
6342  *a tx, ty, tz - position in meters from the DI-Guy global
6343  *a origin
6344  *a is_new_gaze - set to 1 if this is a new gaze;
6345  *a set to 0 if this is continuing an already started
6346  *a gaze
6347  **
6348  *b Returns:
6349  **
6350  ** 0 on success, -1 on failure
6351  */
6352  int gaze_at_point(float tx,
6353  float ty,
6354  float tz,
6355  int is_new_gaze = 1);
6356 
6357  /*l
6358  *b Description:
6359  **
6360  ** This function is identical to gaze_at_point() except that it uses
6361  ** body local coordinates for the character. Use get_position()
6362  ** to learn the idealized position of the character if necessary.
6363  **
6364  ** This function will have no effect on a dead character (see
6365  ** die_now() and get_dead()).
6366  */
6367  int gaze_at_point_local(float tx,
6368  float ty,
6369  float tz,
6370  int is_new_gaze = 1);
6371 
6372  /*l
6373  *b Description:
6374  **
6375  ** This function effectively does a gaze_at_point() each tick.
6376  ** The point to be gazed at is updated each tick to be the position
6377  ** of the specified link on the specified character.
6378  **
6379  ** This function will have no effect on a dead character (see
6380  ** die_now() and get_dead()).
6381  **
6382  *b Arguments:
6383  **
6384  *a target_character_name - name of the character to be
6385  *a gazed at
6386  *a target_character_link_name - link on the character that should
6387  *a be gazed at; pass NULL to gaze at
6388  *a the position link of the character
6389  *a offset_tx, offset_ty, offset_tz - offset onto the link, in meters
6390  **
6391  *b Returns:
6392  **
6393  ** 0 on success, -1 on failure
6394  **
6395  *b Available as Decision Bead/Event
6396  **
6397  *b C++ Example:
6398  **
6399  *e // gaze at the head of character "soldier-1".
6400  *e ch->gaze_at_character("soldier-1",
6401  *e "cervical",
6402  *e 0.0,
6403  *e 0.0,
6404  *e 0.0);
6405  */
6406  int gaze_at_character(const char* target_character_name,
6407  const char* target_character_link_name = NULL,
6408  float offset_tx = 0.0f,
6409  float offset_ty = 0.0f,
6410  float offset_tz = 0.0f);
6411 
6412  /*l
6413  *b Returns:
6414  **
6415  ** 1 if the character is actively gazing, 0 if not
6416  */
6417  int get_gaze_is_active();
6418 
6419  /*l
6420  *b Returns:
6421  **
6422  ** the current gaze point relative to the DI-Guy
6423  ** global coordinate system
6424  */
6425  int get_gaze_point(float* x, float* y, float* z);
6426 
6427  /*l
6428  *b Description:
6429  **
6430  ** A gaze is acquired if the final link in the gaze link chain
6431  ** has fully oriented toward the gaze target, even if other
6432  ** links in the gaze chain are still moving.
6433  **
6434  ** If the gaze is acquired, but any links in the gaze chain
6435  ** are still moving, the gaze is considered acquired but not
6436  ** steady (see get_gaze_is_steady().) If all links have reached
6437  ** a relatively steady state, the gaze is considered acquired
6438  ** and steady.
6439  **
6440  ** If either the acquired or steady status of a gaze has changed
6441  ** (e.g., was acquired but now is not, or was steady but now
6442  ** a link is moving), the diguyCharacter callback with callback_id
6443  ** CALLBACK_ID_GAZE_STATUS will be called.
6444  **
6445  *b Returns:
6446  **
6447  *- - 1 if the final link in the gaze can and has become oriented
6448  *- toward the gaze target
6449  *- - 0 if not
6450  *- - -1 on error
6451  */
6452  int get_gaze_is_acquired();
6453 
6454  /*l
6455  *b Description:
6456  **
6457  ** A gaze is steady if it is acquired, and if all links involved
6458  ** in the gaze have reached a steady state.
6459  **
6460  ** For example, since the eyes move faster than the neck, which
6461  ** moves faster than the back, it's possible for the gaze to
6462  ** be acquired (see get_gaze_is_acquired()) by the eyes as the
6463  ** neck and back are still moving. As the neck and back move into
6464  ** a more natural position, the eyes will not need to be turned
6465  ** as far to keep the gaze acquired.
6466  **
6467  ** If either the acquired or steady status of a gaze has changed
6468  ** (e.g., was acquired but now is not, or was steady but now
6469  ** a link is moving), the diguyCharacter callback with callback_id
6470  ** CALLBACK_ID_GAZE_STATUS will be called.
6471  **
6472  *b Returns:
6473  **
6474  *- - 1 if all links participating in the gaze have reached a
6475  *- relatively steady state
6476  *- - 0 if not
6477  *- - -1 on error
6478  */
6479  int get_gaze_is_steady();
6480 
6481  /*l
6482  *b Description:
6483  **
6484  ** This function removes the fixation target of an ongoing gaze,
6485  ** allowing the character to return to a non-gaze posture and
6486  ** behavior. This effectively frees the character's posture to
6487  ** other influences.
6488  */
6489  int end_gaze();
6490 
6491  /*l
6492  *b Description:
6493  **
6494  ** This function is similar to gaze_at_angle(), but sets the target
6495  ** of left pointing rather than gaze.
6496  **
6497  ** This function will have no effect on a dead character (see
6498  ** die_now() and get_dead()).
6499  **
6500  *b Arguments:
6501  **
6502  *a azimuth - rotation in degrees about up (vertical) axis;
6503  *a positive rotates to character's left
6504  *a elevation - rotation in degrees about forward (horizontal) axis;
6505  *a positive rotates down
6506  *a distance - distance in meters from the position of the character
6507  *a to the lpoint target; positive values only
6508  *a is_new_lpoint - set to 1 if this is a new lpoint;
6509  *a set to 0 if this is continuing an already started
6510  *a lpoint
6511  *a base_gesture_name - the underlying gesture that should be used for
6512  *a motion of the arm; this is a placeholder
6513  *a argument for future functionality and should
6514  *a be set to NULL
6515  */
6516  int lpoint_at_angle(float azimuth,
6517  float elevation,
6518  float distance,
6519  int is_new_lpoint = 1,
6520  const char* base_gesture_name = 0);
6521 
6522  /*l
6523  *b Description:
6524  **
6525  ** This function is identical to gaze_at_local() except that it uses
6526  ** body local coordinates for the character. Use get_position()
6527  ** to learn the idealized position of the character if necessary.
6528  **
6529  ** This function will have no effect on a dead character (see
6530  ** die_now() and get_dead()).
6531  */
6532  int lpoint_at_angle_local(float azimuth,
6533  float elevation,
6534  float distance = 10000.0f,
6535  int is_new_lpoint = 1,
6536  const char* base_gesture_name = 0);
6537 
6538  /*l
6539  *b Description:
6540  **
6541  ** This function sets the current fixation point for the character's
6542  ** left pointing. Point coordinates are given in meters in the
6543  ** DI-Guy global coordinate system.
6544  **
6545  ** See set_position() for a description of the coordinate
6546  ** system.
6547  **
6548  ** Pointing will continue until end_lpoint() is called.
6549  **
6550  ** This function will have no effect on a dead character (see
6551  ** die_now() and get_dead()).
6552  **
6553  *b Arguments:
6554  **
6555  *a tx, ty, tz - position in meters from the DI-Guy global
6556  *a origin of the lpoint target
6557  *a is_new_gaze - set to 1 if this is a new lpoint;
6558  *a set to 0 if this is continuing an already started
6559  *a lpoint
6560  *a base_gesture_name - the underlying gesture that should be used for
6561  *a motion of the arm; this is a placeholder
6562  *a argument for future functionality and should
6563  *a be set to NULL
6564  **
6565  *b Returns:
6566  **
6567  ** 0 on success, -1 on failure
6568  */
6569  int lpoint_at_point(float tx,
6570  float ty,
6571  float tz,
6572  int is_new_lpoint = 1,
6573  const char* base_gesture_name = 0);
6574 
6575  /*l
6576  *b Description:
6577  **
6578  ** This function is identical to lpoint_at_local() except that it uses
6579  ** body local coordinates for the character. Use get_position()
6580  ** to learn the idealized position of the character if necessary.
6581  **
6582  ** This function will have no effect on a dead character (see
6583  ** die_now() and get_dead()).
6584  */
6585  int lpoint_at_point_local(float tx,
6586  float ty,
6587  float tz,
6588  int is_new_lpoint = 1,
6589  const char* base_gesture_name = 0);
6590 
6591  /*l
6592  *b Description:
6593  **
6594  ** This function is identical to gaze_at_character(), but sets the
6595  ** target of left pointing rather than gaze.
6596  **
6597  ** This function will have no effect on a dead character (see
6598  ** die_now() and get_dead()).
6599  */
6600  int lpoint_at_character(const char* target_character_name,
6601  const char* target_character_link_name = NULL,
6602  float offset_tx = 0.0f,
6603  float offset_ty = 0.0f,
6604  float offset_tz = 0.0f);
6605 
6606  /*l
6607  *b Returns:
6608  **
6609  ** the current lpoint target point relative to the DI-Guy
6610  ** global coordinate system
6611  */
6612  int get_lpoint_point(float* x, float* y, float* z);
6613 
6614  /*l
6615  *b Returns:
6616  **
6617  ** the current base gesture of the lpoint
6618  */
6619  const char* get_lpoint_base_gesture_name();
6620 
6621  /*l
6622  *b Returns:
6623  **
6624  ** 1 if the character is actively lpointing, 0 if not
6625  */
6626  int get_lpoint_is_active();
6627 
6628  /*l
6629  *b Returns:
6630  **
6631  ** 1 if the final link in the lpoint can and has become oriented
6632  ** toward the lpoint target;
6633  ** 0 if not;
6634  ** -1 on error
6635  */
6636  int get_lpoint_is_acquired();
6637 
6638  /*l
6639  *b Returns:
6640  **
6641  ** 1 if all links participating in the lpoint have reached a
6642  ** relatively steady state;
6643  ** 0 if not;
6644  ** -1 on error
6645  */
6646  int get_lpoint_is_steady();
6647 
6648  /*l
6649  *b Description:
6650  **
6651  ** This function removes the fixation target of an ongoing lpoint,
6652  ** allowing the character to return to a non-point posture and
6653  ** behavior. This effectively frees the character's posture to
6654  ** other influences.
6655  */
6656  int end_lpoint();
6657 
6658  /*l
6659  *b Description:
6660  **
6661  ** This function sets all gaze control parameters back to their
6662  ** default settings. This undoes modifications to gaze control
6663  ** parameters made by the following calls:
6664  **
6665  *- - set_gaze_param_desired_locate_time()
6666  *- - set_gaze_link_uses_desired_locate_time()
6667  *- - set_gaze_link_azimuth_limits()
6668  *- - set_gaze_link_elevation_limits()
6669  *- - set_gaze_link_azimuth_tolerance()
6670  *- - set_gaze_link_elevation_tolerance()
6671  *- - set_gaze_link_max_angular_vel()
6672  *- - set_gaze_link_scale_factor()
6673  **
6674  *b Returns:
6675  **
6676  ** 0 on success, -1 on failure
6677  */
6678  int set_gaze_params_to_defaults();
6679 
6680  /*l
6681  *b Description:
6682  **
6683  ** This function sets the desired amount of time in seconds it
6684  ** will take for the gaze or point target to be acquired.
6685  **
6686  ** Having a desired locate time effectively limits how fast links
6687  ** in the gaze chain can turn; they will turn as fast as it
6688  ** takes for them to arrive at their proper values, or as fast
6689  ** as their maximum angular velocity, whichever is longer.
6690  **
6691  ** The use of desired locate time can be turned on and off on a
6692  ** link by link bases using the function
6693  ** set_gaze_link_uses_desired_locate_time().
6694  **
6695  ** This value is only a guideline and may be overridden on a link
6696  ** by link basis during the actual gaze, as links try not to
6697  ** exceed their maximum angular velocities.
6698  **
6699  ** The default locate time is 1.0 seconds.
6700  **
6701  *b Arguments:
6702  **
6703  *a t - lower value results in faster turning rate
6704  **
6705  *b Returns:
6706  **
6707  ** 0 on success, -1 on failure
6708  */
6709  int set_gaze_param_desired_locate_time(float t);
6710 
6711  /*l
6712  *b Returns:
6713  **
6714  ** the most recent setting of set_gaze_param_desired_locate_time()
6715  */
6716  float get_gaze_param_desired_locate_time();
6717 
6718  /*l
6719  *b Description:
6720  **
6721  ** This function sets whether the specified link will pay attention
6722  ** to the desired locate time (as set by
6723  ** set_gaze_param_desired_locate_time()), or whether the link turns
6724  ** as fast as its maximum angular velocity allows (as set by
6725  ** set_gaze_link_max_angular_vel()).
6726  **
6727  ** Note that if this value is set to 1, the link still pays attention
6728  ** to its maximum angular velocity as an upper limit on how fast
6729  ** it can turn.
6730  **
6731  ** Valid link names and defaults:
6732  **
6733  *a orientation - 1
6734  *a back - 1
6735  *a cervical - 1
6736  *a eye_l - 0
6737  *a shoulder_l - 1
6738  *a elbow_l - 1
6739  **
6740  *b Arguments:
6741  **
6742  *a link_name - name of the link
6743  *a uses_desired_locate_time - 1 to use desired locate time, 0
6744  *a to disregard
6745  **
6746  *b Returns:
6747  **
6748  ** 0 on success, -1 on failure
6749  */
6750  int set_gaze_link_uses_desired_locate_time(const char* link_name,
6751  int uses_desired_locate_time);
6752 
6753  /*l
6754  *b Returns:
6755  **
6756  ** the most recent setting of set_gaze_link_uses_desired_locate_time()
6757  */
6758  int get_gaze_link_uses_desired_locate_time(const char* link_name);
6759 
6760  /*l
6761  *b Description:
6762  **
6763  ** This function sets the maximum amount the character can turn
6764  ** the specified link horizontally in pursuit of a gaze or point
6765  ** target.
6766  **
6767  ** Valid link names and defaults:
6768  **
6769  *a back - -45 to 45
6770  *a cervical - -80 to 80
6771  *a eye_l - -50 to 50
6772  *a shoulder_l - -30 to 135
6773  *a elbow_l - -30 to 10
6774  **
6775  *b Arguments:
6776  **
6777  *a link_name - name of the link
6778  *a min - value <= 0; in degrees
6779  *a max - value >= 0; in degrees
6780  **
6781  *b Returns:
6782  **
6783  ** 0 on success, -1 on failure
6784  */
6785  int set_gaze_link_azimuth_limits(const char* link_name, float min, float max);
6786 
6787  /*l
6788  *b Returns:
6789  **
6790  ** the most recent setting of set_gaze_link_azimuth_max()
6791  */
6792  int get_gaze_link_azimuth_limits(const char* link_name,
6793  float* min,
6794  float* max);
6795 
6796  /*l
6797  *b Description:
6798  **
6799  ** This function sets the maximum amount the character can turn
6800  ** the specified link vertically in pursuit of a gaze or point
6801  ** target.
6802  **
6803  ** Valid link names and defaults:
6804  **
6805  *a back - -15 to 45
6806  *a cervical - -80 to 45
6807  *a eye_l - -40 to 40
6808  *a shoulder_l - -80 to 80
6809  *a elbow_l - -170 to 0
6810  **
6811  *b Arguments:
6812  **
6813  *a link_name - name of the link
6814  *a min - value <= 0; in degrees
6815  *a max - value >= 0; in degrees
6816  **
6817  *b Returns:
6818  **
6819  ** 0 on success, -1 on failure
6820  */
6821  int set_gaze_link_elevation_limits(const char* link_name,
6822  float min,
6823  float max);
6824 
6826  int get_gaze_link_elevation_limits(const char* link_name,
6827  float* min,
6828  float* max);
6829 
6830  /*l
6831  *b Description:
6832  **
6833  ** This function sets how much difference there can be between
6834  ** the link's current horizontal orientation and the gaze or point
6835  ** target before the link begins to turn to acquire the gaze or
6836  ** point target.
6837  **
6838  ** The combination of this function and
6839  ** set_gaze_link_scale_factor() determine how close the link will
6840  ** turn toward the gaze or point target.
6841  **
6842  ** With a looser (higher) tolerance the link will not turn as much
6843  ** toward the target. With a tighter (lower) tolerance the link
6844  ** will turn more toward the target.
6845  **
6846  ** Valid link names and defaults:
6847  **
6848  *a orientation - -30 to 30
6849  *a back - -45 to 45
6850  *a cervical - -5 to 5
6851  *a eye_l - -1 to 1
6852  *a shoulder_l - -5 to 5
6853  *a elbow_l - -5 to 5
6854  **
6855  *b Arguments:
6856  **
6857  *a link_name - name of the link
6858  *a min - value <= 0; in degrees
6859  *a max - value >= 0; in degrees
6860  **
6861  *b Returns:
6862  **
6863  ** 0 on success, -1 on failure
6864  */
6865  int set_gaze_link_azimuth_tolerance(const char* link_name,
6866  float min,
6867  float max);
6868 
6870  int get_gaze_link_azimuth_tolerance(const char* link_name,
6871  float* min,
6872  float* max);
6873 
6874  /*l
6875  *b Description:
6876  **
6877  ** The elevation equivalent of set_gaze_link_azimuth_tolerance(),
6878  **
6879  ** Valid link names and defaults:
6880  **
6881  *a orientation - -90 to 90
6882  *a back - -45 to 45
6883  *a cervical - -5 to 5
6884  *a eye_l - -1 to 1
6885  *a shoulder_l - -5 to 5
6886  *a elbow_l - -5 to 5
6887  **
6888  *b Arguments:
6889  **
6890  *a link_name - name of the link
6891  *a min - value <= 0; in degrees
6892  *a max - value >= 0; in degrees
6893  **
6894  *b Returns:
6895  **
6896  ** 0 on success, -1 on failure
6897  */
6898  int set_gaze_link_elevation_tolerance(const char* link_name,
6899  float min,
6900  float max);
6901 
6903  int get_gaze_link_elevation_tolerance(const char* link_name,
6904  float* min,
6905  float* max);
6906 
6907  /*l
6908  *b Description:
6909  **
6910  ** This function sets the maximum angular velocity that the
6911  ** back link angles may attain in pursuit of a gaze or point target.
6912  **
6913  ** Valid link names and defaults:
6914  **
6915  *a back - 30 deg/s
6916  *a cervical - 60 deg/s
6917  *a eye_l - 180 deg/s
6918  *a shoulder_l - 180 deg/s
6919  *a elbow_l - 180 deg/s
6920  **
6921  *b Arguments:
6922  **
6923  *a link_name - name of the link
6924  *a angular_vel - angular velocity in degrees per second
6925  **
6926  *b Returns:
6927  **
6928  ** 0 on success, -1 on failure
6929  */
6930  int set_gaze_link_max_angular_vel(const char* link_name, float angular_vel);
6931 
6933  int get_gaze_link_max_angular_vel(const char* link_name, float* angular_vel);
6934 
6935  /*l
6936  *b Description:
6937  **
6938  ** This function sets how much the link will make up the difference
6939  ** toward the gaze or point target.
6940  **
6941  ** The combination of this function and
6942  ** the tolerances determine how close the
6943  ** link will turn toward the gaze or point target.
6944  **
6945  ** With a smaller scale factor the link will not turn as much toward
6946  ** the target. With a higher scale factor the link will turn more
6947  ** toward the target.
6948  **
6949  ** For example, if the gaze or point target is at 60 degrees yaw in
6950  ** back coordinates and the scale factor is 0.5, the back will turn
6951  ** 30 degrees in pursuit of the target.
6952  **
6953  ** Valid link names and defaults:
6954  **
6955  *a back - 0.75
6956  *a cervical - 0.5
6957  *a eye_l - 1.0
6958  *a shoulder_l - 0.9
6959  *a elbow_l - 1.0
6960  **
6961  *b Arguments:
6962  **
6963  *a link_name - name of the link
6964  *a scale_factor - scale factor between 0 and 1
6965  **
6966  *b Returns:
6967  **
6968  ** 0 on success, -1 on failure
6969  */
6970  int set_gaze_link_scale_factor(const char* link_name, float scale_factor);
6971 
6973  int get_gaze_link_scale_factor(const char* link_name, float* scale_factor);
6974 
6975  /*l
6976  *b Description:
6977  **
6978  ** This function sets whether the character can turn the specified
6979  ** link in pursuit of the gaze target.
6980  **
6981  ** Valid link names and defaults:
6982  **
6983  *a orientation - 0
6984  *a back - 1
6985  *a cervical - 1
6986  *a eye_l - 1 if character has movable eyes, else 0
6987  *a shoulder_l - 0
6988  *a elbow_l - 0
6989  **
6990  *b Arguments:
6991  **
6992  *a link_name - name of the link
6993  *a enabled - 1 to enable, 0 to disable
6994  **
6995  *b Returns:
6996  **
6997  ** 0 on success, -1 on failure
6998  */
6999  int set_link_enabled_for_gaze(const char* link_name, int enabled);
7000 
7002  int get_link_enabled_for_gaze(const char* link_name);
7003 
7004  /*l
7005  *b Description:
7006  **
7007  ** This function sets whether the character can change its current
7008  ** posture in pursuit of the gaze target.
7009  **
7010  ** Gaze can change current posture by default.
7011  **
7012  *b Arguments:
7013  **
7014  *a enabled - 1 to enable, 0 to disable
7015  **
7016  *b Returns:
7017  **
7018  ** 0 on success, -1 on failure
7019  */
7020  int set_gaze_can_change_posture(int enabled);
7021 
7023  int get_gaze_can_change_posture();
7024 
7025  /*l
7026  *b Description:
7027  **
7028  ** This function sets whether the character can change its current
7029  ** variant in pursuit of the gaze target.
7030  **
7031  ** Gaze can change current variant by default.
7032  **
7033  *b Arguments:
7034  **
7035  *a enabled - 1 to enable, 0 to disable
7036  **
7037  *b Returns:
7038  **
7039  ** 0 on success, -1 on failure
7040  */
7041  int set_gaze_can_change_variant(int enabled);
7042 
7044  int get_gaze_can_change_variant();
7045 
7046  /*l
7047  *b Description:
7048  **
7049  ** This function sets whether the character can move the specified
7050  ** link in pursuit of the lpoint target.
7051  **
7052  ** Valid link names and defaults:
7053  **
7054  *a orientation - 0
7055  *a back - 1
7056  *a cervical - 0
7057  *a eye_l - 0
7058  *a shoulder_l - 1
7059  *a elbow_l - 1
7060  **
7061  *b Arguments:
7062  **
7063  *a link_name - name of the link
7064  *a enabled - 1 to enable, 0 to disable
7065  **
7066  *b Returns:
7067  **
7068  ** 0 on success, -1 on failure
7069  */
7070  int set_link_enabled_for_lpoint(const char* link_name, int enabled);
7071 
7073  int get_link_enabled_for_lpoint(const char* link_name);
7074 
7075  /*l
7076  *b Description:
7077  **
7078  ** This function adjusts the current azimuth and elevation offsets
7079  ** of the character's head. If a gaze is ongoing, then the nod will
7080  ** be supplemented to the gazing, and the character will attempt to
7081  ** maintain its gaze.
7082  **
7083  ** This function will have no effect on a dead character (see
7084  ** die_now() and get_dead()).
7085  **
7086  *b Arguments:
7087  **
7088  *a azimuth - rotation offset about z (vertical) axis, in degrees;
7089  *a positive rotates to character's left
7090  *a elevation - rotation offset about y (horizontal) axis, in degrees;
7091  *a positive rotates down
7092  *a duration - how long it should take to attain the new azimuth
7093  *a and elevation
7094  **
7095  *b Returns:
7096  **
7097  ** 0 on success, -1 on failure
7098  */
7099  int set_nod(float azimuth,
7100  float elevation,
7101  float duration = 0.5f);
7102 
7103  /*l
7104  *b Description:
7105  **
7106  ** This function causes the character to nod its head for the
7107  ** specified number of times over the specified duration.
7108  **
7109  ** If nod_count is 0.5, the elevation of the head will move from its
7110  ** current elevation straight to nod_elevation_out. The arguments
7111  ** nod_elevation0 and nod_elevation1 will be ignored.
7112  **
7113  ** If nod_count is 1.0, the elevation of the head will move from
7114  ** its current elevation to nod_elevation0, then to
7115  ** nod_elevation_out. The argument nod_elevation1 will be ignored.
7116  **
7117  ** If nod_count is 1.5 or greater, the nod elevation will begin at
7118  ** its current elevation, move to nod_elevation0, then alternate
7119  ** between nod_elevation0 and nod_elevation1, before finally ending
7120  ** at nod_elevation_out.
7121  **
7122  ** The head will maintain an elevation offset of nod_elevation_out
7123  ** until a new call to nod_head() or set_nod() is made.
7124  **
7125  ** This function overrides any nod settings made by the set_nod()
7126  ** function.
7127  **
7128  ** This function will have no effect on a dead character (see
7129  ** die_now() and get_dead()).
7130  **
7131  *b Arguments:
7132  **
7133  *a duration - for how long the nod should be executed
7134  *a nod_count - how many nods the character should perform;
7135  *a this will be rounded to the nearest multiple
7136  *a of 0.5
7137  *a nod_elevation0 - elevation of initial nod in degrees
7138  *a nod_elevation1 - elevation of return nod in degrees
7139  *a nod_elevation_out - ending elevation when nod is complete
7140  **
7141  *b Returns:
7142  **
7143  ** 0 on success, -1 on failure
7144  **
7145  *b Available as Decision Bead/Event
7146  */
7147  int nod_head(float duration,
7148  float nod_count,
7149  float nod_elevation0 = 15.0f,
7150  float nod_elevation1 = 0.0f,
7151  float nod_elevation_out = 0.0f);
7152 
7153  /*l
7154  *b Description:
7155  **
7156  ** This function is similar to nod_head(), except the direction
7157  ** of head movement is side to side rather than up and down.
7158  ** See the nod_head() function for a detailed description of usage.
7159  **
7160  ** This function will have no effect on a dead character (see
7161  ** die_now() and get_dead()).
7162  **
7163  *b Arguments:
7164  **
7165  *a duration - for how long the shake should be executed
7166  *a shake_count - how shakes the character should perform; this
7167  *a will be rounded to the nearest multiple of
7168  *a 0.5
7169  *a shake_azimuth0 - azimuth of initial shake in degrees
7170  *a shake_azimuth1 - azimuth of return shake in degrees
7171  *a shake_azimuth_out - ending azimuth when shake is complete
7172  **
7173  *b Returns:
7174  **
7175  ** 0 on success, -1 on failure
7176  **
7177  *b Available as Decision Bead/Event
7178  */
7179  int shake_head(float duration,
7180  float shake_count,
7181  float shake_azimuth0 = -20.0f,
7182  float shake_azimuth1 = 20.0f,
7183  float shake_azimuth_out = 0.0f);
7184 
7185  /*l
7186  *b Returns:
7187  **
7188  ** current nod azimuth setting; see set_nod(), nod_head(), and
7189  ** shake_head()
7190  */
7191  float get_nod_azimuth();
7192 
7193  /*l
7194  *b Returns:
7195  **
7196  ** current nod elevation setting; see set_nod(), nod_head(), and
7197  ** shake_head()
7198  */
7199  float get_nod_elevation();
7200 
7201 
7202 /*****************************************************************************/
7223  /*l
7224  *b Description:
7225  **
7226  ** This function sets the current desired azimuth and elevation of
7227  ** the character's aim. The angles are in character-local
7228  ** coordinates. Zero values mean straight ahead and level.
7229  ** Aiming will continue until end_aim() is called.
7230  **
7231  ** This function effectively calls aim_at_angle_local(), with a
7232  ** distance of 10000 meters, and is_new_aim set to 1.
7233  **
7234  ** This function will have no effect on a dead character (see
7235  ** die_now() and get_dead()).
7236  **
7237  *b Arguments:
7238  **
7239  *a azimuth - rotation about z (vertical) axis, in degrees;
7240  *a positive rotates to character's left
7241  *a elevation - rotation about y (horizontal) axis, in degrees;
7242  *a positive rotates down
7243  **
7244  *b Returns:
7245  **
7246  ** 0 on success, -1 on failure
7247  */
7248  int set_aim(float azimuth, float elevation);
7249 
7250  /*l
7251  *b Description:
7252  **
7253  ** This function sets the current azimuth, elevation, and
7254  ** distance of the character's aim. A fixed point in 3D space is
7255  ** then found using the two angles and the given distance from
7256  ** the character's idealized position. Angles are given with
7257  ** respect to the DI-Guy global coordinate system.
7258  **
7259  ** See set_position() for a description of the coordinate
7260  ** system.
7261  **
7262  ** Aiming will continue until end_aim() is called.
7263  **
7264  ** This function will have no effect on a dead character (see
7265  ** die_now() and get_dead()).
7266  **
7267  *b Arguments:
7268  **
7269  *a azimuth - rotation in degrees about up (vertical) axis;
7270  *a begins at 0 at the positive X axis of the DI-Guy
7271  *a coordinate system and proceeds counter-clockwise
7272  *a elevation - rotation in degrees about horizontal axis; positive
7273  *a value rotates down
7274  *a distance - distance in meters from the idealized position of the
7275  *a character to the aim target; positive values only,
7276  *a typically this is a large value (e.g. 10,000 meters)
7277  *a is_new_aim - set to 1 if this is a new aim, for jumping to a
7278  *a new target;
7279  *a set to 0 if this is continuing an already
7280  *a started aim, for tracking an existing target
7281  **
7282  *b Returns:
7283  **
7284  ** 0 on success, -1 on failure
7285  */
7286  int aim_at_angle(float azimuth,
7287  float elevation,
7288  float distance,
7289  int is_new_aim = 1);
7290 
7291  /*l
7292  *b Description:
7293  **
7294  ** This function is identical to aim_at_angle() except that the
7295  ** angles are relative to the character's frame of reference. These
7296  ** relative angles will be maintained even if the character rotates.
7297  **
7298  ** Use get_position() to learn the idealized position. The
7299  ** distance is between the idealized position of the character
7300  ** and the fixation point. Aiming will continue until end_aim()
7301  ** is called.
7302  **
7303  ** This function will have no effect on a dead character (see
7304  ** die_now() and get_dead()).
7305  */
7306  int aim_at_angle_local(float azimuth,
7307  float elevation,
7308  float distance,
7309  int is_new_aim = 1);
7310 
7311  /*l
7312  *b Description:
7313  **
7314  ** This function is identical to aim_at_angle() and aim_at_angle_local(),
7315  ** but includes velocity that will modify the angles every frame.
7316  ** This can be useful in networked simulations where targeting velocity is published.
7317  **
7318  ** This function will have no effect on a dead character (see
7319  ** die_now() and get_dead()).
7320  */
7321  int aim_at_angle_with_velocity(float azimuth, float elevation, float az_vel, float el_vel, int local, int is_new_aim = 1);
7322 
7323  /*l
7324  *b Description:
7325  **
7326  ** This function sets the current fixation point of the
7327  ** character's aim. Point coordinates are given in meters in the
7328  ** DI-Guy global coordinate system.
7329  **
7330  ** The function uses default aim behavior settings. Aiming will
7331  ** continue until end_aim() is called.
7332  **
7333  ** This function will have no effect on a dead character (see
7334  ** die_now() and get_dead()).
7335  **
7336  *b Arguments:
7337  **
7338  *a tx, ty, tz - position in meters from the DI-Guy global
7339  *a origin
7340  *a is_new_aim - set to 1 if this is a new aim;
7341  *a set to 0 if this is continuing an already started aim
7342  **
7343  *b Returns:
7344  **
7345  ** 0 on success, -1 on failure
7346  */
7347  int aim_at_point(float x, float y, float z, int is_new_aim = 1);
7348 
7349  /*l
7350  *b Description:
7351  **
7352  ** This function is identical to aim_at_point() except that the
7353  ** coordinates are relative to the character, in its own coordinate
7354  ** system. Use get_position() to learn the idealized position of the
7355  ** character if necessary.
7356  **
7357  ** This function will have no effect on a dead character (see
7358  ** die_now() and get_dead()).
7359  */
7360  int aim_at_point_local(float x, float y, float z, int is_new_aim = 1);
7361 
7362  /*l
7363  *b Description:
7364  **
7365  ** This function effectively does an aim_at_point() each tick.
7366  ** The point to be aimed at is updated each tick to be the position
7367  ** of the specified link on the specified character.
7368  **
7369  ** This function will have no effect on a dead character (see
7370  ** die_now() and get_dead()).
7371  **
7372  *b Arguments:
7373  **
7374  *a target_character_name - name of the character to be
7375  *a aimed at
7376  *a target_character_link_name - link on the character that should
7377  *a be aimed at; pass NULL or "" to
7378  *a aim at the position link of the
7379  *a character. If NULL is passed,
7380  *a function will make best effort to
7381  *a choose a character-appropriate link
7382  *a to target.
7383  *a offset_tx, offset_ty, offset_tz - offset onto the link, in meters
7384  **
7385  *b Returns:
7386  **
7387  ** 0 on success, -1 on failure
7388  **
7389  *b Available as Decision Bead/Event
7390  **
7391  *b C++ Example:
7392  **
7393  *e // aim at the head of character "soldier-1".
7394  *e ch->aim_at_character("soldier-1",
7395  *e "cervical",
7396  *e 0.0,
7397  *e 0.0,
7398  *e 0.0);
7399  */
7400  int aim_at_character(const char* target_character_name,
7401  const char* target_character_link_name = NULL,
7402  float offset_tx = 0.0f,
7403  float offset_ty = 0.0f,
7404  float offset_tz = 0.0f);
7405 
7406  /*l
7407  *b Description:
7408  **
7409  ** This function terminates aiming started by the set_aim(),
7410  ** aim_at_point(), aim_at_point_local(), aim_at_angle(),
7411  ** aim_at_angle_local(), and aim_at_character() functions.
7412  */
7413  void end_aim();
7414 
7416  const char * get_aim_at_character();
7417 
7419  float get_aim_azimuth();
7420 
7422  float get_aim_elevation();
7423 
7424  /*l
7425  *b Description:
7426  **
7427  ** This function returns values that can be used to compute the
7428  ** character's weapon's trajectory, i.e. the mathematical ray that
7429  ** comes out of the end of the barrel.
7430  **
7431  *b Returns:
7432  **
7433  ** 1 if the character is aiming, 0 if not
7434  **
7435  *b Arguments:
7436  **
7437  *a muzzle_x, muzzle_y, muzzle_z - position of muzzle in meters from
7438  *a the origin
7439  *a far_x, far_y, far_z - position of end target in meters from the
7440  *a origin
7441  **
7442  ** Pass NULL for any values that are not needed.
7443  ** Note: values will be zero if the character isn't currently aiming
7444  */
7445  int get_aim_trajectory(float* muzzle_x, float* muzzle_y, float* muzzle_z,
7446  float* far_x, float* far_y, float* far_z);
7447 
7448  /*l
7449  *b Description:
7450  **
7451  ** Not all actions of a character will be affected by aim
7452  ** commands. This function returns 1 if this character
7453  ** is currently in an aim-able action.
7454  **
7455  *b Returns:
7456  **
7457  ** 1 if current action is aim-able; 0 if not
7458  */
7459  int get_aim_is_possible();
7460 
7461  /*l
7462  *b Returns:
7463  **
7464  ** 1 if the aim is acquired, 0 if not
7465  */
7466  int get_aim_is_acquired();
7467 
7468  /*l
7469  *b Returns:
7470  **
7471  ** 1 if all links participating in the aim have reached a
7472  ** relatively steady state, 0 if not, -1 on error
7473  */
7474  int get_aim_is_steady();
7475 
7476 
7477  /*l
7478  *b Returns:
7479  **
7480  ** 1 if character is currently aiming, 0 if not
7481  */
7482  int get_is_aiming();
7483 
7484 
7485  /******************************************************
7486  **
7487  *3 Aim Algorithm 8 Parameters
7488  **
7489  ** This aim algorithm works by adjusting the aiming character's pose
7490  ** such that the difference between the current aim angles and the
7491  ** desired aim angles is decreased each scenario tick.
7492  **
7493  ** How much of that difference that is made up each frame is
7494  ** determined by the factor parameters. The difference between the
7495  ** desired aim angles and the current aim angles, multiplied by a
7496  ** calculated factor, is added to the current aim angles each frame.
7497  ** This causes the aim to "home in" on the desired aim angles.
7498  **
7499  ** For example, if for each frame the calculated factor is 0.5, half
7500  ** of the difference between the desired and current aim angles is
7501  ** made up.
7502  **
7503  ** Unless otherwise specified, all functions callable from:
7504  **
7505  *- - C++
7506  *- - Script
7507  */
7508 
7509  /*l
7510  *b Description:
7511  **
7512  ** This function sets the steady-state factor that is used once
7513  ** an aim is no longer considered "new".
7514  **
7515  ** See the function set_aim_param_new_aim_duration() for information
7516  ** on when an aim is considered new, and how the effective acquire
7517  ** is calculated from this steady-state acquire factor and the
7518  ** new aim factor.
7519  **
7520  *b Arguments:
7521  **
7522  *a factor - unitless value between 0 and 1; default is 0.6
7523  */
7524  void set_aim_param_acquire_factor(float factor);
7525 
7526  /*l
7527  *b Returns:
7528  **
7529  ** the current aim acquire factor parameter
7530  */
7531  float get_aim_param_acquire_factor();
7532 
7533  /*l
7534  *b Description:
7535  **
7536  ** This function sets the factor that is used when an aim is
7537  ** considered new.
7538  **
7539  ** See the function set_aim_param_new_aim_duration() for information
7540  ** on when an aim is considered new, and how the effective acquire
7541  ** is calculated from this new aim factor and the steady-state acquire
7542  ** factor.
7543  **
7544  *b Arguments:
7545  **
7546  *a factor - unitless value between 0 and 1; default is 0.05
7547  */
7548  void set_aim_param_new_aim_factor(float factor);
7549 
7551  float get_aim_param_new_aim_factor();
7552 
7553  /*l
7554  *b Description:
7555  **
7556  ** This function sets how long an aim is considered "new".
7557  **
7558  ** When an aim is brand-new, the effective acquire factor is equal
7559  ** to the new aim factor as set by set_aim_param_new_aim_factor().
7560  ** When the new aim duration has expired, the effective acquire factor
7561  ** is equal to the steady-state acquire factor as set by
7562  ** set_aim_param_acquire_factor(). In between, the effective acquire
7563  ** factor moves smoothly between the two.
7564  **
7565  ** For example, say that the new aim factor is 0.1, the acquire factor
7566  ** is 0.5, and the new aim duration is 0.2 seconds.
7567  ** If a new aim is started, say by a call to aim_at_angle_local(),
7568  ** the effective acquire factor of the first frame will be 0.1. Over
7569  ** the next 0.2 seconds, the effective acquire factor will smoothly
7570  ** ramp up to 0.5, where it will stay until the aim is acquired.
7571  **
7572  *b Arguments:
7573  **
7574  *a duration - how long, in seconds, a new aim should be considered
7575  *a new; default is 1 second
7576  */
7577  void set_aim_param_new_aim_duration(float duration);
7578 
7580  float get_aim_param_new_aim_duration();
7581 
7582  /*l
7583  *b Description:
7584  **
7585  ** This function sets the maximum factor that can be used for any
7586  ** single frame for aim convergence attempts.
7587  **
7588  ** See set_aim_param_acquire_factor() for a discussion of why setting
7589  ** this too close to 1 is not recommended.
7590  **
7591  *b Arguments:
7592  **
7593  *a factor - unitless value between 0 and 1; default is 0.95
7594  */
7595  void set_aim_param_max_per_frame_adj_factor(float factor);
7596 
7598  float get_aim_param_max_per_frame_adj_factor();
7599 
7600  /*l
7601  *b Description:
7602  **
7603  ** This function sets how close the current aim azimuth must be to
7604  ** the desired aim azimuth in order for the aim to be considered
7605  ** acquired.
7606  **
7607  ** Note that the aim isn't fully acquired until both azimuth and
7608  ** elevation are acquired.
7609  **
7610  ** Setting this value too close to 0 will result in the aim never
7611  ** being acquired.
7612  **
7613  *b Arguments:
7614  **
7615  *a range - how close, in degrees, the azimuth must be for the
7616  *a aim to be acquired; default is 0.5 degrees
7617  */
7618  void set_aim_param_azimuth_acquired_range(float range);
7619 
7621  float get_aim_param_azimuth_acquired_range();
7622 
7623  /*l
7624  *b Description:
7625  **
7626  ** This function sets how close the current aim elevation must be to
7627  ** the desired aim elevation in order for the aim to be considered
7628  ** acquired.
7629  **
7630  ** Note that the aim isn't fully acquired until both azimuth and
7631  ** elevation are acquired.
7632  **
7633  ** Setting this value too close to 0 will result in the aim never
7634  ** being acquired.
7635  **
7636  *b Arguments:
7637  **
7638  *a range - how close, in degrees, the elevation must be for the
7639  *a aim to be acquired; default is 1.0 degrees
7640  */
7641  void set_aim_param_elevation_acquired_range(float range);
7642 
7644  float get_aim_param_elevation_acquired_range();
7645 
7646  /*l
7647  *b Description:
7648  **
7649  ** This function attempts to have the character reach its desired
7650  ** aim angles instantly, every frame.
7651  **
7652  ** Set enabled to 0 to disable instant aim convergence.
7653  **
7654  */
7655  void set_aim_converge_every_frame( int enabled );
7656 
7658  int get_aim_converge_every_frame();
7659 
7662  int set_aim_variable_interpolation_time(float time);
7663  float get_aim_variable_interpolation_time();
7664 
7665 /*****************************************************************************/
7669  const char* get_aim_at_link();
7671 
7673  int get_aim_at_link_offset(float* offset_x, float* offset_y, float* offset_z);
7674 
7676  const char* get_gaze_at_link();
7677 
7679  int get_gaze_at_link_offset(float* offset_x, float* offset_y, float* offset_z);
7680 
7681 /*****************************************************************************/
7691  /*l
7692  *b Description:
7693  **
7694  ** This function causes a character to fire his weapon.
7695  **
7696  ** Different weapons have different "munition types", which specify,
7697  ** among other things, the sound to be played, the network info to be
7698  ** sent, and muzzle flash effect. See
7699  ** get_weapon_muzzle_munition_type() for more information on munition
7700  ** types.
7701  **
7702  ** If the weapon fires live rounds (as set by
7703  ** set_weapon_fires_live_rounds()) this function also computes a
7704  ** bullet trajectory, perhaps hitting and killing another character.
7705  **
7706  ** This function will have no effect on a dead character (see
7707  ** die_now() and get_dead()).
7708  **
7709  *b Returns:
7710  **
7711  ** 0 on success, -1 on failure
7712  **
7713  *b Available as Decision Bead/Event
7714  */
7715  int fire_weapon(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
7716 
7717  /*l
7718  *b Description:
7719  **
7720  ** This function causes a character to fire his weapon the
7721  ** specified number of times. This causes a muzzle flash and
7722  ** the weapon's sound (if any) to be played.
7723  **
7724  ** The sound played will be one of, in order:
7725  **
7726  *- - the passed override_sound_name, or
7727  *- - the sound set by set_weapon_sound_override(), or
7728  *- - the default weapon sound based on the character's appearance
7729  **
7730  ** If the weapon fires live rounds (as set by
7731  ** set_weapon_fires_live_rounds()), this function also computes a
7732  ** trajectory for each round, perhaps hitting and killing
7733  ** another character.
7734  **
7735  ** This function will have no effect on a dead character (see
7736  ** die_now() and get_dead()).
7737  **
7738  *b Arguments:
7739  **
7740  *a count - number of times weapon should be fired
7741  *a override_sound_name - override sound to be played
7742  *a dt - time between firings if count > 1
7743  *a muzzle - muzzle on which flash should appear
7744  **
7745  *b Returns:
7746  **
7747  ** 0 on success, -1 on failure
7748  **
7749  *b Available as Decision Bead/Event
7750  */
7751  int fire_weapon_n_times(int count,
7752  float dt = 0.2f,
7753  const char* override_sound_name = NULL,
7755 
7756  /*l
7757  *b Description:
7758  **
7759  ** Fires a bullet at point (x, y) from the camera, using this
7760  ** character as the attacker.
7761  **
7762  *i Currently OpenGL only.
7763  **
7764  ** This function will have no effect on a dead character (see
7765  ** die_now() and get_dead()).
7766  **
7767  *b Returns:
7768  **
7769  ** number of hits
7770  */
7771  int fire_screen_space_bullet(diguyView* view, float x, float y);
7772 
7773  /*l
7774  *b Returns:
7775  **
7776  ** number of times weapon has been fired from specified muzzle
7777  **
7778  *b Available as Decision Bead/Event
7779  */
7780  int get_weapon_fire_count(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
7781 
7782  /*l
7783  *b Description:
7784  **
7785  ** This function sets the default muzzle that will flash when
7786  ** the character fires its weapon due to a call to fire_weapon()
7787  ** or fire_weapon_n_times().
7788  **
7789  ** The default value is DIGUY_MUZZLE_DEFAULT.
7790  **
7791  *b Arguments:
7792  **
7793  *a muzzle - the muzzle that will flash; muzzle 1 is common
7794  **
7795  *b Returns:
7796  **
7797  ** 0 on success, -1 on failure
7798  */
7799  int set_default_weapon_muzzle(diguyMuzzle muzzle);
7800 
7801  /*l
7802  *b Returns:
7803  **
7804  ** current default weapon muzzle that flashes when the character's
7805  ** weapon is fired; see set_default_weapon_muzzle()
7806  */
7807  diguyMuzzle get_default_weapon_muzzle();
7808 
7809  /*l
7810  *b Description:
7811  **
7812  ** When the character fires its weapon, the results depend on the
7813  ** munition type of the muzzle fired from. Munition types specify,
7814  ** among other things:
7815  **
7816  *- - sound played
7817  *- - muzzle flash effect
7818  *- - network data sent (DIS septet)
7819  *- - detonation effect
7820  *- - detonation radius
7821  *- - etc.
7822  **
7823  ** Default munition types for the each muzzle are set automatically
7824  ** when the character's appearance is set. The munition type of the
7825  ** weapon can be overridden by calling
7826  ** set_weapon_munition_type_override().
7827  **
7828  ** Current munition types include:
7829  **
7830  *- - m16
7831  *- - m4
7832  *- - m60
7833  *- - m240
7834  *- - m249
7835  *- - m9
7836  *- - hand_gun
7837  *- - 50cal
7838  *- - m256
7839  *- - ak47
7840  *- - pk74
7841  *- - dragunov
7842  *- - sa80
7843  *- - rpg
7844  *- - m203
7845  *- - 40mm_hedp
7846  *- - javelin
7847  *- - stinger
7848  *- - at4
7849  *- - sa7
7850  *- - molotov_cocktail
7851  *- - 60mm_mortar
7852  *- - 82mm_mortar
7853  *- - 155mm_artillery
7854  *- - IED_mortar
7855  *- - VBIED
7856  *- - m242
7857  *- - 120mm
7858  *- - 125mm
7859  *- - ced
7860  *- - pepper_spray
7861  **
7862  *b Returns:
7863  **
7864  ** munition type of specified muzzle
7865  */
7866  const char* get_weapon_muzzle_munition_type(diguyMuzzle muzzle);
7867 
7869  const char* get_weapon_supplemental_data_name();
7870 
7872  const char* get_default_muzzle_munition_type();
7873 
7874  /*l
7875  *b Description:
7876  **
7877  ** This function allows the default munition type to be overridden.
7878  ** The default value is NULL (don't override default munition type).
7879  **
7880  *b Arguments:
7881  **
7882  *a munition_type - name of a munition type
7883  **
7884  *b Returns:
7885  **
7886  ** 0 on success, -1 on failure
7887  */
7888  int set_weapon_munition_type_override(const char* munition_type);
7889 
7891  const char* get_weapon_munition_type_override();
7892 
7893  /*l
7894  *b Description:
7895  **
7896  ** This function sets whether the character's weapons fire live
7897  ** rounds. If so, when fire_weapon() and fire_weapon_n_times() are
7898  ** called the trajectory of the bullet will be calculated and checked
7899  ** against characters in the scenario.
7900  **
7901  ** The default value is 1.
7902  **
7903  *b Arguments:
7904  **
7905  *a weapon_fires_live_rounds - set to 1 for live rounds; set to 0
7906  *a for "blanks"
7907  **
7908  *b Returns:
7909  **
7910  ** 0 on success, -1 on failure
7911  **
7912  *b Available as Decision Bead/Event
7913  */
7914  int set_weapon_fires_live_rounds(int weapon_fires_live_rounds);
7915 
7916  /*l
7917  *b Returns:
7918  **
7919  ** current setting of whether weapon fires live rounds or blanks; see
7920  ** set_weapon_fires_live_rounds()
7921  **
7922  *b Available as Decision Bead/Event
7923  */
7924  int get_weapon_fires_live_rounds();
7925 
7926  /*l
7927  *b Description:
7928  **
7929  ** A weapon sound is played when the character fires its weapon
7930  ** due to a call to fire_weapon() or fire_weapon_n_times().
7931  ** The sound that is played is generally derived from the weapon's
7932  ** munition type, which can be different for each muzzle.
7933  **
7934  ** This function overrides the default sound that will be played.
7935  ** Note that this overrides the sound for all muzzles.
7936  **
7937  ** The default value is NULL (don't override default sound).
7938  **
7939  ** To *not* play a sound at all, set the weapon sound gain override
7940  ** to 0.
7941  **
7942  *b Arguments:
7943  **
7944  *a sound - name of a sound defined in the scenario;
7945  *a pass NULL to specify that default should be played
7946  **
7947  *b Returns:
7948  **
7949  ** 0 on success, -1 on failure
7950  */
7951  int set_weapon_sound_override(const char* sound_name);
7952 
7953  /*l
7954  *b Description:
7955  **
7956  ** The function returns the current weapon sound override, if one
7957  ** is set; see set_weapon_sound_override().
7958  **
7959  ** This function will not return NULL. The empty string ("") is
7960  ** returned if a weapon sound override is not set.
7961  **
7962  *b Returns:
7963  **
7964  ** name of weapon sound override
7965  */
7966  const char* get_weapon_sound_override();
7967 
7968  /*l
7969  *b Description:
7970  **
7971  ** This function overrides the default gain on the sound played
7972  ** due to a call to fire_weapon() or fire_weapon_n_times().
7973  **
7974  ** Pass 1.0 to use the sound's default amplitude. Lower numbers
7975  ** decrease volume, higher numbers increase volume.
7976  **
7977  ** Pass 0.0 to completely disable playing of weapon sound.
7978  **
7979  ** The default value is 3.0.
7980  **
7981  ** See set_weapon_sound_override().
7982  **
7983  *b Arguments:
7984  **
7985  *a sound_gain - amount by which to change sound volume
7986  **
7987  *b Returns:
7988  **
7989  ** 0 on success, -1 on failure
7990  */
7991  int set_weapon_sound_gain_override(float gain);
7992 
7994  float get_weapon_sound_gain_override();
7995 
7996  /*l
7997  *b Description:
7998  **
7999  ** This function provides aiming assistance by making it possible for
8000  ** roughly-aimed weapons to hit targets. When spread is nonzero,
8001  ** fire_weapon searches for a target within a conical space centered
8002  ** on the muzzle. Within this cone, the live character within weapon
8003  ** range, and with the smallest angular deviation from the weapon, is
8004  ** chosen, by default, as the target. Other function calls may alter
8005  ** this aiming behavior, making it aim only at enemy targets, for
8006  ** example, or making it prefer close targets to far ones.
8007  **
8008  *b Arguments:
8009  **
8010  *a spread - angular deviation from weapon muzzle within which a
8011  *a target will be found
8012  **
8013  ** Spread values above 145 are suicidal (character can shoot himself).
8014  ** 90 is the highest sensible value, which covers everything ahead
8015  ** of the weapon muzzle. A value of 0 is the default, meaning that
8016  ** only targets in line with the muzzle are hit.
8017  */
8018  void set_weapon_spread(float spread);
8019 
8020  /*l
8021  *b Description:
8022  **
8023  ** This function affects how targets are chosen when
8024  ** the character's weapon_spread is nonzero. Only
8025  ** characters more than near_range meters away from the muzzle
8026  ** will be fired upon. Characters which are closer than
8027  ** near_range meters will not be fired upon.
8028  **
8029  ** This value does not affect weapon behavior when weapon_spread
8030  ** is zero.
8031  **
8032  ** If this function is never called for a character, it is as if
8033  ** the function had been called with a value of zero.
8034  **
8035  *b Arguments:
8036  **
8037  *a near_range - distance closer than which no character will be
8038  *a targeted
8039  */
8040  void set_weapon_near_range(float near_range);
8041  float get_weapon_near_range();
8042 
8043  /*l
8044  *b Description:
8045  **
8046  ** This function sets the range of the character's
8047  ** weapon.
8048  **
8049  ** If this function is never called for a character, it is as if
8050  ** the function had been called with a value of 500.0.
8051  **
8052  *b Arguments:
8053  **
8054  *a far_range - range of the weapon in meters
8055  */
8056  void set_weapon_far_range( float far_range );
8057  float get_weapon_far_range();
8058 
8059  /*l
8060  *b Description:
8061  **
8062  ** This function sets a weapon's ratio of hits to fired rounds. A
8063  ** value of 1.0 (the default) means the weapon will hit everything it
8064  ** is aimed at. Values less than 1.0 cause the weapon to
8065  ** probabilistically miss targets, even when perfectly aimed at them.
8066  ** A value of zero means the weapon doesn't hit anything, even if it
8067  ** is perfectly aimed. A value of 0.5 will hit half of the time.
8068  */
8069  void set_weapon_hit_ratio( float hit_ratio );
8070 
8071  /*l
8072  *b Description:
8073  **
8074  ** This function sets the duration of a weapon's muzzle flash.
8075  ** The duration is specified as the number of frames it will be visible
8076  ** when shown.
8077  */
8078  void set_weapon_flash_duration( int muzzle_flash_duration );
8079 
8080  /*l
8081  *b Description:
8082  **
8083  ** This function sets the number of potential impacts a fired round
8084  ** can have. The default is 1. Specifying more than 1 means the
8085  ** round will completely go through objects, triggering a
8086  ** CALLBACK_ID_IMPACT callback each time, until the maximum number of
8087  ** impacts has been reached.
8088  */
8089  void set_weapon_max_impacts( int val );
8090 
8091  /*l
8092  *b Returns:
8093  **
8094  ** state of accessory1
8095  */
8096  int get_accessory1_state();
8097 
8098  /*l
8099  *b Returns:
8100  **
8101  ** state of the character's rifle
8102  */
8103  int get_rifle_state();
8104 
8105  /*l
8106  *b Description
8107  **
8108  ** This function sets whether the projectiles of certain appearances'
8109  ** weapons (such as rocket launchers and RPGs) are visible. Note that
8110  ** most weapons do not have visible projectiles and this function will
8111  ** therefore have no effect.
8112  **
8113  *b Arguments:
8114  **
8115  *a muzzle - which muzzle's projectile should be shown/hidden
8116  *a is_visible - pass 1 to show, pass 0 to hide
8117  **
8118  *b Returns:
8119  **
8120  ** 0 on success, -1 on failure
8121  */
8122  int set_weapon_projectile_is_visible(diguyMuzzle muzzle, int is_visible);
8123 
8124  /*l
8125  *b Description
8126  **
8127  ** This function returns the most recent setting of
8128  ** set_weapon_projectile_is_visible().
8129  **
8130  *b Arguments:
8131  **
8132  *a muzzle - which muzzle's projectile should be queried
8133  **
8134  *b Returns:
8135  **
8136  ** 1 if visible, 0 if not
8137  */
8138  int get_weapon_projectile_is_visible(diguyMuzzle muzzle);
8139 
8140  /*l
8141  *b Description:
8142  **
8143  ** Retrieves the position and direction of the character's weapon.
8144  **
8145  *b Arguments:
8146  **
8147  *a muzzle_tx, muzzle_ty, muzzle_tz - muzzle position, and beginning
8148  *a of aim vector
8149  *a end_pt_tx, end_pt_ty, end_pt_tz - end point of aim vector
8150  *a muzzle_rz, muzzle_rx, muzzle_ry - orientation of muzzle in degrees
8151  *a muzzle - the muzzle for which the aim vector is needed
8152  *a in_character_local_coordinates - pass 0 for values in world
8153  *a coordinates (the default), 1 for values in character-local
8154  *a coordinates
8155  **
8156  ** The muzzle position and end point are in meters from the origin
8157  ** (if using world coordinates) or in meters from the character's
8158  ** position (if using character-local coordinates).
8159  **
8160  ** The distance of the end point from the muzzle position should
8161  ** be the weapon's far range, set by set_weapon_far_range().
8162  **
8163  ** Pass NULL for any values that are not needed.
8164  **
8165  ** *Note:* The muzzle argument is currently not used, and is present
8166  ** for future implementation.
8167  **
8168  *b Returns:
8169  **
8170  ** 0 on success, -1 on failure
8171  */
8172  int get_weapon_aim_vector(float* muzzle_tx, float* muzzle_ty, float* muzzle_tz,
8173  float* end_pt_tx = NULL, float* end_pt_ty = NULL, float* end_pt_tz = NULL,
8174  float* muzzle_rz = NULL, float* muzzle_rx = NULL, float* muzzle_ry = NULL,
8175  int in_character_local_coordinates = 0,
8177 
8178  /*l
8179  *b Description
8180  **
8181  ** This function returns the link the passed muzzle is associated
8182  ** with. For example, soldier rifle muzzles are attached to the
8183  ** "rifle_joint" link.
8184  **
8185  ** Call get_muzzle_offset() to get the offset of the muzzle on this
8186  ** link.
8187  **
8188  *b Arguments:
8189  **
8190  *a muzzle - muzzle of interest
8191  **
8192  *b Returns:
8193  **
8194  ** name of link, or NULL if the character doesn't have the specified
8195  ** muzzle
8196  */
8197  const char* get_muzzle_link(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
8198 
8199  /*l
8200  *b Description
8201  **
8202  ** This function returns the offset of the muzzle from the link it
8203  ** is attached to as returned by get_muzzle_link().
8204  **
8205  *b Arguments:
8206  **
8207  *a muzzle - muzzle of interest
8208  *a offset_x, offset_y, offset_z - variables in which to return results
8209  **
8210  *b Returns:
8211  **
8212  ** 0 on success, -1 on failure
8213  */
8214  int get_muzzle_offset(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT,
8215  float* offset_x = NULL,
8216  float* offset_y = NULL,
8217  float* offset_z = NULL);
8218 
8219  /*l
8220  *b Description
8221  **
8222  ** This function sets the highest horizontal error possible when the
8223  ** weapon is fired. If non-0, a random horizontal error angle will
8224  ** be computed and added to the weapon's horizontal aim angle.
8225  **
8226  *b Arguments:
8227  **
8228  *a h_error - highest possible horizontal error
8229  **
8230  *b Returns:
8231  **
8232  ** 0 on success, -1 on failure
8233  */
8234  int set_weapon_max_azimuth_error(float h_error);
8235 
8237  float get_weapon_max_azimuth_error();
8238 
8239  /*l
8240  *b Description:
8241  **
8242  ** Similar to set_weapon_max_azimuth_error(), but for vertical aim.
8243  */
8244  int set_weapon_max_elevation_error(float v_error);
8245 
8247  float get_weapon_max_elevation_error();
8248 
8249  /*l
8250  *b Description
8251  **
8252  ** This function sets whether tracer effects will be shown when
8253  ** the weapon is fired. Not all weapons will support this effect.
8254  **
8255  *b Arguments:
8256  **
8257  *a enabled - pass 1 to enable, 0 to disable
8258  **
8259  *b Returns:
8260  **
8261  ** 0 on success, -1 on failure
8262  */
8263  int set_weapon_tracers_enabled(int enabled);
8264 
8266  int get_weapon_tracers_enabled();
8267 
8268  /*l
8269  *b Returns:
8270  **
8271  ** number of rounds until next tracer
8272  */
8273  int get_weapon_rounds_until_tracer(diguyMuzzle muzzle);
8274 
8275 
8276  /*l
8277  *b Description:
8278  **
8279  ** Similar to diguyScenario::trigger_detonation(), but detonation
8280  ** occurs at character's position.
8281  **
8282  *b Arguments:
8283  **
8284  *a munition_name - name of the munition to detonate
8285  *a attacker_name - this MUST be specified if the detonation is being
8286  *a broadcast over the network
8287  *a radius_override - defaults to the data in the munition config file
8288  *a broadcast_on_network - pass 0 to not broadcast detonation on DIS
8289  *a network
8290  **
8291  ** Note: Overriding the detonation radius will NOT work on broadcast
8292  ** detonations since the override value is not transmitted.
8293  */
8294  int trigger_detonation_on_character(const char* munition_name,
8295  const char* attacker_name = NULL,
8296  float radius_override = -1.0f,
8297  int broadcast_on_network = 1);
8298 
8299 
8300 /*****************************************************************************/
8311  /*l
8312  *b Description:
8313  **
8314  ** This function changes the face of the character to reflect the
8315  ** specified user-defined named facial expression.
8316  **
8317  ** Currently affects only "facefx" appearances.
8318  **
8319  *b Arguments:
8320  **
8321  *a facex_name - name of face expression to be applied
8322  *a blend_duration - how long (in seconds) to take to change the face
8323  *a strength - a multiplier between 0 and 1 on the expression
8324  **
8325  ** Face expressions available by default in new scenarios are:
8326  **
8327  *- - Neutral
8328  *- - Smile_cl
8329  *- - Trust
8330  *- - Sad
8331  *- - Mad
8332  *- - Distrust
8333  *- - Conniving
8334  *- - Smile
8335  *- - BrowsDown
8336  *- - BrowsUp
8337  **
8338  ** New face expressions can be added using the
8339  ** diguyScenario::create_face_expression() function.
8340  **
8341  *b Returns:
8342  **
8343  ** 0 on success, -1 on failure
8344  **
8345  *b Available as Decision Bead/Event
8346  **
8347  *b C++ Example:
8348  **
8349  *e diguyCharacter* ch = scenario->get_character_at_index(0);
8350  *e
8351  *e // take one second to get mad
8352  *e ch->set_face_expression("Mad", 1.0);
8353  */
8354  int set_face_expression(const char* facex_name, float blend_duration, float strength = 1.0f);
8355 
8356  /*l
8357  *b Description:
8358  **
8359  ** This function sets the current azimuth and elevation of the
8360  ** character's eyes.
8361  **
8362  ** Currently affects only "facefx" appearances.
8363  **
8364  *b Arguments:
8365  **
8366  *a azimuth - rotation about up (vertical) axis, in degrees;
8367  *a positive rotates to character's left
8368  *a elevation - rotation about forward (horizontal) axis, in degrees;
8369  *a positive rotates down
8370  *a blend_time - how long to take to reach new orientation
8371  **
8372  *b Returns:
8373  **
8374  ** 0 on success, -1 on failure
8375  **
8376  */
8377  int set_orientation_eyes(float azimuth,
8378  float elevation,
8379  float blend_time = 0.0f);
8380 
8381  /*l
8382  *b Description:
8383  **
8384  ** This function gets the current azimuth and elevation of the
8385  ** character's eyes. It currently doesn't take blending into account.
8386  **
8387  ** Currently affects only "facefx" appearances.
8388  **/
8389  int get_orientation_eyes(float* azimuth, float* elevation);
8390 
8391  /*l
8392  *b Description:
8393  **
8394  ** Sets how open the eyes are. The eyes will stay at this level
8395  ** indefinitely. To get automatic blinking behavior, call blink().
8396  **
8397  *b Arguments:
8398  **
8399  *a droop_amount - 1 = eyes closed, 0 = eyes open, 0.5 = half open
8400  **
8401  *b Returns:
8402  **
8403  ** 0 on success, -1 on failure
8404  **
8405  *b Available as Decision Bead/Event
8406  */
8407  int set_eye_droop(float droop_amount, float blend_time = 0.0f);
8408 
8410  float get_eye_droop();
8411 
8412  /*l
8413  *b Description:
8414  **
8415  ** This function blinks the eyes. To have the eyes close to a
8416  ** specific amount and stay there, call set_eye_droop().
8417  **
8418  ** Only characters with expressive face appearances can blink.
8419  **
8420  *b Arguments:
8421  **
8422  *a duration_in - how long in seconds the first part of the blink
8423  *a (typically eyes closing) should take
8424  *a duration_out - how long in seconds the second part of the blink
8425  *a (typically eyes opening) should take
8426  *a target_in - how closed the eyes should be at duration_in
8427  *a target_out - how open the eyes should be at duration_out and
8428  *a thereafter
8429  *a tin - time at which blink should occur; default is now
8430  **
8431  *b Returns:
8432  **
8433  ** 0 on success, -1 on failure
8434  **
8435  *b Available as Decision Bead/Event
8436  */
8437  int blink(float duration_in = 0.1f,
8438  float duration_out = 0.2f,
8439  float target_in = 1.0f,
8440  float target_out = 0.0f,
8441  float tin = DIGUY_DEFAULT_FLOAT);
8442 
8443  /*l
8444  *b Description:
8445  **
8446  ** This function enables automatic eye blinking, so that blinks
8447  ** will happen without further function calls. The various
8448  ** controlling factors of blinks are set by the following functions:
8449  **
8450  *- - set_automatic_blink_duration_in()
8451  *- - set_automatic_blink_duration_out()
8452  *- - set_automatic_blink_target_in()
8453  *- - set_automatic_blink_target_out()
8454  **
8455  ** See blink() for information on what these factors mean.
8456  **
8457  ** Only characters with expressive face appearances can blink.
8458  **
8459  *b Arguments:
8460  **
8461  *a enabled - pass 1 to enable automatic blinks; 0 to disable
8462  *a period - how many seconds between each blink
8463  *a period_variation - variation on how many seconds between
8464  *a each blink
8465  **
8466  ** If blinks are enabled, the first blink will happen immediately.
8467  ** Successive blinks will happen between times (period -
8468  ** period_variation) and (period + period_variation) after the
8469  ** previous blink ends.
8470  **
8471  *b Returns:
8472  **
8473  ** 0 on success, -1 on failure
8474  **
8475  *b Available as Decision Bead/Event
8476  */
8477  int set_automatic_blinks_enabled(int enabled,
8478  float period = 6.0f,
8479  float period_variation = 3.0f);
8480 
8482  int get_automatic_blinks_enabled();
8483 
8484  /*l
8485  *b Description:
8486  **
8487  ** This function sets how long it will take the eye to close during
8488  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8489  ** blink().
8490  **
8491  *b Arguments:
8492  **
8493  *a duration_in - time in seconds for eye droop to go from droop
8494  *a target in to target out
8495  **
8496  *b Available as Decision Bead/Event
8497  */
8498  void set_automatic_blink_duration_in(float duration_in);
8499 
8501  float get_automatic_blink_duration_in();
8502 
8503  /*l
8504  *b Description:
8505  **
8506  ** This function sets how long it will take the eye to open during
8507  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8508  ** blink().
8509  **
8510  *b Arguments:
8511  **
8512  *a duration_out - time in seconds for eye droop to go from droop
8513  *a target out to target in
8514  **
8515  *b Available as Decision Bead/Event
8516  */
8517  void set_automatic_blink_duration_out(float duration_out);
8518 
8520  float get_automatic_blink_duration_out();
8521 
8522  /*l
8523  *b Description:
8524  **
8525  ** This function sets how much the eye will close during
8526  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8527  ** blink().
8528  **
8529  *b Arguments:
8530  **
8531  *a target_in - how far to close eye; 1.0 is all closed, 0.0 is
8532  *a all open
8533  **
8534  *b Available as Decision Bead/Event
8535  */
8536  void set_automatic_blink_target_in(float target_in);
8537 
8539  float get_automatic_blink_target_in();
8540 
8541  /*l
8542  *b Description:
8543  **
8544  ** This function sets how much the eye will open during
8545  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8546  ** blink().
8547  **
8548  *b Arguments:
8549  **
8550  *a target_out - how far to open eye; 1.0 is all closed, 0.0 is
8551  *a all open
8552  **
8553  *b Available as Decision Bead/Event
8554  */
8555  void set_automatic_blink_target_out(float target_out);
8556 
8558  float get_automatic_blink_target_out();
8559 
8560  /*l
8561  *b Returns:
8562  **
8563  ** 1 if the character is speaking, 0 if not. With a FaceFX character
8564  ** this is true if a character is actively playing a FaceFX animation
8565  */
8566  int is_speaking();
8567 
8568  /*l
8569  *b Description:
8570  **
8571  ** FaceFX animations are referred to as a group/animation name.
8572  ** This function allows you to set the current group once.
8573  ** See diguyScenario::facefx_mount_animset() for how to load a new
8574  ** animset on an actor.
8575  */
8576  int set_current_facefx_animation_group(const char* anim_group);
8577 
8578  /*l
8579  *b Returns:
8580  **
8581  ** the current FaceFX animation group set for this character
8582  */
8583  const char* get_current_facefx_animation_group();
8584 
8585  /*l
8586  *b Returns:
8587  **
8588  ** the name of the FaceFX actor that goes with the current head
8589  ** appearance; returns NULL if there's no FaceFX actor
8590  */
8591  const char* get_facefx_actor();
8592 
8593  /*l
8594  *b Description:
8595  **
8596  ** Mounts an animset on the current FaceFX actor. See also
8597  ** diguyScenario::facefx_mount_animset()
8598  */
8599  int facefx_mount_animset(const char* file_name);
8600 
8601  /*l
8602  *b Description:
8603  **
8604  ** Plays a FaceFX animation. This is the main way a facial animation
8605  ** sequence is triggered. The animation can be named
8606  ** "group_name/animation" or just "animation" if the proper group has
8607  ** been set with set_current_facefx_animation_group().
8608  */
8609  int play_facefx_animation(const char* animation,
8610  float magnitude_scale = 1.0f,
8611  float duration_scale = 1.0f,
8612  float blendin_time = 0.1f,
8613  float blendout_time = 0.1f,
8614  int loop = 0);
8615 
8616  /*l
8617  *b Description:
8618  **
8619  ** Stops all active FaceFX animations.
8620  */
8621  int stop_facefx_animations(float blend_time = 0.25f, int stop_sounds = 1);
8622 
8623  /*****************************************************************************/
8628  /*l
8629  *b Returns:
8630  **
8631  ** the number of nodes in the FaceFX actor's face graph
8632  */
8633  int get_num_facefx_nodes();
8634 
8635  /*l
8636  *b Returns:
8637  **
8638  ** the name of the node with index 'index' in the FaceFX actor's face
8639  ** graph
8640  */
8641  const char* get_facefx_node_name(int index);
8642 
8643  /*l
8644  *b Returns:
8645  **
8646  ** the index of the node with name 'node_name'
8647  */
8648  int find_facefx_node_index(const char* node_name);
8649 
8650  /*l
8651  *b Description:
8652  **
8653  ** Allows low level control of individual nodes of the characters face
8654  ** graph. End users can use this function to get finer grained
8655  ** control over eye direction and emotional state.
8656  */
8657  int set_facefx_node_value(int node_index,
8658  float value,
8659  float blend_time = 0.25f);
8660 
8661  /*l
8662  *b Description:
8663  **
8664  ** Retrieves the current final value of a node
8665  **/
8666  float get_facefx_node_value(int node_index);
8667 
8668 /*****************************************************************************/
8712  /*l
8713  *b Description:
8714  **
8715  ** This function creates (but does not begin) the specified gesture.
8716  ** Exact control over the gesture, such as number of repetitions,
8717  ** when the gesture should begin, when it should end, when it
8718  ** should reach specific points within the gestures, etc., is then
8719  ** possible by making calls through the returned
8720  ** diguyCharacterGesture object.
8721  **
8722  ** To begin execution of the gesture, call the begin_now() function
8723  ** of the diguyCharacterGesture object.
8724  **
8725  ** *Do not* call delete on the returned object. It should be
8726  ** destroyed either by calling destroy_gesture(), or by calling
8727  ** set_automatic_destroy_flag(1) on the diguyCharacterGesture
8728  ** object.
8729  **
8730  *b Arguments:
8731  **
8732  *a gesture_name - name of the gesture of create
8733  **
8734  *b Returns:
8735  **
8736  ** pointer to object of type diguyCharacterGesture
8737  */
8738  diguyCharacterGesture* create_gesture(const char* gesture_name);
8739 
8740  /*l
8741  *b Description:
8742  **
8743  ** This function destroys a gesture object created by
8744  ** create_gesture().
8745  **
8746  *b Arguments:
8747  **
8748  *a gesture - gesture to destroy
8749  **
8750  *b Returns:
8751  **
8752  ** 0 on success, -1 on failure
8753  */
8754  int destroy_gesture(diguyCharacterGesture* gesture);
8755 
8756  /*l
8757  *b Description:
8758  **
8759  ** This function executes the specified gesture or motion file on disk.
8760  **
8761  ** The gesture will automatically begin and end. The only control
8762  ** over the executed gesture is whether is should be ended or aborted
8763  ** early. See end_executing_gesture() and abort_executing_gesture().
8764  ** For full control of gesture attributes, use create_gesture()
8765  ** instead.
8766  **
8767  ** A gesture takes over control of a subset of a character's pose
8768  ** variables and can be overlaid on top of most base actions of the
8769  ** character.
8770  **
8771  ** Note that gestures should be preloaded at the beginning of a
8772  ** scenario to avoid a hitch in frame rate. See the function
8773  ** diguyScenario::preload_gesture().
8774  **
8775  ** This function will have no effect on a dead character (see
8776  ** die_now() and get_dead()).
8777  **
8778  *b Arguments:
8779  **
8780  *a gesture_name - name of the gesture to execute, as of diguy 13.2 this can be
8781  *a a bdm file, and a full body gesture will be created on the fly.
8782  *a reps - how many times the gesture should be
8783  *a repeated; default is 1 if no duration
8784  *a is specified, or best fit if there is
8785  *a a duration specified
8786  *a overall_duration - for how long the gesture should be executed;
8787  *a default is such that no time scaling occurs
8788  *a channel_A_weight - the weight given to channel A of the
8789  *a gesture; ignored if the gesture does not
8790  *a have multiple channels
8791  **
8792  ** If the gesture is a multi-stage gesture, the overall duration
8793  ** will be spread proportionately over each stage.
8794  **
8795  *b Returns:
8796  **
8797  ** 0 on success, -1 on failure
8798  **
8799  *b Available as Decision Bead/Event
8800  */
8801  int execute_gesture(const char* gesture_name,
8802  int reps = DIGUY_DEFAULT_INT,
8803  float overall_duration = DIGUY_DEFAULT_FLOAT,
8804  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8805 
8806  /*l
8807  *b Description:
8808  **
8809  ** The gesture will automatically begin and end. The only control
8810  ** over the executed gesture is whether is should be ended or aborted
8811  ** early. See end_executing_gesture() and abort_executing_gesture().
8812  ** For full control of gesture attributes, use create_gesture()
8813  ** instead.
8814  **
8815  ** If the specified gesture is not a 1 stage gesture, no gesture
8816  ** is executed and an error value is returned.
8817  **
8818  ** The specified gesture can be a one or two channel 1 stage gesture,
8819  ** in which case the specified channel weight will be used over the
8820  ** course of the entire gesture.
8821  **
8822  ** A 1 stage gesture is a comprised of a single motion that begins
8823  ** and ends the gesture.
8824  **
8825  ** n repetitions of a 1 stage gesture will repeat the stage 1
8826  ** motion n times.
8827  **
8828  ** This function will have no effect on a dead character (see
8829  ** die_now() and get_dead()).
8830  **
8831  *b Arguments:
8832  **
8833  *a gesture_name - name of the gesture of execute
8834  *a reps - how many times the gesture should be
8835  *a repeated; default is 1 if no duration
8836  *a is specified, or best fit if there is
8837  *a a duration specified
8838  *a stage1_duration - how long stage 1 of the gesture should take;
8839  *a default is such that no time scaling occurs
8840  *a channel_A_weight - the weight given to channel A of the
8841  *a gesture; ignored if the gesture does not
8842  *a have multiple channels
8843  **
8844  *b Returns:
8845  **
8846  ** 0 on success, -1 on failure
8847  */
8848  int execute_1stage_gesture(const char* gesture_name,
8849  int reps = DIGUY_DEFAULT_INT,
8850  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8851  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8852 
8853  /*l
8854  *b Description:
8855  **
8856  ** This function is similar to execute_1stage_gesture().
8857  **
8858  ** Stage 1 of a 2 stage gesture is a motion that begins the gesture
8859  ** and leads to the "peak" of the gesture.
8860  **
8861  ** Stage 2 of a 2 stage gesture is the motion that returns the
8862  ** gesture from the "peak" to the starting position.
8863  **
8864  ** n repetitions of a 2 stage gesture will repeat the stage 1 motion
8865  ** followed by the stage 2 motion n times.
8866  **
8867  ** This function will have no effect on a dead character (see
8868  ** die_now() and get_dead()).
8869  **
8870  *b Arguments:
8871  **
8872  *a gesture_name - name of the gesture of execute
8873  *a reps - how many times the gesture should be
8874  *a repeated; default is 1 if no duration
8875  *a is specified, or best fit if there is
8876  *a a duration specified
8877  *a stage1_duration - how long stage 1 of the gesture should take,
8878  *a i.e., how far into the gesture the "peak"
8879  *a will occur;
8880  *a default is such that no time scaling occurs
8881  *a stage2_duration - how long stage 2 of the gesture should take;
8882  *a default is such that no time scaling occurs
8883  *a channel_A_weight - the weight given to channel A of the
8884  *a gesture; ignored if the gesture does not
8885  *a have multiple channels
8886  **
8887  *b Returns:
8888  **
8889  ** 0 on success, -1 on failure
8890  */
8891  int execute_2stage_gesture(const char* gesture_name,
8892  int reps = DIGUY_DEFAULT_INT,
8893  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8894  float stage2_duration = DIGUY_DEFAULT_FLOAT,
8895  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8896 
8897  /*l
8898  *b Description:
8899  **
8900  ** This function is similar to execute_1stage_gesture().
8901  **
8902  ** Stage 1 of a 3 stage gesture is a motion that begins the gesture
8903  ** and leads to stage 2; e.g., raising the right arm in preparation
8904  ** for waving.
8905  **
8906  ** Stage 2 of a 3 stage gesture is a motion that can loop
8907  ** indefinitely; e.g., waving the right arm back and forth.
8908  **
8909  ** Stage 3 of a 3 stage gesture is the motion that ends the gesture;
8910  ** e.g., returning the right arm to the side of the body to complete
8911  ** the wave.
8912  **
8913  ** n repetitions of a 3 stage gesture will play the stage 1 motion
8914  ** once, followed by n reps of the stage 2 motion, followed by 1
8915  ** stage 3 motion.
8916  **
8917  ** This function will have no effect on a dead character (see
8918  ** die_now() and get_dead()).
8919  **
8920  *b Arguments:
8921  **
8922  *a gesture_name - name of the gesture of execute
8923  *a reps - how many times the gesture should be
8924  *a repeated; default is 1 if no duration
8925  *a is specified, or best fit if there is
8926  *a a duration specified
8927  *a stage1_duration - how long stage 1 of the gesture should take;
8928  *a default is such that no time scaling occurs
8929  *a stage2_duration - how long each repetition of stage 2 of the
8930  *a gesture should take;
8931  *a default is such that no time scaling occurs
8932  *a stage3_duration - how long stage 3 of the gesture should take;
8933  *a default is such that no time scaling occurs
8934  *a channel_A_weight - the weight given to channel A of the
8935  *a gesture; ignored if the gesture does not
8936  *a have multiple channels
8937  **
8938  *b Returns:
8939  **
8940  ** 0 on success, -1 on failure
8941  */
8942  int execute_3stage_gesture(const char* gesture_name,
8943  int reps = DIGUY_DEFAULT_INT,
8944  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8945  float stage2_duration = DIGUY_DEFAULT_FLOAT,
8946  float stage3_duration = DIGUY_DEFAULT_FLOAT,
8947  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8948 
8949  /*l
8950  *b Description:
8951  **
8952  ** The gesture will automatically begin and end. The only control
8953  ** over the executed gesture is whether is should be ended or aborted
8954  ** early. See end_executing_gesture() and abort_executing_gesture().
8955  ** For full control of gesture attributes, use create_gesture()
8956  ** instead.
8957  **
8958  ** This function serves as a quick way of executing a table gesture.
8959  ** There are many capabilities of table gestures that are accessible
8960  ** only through the full diguyCharacterGesture object.
8961  **
8962  ** If the specified gesture is not a table gesture, no gesture is
8963  ** executed and an error value is returned.
8964  **
8965  ** A table stage gesture is a comprised of a table of gesture actions
8966  ** that can be transitioned between without going through a neutral
8967  ** position.
8968  **
8969  ** n repetitions of a table gesture will repeat the loop action
8970  ** n times.
8971  **
8972  ** This function will have no effect on a dead character (see
8973  ** die_now() and get_dead()).
8974  **
8975  *b Arguments:
8976  **
8977  *a gesture_name - name of the gesture of execute
8978  *a reps - how many times the gesture should be repeated;
8979  *a default is 1
8980  *a loop_action - which action in the gesture should be looped;
8981  *a default is action at index 1 of table
8982  *a begin_action - which action the gesture should begin from;
8983  *a default is action at index 0
8984  *a end_action - which action the gesture should end at;
8985  *a default is action at index 0
8986  **
8987  *b Returns:
8988  **
8989  ** 0 on success, -1 on failure
8990  */
8991  int execute_table_gesture(const char* gesture_name,
8992  int reps = DIGUY_DEFAULT_INT,
8993  const char* loop_action = NULL,
8994  const char* begin_action = NULL,
8995  const char* end_action = NULL);
8996 
8997  /*l
8998  *b Description:
8999  **
9000  ** Executes the given gesture and performs the given action as a table action.
9001  **
9002  *b Arguments:
9003  **
9004  *a gesture_name - name of the gesture to execute
9005  *a desired_action - name of table action to perform
9006  **
9007  *b Returns:
9008  **
9009  ** 0 on success, -1 on failure
9010  **
9011  **/
9012  int set_executing_table_gesture_desired_action(const char* gesture_name,
9013  const char* desired_action);
9014 
9015  /*l
9016  *b Description:
9017  **
9018  ** This function alerts the specified gesture that it should end.
9019  ** The gesture will stop repeating and play its "out" motions as
9020  ** soon as possible.
9021  **
9022  ** In order to immediately stop the gesture, use the
9023  ** abort_executing_gesture() function.
9024  **
9025  *b Arguments:
9026  **
9027  *a gesture_name - name of executing gesture to end
9028  **
9029  *b Returns:
9030  **
9031  ** 0 on success, -1 on failure
9032  **
9033  *b See Also:
9034  **
9035  ** abort_executing_gesture()
9036  */
9037  int end_executing_gesture(const char* gesture_name);
9038 
9039  /*l
9040  *b Description:
9041  **
9042  ** This function aborts a gesture previously executed by one of
9043  ** the execute_*_gesture() calls, if it is currently executing.
9044  ** If a gesture with the given name is not executing, this function
9045  ** will have no effect.
9046  **
9047  ** This call won't cause the gesture to switch to its "out" motion;
9048  ** it is a straight-forward blend out of whatever the gesture is
9049  ** currently doing. Use the end_executing_gesture() call to make
9050  ** the gesture play its "out" motion as soon as possible,
9051  ** therefore ending the gesture in a smoother way.
9052  **
9053  *b Arguments:
9054  **
9055  *a gesture_name - name of executing gesture to abort
9056  *a max_rampdown_interval - max amount of time spent trying to
9057  *a smooth over any motion seams; set
9058  *a to 0.5 for a smooth transition, set
9059  *a to 0 for an immediate abort
9060  **
9061  *b Returns:
9062  **
9063  ** 0 on success, -1 on failure
9064  **
9065  *b See Also:
9066  **
9067  ** end_executing_gesture(), abort_all_gestures()
9068  */
9069  int abort_executing_gesture(const char* gesture_name,
9070  float max_rampdown_interval = .5f);
9071 
9072  /*l
9073  *b Description:
9074  **
9075  ** This function alerts all active gestures that they should end.
9076  ** The gestures will stop repeating and play their "out" motions as
9077  ** soon as possible.
9078  **
9079  ** In order to immediately stop all gestures, use the
9080  ** abort_all_gestures() function.
9081  **
9082  *b Returns:
9083  **
9084  ** 0 on success, -1 on failure
9085  **
9086  *b See Also:
9087  **
9088  ** abort_all_gestures(), diguyCharacterGesture::end_gesture()
9089  */
9090  int end_all_gestures();
9091 
9092  /*l
9093  *b Description:
9094  **
9095  ** This function aborts all active gestures. All gestures will
9096  ** immediately begin to lose their effect on the
9097  ** character's pose.
9098  **
9099  ** This won't cause the gestures to switch to their "out" motions;
9100  ** it is a straight-forward blend out of whatever the gesture is
9101  ** currently doing. Use the end_all_gestures() call to make all
9102  ** active gestures play their "out" motions as soon as possible,
9103  ** therefore ending the gestures in a smoother way.
9104  **
9105  *b Arguments:
9106  **
9107  *a max_rampdown_interval - max amount of time spent trying to
9108  *a smooth over any motion seams; set
9109  *a to 0.5 for a smooth transition, set
9110  *a to 0 for an immediate abort
9111  **
9112  *b Returns:
9113  **
9114  ** 0 on success, -1 on failure
9115  **
9116  *b See Also:
9117  **
9118  ** end_all_gestures(), diguyCharacterGesture::abort_now()
9119  */
9120  int abort_all_gestures(float max_rampdown_interval);
9121 
9122 
9123 /*****************************************************************************/
9155  /*l
9156  *b Description:
9157  **
9158  ** This function will play the specified sound. The sound will be
9159  ** "ambient"; i.e., it will be equally audible from everywhere within
9160  ** the world. Use the function play_3d_sound() to play a sound that
9161  ** moves with the character.
9162  **
9163  ** This function will have no effect on a dead character (see
9164  ** die_now() and get_dead()).
9165  **
9166  ** Unless the sound loops, the sound will play to completion and then
9167  ** stop. To stop the sound early or stop a looping sound call
9168  ** diguyCharacter::stop_all_sounds() or diguyCharacter::stop_sound().
9169  **
9170  *b Arguments
9171  **
9172  *a sound_name - name of sound to play
9173  *a sound_gain - by how much sound's amplitude should be multiplied
9174  *a sound_loop - indicates that sound should loop indefinitely
9175  **
9176  ** There must be a diguySound in the scenario with the passed
9177  ** sound_name. See diguyScenario::create_sound().
9178  **
9179  ** See set_current_voice_actor() for information on how a voice actor
9180  ** can change which sound in the scenario is selected.
9181  **
9182  *b Returns:
9183  **
9184  ** 0 on success, -1 on failure
9185  **
9186  *b Available as Decision Bead/Event
9187  */
9188  int play_sound(const char* sound_name,
9189  float sound_gain = 1.0f,
9190  int sound_loops = 0);
9191 
9192  /*l
9193  *b Description:
9194  **
9195  ** This function will play the specified sound at the character's
9196  ** location. As the character moves, the sound will move with it.
9197  ** Use the function play_sound() to play a sound that is ambient and
9198  ** does not move with the character.
9199  **
9200  ** Note that not all sound modules support 3D sounds.
9201  **
9202  ** This function will have no effect on a dead character (see
9203  ** die_now() and get_dead()).
9204  **
9205  ** Unless the sound loops, the sound will play to completion and then
9206  ** stop. To stop the sound early or stop a looping sound call
9207  ** diguyCharacter::stop_all_sounds() or diguyCharacter::stop_sound().
9208  **
9209  *b Arguments
9210  **
9211  *a sound_name - the name of the sound to play
9212  *a sound_gain - by how much the sound's amplitude
9213  *a should be multiplied
9214  *a sound_loop - indicates that the sound should loop
9215  *a indefinitely
9216  **
9217  ** There must be a diguySound in the scenario with the passed
9218  ** sound_name. See diguyScenario::create_sound().
9219  **
9220  ** See set_current_voice_actor() for information on how a voice actor
9221  ** can change which sound in the scenario is selected.
9222  **
9223  *b Returns:
9224  **
9225  ** 0 on success, -1 on failure
9226  **
9227  *b Available as Decision Bead/Event
9228  */
9229  int play_3d_sound(const char* sound_name,
9230  float sound_gain = 1.0f,
9231  int sound_loops = 0);
9232 
9233  /*l
9234  *b Description:
9235  **
9236  ** This function creates (but does not start playing) an instance of
9237  ** the specified sound.
9238  **
9239  ** Exact control over the sound instance is possible by making calls
9240  ** through the returned diguySoundInstance object.
9241  **
9242  ** To begin playing the sound, call diguySoundInstance::begin_now().
9243  **
9244  ** *Do not* call delete on the returned object. It should be
9245  ** destroyed either by calling diguyCharacter::destroy_sound_instance()
9246  ** or by calling diguySoundInstance::set_automatic_destroy_flag(1) on
9247  ** the returned object.
9248  **
9249  *b Arguments:
9250  **
9251  *a sound_name - name of the sound for which to create an instance
9252  **
9253  ** There must be a diguySound in the scenario with the passed
9254  ** sound_name. See diguyScenario::create_sound().
9255  **
9256  *b Returns:
9257  **
9258  ** pointer to object of type diguySoundInstance
9259  */
9260  diguySoundInstance* create_sound_instance(const char* sound_name);
9261 
9262  /*l
9263  *b Description:
9264  **
9265  ** This function destroys a sound instance object created by
9266  ** create_sound_instance().
9267  **
9268  ** Do not destroy a sound for which the
9269  ** diguySoundInstance::set_automatic_destroy_flag(1) has been called.
9270  **
9271  *b Arguments:
9272  **
9273  *a sound_instance - sound instance to destroy
9274  **
9275  *b Returns:
9276  **
9277  ** 0 on success, -1 on failure
9278  */
9279  int destroy_sound_instance(diguySoundInstance* sound_instance);
9280 
9281  /*l
9282  *b Description:
9283  **
9284  ** This function stops all active sound instances from this character.
9285  ** All sounds being played by this character will fade out and stop
9286  ** after rampdown_time, by default fade out is instant.
9287  **
9288  ** Sound instances that are automatically managed will be destroyed.
9289  ** This includes sound started by a call to
9290  ** diguyCharacter::play_sound() or a sound instance whose
9291  ** set_automatic_destroy_flag() function has been called.
9292  **
9293  ** diguySoundInstance pointers returned by a call to
9294  ** diguyCharacter::create_sound_instance(), which have not been set to
9295  ** be automatically destroyed, will still be valid.
9296  **
9297  *b Arguments:
9298  **
9299  *a rampdown_time - how long to fade out the sound
9300  **
9301  *b Returns:
9302  **
9303  ** 0 on success, -1 on failure
9304  **
9305  *b Available as Decision Bead/Event
9306  */
9307  int stop_all_sounds(float rampdown_time = 0.0f);
9308 
9309  /*l
9310  *b Description:
9311  **
9312  ** This function stops a named sound instance from this character.
9313  **
9314  ** Sound instances that are automatically managed will be destroyed.
9315  ** This includes sound started by a call to
9316  ** diguyCharacter::play_sound() or a sound instance whose
9317  ** set_automatic_destroy_flag() function has been called.
9318  **
9319  ** diguySoundInstance pointers returned by a call to
9320  ** diguyCharacter::create_sound_instance(), which have not been set to
9321  ** be automatically destroyed, will still be valid.
9322  **
9323  *b Arguments:
9324  **
9325  *a sound_name - the name of the sound to stop
9326  *a rampdown_time - how long to fade out the sound
9327  **
9328  *b Returns:
9329  **
9330  ** 0 on success, -1 on failure
9331  **
9332  *b Available as Decision Bead/Event
9333  */
9334  int stop_sound(const char* sound_name, float rampdown_time = 0.0f);
9335 
9336  /*l
9337  *b Returns:
9338  **
9339  ** 1 if the character is playing a the sound specified, 0 if not
9340  */
9341  int is_playing_sound(const char* sound_name);
9342 
9343  /*l
9344  *b Description:
9345  **
9346  ** Sets the "voice actor" for the character.
9347  **
9348  ** Having a voice actor can change which sounds from the scenario a
9349  ** character selects when the diguyCharacter::play_sound() or
9350  ** diguyCharacter::play_3d_sound().
9351  **
9352  ** When play_sound() is called the character asks the scenario for
9353  ** the sound with the specified name. If a voice actor has been set
9354  ** the character will first ask the scenario for the sound name
9355  ** prepended with the voice actor and a slash ("/"). If there isn't
9356  ** a sound with that modified name, it will ask the scenario for a
9357  ** sound with the exact specified name.
9358  **
9359  ** For example, if the character has the voice actor "carl" and is
9360  ** told to play the sound "run_away", the character will first look
9361  ** for a sound named "carl/run_away". If that isn't found, it will
9362  ** look for a sound named "run_away". (If that isn't found no sound
9363  ** is played.)
9364  **
9365  *b Lua Example:
9366  **
9367  ** A more specific example: say that various characters in the
9368  ** scenario need to say "hello". Some of the characters are male,
9369  ** some are female. There are two ways this can be set up.
9370  **
9371  ** The first way, not using a voice actor, is to have two sounds
9372  ** specified in the scenario: "male_hello" and "female_hello". These
9373  ** sounds specify the sound files "male_hello.wav" and
9374  ** "female_hello.wav", respectively. A male character would then do
9375  ** the following to say hello:
9376  **
9377  *e male_character:play_sound("male_hello")
9378  **
9379  ** A female character would do:
9380  **
9381  *e female_character:play_sound("female_hello")
9382  **
9383  ** This is fine, except when one script or character mind needs to be
9384  ** shared by a range of characters, some male and some female.
9385  **
9386  ** In this case it's better to use a voice actor. Say that the sounds
9387  ** specified above have the names "male/hello" and "female/hello";
9388  ** they still have the separate sound files specified. If the
9389  ** character has its voice actor specified as "male" and is told to
9390  ** play the sound "hello", it will select the sound "male/hello" as
9391  ** the sound to play. If its voice actor is "female" and is told to
9392  ** play the sound "hello", it will select the sound "female/hello".
9393  **
9394  *e -- called earlier: character:set_voice_actor("male")
9395  *e character:play_sound("hello") -- plays sound "male/hello"
9396  **
9397  *e -- called earlier: character:set_voice_actor("female")
9398  *e character:play_sound("hello") -- plays sound "female/hello"
9399  **
9400  *b Arguments:
9401  **
9402  *a voice_actor - name of voice actor
9403  **
9404  ** voice_actor can be an arbitrary string. It doesn't need to match
9405  ** any character name, but should have matching sounds specified in
9406  ** the scenario.
9407  **
9408  *b Returns:
9409  **
9410  ** 0 on success, -1 on failure
9411  */
9412  int set_current_voice_actor(const char* voice_actor);
9413 
9415  const char* get_current_voice_actor();
9416 
9417 
9418 /*****************************************************************************/
9454  /*l
9455  *b Description:
9456  **
9457  ** This function returns the state of the character in the form
9458  ** required by DIS.
9459  **
9460  ** Note that there is no corresponding set_DIS_lifeform_state()
9461  ** function. The lifeform state is derived from the character's
9462  ** action, posture, and variant information.
9463  **
9464  *b Returns:
9465  **
9466  ** one of the following values defined in diguy_dis_constants.h:
9467  **
9468  *- DIGUY_DIS_LIFEFORM_UNUSED (0)
9469  *- DIGUY_DIS_LIFEFORM_UPRIGHT_STANDING_STILL (1)
9470  *- DIGUY_DIS_LIFEFORM_UPRIGHT_WALKING (2)
9471  *- DIGUY_DIS_LIFEFORM_UPRIGHT_RUNNING (3)
9472  *- DIGUY_DIS_LIFEFORM_KNEELING (4)
9473  *- DIGUY_DIS_LIFEFORM_PRONE (5)
9474  *- DIGUY_DIS_LIFEFORM_CRAWLING (6)
9475  *- DIGUY_DIS_LIFEFORM_SWIMMING (7)
9476  *- DIGUY_DIS_LIFEFORM_PARACHUTING (8)
9477  *- DIGUY_DIS_LIFEFORM_JUMPING (9)
9478  *- DIGUY_DIS_LIFEFORM_SITTING (10)
9479  *- DIGUY_DIS_LIFEFORM_SQUATTING (11)
9480  *- DIGUY_DIS_LIFEFORM_CROUCHING (12)
9481  *- DIGUY_DIS_LIFEFORM_WADING (13)
9482  **
9483  *b Callable For Networked Entities That Are:
9484  **
9485  *- - DIS published and reflected
9486  */
9487  int get_DIS_lifeform_state();
9488 
9489  /*l
9490  *b Description:
9491  **
9492  ** This function returns the position of the character's
9493  ** primary weapon, in the form required by DIS.
9494  **
9495  *b Returns:
9496  **
9497  ** one of the following values defined in diguy_dis_constants.h:
9498  **
9499  *- DIGUY_DIS_PRIMARY_WEAPON_NOT_PRESENT (0)
9500  *- DIGUY_DIS_PRIMARY_WEAPON_STOWED (1)
9501  *- DIGUY_DIS_PRIMARY_WEAPON_DEPLOYED (2)
9502  *- DIGUY_DIS_PRIMARY_WEAPON_IN_FIRING_POSITION (3)
9503  **
9504  *b Callable For Networked Entities That Are:
9505  **
9506  *- - DIS published
9507  */
9508  int get_DIS_primary_weapon_position();
9509 
9510  /*l
9511  *b Description:
9512  **
9513  ** This function returns the position of the character's
9514  ** secondary weapon, in the form required by DIS.
9515  **
9516  *b Returns:
9517  **
9518  ** one of the following values defined in diguy_dis_constants.h:
9519  **
9520  *- DIGUY_DIS_SECONDARY_WEAPON_NOT_PRESENT (0)
9521  *- DIGUY_DIS_SECONDARY_WEAPON_STOWED (1)
9522  *- DIGUY_DIS_SECONDARY_WEAPON_DEPLOYED (2)
9523  *- DIGUY_DIS_SECONDARY_WEAPON_IN_FIRING_POSITION (3)
9524  **
9525  *b Callable For Networked Entities That Are:
9526  **
9527  *- - DIS published
9528  */
9529  int get_DIS_secondary_weapon_position();
9530 
9531  /*l
9532  *b Description:
9533  **
9534  ** This function sets the Marking Text for characters that are
9535  ** published to the network by DI-Guy Networking. The default
9536  ** network marking is the empty string "".
9537  **
9538  ** This function should only be called for published characters.
9539  ** The Marking Text is set internally for reflected characters.
9540  **
9541  *b Returns:
9542  **
9543  ** 0 on success, -1 on failure
9544  **
9545  *b Callable For Networked Entities That Are:
9546  **
9547  *- - DIS published
9548  *- - HLA published
9549  */
9550  int set_network_marking(const char* network_marking);
9551 
9552  /*l
9553  *b Description:
9554  **
9555  ** This function gets the Marking Text for characters.
9556  **
9557  ** For published characters this value will be what was most
9558  ** recently set by set_network_marking().
9559  **
9560  ** For reflected characters this value will be read from the
9561  ** reflected characters' entity state information.
9562  **
9563  *b Returns:
9564  **
9565  ** character's Marking Text; will never be NULL
9566  **
9567  *b Callable For Networked Entities That Are:
9568  **
9569  *- - DIS published and reflected
9570  *- - HLA published and reflected
9571  */
9572  const char* get_network_marking();
9573 
9574  /*l
9575  *b Description:
9576  **
9577  ** This function sets whether this character will be published
9578  ** by DI-Guy Networking. This value is persistent, and does
9579  ** not depend on whether there actually *is* currently a
9580  ** network connection.
9581  **
9582  ** The default is 1, the character is published.
9583  **
9584  ** This function should *not* be called for reflected characters.
9585  ** It affects to both DIS and HLA networking.
9586  **
9587  *b Returns:
9588  **
9589  ** 0 on success, -1 on failure
9590  **
9591  *b Callable For Networked Entities That Are:
9592  **
9593  *- - DIS published
9594  *- - HLA published
9595  */
9596  int set_is_network_published(int is_network_published);
9597 
9598  /*l
9599  *b Description:
9600  **
9601  ** This function returns whether the character is published
9602  ** by DI-Guy Networking. It will always return 0 for reflected
9603  ** characters.
9604  **
9605  ** This function can be called for any character.
9606  **
9607  *b Returns:
9608  **
9609  ** 1 if published, 0 if not
9610  **
9611  *b Available as Decision Bead/Event
9612  **
9613  *b Callable For Networked Entities That Are:
9614  **
9615  *- - DIS published and reflected
9616  *- - HLA published and reflected
9617  */
9618  int get_is_network_published();
9619 
9620  /*l
9621  *b Description:
9622  **
9623  ** Experimental function that returns a vrlink entity state repository,
9624  ** useful for adding additional information to a diguy that we don't usually
9625  ** model.
9626  */
9627  DtEntityStateRepository * get_vrlink_entity_state_repository();
9628 
9629  /*l
9630  *b Description:
9631  **
9632  ** This function returns whether the character is a
9633  ** reflected character created by DI-Guy Networking.
9634  **
9635  ** This function can be called for any character.
9636  **
9637  *b Returns:
9638  **
9639  ** 1 if reflected, 0 if not
9640  **
9641  *b Available as Decision Bead/Event
9642  **
9643  *b Callable For Networked Entities That Are:
9644  **
9645  *- - DIS published and reflected
9646  *- - HLA published and reflected
9647  */
9648  int get_is_network_reflected();
9649 
9650  /*l
9651  *b Description:
9652  **
9653  ** This function returns whether this character is in a
9654  ** "paused" state. This will only be true for reflected
9655  ** characters.
9656  **
9657  ** A reflected character will be paused if the network
9658  ** entity it is representing is paused; i.e., its personal
9659  ** timeline is not advancing. The most common case of this
9660  ** is when this character is reflecting a published character
9661  ** of a DI-Guy Scenario application that is in a paused or
9662  ** stopped state.
9663  **
9664  ** If DI-Guy Scenario, paused characters will remain frozen
9665  ** in their current postures.
9666  **
9667  *b Returns:
9668  **
9669  ** 1 if paused, 0 if not
9670  **
9671  *b Available as Decision Bead/Event
9672  */
9673  int get_is_network_paused();
9674 
9675  /*l
9676  *b Description:
9677  **
9678  ** Overrides built-in logic for network pausing, becomes end user's responsibility
9679  ** to manage
9680  */
9681  int set_is_network_paused(int paused);
9682 
9683  /*l
9684  *b Description:
9685  **
9686  ** This function returns the character's "network entity number".
9687  ** This number is valid and persistent regardless of whether the
9688  ** character is currently published.
9689  **
9690  ** This number is primarily used internally by DI-Guy Networking
9691  ** for creating entity IDs.
9692  **
9693  *b Returns:
9694  **
9695  ** character's network entity number
9696  **
9697  *b Callable For Networked Entities That Are:
9698  **
9699  *- - DIS published and reflected
9700  *- - HLA published and reflected
9701  */
9702  int get_network_entity_number();
9703 
9704  /*l
9705  *b Description:
9706  **
9707  ** This function returns the name of an action for a character,
9708  ** given the DIS damage state, lifeform state, primary weapon
9709  ** state, speed of the character, and direction of travel.
9710  ** Constants are all defined in diguy_dis_constants.h:
9711  **
9712  *b Arguments:
9713  **
9714  *a damage_state - one of the values listed below
9715  *a life_form_state - one of the values listed below
9716  *a primary_weapon_state - one of the values listed below
9717  *a speed - in meters/second
9718  *a forward - whether the action should move
9719  *a forward (pass 1), or backward (pass 0)
9720  **
9721  ** Valid values for damage_state:
9722  **
9723  *- - DIGUY_DIS_DAMAGE_NONE (0)
9724  *- - DIGUY_DIS_DAMAGE_SLIGHT (1)
9725  *- - DIGUY_DIS_DAMAGE_MODERATE (2)
9726  *- - DIGUY_DIS_DAMAGE_DESTROYED (3)
9727  **
9728  ** Valid values for life_form_state:
9729  **
9730  *- - DIGUY_DIS_LIFEFORM_UNUSED (0)
9731  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_STANDING_STILL (1)
9732  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_WALKING (2)
9733  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_RUNNING (3)
9734  *- - DIGUY_DIS_LIFEFORM_KNEELING (4)
9735  *- - DIGUY_DIS_LIFEFORM_PRONE (5)
9736  *- - DIGUY_DIS_LIFEFORM_CRAWLING (6)
9737  *- - DIGUY_DIS_LIFEFORM_SWIMMING (7)
9738  *- - DIGUY_DIS_LIFEFORM_PARACHUTING (8)
9739  *- - DIGUY_DIS_LIFEFORM_JUMPING (9)
9740  *- - DIGUY_DIS_LIFEFORM_SITTING (10)
9741  *- - DIGUY_DIS_LIFEFORM_SQUATTING (11)
9742  *- - DIGUY_DIS_LIFEFORM_CROUCHING (12)
9743  *- - DIGUY_DIS_LIFEFORM_WADING (13)
9744  **
9745  ** Valid values for primary_weapon_state:
9746  **
9747  *- - DIGUY_DIS_PRIMARY_WEAPON_NOT_PRESENT (0)
9748  *- - DIGUY_DIS_PRIMARY_WEAPON_STOWED (1)
9749  *- - DIGUY_DIS_PRIMARY_WEAPON_DEPLOYED (2)
9750  *- - DIGUY_DIS_PRIMARY_WEAPON_IN_FIRING_POSITION (3)
9751  **
9752  ** Note that a backward motion can be requested in a couple of
9753  ** ways: either by passing a negative speed, or by passing
9754  ** 0 for the forward argument, or both.
9755  **
9756  *b Returns:
9757  **
9758  ** name of an action if a match is found, NULL if not
9759  **
9760  *b Callable For Networked Entities That Are:
9761  **
9762  *- - DIS published
9763  */
9764  const char* get_action_from_entity_state(int damage_state,
9765  int life_form_state,
9766  int primary_weapon_state,
9767  float speed,
9768  int forward);
9769 
9770  /*l
9771  *b Description:
9772  **
9773  ** Sets the damage state for the network published character.
9774  ** Depending on the appearance configuration info the character may automatically switch to a new appearance.
9775  **
9776  *b Arguments:
9777  **
9778  *a state - one of the values listed below
9779  **
9780  ** Valid values for state (defined in diguy_dis_constants.h):
9781  **
9782  *- - DIGUY_DIS_DAMAGE_NONE (0)
9783  *- - DIGUY_DIS_DAMAGE_SLIGHT (1)
9784  *- - DIGUY_DIS_DAMAGE_MODERATE (2)
9785  *- - DIGUY_DIS_DAMAGE_DESTROYED (3)
9786  **
9787  *b Callable For Networked Entities That Are:
9788  **
9789  *- - DIS published
9790  */
9791  void set_DIS_damage_state(int state);
9792 
9795  int get_DIS_damage_state();
9796 
9797  /*l
9798  *b Description:
9799  **
9800  ** Returns the name of damage state appearances based on the base appearance of the character.
9801  ** NULL if there is no appearance specified.
9802  */
9803  const char * get_damage_state_appearance_name(int state);
9804 
9805  /*l
9806  *b Description:
9807  **
9808  ** Sets the smoke state for a network published character.
9809  ** Starts or stops the "smoke" and "engine_smoke" appearance
9810  ** effects as appropriate.
9811  **
9812  *b Arguments:
9813  **
9814  *a state - one of the values listed below
9815  **
9816  ** Valid values for state (defined in diguy_dis_constants.h):
9817  **
9818  *- - DIGUY_DIS_SMOKE_NOT_SMOKING (0)
9819  *- - DIGUY_DIS_SMOKE_SMOKE_PLUME (1)
9820  *- - DIGUY_DIS_SMOKE_ENGINE_SMOKE (2)
9821  *- - DIGUY_DIS_SMOKE_ENGINE_SMOKE_AND_SMOKE_PLUME (3)
9822  **
9823  *b Callable For Networked Entities That Are:
9824  **
9825  *- - DIS published
9826  */
9827  void set_DIS_smoke_state(int state);
9828 
9831  int get_DIS_smoke_state();
9832 
9833  /*l
9834  *b Description:
9835  **
9836  ** Sets the flames state for a network published character.
9837  ** Starts or stops the "flames" appearance effect as appropriate.
9838  **
9839  *b Arguments:
9840  **
9841  ** state - one of the values listed below
9842  **
9843  ** Valid values for state (defined in diguy_dis_constants.h):
9844  **
9845  *- - DIGUY_DIS_FLAMES_NONE (0)
9846  *- - DIGUY_DIS_FLAMES_PRESENT (1)
9847  **
9848  *b Callable For Networked Entities That Are:
9849  **
9850  *- - DIS published
9851  */
9852  void set_DIS_flames_state(int state);
9853 
9856  int get_DIS_flames_state();
9857 
9858  /*l
9859  *b Description:
9860  **
9861  ** Sets the power plant state for a network published character.
9862  ** Vehicle power plants default to being on.
9863  **
9864  *b Arguments:
9865  **
9866  ** state - one of the values listed below
9867  **
9868  ** Valid values for state (defined in diguy_dis_constants.h):
9869  **
9870  *- - DIGUY_DIS_POWER_PLANT_OFF (0)
9871  *- - DIGUY_DIS_POWER_PLANT_ON (1)
9872  **
9873  *b Callable For Networked Entities That Are:
9874  **
9875  *- - DIS published
9876  */
9877  void set_DIS_power_plant_state(int state);
9878 
9881  int get_DIS_power_plant_state();
9882 
9885  void set_emissivity(float r, float g, float b, float lerp_time = .25);
9886 
9889  void get_emissivity(float *r, float *g, float *b);
9890 
9891  /*l
9892  *b Description:
9893  **
9894  ** Sets the trailing effect state for a network published character.
9895  **
9896  *b Arguments:
9897  **
9898  ** state - one of the values listed below
9899  **
9900  ** Valid values for state (defined in diguy_dis_constants.h):
9901  **
9902  *- - DIGUY_DIS_TRAILING_EFFECT_NONE (0)
9903  *- - DIGUY_DIS_TRAILING_EFFECT_SMALL (1)
9904  *- - DIGUY_DIS_TRAILING_EFFECT_MEDIUM (2)
9905  *- - DIGUY_DIS_TRAILING_EFFECT_LARGE (3)
9906  **
9907  *b Callable For Networked Entities That Are:
9908  **
9909  *- - DIS published
9910  */
9911  void set_DIS_trailing_effect_state(int state);
9912 
9915  int get_DIS_trailing_effect_state();
9916 
9918  void set_DIS_station_name(int name);
9919  int get_DIS_station_name() const;
9920 
9922  void set_DIS_station_number(int number);
9923  int get_DIS_station_number() const;
9924 
9927  void set_head_lights_state(int state);
9928 
9930  int get_head_lights_state() const;
9931 
9933  void set_tail_lights_state(int state);
9934 
9936  int get_tail_lights_state() const;
9937 
9938 
9939 /*****************************************************************************/
9949  /*l
9950  *b Description:
9951  **
9952  ** This function will create a new active formation with this
9953  ** character as its leader. The formation followers will fall
9954  ** into the formation given by the formation name.
9955  **
9956  ** The formation is broken up, or disbanded, by calling
9957  ** break_formation().
9958  **
9959  *b Arguments:
9960  **
9961  *a formation_name - the name of the formation
9962  *a snap_to_position_flag - if 1, following characters will
9963  *a immediately snap to their assigned
9964  *a positions; otherwise following characters
9965  *a will move toward their assigned
9966  *a positions from their current positions
9967  *a break_existing_formations_flag - if 1, any formations this
9968  *a character is leading with be broken
9969  *a as if the break_formation() call were
9970  *a made
9971  **
9972  *b Returns:
9973  **
9974  ** 0 on success, -1 on failure
9975  **
9976  *b Available as Decision Bead/Event
9977  */
9978  int call_formation(const char* formation_name,
9979  int snap_to_position_flag = 0,
9980  int break_existing_formations_flag = 1);
9981 
9982  /*l
9983  *b Description:
9984  **
9985  ** This function breaks up a formation initiated by call_formation().
9986  **
9987  *b Arguments:
9988  **
9989  *a formation_name - the name of the formation to break;
9990  *a passing NULL or "(all)" will break all formations
9991  *a this character is leading
9992  **
9993  *b Returns:
9994  **
9995  ** 0 on success, -1 on failure
9996  **
9997  *b Available as Decision Bead/Event
9998  */
9999  int break_formation(const char* formation_name = NULL);
10000 
10001 
10002 /*****************************************************************************/
10010  /*l
10011  *b Description:
10012  **
10013  ** This function adds a copy of the specified scenario guide
10014  ** to the character. Any changes that are subsequently made
10015  ** to the added guide -- for example by a call to
10016  ** diguyCharacterGuide::set_algorithm_float_parameter() -- are
10017  ** private to this copy of the guide and will not affect others.
10018  **
10019  ** The guide will be enabled by default. Guides can be disabled
10020  ** by calling diguyCharacterGuide::set_guide_enabled(0), or by
10021  ** passing 1 for the argument automatically_disable_when_acquired.
10022  **
10023  ** Note that disabling a guide is not the same as removing it.
10024  ** Disabled guides are still a part of the character and can
10025  ** later be re-enabled by calling diguyCharacterGuide::set_enabled().
10026  **
10027  *b Arguments:
10028  **
10029  *a guide_name - name of guide to find and copy
10030  *a automatically_disable_when_acquired - set to 1 to have the guide
10031  *a be automatically disabled when it has acquired
10032  *a its target
10033  **
10034  *b Returns:
10035  **
10036  ** object of type diguyCharacterGuide; if a guide with guide_name
10037  ** is not found, returns NULL
10038  */
10039  diguyCharacterGuide* add_guide(const char* guide_name,
10040  int automatically_disable_when_acquired = 0);
10041 
10042  /*l
10043  *b Description:
10044  **
10045  ** This function creates a new guide and adds it to the character.
10046  **
10047  ** The guide will be enabled by default. Guides can be disabled
10048  ** by calling diguyCharacterGuide::set_guide_enabled(), or by
10049  ** passing 1 for the argument automatically_disable_when_acquired.
10050  **
10051  ** Important note: a new guide will always be created, even if one with
10052  ** the same name already exists
10053  **
10054  *b Arguments:
10055  **
10056  *a guide_name - name of guide to find and copy
10057  *a guide_algorithm - name of guide algorithm to be used
10058  *a automatically_disable_when_acquired - set to 1 to have the guide
10059  *a be automatically disabled when it has
10060  *a acquired its target
10061  **
10062  *b Returns:
10063  **
10064  ** object of type diguyCharacterGuide; if a guide with guide_name
10065  ** is not found, returns NULL
10066  */
10067  diguyCharacterGuide* create_guide(const char* guide_name,
10068  const char* guide_algorithm,
10069  int automatically_disable_when_acquired = 0);
10070 
10071  /*l
10072  *b Description:
10073  **
10074  ** Like create_guide(), but returns guide if it already exists
10075  **
10076  *b Arguments:
10077  **
10078  *a guide_name - name of guide to find and copy
10079  *a guide_algorithm - name of guide algorithm to be used
10080  *a automatically_disable_when_acquired - set to 1 to have the guide
10081  *a be automatically disabled when it has
10082  *a acquired its target
10083  **
10084  *b Returns:
10085  **
10086  ** object of type diguyCharacterGuide; if a guide with guide_name
10087  ** is not found, returns NULL
10088  */
10089  diguyCharacterGuide* find_or_create_guide(const char* guide_name,
10090  const char* guide_algorithm,
10091  int automatically_disable_when_acquired = 0);
10092 
10093  /*l
10094  *b Description:
10095  **
10096  ** This function returns a pointer to the specified guide
10097  ** of the character, if is exists.
10098  **
10099  *b Arguments:
10100  **
10101  *a guide_name - name of guide to find
10102  **
10103  *b Returns:
10104  **
10105  ** object of type diguyCharacterGuide; if a guide with guide_name
10106  ** is not found, returns NULL
10107  */
10108  diguyCharacterGuide* find_guide(const char* guide_name);
10109 
10110  /*l
10111  *b Description:
10112  **
10113  ** This function removes the specified guide from the
10114  ** character.
10115  **
10116  *b Arguments:
10117  **
10118  *a guide_name - name of the guide to remove; must match name
10119  *a used by add_guide() or create_guide() call
10120  **
10121  *b Returns:
10122  **
10123  ** 0 on success, -1 on failure
10124  */
10125  int remove_guide_with_name(const char* guide_name);
10126 
10127  /*l
10128  *b Description:
10129  **
10130  ** This function removes the specified guide from the
10131  ** character.
10132  **
10133  *b Arguments:
10134  **
10135  *a guide - object returned by add_guide() call
10136  **
10137  *b Returns:
10138  **
10139  ** 0 on success, -1 on failure
10140  */
10141  int remove_guide(diguyCharacterGuide* guide);
10142 
10143  /*l
10144  *b Description:
10145  **
10146  ** This function removes all guides from the character.
10147  **
10148  *b Returns:
10149  **
10150  ** 0 on success, -1 on failure
10151  */
10152  int remove_all_guides();
10153 
10154  /*l
10155  *b Description:
10156  **
10157  ** This function removes all guides that are disabled.
10158  **
10159  *b Returns:
10160  **
10161  ** 0 on success, -1 on failure
10162  */
10163  int remove_all_disabled_guides();
10164 
10165 
10166 /*****************************************************************************/
10176  /*l
10177  *b Description:
10178  **
10179  ** This function adds a "motion texture" to the character. A
10180  ** motion texture is a relatively long (usually 10 seconds or
10181  ** more) loop that will add natural-looking, low amplitude
10182  ** joint angle adjustments.
10183  **
10184  ** This function will have no effect on a dead character (see
10185  ** die_now() and get_dead()).
10186  **
10187  *b Arguments:
10188  **
10189  *a motex_name - name of the motion texture to add; see below
10190  *a texture_gain - the relative amplitude of the motion texture;
10191  *a higher numbers result in more pronounced
10192  *a movements
10193  *a end_previous_motex - flag denoting whether this motion texture
10194  *a replaces all previously added motion
10195  *a textures; pass 1 to end existing textures
10196  *a rampup_interval - how long, in seconds, to take ramping up
10197  *a into the motion texture
10198  **
10199  ** List of currently available motion textures:
10200  **
10201  *- - "default"
10202  *- - "motex_stand_casual"
10203  **
10204  ** If 1 is passed for the argument end_previous_motex, the
10205  ** rampup_interval argument will be used as the interval for
10206  ** ending existing motion textures.
10207  **
10208  *b Returns:
10209  **
10210  ** 0 on success, -1 on failure
10211  **
10212  */
10213  int add_motion_texture(const char* motex_name = "default",
10214  float texture_gain = 1.0f,
10215  int end_previous_motex = 1,
10216  float rampup_interval = 0.2f);
10217 
10218  /*l
10219  *b Description:
10220  **
10221  ** This function gradually ends any active motion textures added by
10222  ** add_motion_texture().
10223  **
10224  *b Arguments:
10225  **
10226  *a rampdown_interval - how long, in seconds, to take ending the
10227  *a motion texture
10228  **
10229  *b Returns:
10230  **
10231  ** 0 on success, -1 on failure
10232  */
10233  int end_motion_texture(float rampdown_interval = 0.2f);
10234 
10235  /*l
10236  *b Description:
10237  **
10238  ** This function sets an initial motion texture that should be
10239  ** used by the character whenever the character is loaded from
10240  ** a scenario or the character's scenario is reset.
10241  **
10242  ** The gain of the motion texture can be set by calling
10243  ** set_initial_motion_texture_gain(). The initial motion
10244  ** texture gain is 1.0 by default.
10245  **
10246  *b See Also:
10247  **
10248  ** add_motion_texture(), set_initial_motion_texture_gain()
10249  **
10250  *b Arguments:
10251  **
10252  *a motex_name - name of the motion texture
10253  **
10254  *b Returns:
10255  **
10256  ** 0 on success, -1 on failure
10257  */
10258  int set_initial_motion_texture(const char* motex_name);
10259 
10260  /*l
10261  *b Description:
10262  **
10263  ** This function returns the initial motion texture as set
10264  ** by a call to set_initial_motion_texture().
10265  **
10266  *b Returns:
10267  **
10268  ** name of initial motion texture
10269  */
10270  const char* get_initial_motion_texture();
10271 
10272  /*l
10273  *b Description:
10274  **
10275  ** This function sets the gain of the initial motion texture
10276  ** of the character. The initial motion texture can be set
10277  ** by calling set_initial_motion_texture().
10278  **
10279  *b Arguments:
10280  **
10281  *a motex_gain - gain of the motion texture; higher gains
10282  *a result in more pronounced motion
10283  **
10284  *b Returns:
10285  **
10286  ** 0 on success, -1 on failure
10287  */
10288  int set_initial_motion_texture_gain(float motex_gain);
10289 
10290  /*l
10291  *b Description:
10292  **
10293  ** This function returns the initial motion texture gain as set
10294  ** by a call to set_initial_motion_texture_gain().
10295  **
10296  *b Returns:
10297  **
10298  ** gain of initial motion texture
10299  */
10300  float get_initial_motion_texture_gain();
10301 
10302 
10303 /*****************************************************************************/
10313  /*l
10314  *b Description:
10315  **
10316  ** This function sets what type of "history" will be kept for the
10317  ** character.
10318  **
10319  ** If time is run backwards in a scenario, characters
10320  ** with history will replay the motions they performed at that
10321  ** time. Characters without history will stay frozen in place
10322  ** until time advances past the point from which it was run
10323  ** backwards.
10324  **
10325  ** The default is DIGUY_HISTORY_TYPE_NONE for characters created
10326  ** using the diguyScenario::create_character() function.
10327  ** Characters loaded from a .dss file will retain their history
10328  ** settings from the DI-Guy Scenario editing session.
10329  **
10330  *b Arguments:
10331  **
10332  *a history_type - history type to be used for the character
10333  **
10334  ** history_type should be one of the following values:
10335  **
10336  *i DIGUY_HISTORY_TYPE_NONE
10337  **
10338  ** This history type saves no history.
10339  **
10340  *i DIGUY_HISTORY_TYPE_COMPLETE
10341  **
10342  ** This history type saves all of a character's history.
10343  **
10344  ** The initial amount of history to be saved, before memory buffers
10345  ** need to be resized, can be set by the function
10346  ** set_history_size_t(). The size by which memory buffers grow each
10347  ** time they do need to get resized by be set by
10348  ** set_history_size_increment_t().
10349  **
10350  *i DIGUY_HISTORY_TYPE_FIRST
10351  **
10352  ** This history type is no longer supported. Characters from
10353  ** a .dss that have this history type will have their history
10354  ** type set to DIGUY_HISTORY_TYPE_COMPLETE.
10355  **
10356  *i DIGUY_HISTORY_TYPE_LAST
10357  **
10358  ** This history type is no longer supported. Characters from
10359  ** a .dss that have this history type will have their history
10360  ** type set to DIGUY_HISTORY_TYPE_COMPLETE.
10361  **
10362  *b Returns:
10363  **
10364  ** 0 on success, -1 on failure
10365  */
10366  int set_history_type(diguyHistoryType history_type);
10367 
10368  /*l
10369  *b Returns:
10370  **
10371  ** the current history type of the character; see
10372  ** set_history_type()
10373  */
10374  diguyHistoryType get_history_type();
10375 
10376  /*l
10377  *b Description:
10378  **
10379  ** This function sets the size of the character's history
10380  ** buffer, in seconds.
10381  **
10382  *b Arguments:
10383  **
10384  *a t - length of history buffer, in seconds
10385  **
10386  *b Returns:
10387  **
10388  ** 0 on success, -1 on failure
10389  */
10390  int set_history_size_t(float t);
10391 
10392  /*l
10393  *b Description:
10394  **
10395  ** This function returns the current history buffer size.
10396  ** See set_history_size_t().
10397  **
10398  *b Returns:
10399  **
10400  ** current history size
10401  */
10402  float get_history_size_t();
10403 
10404  /*l
10405  *b Description:
10406  **
10407  ** This function sets the size of the character's history
10408  ** buffer increment, in seconds.
10409  **
10410  *b Arguments:
10411  **
10412  *a t - length of history buffer increment, in seconds
10413  **
10414  *b Returns:
10415  **
10416  ** 0 on success, -1 on failure
10417  */
10418  int set_history_size_increment_t(float t);
10419 
10420  /*l
10421  *b Description:
10422  **
10423  ** This function returns the current history buffer size increment.
10424  ** See set_history_size_increment_t().
10425  **
10426  *b Returns:
10427  **
10428  ** current history size increment
10429  */
10430  float get_history_size_increment_t();
10431 
10432 
10433 /*****************************************************************************/
10443  /*l
10444  *b Description:
10445  **
10446  ** This function sets the desired posture of the character. This,
10447  ** along with the desired variant, is used primarily by some guides.
10448  ** Specifically, to help choose which actions are used to reach the
10449  ** desired position and orientation of the character.
10450  **
10451  ** Pass DIGUY_MOTION_POSTURE_ANY for there to be no desired posture.
10452  **
10453  *b Arguments:
10454  **
10455  *a posture - new desired posture
10456  */
10457  void set_desired_posture(diguyMotionPosture desired_posture);
10458 
10459  /*l
10460  *b Returns:
10461  **
10462  ** current desired posture of the character
10463  */
10464  diguyMotionPosture get_desired_posture();
10465 
10466  /*l
10467  *b Description:
10468  **
10469  ** This function sets the desired variant of the character. This,
10470  ** along with the desired posture, is used primarily by some guides.
10471  ** Specifically, to help choose which actions are used to reach the
10472  ** desired position and orientation of the character.
10473  **
10474  ** Pass DIGUY_MOTION_VARIANT_ANY for there to be no desired variant.
10475  **
10476  *b Arguments:
10477  **
10478  *a variant - new desired variant
10479  */
10480  void set_desired_variant(diguyMotionVariant desired_variant);
10481 
10483  diguyMotionVariant get_desired_variant();
10484 
10485  /*l
10486  *b Description:
10487  **
10488  ** This function looks up the character action that most closely
10489  ** matches the given criteria.
10490  **
10491  *b Arguments:
10492  **
10493  *a direction - the direction of travel relative to
10494  *a the character's facing direction
10495  *a posture - overall desired posture; pass
10496  *a DIGUY_MOTION_POSTURE_ANY
10497  *a to specify that any posture will do
10498  *a variant - overall desired variant; pass
10499  *a DIGUY_MOTION_VARIANT_ANY
10500  *a to specify that any variant will do
10501  *a speed - speed in meters per second
10502  *a comparison - how the passed speed should compare
10503  *a to the action's speed
10504  *a comparison_tolerance - tolerance of comparison
10505  *a match_posture_before_variant - pass 1 if posture should be matched
10506  *a before variant if an exact match is
10507  *a not found; pass 0 if variant should
10508  *a be matched before posture
10509  *a posture_alternate1 - if an exact match is not found, use this
10510  *a as the first alternate posture; pass
10511  *a DIGUY_MOTION_POSTURE_UNKNOWN
10512  *a to specify that no alternate should be used
10513  *a posture_alternate2 - if an exact match is not found, use this
10514  *a as the second alternate posture; pass
10515  *a DIGUY_MOTION_POSTURE_UNKNOWN
10516  *a to specify that no alternate should be used
10517  *a variant_alternate1 - if an exact match is not found, use this
10518  *a as the first alternate variant; pass
10519  *a DIGUY_MOTION_VARIANT_UNKNOWN
10520  *a to specify that no alternate should be used
10521  *a variant_alternate2 - if an exact match is not found, use this
10522  *a as the second alternate variant; pass
10523  *a DIGUY_MOTION_VARIANT_UNKNOWN
10524  *a to specify that no alternate should be used
10525  *a return_random_match - (Experimental) if multiple actions match the
10526  *a specified criteria randomly return one of
10527  *a them. Typically only used for still motions
10528  *a and restricted to EQUAL and NEAREST
10529  *a comparisons
10530  **
10531  ** The direction argument should be one of the following:
10532  **
10533  *- - DIGUY_MOTION_DIRECTION_NONE - does not move character
10534  *- - DIGUY_MOTION_DIRECTION_FORWARD - moves character forward
10535  *- - DIGUY_MOTION_DIRECTION_BACKWARD - moves character backward
10536  *- - DIGUY_MOTION_DIRECTION_LEFT - moves character left
10537  *- - DIGUY_MOTION_DIRECTION_RIGHT - moves character right
10538  *- - DIGUY_MOTION_DIRECTION_UP - moves character up
10539  *- - DIGUY_MOTION_DIRECTION_DOWN - moves character down
10540  *- - DIGUY_MOTION_DIRECTION_TURN_LEFT - turns character left
10541  *- - DIGUY_MOTION_DIRECTION_TURN_RIGHT - turns character right
10542  *- - DIGUY_MOTION_DIRECTION_NONLINEAR - moves character in
10543  *- multiple directions
10544  *- - DIGUY_MOTION_DIRECTION_LINEAR_OFFAXIS - moves character in a
10545  *- line, but not on any
10546  *- of the principle axes
10547  **
10548  ** Not every direction is supported by every character. If the
10549  ** character does not have any actions that move in the specified
10550  ** direction, the returned action will be NULL.
10551  **
10552  ** Use the calls diguyScenario::get_character_type_num_directions()
10553  ** and diguyScenario::get_character_type_direction_at_index() to
10554  ** enumerate which directions a character can travel.
10555  **
10556  ** The posture arguments should be one of the following:
10557  **
10558  *- - DIGUY_MOTION_POSTURE_UNKNOWN - unknown posture
10559  *- - DIGUY_MOTION_POSTURE_ANY - any posture; a wildcard
10560  *- - DIGUY_MOTION_POSTURE_UPRIGHT - upright posture; e.g., standing,
10561  *- walking, or running
10562  *- - DIGUY_MOTION_POSTURE_CROUCHED - crouched posture; e.g., kneeling
10563  *- or walking low
10564  *- - DIGUY_MOTION_POSTURE_PRONE - prone posture; e.g., lying prone
10565  *- or crawling
10566  *- - DIGUY_MOTION_POSTURE_SITTING - sitting posture
10567  *- - DIGUY_MOTION_POSTURE_KNEELING - kneeling posture
10568  *- - DIGUY_MOTION_POSTURE_SWIMMING - swimming posture
10569  *- - DIGUY_MOTION_POSTURE_PARACHUTING - parachuting posture
10570  *- - DIGUY_MOTION_POSTURE_JUMPING - jumping posture
10571  *- - DIGUY_MOTION_POSTURE_SQUATTING - jumping posture
10572  *- - DIGUY_MOTION_POSTURE_WADING - wading posture
10573  **
10574  ** The posture arguments specify the overall posture the action
10575  ** should have. Most characters have an upright posture.
10576  ** The other postures a character has is dependent on character type.
10577  ** Passing DIGUY_MOTION_POSTURE_ANY for the arguments posture,
10578  ** posture_alternate1, or posture_alternate2 means that the posture of
10579  ** the action should not be used to determine a match.
10580  **
10581  ** Use the calls diguyScenario::get_character_type_num_postures()
10582  ** and diguyScenario::get_character_type_posture_at_index() to
10583  ** enumerate which postures a specific character type has.
10584  **
10585  ** The variant arguments specify the overall mood the action should
10586  ** convey. Most characters have a "normal" variant. The other
10587  ** variants a character has is dependent on character type. Passing
10588  ** DIGUY_MOTION_VARIANT_ANY for the arguments variant,
10589  ** variant_alternate1, or variant_alternate2 means that the variant of
10590  ** the action should not be used to determine a match.
10591  **
10592  ** Use the calls diguyScenario::get_character_type_num_variants()
10593  ** and diguyScenario::get_character_type_variant_at_index() to
10594  ** enumerate which variants a specific character type has.
10595  **
10596  ** The comparison argument should be one of the following:
10597  **
10598  *- - DIGUY_PARAMETER_COMPARISON_EQUAL - matched action's speed
10599  *- must be within
10600  *- comparison_tolerance of
10601  *- passed speed
10602  *- - DIGUY_PARAMETER_COMPARISON_NEAREST - matched action's speed
10603  *- is closer than any other
10604  *- potential match's, but
10605  *- still within
10606  *- comparison_tolerance
10607  *- - DIGUY_PARAMETER_COMPARISON_GREATER - matched action's speed
10608  *- faster than passed speed,
10609  *- but still within
10610  *- comparison_tolerance
10611  *- - DIGUY_PARAMETER_COMPARISON_LESS - matched action's speed
10612  *- slower than passed speed,
10613  *- but still within
10614  *- comparison_tolerance
10615  *-
10616  ** The difference between DIGUY_PARAMETER_COMPARISON_EQUAL and
10617  ** DIGUY_PARAMETER_COMPARISON_NEAREST is largely in the
10618  ** value used for comparison_tolerance if DIGUY_DEFAULT_FLOAT is
10619  ** passed; the comparison_tolerance argument defaults to 0.001 for
10620  ** DIGUY_PARAMETER_COMPARISON_EQUAL, and 16384.0 for all
10621  ** other comparison types. Otherwise these two comparison types
10622  ** operate the same.
10623  **
10624  *b Returns:
10625  **
10626  ** name of an action if a match is found, NULL if not
10627  **
10628  *b C++ Example:
10629  **
10630  *e diguyCharacter* ch = scenario->get_character_at_index(0);
10631  *e const char* new_action;
10632  *e
10633  *e //
10634  *e // Get an action that moves forward in an upright posture,
10635  *e // whose speed move at least 2.0 meters per second:
10636  *e //
10637  *e new_action = ch->get_action_from_description(
10638  *e DIGUY_MOTION_DIRECTION_FORWARD,
10639  *e DIGUY_MOTION_POSTURE_UPRIGHT,
10640  *e DIGUY_MOTION_VARIANT_ANY,
10641  *e 2.0,
10642  *e DIGUY_PARAMETER_COMPARISON_GREATER, DIGUY_DEFAULT_FLOAT);
10643  *e
10644  *e //
10645  *e // Get an action that is standing still, with the variant
10646  *e // DIGUY_MOTION_VARIANT_READY. If no action has that variant,
10647  *e // try DIGUY_MOTION_VARIANT_AIM as variant_alternate1,
10648  *e // and DIGUY_MOTION_VARIANT_ANY as variant_alternate2:
10649  *e //
10650  *e new_action = ch->get_action_from_description(
10651  *e DIGUY_MOTION_DIRECTION_NONE,
10652  *e DIGUY_MOTION_POSTURE_ANY,
10653  *e DIGUY_MOTION_VARIANT_READY,
10654  *e 0.0,
10655  *e DIGUY_PARAMETER_COMPARISON_NEAREST, DIGUY_DEFAULT_FLOAT,
10656  *e 0,
10657  *e DIGUY_MOTION_POSTURE_UNKNOWN,
10658  *e DIGUY_MOTION_POSTURE_UNKNOWN,
10659  *e DIGUY_MOTION_VARIANT_AIM,
10660  *e DIGUY_MOTION_VARIANT_ANY);
10661  **
10662  */
10663  const char* get_action_from_description(diguyMotionDirection direction,
10664  diguyMotionPosture posture,
10665  diguyMotionVariant variant,
10666  float speed,
10668  float comparison_tolerance = DIGUY_DEFAULT_FLOAT,
10669  int match_posture_before_variant = 1,
10670  diguyMotionPosture posture_alternate1 = DIGUY_MOTION_POSTURE_UNKNOWN,
10671  diguyMotionPosture posture_alternate2 = DIGUY_MOTION_POSTURE_UNKNOWN,
10672  diguyMotionVariant variant_alternate1 = DIGUY_MOTION_VARIANT_UNKNOWN,
10673  diguyMotionVariant variant_alternate2 = DIGUY_MOTION_VARIANT_UNKNOWN,
10674  int return_random_match = 0);
10675 
10676  /*l
10677  *b Description:
10678  **
10679  ** This function is very similar to get_action_from_description(),
10680  ** but substitutes turn amount per action iteration for speed.
10681  **
10682  *b Arguments:
10683  **
10684  *a direction - the direction of travel relative to
10685  *a the character's facing direction
10686  *a posture - overall desired posture; pass
10687  *a DIGUY_MOTION_POSTURE_ANY
10688  *a to specify that any posture will do
10689  *a variant - overall desired variant; pass
10690  *a DIGUY_MOTION_VARIANT_ANY
10691  *a to specify that any variant will do
10692  *a turn_amount - how many degrees each iteration of the
10693  *a action should turn the character
10694  *a comparison - how the passed turn amount should compare
10695  *a to the action's turn amount
10696  *a comparison_tolerance - tolerance of comparison
10697  *a match_posture_before_variant - pass 1 if posture should be matched
10698  *a before variant if an exact match is
10699  *a not found; pass 0 if variant should
10700  *a be matched before posture
10701  *a posture_alternate1 - if an exact match is not found, use this
10702  *a as the first alternate posture; pass
10703  *a DIGUY_MOTION_POSTURE_UNKNOWN
10704  *a to specify that no alternate should be used
10705  *a posture_alternate2 - if an exact match is not found, use this
10706  *a as the second alternate posture; pass
10707  *a DIGUY_MOTION_POSTURE_UNKNOWN
10708  *a to specify that no alternate should be used
10709  *a variant_alternate1 - if an exact match is not found, use this
10710  *a as the first alternate variant; pass
10711  *a DIGUY_MOTION_VARIANT_UNKNOWN
10712  *a to specify that no alternate should be used
10713  *a variant_alternate2 - if an exact match is not found, use this
10714  *a as the second alternate variant; pass
10715  *a DIGUY_MOTION_VARIANT_UNKNOWN
10716  *a to specify that no alternate should be used
10717  **
10718  ** The direction argument should be one of the following:
10719  **
10720  *- - DIGUY_MOTION_DIRECTION_TURN_LEFT - turns character left
10721  *- - DIGUY_MOTION_DIRECTION_TURN_RIGHT - turns character right
10722  **
10723  ** Not every direction is supported by every character. If the
10724  ** character does not have any actions that move in the specified
10725  ** direction, the returned action will be NULL.
10726  **
10727  ** The turn amount argument should be a positive number.
10728  **
10729  ** Refer to get_action_from_description() for more information on
10730  ** other arguments.
10731  **
10732  *b Returns:
10733  **
10734  ** name of an action if a match is found, NULL if not
10735  **
10736  */
10737  const char* get_turning_action_from_description(diguyMotionDirection direction,
10738  diguyMotionPosture posture,
10739  diguyMotionVariant variant,
10740  float turn_amount,
10742  float comparison_tolerance = DIGUY_DEFAULT_FLOAT,
10743  int match_posture_before_variant = 1,
10744  diguyMotionPosture posture_alternate1 = DIGUY_MOTION_POSTURE_UNKNOWN,
10745  diguyMotionPosture posture_alternate2 = DIGUY_MOTION_POSTURE_UNKNOWN,
10746  diguyMotionVariant variant_alternate1 = DIGUY_MOTION_VARIANT_UNKNOWN,
10747  diguyMotionVariant variant_alternate2 = DIGUY_MOTION_VARIANT_UNKNOWN);
10748 
10749 
10750 /*****************************************************************************/
10760  /*l
10761  *b Returns:
10762  **
10763  ** number of variables the character has
10764  */
10765  int get_num_variables();
10766 
10767  /*l
10768  *b Returns:
10769  **
10770  ** pointer of type diguyVariable; NULL if no
10771  ** variable at the specified index
10772  **
10773  *b Arguments:
10774  **
10775  *a index - index of the variable; indices start at 0
10776  */
10777  diguyVariable* get_variable_at_index(int index);
10778 
10779  /*l
10780  *b Returns:
10781  **
10782  ** pointer of type diguyVariable; NULL if no
10783  ** variable with the specified name
10784  **
10785  *b Arguments:
10786  **
10787  *a name - name of the variable
10788  */
10789  diguyVariable* get_variable_with_name( const char* name );
10790 
10791  /*l
10792  *b Description:
10793  **
10794  ** This function returns a pointer to the specified variable.
10795  **
10796  *b Arguments:
10797  **
10798  *a name - name of variable to be found
10799  **
10800  *b Returns:
10801  **
10802  ** pointer of type diguyVariable; NULL if not found
10803  */
10804  diguyVariable* find_variable(const char* name);
10805 
10806  /*l
10807  *b Description:
10808  **
10809  ** This function finds the variable with the given name or
10810  ** creates it if it doesn't exist.
10811  **
10812  *b Arguments:
10813  **
10814  *a name - name of the variable to find or create
10815  **
10816  *b Returns:
10817  **
10818  ** pointer of type diguyVariable; should never be NULL
10819  */
10820  diguyVariable* find_or_create_variable(const char* name);
10821 
10822  /*l
10823  *b Description:
10824  **
10825  ** This function destroys the passed variable.
10826  **
10827  *b Arguments:
10828  **
10829  *a variable - pointer to a diguyVariable
10830  **
10831  *b Returns:
10832  **
10833  ** 0 on success, -1 on failure
10834  */
10835  int destroy_variable(diguyVariable* variable);
10836 
10837  /*l
10838  *b Returns:
10839  **
10840  ** 1 if variable is equal to passed value,
10841  ** 0 if not
10842  **
10843  *b Arguments:
10844  **
10845  *a varname - name of variable to compare
10846  *a value - value to compare against
10847  **
10848  *b Available as Decision Bead/Event
10849  */
10850  int variable_equal_to_int(const char* varname, int value);
10851 
10852  /*l
10853  *b Returns:
10854  **
10855  ** 1 if variable is greater than passed value,
10856  ** 0 if not
10857  **
10858  *b Arguments:
10859  **
10860  *a varname - name of variable to compare
10861  *a value - value to compare against
10862  **
10863  *b Available as Decision Bead/Event
10864  */
10865  int variable_greater_than_int(const char* varname, int value);
10866 
10867  /*l
10868  *b Returns:
10869  **
10870  ** 1 if variable is less than passed value,
10871  ** 0 if not
10872  **
10873  *b Arguments:
10874  **
10875  *a varname - name of variable to compare
10876  *a value - value to compare against
10877  **
10878  *b Available as Decision Bead/Event
10879  */
10880  int variable_less_than_int(const char* varname, int value);
10881 
10882  /*l
10883  *b Returns:
10884  **
10885  ** 1 if variable is equal to passed value,
10886  ** 0 if not
10887  **
10888  *b Arguments:
10889  **
10890  *a varname - name of variable to compare
10891  *a value - value to compare against
10892  **
10893  *b Available as Decision Bead/Event
10894  */
10895  int variable_equal_to_float(const char* varname, float value);
10896 
10897  /*l
10898  *b Returns:
10899  **
10900  ** 1 if variable is greater than passed value,
10901  ** 0 if not
10902  **
10903  *b Arguments:
10904  **
10905  *a varname - name of variable to compare
10906  *a value - value to compare against
10907  **
10908  *b Available as Decision Bead/Event
10909  */
10910  int variable_greater_than_float(const char* varname, float value);
10911 
10912  /*l
10913  *b Returns:
10914  **
10915  ** 1 if variable is less than passed value,
10916  ** 0 if not
10917  **
10918  *b Arguments:
10919  **
10920  *a varname - name of variable to compare
10921  *a value - value to compare against
10922  **
10923  *b Available as Decision Bead/Event
10924  */
10925  int variable_less_than_float(const char* varname, float value);
10926 
10927  /*l
10928  *b Returns:
10929  **
10930  ** 1 if variable is equal than passed value,
10931  ** 0 if not
10932  **
10933  *b Arguments:
10934  **
10935  *a varname - name of variable to compare
10936  *a value - value to compare against
10937  **
10938  *b Available as Decision Bead/Event
10939  */
10940  int variable_equal_to_string(const char* varname, const char* value);
10941 
10942  /*l
10943  *b Returns:
10944  **
10945  ** 1 if variable is greater than passed value (comes
10946  ** later alphabetically), 0 if not
10947  **
10948  *b Arguments:
10949  **
10950  *a varname - name of variable to compare
10951  *a value - value to compare against
10952  **
10953  *b Available as Decision Bead/Event
10954  */
10955  int variable_greater_than_string(const char* varname, const char* value);
10956 
10957  /*l
10958  *b Returns:
10959  **
10960  ** 1 if variable is less than passed value (comes
10961  ** sooner alphabetically), 0 if not
10962  **
10963  *b Arguments:
10964  **
10965  *a varname - name of variable to compare
10966  *a value - value to compare against
10967  **
10968  *b Available as Decision Bead/Event
10969  */
10970  int variable_less_than_string(const char* varname, const char* value);
10971 
10972  /*l
10973  *b Description:
10974  **
10975  ** This function decrements the variable by the passed amount.
10976  **
10977  *b Arguments:
10978  **
10979  *a varname - name of variable to modify
10980  *a value - amount to decrement
10981  **
10982  *b Returns:
10983  **
10984  ** 0 on success, -1 on failure
10985  **
10986  *b Available as Decision Bead/Event
10987  */
10988  int variable_decrement_value_as_int(const char* varname, int value = 1);
10989 
10990  /*l
10991  *b Description:
10992  **
10993  ** This function increments the variable by the passed amount.
10994  **
10995  *b Arguments:
10996  **
10997  *a varname - name of variable to modify
10998  *a value - amount to increment
10999  **
11000  *b Returns:
11001  **
11002  ** 0 on success, -1 on failure
11003  **
11004  *b Available as Decision Bead/Event
11005  */
11006  int variable_increment_value_as_int(const char* varname, int value = 1);
11007 
11008  /*l
11009  *b Description:
11010  **
11011  ** This function is a convenience function for setting the variable
11012  ** to a new integer value without retrieving the diguyVariable
11013  ** object.
11014  **
11015  *b Arguments:
11016  **
11017  *a varname - name of variable to modify
11018  *a value - new value
11019  *a create_if_doesnt_exist - pass 1 to create the variable if it
11020  *a doesn't exist
11021  **
11022  *b Returns:
11023  **
11024  ** 0 on success, -1 on failure
11025  **
11026  *b Available as Decision Bead/Event
11027  */
11028  int variable_set_value_as_int(const char* varname,
11029  int value,
11030  int create_if_doesnt_exist = 1);
11031 
11032  /*l
11033  *b Description:
11034  **
11035  ** Short form of variable_set_value_as_int().
11036  */
11037  int set_ivar(const char* varname,
11038  int value,
11039  int create_if_doesnt_exist = 1);
11040 
11041  /*l
11042  *b Description:
11043  **
11044  ** This function is a convenience function for retrieving the
11045  ** value of a variable without retrieving the diguyVariable
11046  ** object.
11047  **
11048  ** If the variable doesn't exist and create_if_doesnt_exist is
11049  ** 0, the returned value will be 0.
11050  **
11051  *b Arguments:
11052  **
11053  *a varname - name of variable to query
11054  *a create_if_doesnt_exist - pass 1 to create the variable if it
11055  *a doesn't exist
11056  **
11057  *b Returns:
11058  **
11059  ** value of variable as int
11060  */
11061  int get_ivar(const char* varname,
11062  int create_if_doesnt_exist = 1);
11063 
11064  /*l
11065  *b Description:
11066  **
11067  ** Similar to variable_set_value_as_int(), for sets a
11068  ** floating point value instead.
11069  */
11070  int variable_set_value_as_float(const char* varname,
11071  float value,
11072  int create_if_doesnt_exist = 1);
11073 
11074  /*l
11075  *b Description:
11076  **
11077  ** Short form of variable_set_value_as_float().
11078  */
11079  int set_fvar(const char* varname,
11080  float value,
11081  int create_if_doesnt_exist = 1);
11082 
11083  /*l
11084  *b Description:
11085  **
11086  ** Similar to variable_get_value_as_int(), for returns a
11087  ** floating point value instead.
11088  **
11089  ** If the variable doesn't exist and create_if_doesnt_exist is
11090  ** 0, the returned value will be 0.0.
11091  */
11092  float get_fvar(const char* varname,
11093  int create_if_doesnt_exist = 1);
11094 
11095  /*l
11096  *b Description:
11097  **
11098  ** Similar to variable_set_value_as_int(), for sets a
11099  ** string value instead.
11100  */
11101  int variable_set_value_as_string(const char* varname,
11102  const char* value,
11103  int create_if_doesnt_exist = 1);
11104 
11105  /*l
11106  *b Description:
11107  **
11108  ** Short form of variable_set_value_as_string().
11109  */
11110  int set_svar(const char* varname,
11111  const char* value,
11112  int create_if_doesnt_exist = 1);
11113 
11114  /*l
11115  *b Description:
11116  **
11117  ** Similar to variable_get_value_as_int(), for returns a
11118  ** string value instead.
11119  **
11120  ** If the variable doesn't exist and create_if_doesnt_exist is
11121  ** 0, the returned value will be "".
11122  */
11123  const char* get_svar(const char* varname,
11124  int create_if_doesnt_exist = 1);
11125 
11126 
11127 /*****************************************************************************/
11142  /*l
11143  *b Description:
11144  **
11145  ** This function returns a pointer to the label object of
11146  ** the character.
11147  **
11148  ** Currently character labels are only enabled in DI-Guy Scenario.
11149  **
11150  *b Returns:
11151  **
11152  ** pointer to the character's label
11153  */
11154  diguyViewLabel* get_name_label();
11155 
11156  /*l
11157  *b Description:
11158  **
11159  ** This function sets the text of the character's label.
11160  ** By default the label text matches the character's name.
11161  **
11162  ** Currently character labels are only enabled in DI-Guy Scenario.
11163  **
11164  *b Arguments:
11165  **
11166  *a label_text - new text for the label
11167  **
11168  *b Returns:
11169  **
11170  ** 0 on success, -1 on failure
11171  */
11172  int set_label_text(const char* label_text);
11173 
11174  /*l
11175  *b Description:
11176  **
11177  ** This function returns the character's label text.
11178  ** See set_label_text().
11179  **
11180  *b Returns:
11181  **
11182  ** current label text; the returned pointer will never be NULL
11183  */
11184  const char* get_label_text();
11185 
11186  /*l
11187  *b Description:
11188  **
11189  ** This function sets whether the label of this character
11190  ** is visible. This setting will only be taken into account
11191  ** if the visibility flag for Character Labels is set to
11192  ** "Per Object".
11193  **
11194  ** Currently character labels are only enabled in DI-Guy Scenario.
11195  **
11196  *b Arguments:
11197  **
11198  *a is_visible - pass 1 to show, pass 0 to hide
11199  **
11200  *b Returns:
11201  **
11202  ** 0 on success, -1 on failure
11203  */
11204  int set_label_is_visible(int is_visible);
11205 
11206  /*l
11207  *b Description:
11208  **
11209  ** This function returns the most recent setting of
11210  ** set_label_is_visible().
11211  **
11212  *b Returns:
11213  **
11214  ** 1 if visible, 0 if not
11215  */
11216  int get_label_is_visible();
11217 
11218  /*l
11219  *b Description:
11220  **
11221  ** This function sets the text color of the character's label. By
11222  ** default the label text color is opaque white.
11223  **
11224  ** Currently character labels are only enabled in DI-Guy Scenario.
11225  **
11226  *b Arguments:
11227  **
11228  *a r, g, b, a - the red, green, blue, and alpha
11229  *a components of the text color
11230  **
11231  ** An alpha component of 0 makes the text completely transparent.
11232  ** An alpha component of 1 makes the text completely opaque.
11233  ** Values in between result in varying levels of transparency.
11234  **
11235  *b Returns:
11236  **
11237  ** 0 on success, -1 on failure
11238  */
11239  int set_label_text_color(float r, float g, float b, float a);
11240 
11241  /*l
11242  *b Description:
11243  **
11244  ** Alternate version of set_label_text_color().
11245  */
11246  int set_label_text_color_vec4(const diguyVec4f & color);
11247 
11248  /*l
11249  *b Description:
11250  **
11251  ** This function returns, in the passed variable pointers, the
11252  ** most recent setting of set_label_text_color().
11253  **
11254  *b Returns:
11255  **
11256  ** 0 on success, -1 on failure
11257  */
11258  int get_label_text_color(float* r, float* g, float* b, float* a);
11259 
11260  /*l
11261  *b Description:
11262  **
11263  ** Alternate version of get_label_text_color().
11264  */
11265  diguyVec4f get_label_text_color_vec4();
11266 
11267  /*l
11268  *b Description:
11269  **
11270  ** This function sets the text shadow color of the character's label.
11271  ** By default the label text shadow color is gray.
11272  **
11273  ** Currently character labels are only enabled in DI-Guy Scenario.
11274  **
11275  *b Arguments:
11276  **
11277  *a r, g, b, a - the red, green, blue, and alpha
11278  *a components of the text shadow color
11279  **
11280  ** An alpha component of 0 makes the text completely transparent.
11281  ** An alpha component of 1 makes the text completely opaque.
11282  ** Values in between result in varying levels of transparency.
11283  **
11284  *b Returns:
11285  **
11286  ** 0 on success, -1 on failure
11287  */
11288  int set_label_text_shadow_color(float r, float g, float b, float a);
11289 
11290  /*l
11291  *b Description:
11292  **
11293  ** Alternate version of set_label_text_shadow_color().
11294  */
11295  int set_label_text_shadow_color_vec4(const diguyVec4f & color);
11296 
11297  /*l
11298  *b Description:
11299  **
11300  ** This function returns, in the passed variable pointers, the
11301  ** most recent setting of set_label_text_shadow_color().
11302  **
11303  *b Returns:
11304  **
11305  ** 0 on success, -1 on failure
11306  */
11307  int get_label_text_shadow_color(float* r, float* g, float* b, float* a);
11308 
11309  /*l
11310  *b Description:
11311  **
11312  ** Alternate version of get_label_text_shadow_color().
11313  */
11314  diguyVec4f get_label_text_shadow_color_vec4();
11315 
11316  /*l
11317  *b Description:
11318  **
11319  ** This function sets the whether the text shadow is visible.
11320  **
11321  *b Arguments:
11322  **
11323  *a visible - pass 1 to make shadow visible, 0 to make it invisible
11324  **
11325  *b Returns:
11326  **
11327  ** 0 on success, -1 on failure
11328  */
11329  int set_label_text_shadow_is_visible(int is_visible);
11330 
11331  /*l
11332  *b Returns:
11333  **
11334  ** 1 if text shadow is visible, 0 if not
11335  */
11336  int get_label_text_shadow_is_visible();
11337 
11338  /*l
11339  *b Description:
11340  **
11341  ** This function sets the background color of the character's
11342  ** label. By default the label background color is transparent
11343  ** blue.
11344  **
11345  ** Currently character labels are only enabled in DI-Guy Scenario.
11346  **
11347  *b Arguments:
11348  **
11349  *a r, g, b, a - the red, green, blue, and alpha
11350  *a components of the text color
11351  **
11352  ** An alpha component of 0 makes the text completely transparent.
11353  ** An alpha component of 1 makes the text completely opaque.
11354  ** Values in between result in varying levels of transparency.
11355  **
11356  *b Returns:
11357  **
11358  ** 0 on success, -1 on failure
11359  */
11360  int set_label_background_color(float r, float g, float b, float a);
11361 
11362  /*l
11363  *b Description:
11364  **
11365  ** Alternate version of set_label_background_color().
11366  */
11367  int set_label_background_color_vec4(const diguyVec4f & color);
11368 
11369  /*l
11370  *b Description:
11371  **
11372  ** This function returns, in the passed variable pointers, the
11373  ** most recent setting of set_label_background_color().
11374  **
11375  *b Returns:
11376  **
11377  ** 0 on success, -1 on failure
11378  */
11379  int get_label_background_color(float* r, float* g, float* b, float* a);
11380 
11381  /*l
11382  *b Description:
11383  **
11384  ** Alternate version of get_label_background_color().
11385  */
11386  diguyVec4f get_label_background_color_vec4();
11387 
11388  /*l
11389  *b Description:
11390  **
11391  ** This function sets how high the label of the character will float
11392  ** above the character.
11393  **
11394  *b Arguments:
11395  **
11396  *a offset - offset, in meters, of label above character
11397  */
11398  void set_label_link_offset_override(float offset);
11399 
11400  /*l
11401  *b Returns:
11402  **
11403  ** how high the label of the character will float above the character
11404  */
11405  float get_label_link_offset_override();
11406 
11407  /*l
11408  *b Description:
11409  **
11410  ** This function sets whether the label text should show some basic
11411  ** state information about the character instead of its name or
11412  ** the text set by set_label_text().
11413  **
11414  ** The state shown is: Character name, current path, current action.
11415  ** The current path and current action will change as the character
11416  ** moves through paths and actions.
11417  **
11418  *b Arguments:
11419  **
11420  *a show_state - pass 1 to show state, 0 to show original text
11421  */
11422  int set_label_shows_character_state(int show_state);
11423 
11424  /*l
11425  *b Returns:
11426  **
11427  ** whether character state information is shown instead of the
11428  ** character's name or other label text
11429  */
11430  int get_label_shows_character_state();
11431 
11432 
11433 /*****************************************************************************/
11446  /*l
11447  *b Returns:
11448  **
11449  ** pointer of type diguyImpact; NULL if there has been no recent
11450  ** impact recorded; useful for finding out who or what was hit
11451  */
11452  diguyImpact* get_last_impact_record();
11453 
11454  /*l
11455  *b Returns:
11456  **
11457  ** the last impact number
11458  */
11459  int get_last_impact_number();
11460 
11461  /*l
11462  *b Returns:
11463  **
11464  ** the processed flag on the diguyImpact class
11465  */
11466  int get_last_impact_been_processed();
11467 
11468  /*l
11469  *b Description:
11470  **
11471  ** Sets the processed flag on the diguyImpact object.
11472  */
11473  void set_last_impact_been_processed();
11474 
11475  /*l
11476  *b Description:
11477  **
11478  ** Sets the maximum number of unprocessed impacts there can be.
11479  **
11480  ** The unprocessed impact array is a first-in-first-out queue. If an
11481  ** impact occurs that pushes the number of unprocessed impacts past
11482  ** this maximum number, earlier impacts will be dropped from the
11483  ** array.
11484  **
11485  ** The initial value is 10.
11486  */
11487  void set_max_unprocessed_impacts(int max_unprocessed_impacts);
11488 
11489  /*l
11490  *b Returns:
11491  **
11492  ** maximum number of unprocessed impacts
11493  */
11494  int get_max_unprocessed_impacts();
11495 
11496  /*l
11497  *b Returns:
11498  **
11499  ** the last impact link
11500  */
11501  const char* get_last_impact_link();
11502 
11503  /*l
11504  *b Returns:
11505  **
11506  ** 1 if the last impact link is the link named
11507  */
11508  int get_last_impact_link_is(const char* link_name);
11509 
11510  /*l
11511  *b Returns:
11512  **
11513  ** 1 if the last impact resulted from an impact with a vehicle,
11514  ** 0 if not
11515  */
11516  int get_last_impact_is_from_vehicle();
11517 
11518  /*l
11519  *b Returns:
11520  **
11521  ** 1 if the last impact speed is greater than the passed speed,
11522  ** 0 if not
11523  */
11524  int get_last_impact_speed_is_greater_than(float impact_speed);
11525 
11526  /*l
11527  *b Description:
11528  **
11529  ** Sets if impacts are ever processed on this character.
11530  ** Useful for temporary effects and the like.
11531  */
11532  void set_is_immune_to_impacts(int immune);
11533 
11534  /*l
11535  *b Returns:
11536  **
11537  ** 1 if the character is immune to impacts
11538  ** 0 if not
11539  */
11540  int get_is_immune_to_impacts();
11541 
11542 
11543 /*****************************************************************************/
11565  /*l
11566  *b Description:
11567  **
11568  ** This function starts the specified appearance effect on
11569  ** the character.
11570  **
11571  ** The following appearance effects are available:
11572  **
11573  *- - "brake_lights"
11574  *- - "debris"
11575  *- - "debris_dark"
11576  *- - "dust"
11577  *- - "engine_smoke"
11578  *- - "explosion"
11579  *- - "explosion_dark"
11580  *- - "flames"
11581  *- - "flashing_lights"
11582  *- - "ground_dust_burst"
11583  *- - "headlights"
11584  *- - "rotor_wash"
11585  *- - "smoke"
11586  *- - "smoke_dark"
11587  *- - "smoke_trail"
11588  **
11589  *b Arguments:
11590  **
11591  *a effect - name of appearance effect to be started
11592  *a override_link - link to attach to; overrides default
11593  *a override_scale - scale to use for effect; overrides default
11594  *a override_offset_x - x offset to use for effect; overrides default
11595  *a override_offset_y - y offset to use for effect; overrides default
11596  *a override_offset_z - z offset to use for effect; overrides default
11597  *a override_duration - overrides how long the effect should show
11598  *a before automatically ending
11599  **
11600  *b Returns:
11601  **
11602  ** 0 on success, -1 on failure
11603  **
11604  *b Available as Decision Bead/Event
11605  */
11606  int begin_appearance_effect(const char* effect,
11607  const char* override_link = NULL,
11608  float override_scale = DIGUY_DEFAULT_FLOAT,
11609  float override_offset_x = DIGUY_DEFAULT_FLOAT,
11610  float override_offset_y = DIGUY_DEFAULT_FLOAT,
11611  float override_offset_z = DIGUY_DEFAULT_FLOAT,
11612  float override_duration = DIGUY_DEFAULT_FLOAT);
11613 
11614  /*l
11615  *b Description:
11616  **
11617  ** This function ends the specified appearance effect on the
11618  ** character.
11619  **
11620  ** The active particles of the effect will go to completion. Use
11621  ** stop_all_appearance_effects() to immediately stop effects,
11622  ** including their active particles.
11623  **
11624  ** If the effect hasn't been started, nothing happens.
11625  **
11626  *b Arguments:
11627  **
11628  *a effect - name of appearance effect to be ended
11629  *a override_link - optional override link effect is attached to
11630  **
11631  ** Pass "all" for the effect argument to end all of this character's
11632  ** appearance effects.
11633  **
11634  *b Returns:
11635  **
11636  ** 0 on success, -1 on failure
11637  **
11638  *b Available as Decision Bead/Event
11639  */
11640  int end_appearance_effect(const char* effect,
11641  const char* override_link = NULL);
11642 
11643  /*l
11644  *b Description:
11645  **
11646  ** This function stops the specified appearance effect on the
11647  ** character.
11648  **
11649  ** The active particle systems of the effect will immediately be
11650  ** removed. Use end_appearance_effect() to gradually stop effects;
11651  ** that function lets active particles move to completion.
11652  **
11653  ** If the effect hasn't been started, nothing happens.
11654  **
11655  *b Arguments:
11656  **
11657  *a effect - name of appearance effect to be ended
11658  *a override_link - optional override link effect is attached to
11659  **
11660  ** Pass "all" for the effect argument to stop all of this character's
11661  ** appearance effects.
11662  **
11663  *b Returns:
11664  **
11665  ** 0 on success, -1 on failure
11666  **
11667  *b Available as Decision Bead/Event
11668  */
11669  int stop_appearance_effect(const char* effect,
11670  const char* override_link = NULL);
11671 
11672  /*l
11673  *b Description:
11674  **
11675  ** Equivalent to stop_appearance_effect("all");
11676  */
11677  int stop_all_appearance_effects();
11678 
11679  /*l
11680  *b Description:
11681  **
11682  ** This function checks to see if the specified appearance effect
11683  ** has been started with begin_appearance_effect().
11684  **
11685  *b Arguments:
11686  **
11687  *a effect - name of appearance effect to check
11688  *a override_link - optional override link effect is attached to
11689  **
11690  *b Returns:
11691  **
11692  ** 1 if appearance is active, 0 if not
11693  */
11694  int appearance_effect_is_active(const char* effect,
11695  const char* override_link = NULL);
11696 
11697 
11698 /*****************************************************************************/
11711  /*l
11712  *b Description:
11713  **
11714  ** This function returns a pointer to a diguyChainSimulation if the
11715  ** character is a chain_simulation type of character.
11716  **
11717  *b Returns:
11718  **
11719  ** pointer to a diguyChainSimulation
11720  */
11721  diguyChainSimulation* get_chain_simulation();
11722 
11723 
11724 /*****************************************************************************/
11737  /*l
11738  *b Description:
11739  **
11740  ** This function returns a pointer to a diguyVehicleController if the
11741  ** character has one.
11742  **
11743  *b Returns:
11744  **
11745  ** pointer to a diguyVehicleController; may return NULL if character
11746  ** does not have a vehicle controller object
11747  */
11748  diguyVehicleController* get_vehicle_controller();
11749 
11750  /*l
11751  *b Description:
11752  **
11753  ** For most characters playing a travel forward action, the
11754  ** character's facing direction matches the direction of travel. For
11755  ** example, when humans walk forward their pelvis is generally
11756  ** aligned in the direction of travel.
11757  **
11758  ** Some vehicle characters behave differently. For vehicles whose
11759  ** front wheels steer, when turning the vehicle body will pivot around
11760  ** the rear axle. Only gradually will the rear of the vehicle swing
11761  ** in behind the direction of travel. Think of a car making a very
11762  ** sharp turn, and how the rear of the car swings in behind the front
11763  ** as the turn is completed.
11764  **
11765  ** This function will return the orientation of the body of the
11766  ** vehicle; i.e., the orientation of the forward vector along the
11767  ** vehicle's long axis. As mentioned above this may be different
11768  ** than the orientation of the direction of travel.
11769  **
11770  ** This function will return valid results for all characters, though
11771  ** the returned values from this function and that of
11772  ** get_orientation() will be the same for non-vehicle characters.
11773  **
11774  *b Returns:
11775  **
11776  ** 0 on success, -1 on failure
11777  */
11778  int get_vehicle_body_orientation(float* rz, float* rx, float* ry);
11779 
11780 
11781 /*****************************************************************************/
11798  /*l
11799  *b Description:
11800  **
11801  ** This function sets the name of the shader technique that will be
11802  ** used by the character when the scenario is using the specified
11803  ** render mode. See diguyScenario::set_current_render_mode().
11804  **
11805  ** Note that care should be taken when changing the shader of
11806  ** characters with skinned appearances. A shader capable of properly
11807  ** transforming vertices must be used for such characters.
11808  **
11809  ** The shader with the given name should be loaded first. If the
11810  ** shader technique is not one of DI-Guy's stock shaders, a custom
11811  ** shader technique can be loaded explicitly by calling
11812  ** the diguyApp::load_shader_program() function.
11813  **
11814  *b NOTE:
11815  **
11816  ** The specified shader technique may not take effect immediately,
11817  ** if the scenario's current render mode is different than the
11818  ** passed render mode. See
11819  ** diguyScenario::set_current_render_mode().
11820  **
11821  *b Arguments:
11822  **
11823  *a shader_name - shader technique name; can be NULL
11824  *a render_mode - render mode to modify; passing NULL will
11825  *a modify shader "normal" render mode
11826  **
11827  *b Returns:
11828  **
11829  ** 0 on success, -1 on failure
11830  */
11831  int set_render_mode_shader(const char* shader_name,
11832  const char* render_mode = NULL);
11833 
11834  /*l
11835  *b Description:
11836  **
11837  ** This function resets the shader technique for the specified render
11838  ** mode to its default. This will be the shader technique name
11839  ** returned by
11840  ** diguyScenario::get_default_character_shader_program_name().
11841  **
11842  ** If the specified render mode is the current scenario render mode,
11843  ** the current shader will change immediately. If not, the change
11844  ** will not take effect until the specified render mode becomes the
11845  ** current scenario render mode. See
11846  ** diguyScenario::set_current_render_mode().
11847  **
11848  *b Arguments:
11849  **
11850  *a render_mode - render mode to modify; passing NULL will
11851  *a modify shader of "normal" render mode
11852  */
11853  void reset_render_mode_shader_to_default(const char* render_mode = NULL);
11854 
11855  /*l
11856  *b Description:
11857  **
11858  ** This function returns the name of the shader technique that will be used by
11859  ** the character when the scenario is using the specified render
11860  ** mode.
11861  **
11862  *b Arguments:
11863  **
11864  *a render_mode - render mode for which to get technique name;
11865  *a pass NULL for "normal" render mode
11866  **
11867  *b Returns:
11868  **
11869  ** name of shader technique; NULL if none or error
11870  */
11871  const char* get_render_mode_shader(const char* render_mode = NULL);
11872 
11873  /*l
11874  *b Description:
11875  **
11876  ** This function returns the shader program that is in use by the
11877  ** character. Shader programs are shared objects that can be used
11878  ** by multiple characters. This is here for backwards compatibility,
11879  ** and just returns the highest quality shader technique shader.
11880  **
11881  *b Returns:
11882  **
11883  ** object of type diguyGraphicsShaderProgram; NULL if none
11884  */
11885  diguyGraphicsShaderProgram* get_shader_program();
11886 
11887  /*l
11888  *b Description:
11889  **
11890  ** This function returns the shader technique that is in use by the
11891  ** character. Shader techniques own a number of shader objects.
11892  **
11893  *b Returns:
11894  **
11895  ** object of type diguyGraphicsShaderTechnique; NULL if none
11896  */
11897  diguyGraphicsShaderTechnique* get_shader_technique();
11898 
11899  /*l
11900  *b Description:
11901  **
11902  ** This function overrides the current shader with the specified
11903  ** temporary shader. This temporary shader will remain in effect
11904  ** until:
11905  **
11906  *- - the scenario is reset
11907  *- - reset_current_shader_to_default() is called
11908  *- - set_temporary_current_shader() is called with NULL
11909  **
11910  *b Arguments:
11911  **
11912  *a shader_name - shader name; can be NULL
11913  **
11914  ** Passing NULL for the shader name will un-set the temporary shader,
11915  ** resetting the render mode shader to its default.
11916  **
11917  *b Returns:
11918  **
11919  ** 0 on success, -1 on failure
11920  */
11921  int set_temporary_current_shader(const char* shader_name);
11922 
11923  /*l
11924  *b Description:
11925  **
11926  ** This is a convenience function for resetting the current render
11927  ** mode shader to its default.
11928  **
11929  ** It is equivalent to retrieving the current render mode using
11930  ** diguyScenario::get_current_render_mode(), and calling
11931  ** reset_render_mode_shader_to_default() with that render mode.
11932  */
11933  void reset_current_shader_to_default();
11934 
11935  /*l
11936  *b Description:
11937  **
11938  ** This is a convenience function for refreshing the shader
11939  ** of a character. Usually used in conjunction with logic
11940  ** provided by the user with the graphics API.
11941  */
11942  void trigger_shader_refresh();
11943 
11944  /*l
11945  *b Description:
11946  **
11947  ** This function returns the shader instance that is in use by the
11948  ** character. Each character has its own shader instance.
11949  **
11950  ** Note that the shader instance of a character can change over the
11951  ** lifetime of the character. For example, it will change if the
11952  ** appearance of the character changes. Therefore the returned
11953  ** pointer should not be stored, but should be re-read each time
11954  ** it is needed.
11955  **
11956  *b Returns:
11957  **
11958  ** object of type diguyGraphicsShaderInstance; NULL if none
11959  */
11960  diguyGraphicsShaderInstance* get_shader_instance();
11961 
11962  /*l
11963  *b Description:
11964  **
11965  ** This function resets current values of the variables of the shader
11966  ** back to their initial reset values.
11967  */
11968  void reset_shader_instance_variables_to_initial_values();
11969 
11970  /*l
11971  *b Description:
11972  **
11973  ** This function resets the current and initial values of variables
11974  ** of the shader to the built-in DI-Guy configuration defaults.
11975  */
11976  void reset_shader_instance_variables_to_program_defaults();
11977 
11978 
11979 /*****************************************************************************/
12003  /*l
12004  *b Description:
12005  **
12006  ** This function sets the named character as the attack
12007  ** target of this agent. This agent will pursue the
12008  ** target until it is within range, and then will fire its
12009  ** weapon in an attempt to kill the target.
12010  **
12011  ** This function will implicitly put this agent into the
12012  ** attack behavior.
12013  **
12014  ** The current focus character will be set the specified character.
12015  ** Pass NULL or the empty string ("") to not change the focus
12016  ** character, but still change to the pursue behavior.
12017  **
12018  ** The current focus group will be un-set.
12019  **
12020  *b Arguments:
12021  **
12022  *a character_name - character to attack
12023  **
12024  *b Returns:
12025  **
12026  ** 0 on success, -1 on failure
12027  **
12028  *b Available as Decision Bead/Event
12029  */
12030  int agent_attack_character(const char* character_name);
12031 
12032  /*l
12033  *b Description:
12034  **
12035  ** This function is similar to agent_attack_character(), but instead
12036  ** will choose attack targets from the characters in the specified
12037  ** group.
12038  **
12039  ** This function will implicitly put this agent into the attack
12040  ** behavior.
12041  **
12042  ** The current focus group will be set to the specified group. Pass
12043  ** NULL or the empty string ("") to not change the focus group, but
12044  ** still change to the attack behavior.
12045  **
12046  ** The current focus character will be un-set.
12047  **
12048  *b Arguments:
12049  **
12050  *a group_name - name of group from which attack targets should
12051  *a be chosen
12052  **
12053  *b Returns:
12054  **
12055  ** 0 on success, -1 on failure
12056  **
12057  *b Available as Decision Bead/Event
12058  */
12059  int agent_attack_group(const char* group_name);
12060 
12061  /*l
12062  *b Description:
12063  **
12064  ** See diguyAgentParams::set_attack_zone_enabled().
12065  */
12066  int agent_set_attack_zone_enabled(int use_attack_zone);
12067 
12068  /*l
12069  *b Description:
12070  **
12071  ** See diguyAgentParams::get_attack_zone_enabled().
12072  */
12073  int agent_get_attack_zone_enabled();
12074 
12075  /*l
12076  *b Description:
12077  **
12078  ** See diguyAgentParams::set_attack_zone().
12079  */
12080  int agent_set_attack_zone(float x, float y, float z, float radius);
12081 
12082  /*l
12083  *b Description:
12084  **
12085  ** See diguyAgentParams::get_attack_zone().
12086  */
12087  int agent_get_attack_zone(float* x, float* y, float* z, float* radius);
12088 
12095  /*l
12096  *b Description:
12097  **
12098  ** This function adds a flee object to this agent.
12099  ** This agent will attempt to move away from the specified
12100  ** character until it is beyond the specified flee distance.
12101  **
12102  ** Note: Currently there can only be one flee object. This
12103  ** restriction will be lifted in a future version.
12104  **
12105  ** This function will implicitly put this agent into the
12106  ** flee behavior.
12107  **
12108  ** Neither the current focus character nor group will be
12109  ** changed by this function.
12110  **
12111  *b Arguments:
12112  **
12113  *a character_name - character from which to flee
12114  *a distance - minimum distance to move away from character
12115  *a danger_level - how "strong" the flee should be; set from
12116  *a 0 to 100
12117  **
12118  ** The danger_level argument is not currently used, but will be in
12119  ** a future version.
12120  **
12121  *b Returns:
12122  **
12123  ** 0 on success, -1 on failure
12124  **
12125  *b Available as Decision Bead/Event
12126  */
12127  int agent_flee_character(const char* character_name,
12128  float distance,
12129  int danger_level = 50);
12130 
12131  /*l
12132  *b Description:
12133  **
12134  ** This function adds a flee object to this agent. This agent
12135  ** will attempt to move away from the specified group until it is
12136  ** beyond the specified flee distance.
12137  **
12138  ** This function will implicitly put this agent into the flee
12139  ** behavior.
12140  **
12141  ** Neither the current focus character nor group will be changed
12142  ** by this function.
12143  **
12144  *b Arguments:
12145  **
12146  *a group_name - group from which to flee
12147  *a distance - minimum distance to move away from character
12148  *a danger_level - how "strong" the flee should be; set from
12149  *a 0 to 100
12150  **
12151  ** The danger_level argument is not currently used, but will be in
12152  ** a future version.
12153  **
12154  *b Returns:
12155  **
12156  ** 0 on success, -1 on failure
12157  **
12158  *b Available as Decision Bead/Event
12159  */
12160  int agent_flee_group(const char* group_name,
12161  float distance,
12162  int danger_level = 50);
12163 
12164  /*l
12165  *b Description:
12166  **
12167  ** This function is similar to agent_flee_group(), but the
12168  ** agent will instead flee the members of the specified
12169  ** crowd.
12170  */
12171  int agent_flee_crowd(const char* crowd_name,
12172  float distance,
12173  int danger_level = 50);
12174 
12175  /*l
12176  *b Description:
12177  **
12178  ** This function adds a flee object to this agent.
12179  ** This agent will attempt to move away from the specified
12180  ** location until it is beyond the specified flee distance.
12181  **
12182  ** Note: Currently there can only be one flee object. This
12183  ** restriction will be lifted in a future version.
12184  **
12185  ** This function will implicitly put this agent into the
12186  ** flee behavior.
12187  **
12188  ** Neither the current focus character nor group will be
12189  ** changed by this function.
12190  **
12191  *b Arguments:
12192  **
12193  *a x, y, z - location from which to flee
12194  *a distance - minimum distance to move away from character
12195  *a danger_level - how "strong" the flee should be; set from
12196  *a 0 to 100
12197  **
12198  ** The danger_level argument is not currently used, but will be in
12199  ** a future version.
12200  **
12201  *b Returns:
12202  **
12203  ** 0 on success, -1 on failure
12204  */
12205  int agent_flee_location(float x, float y, float z,
12206  float distance,
12207  int danger_level = 50);
12208 
12209  /*l
12210  *b Description:
12211  **
12212  ** This function removes all flee objects.
12213  **
12214  ** This function has no effect on current behavior.
12215  **
12216  *b Returns:
12217  **
12218  ** 0 on success, -1 on failure
12219  **
12220  *b Available as Decision Bead/Event
12221  */
12222  void agent_remove_all_flee_objects();
12223 
12234  /*l
12235  *b Description:
12236  **
12237  ** This function puts this agent into the mingle behavior, in which
12238  ** it will choose semi-random points in the specified region and
12239  ** subregion to move to. The agent will remain at the selected
12240  ** points for some amount of time, and the select a new point.
12241  **
12242  ** If all members of a crowd have this behavior they will tend to get
12243  ** together in small groups.
12244  **
12245  ** Use diguyAgentParams::set_move_on_t_min() and
12246  ** diguyAgentParams::set_move_on_t_max() for setting how long the
12247  ** agent will remain at the selected mingle points.
12248  **
12249  *b Arguments:
12250  **
12251  *a region_name - region in which to mingle
12252  *a subregion_name - subregion in which to mingle
12253  **
12254  ** The behavior region will be set the specified region. Pass NULL
12255  ** or "(current)" to not change the current behavior region.
12256  **
12257  *b Returns:
12258  **
12259  ** 0 on success, -1 on failure
12260  **
12261  *b Available as Decision Bead/Event
12262  */
12263  int agent_mingle_in_region(const char* region_name = "(current)",
12264  const char* subregion_name = "base");
12265 
12276  /*l
12277  *b Description:
12278  **
12279  ** This function is similar to agent_mingle_in_region(), but agents
12280  ** will pick completely random points and not try to clump together
12281  ** in small groups.
12282  **
12283  *b Returns:
12284  **
12285  ** 0 on success, -1 on failure
12286  **
12287  *b Available as Decision Bead/Event
12288  */
12289  int agent_wander_region(const char* region_name = "(current)",
12290  const char* subregion_name = "base");
12291 
12302  /*l
12303  *b Description:
12304  **
12305  ** This function will cause this agent to pursue the specified
12306  ** character. This agent will attempt to move toward the specified
12307  ** character until it is within its still distance as specified in
12308  ** its agent params.
12309  **
12310  ** This function will implicitly put this agent into the pursue
12311  ** behavior.
12312  **
12313  ** The current focus group will be set to the specified group. Pass
12314  ** NULL or the empty string ("") to not change the focus group, but
12315  ** still change to the attack behavior.
12316  **
12317  ** The current focus character will be un-set.
12318  **
12319  *b Arguments:
12320  **
12321  *a character_name - character to pursue
12322  **
12323  *b Returns:
12324  **
12325  ** 0 on success, -1 on failure
12326  **
12327  *b Available as Decision Bead/Event
12328  */
12329  int agent_pursue_character(const char* character_name);
12330 
12331  /*l
12332  *b Description:
12333  **
12334  ** This function is similar to agent_pursue_character(), but the
12335  ** point toward the agent will move will be offset from the pursued
12336  ** character by the passed offset.
12337  */
12338  int agent_pursue_character_with_offset(const char* character_name,
12339  float offset_x,
12340  float offset_y);
12341 
12342  /*l
12343  *b Description:
12344  **
12345  ** This function is similar to agent_pursue_character(), but instead
12346  ** will choose pursue characters from the characters in the specified
12347  ** group.
12348  **
12349  ** This function will implicitly put this agent into the pursue
12350  ** behavior.
12351  **
12352  ** The current focus group will be set to the specified group. Pass
12353  ** NULL or the empty string ("") to not change the focus group, but
12354  ** still change to the pursue behavior.
12355  **
12356  ** The current focus character will be un-set.
12357  **
12358  *b Arguments:
12359  **
12360  *a group_name - name of group from which pursue characters should
12361  *a be chosen
12362  **
12363  *b Returns:
12364  **
12365  ** 0 on success, -1 on failure
12366  **
12367  *b Available as Decision Bead/Event
12368  */
12369  int agent_pursue_group(const char* group_name);
12370 
12371  /*l
12372  *b Description:
12373  **
12374  ** Calls a formation with this character as a leader, oriented towards
12375  ** (target_x, target_y).
12376  **
12377  *b Returns:
12378  **
12379  ** 0 on success, -1 on failure
12380  */
12381  int agent_call_formation(const char* formation_name,
12382  float target_x,
12383  float target_y);
12384 
12395  /*l
12396  *b Description:
12397  **
12398  ** This function has the character travel along its behavior path
12399  ** shape, typically to the end and then back to the beginning. It
12400  ** will put the agent into the travel behavior.
12401  **
12402  *b Arguments:
12403  **
12404  *a direction - should be either "forward" or "backward"; pass NULL
12405  *a for default forward
12406  *a at_end - what to do when end of path reached
12407  *a waypoint_index - index of waypoint to start at; -1 for nearest,
12408  *a -2 for random
12409  *a offset_y - sideways offset from behavior path
12410  **
12411  ** Valid values for at_end are:
12412  **
12413  *- - "reverse"
12414  *- - "loop"
12415  *- - "stop"
12416  *- - "teleport"
12417  **
12418  ** See the documentation for diguyNavPathAtEnd for information on
12419  ** what each value means.
12420  */
12421  int agent_travel_behavior_path(const char* direction = NULL,
12422  const char* at_end = NULL,
12423  int waypoint_index = -1,
12424  float offset_y = 0.5f);
12425 
12426  /*l
12427  *b Description:
12428  **
12429  ** Similar to agent_travel_behavior_path(), but specific path can be
12430  ** set rather than using behavior path.
12431  */
12432  int agent_travel_path_shape(const char* path_shape_name,
12433  const char* direction = NULL,
12434  const char* at_end = NULL,
12435  int waypoint_index = -1,
12436  float offset_y = 0.5f);
12437 
12438  /*l
12439  *b Description:
12440  **
12441  ** The agent will create a travel path around the border of the
12442  ** region specified. A CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED
12443  ** callback will be triggered every time a character completes a loop
12444  ** around the border.
12445  **
12446  *b Arguments:
12447  **
12448  *a region_name - the name of the region to patrol; leaving blank or
12449  *a passing NULL will use the agent's current region
12450  *a subregion - name of the subregion to use; defaults to the base
12451  *a subregion
12452  **
12453  *b Returns:
12454  **
12455  ** 0 on success, -1 on failure
12456  */
12457  int agent_travel_region_border(const char* region_name = NULL,
12458  const char* subregion_name = "base");
12459 
12460  /*l
12461  *b Description:
12462  **
12463  ** Agent will attempt to create a navigation path on the via_region
12464  ** and then travel it. An A* path planning algorithm is used to find
12465  ** the path, cost preferences from the character's current
12466  ** diguyAgentParams are used in the search.
12467  **
12468  *b Note: as of DI-Guy 12 there is a version of this function
12469  ** agent_move_to_point_bg() that uses a multi-threaded infrastructure.
12470  ** We strongly recommend using it for future developments.
12471  **
12472  *b Arguments:
12473  **
12474  *a x, y, z - the target location
12475  *a via_region - the name of the region to run A* on (pass in "*"
12476  *a to have the code attempt to find the nearest
12477  *a region automatically.)
12478  *a subregion_name - the name of the subregion to restrict search to
12479  **
12480  *b Returns:
12481  **
12482  ** 0 on success, -1 on failure
12483  */
12484  int agent_move_to_point(float x, float y, float z,
12485  const char* via_region = NULL,
12486  const char* subregion_name = "base");
12487 
12488  /*l
12489  *b Description:
12490  **
12491  ** A multi-threaded version of agent_move_to_point(). See that
12492  ** function for more information.
12493  **
12494  ** We recommend switching to using this over the single threaded
12495  ** version. When the path result has been computed a callback with id
12496  ** CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED is triggered and the result is
12497  ** stored in get_path_planning_result(). You can also poll for
12498  ** completion via get_is_path_planning().
12499  **
12500  *b Returns:
12501  **
12502  ** diguyNavPathSearchResults enum value
12503  **
12504  ** The return value is typically DIGUY_NAV_PATH_ERROR_NONE (0) on
12505  ** success, DIGUY_NAV_PATH_ERROR_SEARCH_QUEUED if this has been queued
12506  ** for multi-threading, or a negative value on failure.
12507  */
12508  int agent_move_to_point_bg(float x, float y, float z,
12509  const char* via_region = NULL,
12510  const char* subregion_name = "base");
12511 
12512  /*l
12513  *b Description:
12514  **
12515  ** Agent will attempt to create a navigation path on the region
12516  ** via_region and then travel it. An A* path planning algorithm is
12517  ** used to find the path.
12518  **
12519  ** The subregion masks are used to specify which subregions to use or
12520  ** avoid. Cost bias values can be used to make tweak how strong the
12521  ** repulsion values are.
12522  **
12523  *b Note:
12524  **
12525  ** As of DI-Guy 12 there is a version of this function
12526  ** agent_move_to_point_via_subregions_bg that uses a multi-threaded
12527  ** infrastructure. We strongly recommend using it for future
12528  ** developments.
12529  **
12530  ** This function will fail and return -1 if a path cannot be found.
12531  **
12532  *b Arguments:
12533  **
12534  *a x, y, z - the target location
12535  *a via_region - the name of the region to run A* on (pass in "*"
12536  *a to have the code attempt to find the nearest
12537  *a region automatically)
12538  *a preferred_subregions_mask - diguySubregionMask value of regions
12539  *a preferred for travel
12540  *a cost_bias_for_preferred_regions - how much cheaper it will be
12541  *a to cross spaces that are part of desired subregion;
12542  *a should be < 1.0
12543  *a cost_bias_for_neutral_regions - how much more expensive it will be
12544  *a to cross spaces that are not part of desired subregion; see
12545  *a below for more information
12546  *a repulsed_regions_mask - diguySubregionMask value of regions *not*
12547  *a preferred for travel
12548  *a cost_bias_for_repulsed_regions - how much more expensive it will be
12549  *a to cross regions that are marked as repulsive; pass
12550  *a DIGUY_DEFAULT_FLOAT to avoid completely
12551  **
12552  ** Pass DIGUY_DEFAULT_FLOAT for cost_bias_for_neutral_regions and
12553  ** cost_bias_for_repulsed_regions to specify that they should be
12554  ** avoided completely.
12555  **
12556  ** The preferred_subregions_mask and repulsed_regions_mask use
12557  ** DI-Guy subregion mask values combined together. For example,
12558  ** DIGUY_SUBREGION_MASK_SIDEWALK | DIGUY_SUBREGION_MASK_CROSSWALK.
12559  **
12560  ** For cost_bias_for_neutral_regions, specifying a non-zero value for
12561  ** this lowers the likelihood that searches fail on disjointed
12562  ** subregions. A value < 1 will cause the planner to run faster but
12563  ** explore fewer points, possibly missing preferred regions. Values
12564  ** greater then 1 will explore more points but will be slower.
12565  **
12566  *b NOTE:
12567  **
12568  *b THIS API has changed for DI-GUY 11.
12569  **
12570  ** cost_bias_for_preferred_regions has been added and the neutral and
12571  ** repulsed default values have changed.
12572  **
12573  *b Returns:
12574  **
12575  ** 0 on success, -1 on failure
12576  */
12577  int agent_move_to_point_via_subregions(float x, float y, float z,
12578  const char* via_region = NULL,
12579  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12580  float cost_bias_for_preferred_regions = 0.25f,
12581  float cost_bias_for_neutral_regions = 1.1f,
12582  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12583  float cost_bias_for_repulsed_regions = 10.0f,
12584  int cost_rule = 0);
12585 
12586  /*l
12587  *b Description:
12588  **
12589  ** A multi-threaded version of agent_move_to_point_via_subregions().
12590  ** We recommend switching to using this over the single threaded
12591  ** version. When the result is found a
12592  ** CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED is triggered and the result is
12593  ** stored in get_path_planning_result(), you can also poll for
12594  ** completion via get_is_path_planning().
12595  **
12596  *b Returns:
12597  **
12598  ** diguyNavPathSearchResults enum value
12599  **
12600  ** The return value is typically DIGUY_NAV_PATH_ERROR_NONE (0) on
12601  ** success, DIGUY_NAV_PATH_ERROR_SEARCH_QUEUED if this has been queued
12602  ** for multi-threading, or a negative value on failure.
12603  */
12604  int agent_move_to_point_via_subregions_bg(float x, float y, float z,
12605  const char* via_region = NULL,
12606  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12607  float cost_bias_for_preferred_regions = 0.25f,
12608  float cost_bias_for_neutral_regions = 1.1f,
12609  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12610  float cost_bias_for_repulsed_regions = 10.0f,
12611  int cost_rule = 0);
12612 
12613  /*l
12614  *b Returns:
12615  **
12616  ** diguyNavPathSearchResults value after agent_move_to_point_bg()
12617  ** or agent_move_to_point_via_subregions_bg() has been called when
12618  ** the multi-threaded path planner has completed.
12619  */
12620  int get_path_planning_result();
12621 
12622  /*l
12623  *b Returns:
12624  **
12625  ** 1 if character is currently waiting for a result from the
12626  ** multi-threaded path planner, else 0
12627  */
12628  int get_is_path_planning();
12629 
12630  /*l
12631  *b Description:
12632  **
12633  ** Agent will attempt to create a navigation path on the via_region
12634  ** to a point in the target region, and then travel it. An A* path
12635  ** planning algorithm is used to find the path. Cost preferences from
12636  ** the character's current diguyAgentParams are used in the search.
12637  **
12638  *b Arguments:
12639  **
12640  *a region - target region
12641  *a subregion_name - target subregion
12642  *a via_region - name of the region travel in
12643  **
12644  *b Returns:
12645  **
12646  ** 0 on success, -1 on failure
12647  **
12648  *b Available as Decision Bead/Event
12649  */
12650  int agent_move_to_region(const char* region,
12651  const char* subregion_name = "base",
12652  const char* via_region = NULL);
12653 
12654  /*l
12655  *b Description:
12656  **
12657  ** Similar to agent_move_to_point_via_subregions(), but for moving to
12658  ** another region.
12659  **
12660  *b NOTE:
12661  **
12662  *b THIS API has changed for DI-GUY 11.
12663  **
12664  ** cost_bias_for_preferred_regions has been added and the neutral and
12665  ** repulsed default values have changed.
12666  **
12667  *b See Also:
12668  **
12669  ** diguyScenario::set_max_distance_planning_multiplier();
12670  ** diguyScenario::get_time_spent_path_planning_this_frame();
12671  **
12672  *b Returns:
12673  **
12674  ** 0 on success, -1 on failure
12675  */
12676  int agent_move_to_region_via_subregions(const char* region_name,
12677  const char* subregion_name = "base",
12678  const char* via_region = NULL,
12679  float cost_bias_for_preferred_regions = 0.25f,
12680  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12681  float cost_bias_for_neutral_regions = 1.1f,
12682  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12683  float cost_bias_for_repulsed_regions = 10.0f);
12684 
12695  /*l
12696  *b Description:
12697  **
12698  ** The agent will begin following the specified path, using the path
12699  ** follow behavior (DIGUY_AGENT_BEHAVIOR_PATH_FOLLOW).
12700  **
12701  ** The path follow behavior allows an agent to approximately follow a
12702  ** diguyCharacterPath without being in path position mode. The agent
12703  ** can respond to external stimuli (e.g., run away from gunfire), and
12704  ** later return to and resume the path.
12705  **
12706  ** Currently the path must be a path previously defined for the
12707  ** character, through either DI-Guy Scenario or via path API calls.
12708  **
12709  *b Arguments:
12710  **
12711  *a path_name - name of a path of this character
12712  **
12713  *b Returns:
12714  **
12715  ** 0 on success, -1 on failure
12716  **
12717  *b Available as Decision Bead/Event
12718  */
12719  int agent_path_follow(const char* path_name);
12720 
12721  /*l
12722  *b Description:
12723  **
12724  ** The agent will resume following the path specified by a previous
12725  ** call to agent_path_follow(). This will put the agent back into
12726  ** the path follow behavior.
12727  **
12728  *b Returns:
12729  **
12730  ** 0 on success, -1 on failure
12731  **
12732  *b Available as Decision Bead/Event
12733  */
12734  int agent_resume_path_follow();
12735 
12736  /*l
12737  *b Returns:
12738  **
12739  ** the path being followed in path behavior mode
12740  */
12741  diguyCharacterPath* agent_get_path_follow_path();
12742 
12743  /*l
12744  *b Description:
12745  **
12746  ** In path follow behavior the agent moves along the path specified
12747  ** in agent_path_follow(). How far along the agent is on the path is
12748  ** specified in seconds. This function returns that time.
12749  **
12750  ** Note that advancing along the path may be paused for some reason,
12751  ** typically because the agent is resuming path follow behavior
12752  ** after being in a different behavior, or the agent is too far away
12753  ** from the current desired position on the path. In this case the
12754  ** returned time may not advance for awhile until the agent is close
12755  ** enough to the path to resume advancing along it.
12756  **
12757  ** Call diguyAgentParams::set_path_follow_pause_t_when_off_path()
12758  ** to set whether time will be paused when off of the path.
12759  **
12760  ** Call diguyAgentParams::set_path_follow_unpause_t_at_radius() to
12761  ** set how close the agent must be to the last point on the path
12762  ** before time will resume.
12763  **
12764  *b Returns:
12765  **
12766  ** how far, in seconds, the agent is along its path follow path
12767  */
12768  float agent_get_path_follow_path_t();
12769 
12770  /*l
12771  *b Returns:
12772  **
12773  ** 1 if time along the path is not advancing, else 0
12774  */
12775  int agent_get_path_follow_path_t_paused();
12776 
12787  /*l
12788  *b Returns:
12789  **
12790  ** the crowd this agent is a part of, if any; returns NULL if not in
12791  ** a crowd
12792  */
12793  diguyCrowd* agent_get_crowd();
12794 
12795  /*l
12796  *b Description:
12797  **
12798  ** This function allows the end user to directly change an agent's
12799  ** current behavior. This function currently the only way to start
12800  ** an agent "idling".
12801  */
12802  int agent_begin_behavior(const char* behavior_name);
12803 
12804  /*l
12805  *b Description:
12806  **
12807  ** This function sets the behavior of the agent to "none".
12808  */
12809  int agent_stop_behavior();
12810 
12811  /*l
12812  *b Description:
12813  **
12814  ** This function is a convenience function that changes the focus
12815  ** character of this agent's current crowd params.
12816  **
12817  ** This can also be done by getting the character's current params
12818  ** using get_agent_current_params(), and then calling
12819  ** set_focus_character() on that object. This function
12820  ** call, however, is available in decisions.
12821  **
12822  ** The agent currently need not be part of a crowd for this function
12823  ** to work.
12824  **
12825  *b Arguments:
12826  **
12827  *a character_name - name of character to become new focus
12828  *a character; pass NULL or "" to un-set
12829  *a the focus character
12830  **
12831  *b Returns:
12832  **
12833  ** 0 on success, -1 on failure
12834  **
12835  *b Available as Decision Bead/Event
12836  */
12837  int agent_set_current_focus_character(const char* character_name);
12838 
12839  /*l
12840  *b Description:
12841  **
12842  ** This function returns the current character this agent
12843  ** is focused on. This will either be the character named
12844  ** by the focus character, or the character chosen from the
12845  ** focus group to be the current focus character.
12846  **
12847  ** The agent currently need not be part of a crowd for this function
12848  ** to work.
12849  **
12850  *b Returns:
12851  **
12852  *a pointer to type diguyCharacter
12853  */
12854  diguyCharacter* agent_get_current_focus_character();
12855 
12856  /*l
12857  *b Description:
12858  **
12859  ** Similar to set_current_focus_character(), but sets
12860  ** the current focus group instead of character.
12861  **
12862  ** The agent currently need not be part of a crowd for this function
12863  ** to work.
12864  **
12865  *b Arguments:
12866  **
12867  *a group_name - name of group to become new focus
12868  *a group; pass NULL or "" to un-set
12869  *a the focus group
12870  **
12871  *b Returns:
12872  **
12873  ** 0 on success, -1 on failure
12874  **
12875  *b Available as Decision Bead/Event
12876  */
12877  int agent_set_current_focus_group(const char* group_name);
12878 
12879  /*l
12880  *b Description:
12881  **
12882  ** This function returns the initial agent parameters of
12883  ** this agent. The initial parameters of this agent
12884  ** can then be edited through this object.
12885  **
12886  ** Changes to the initial parameters will have no effect until
12887  ** the scenario is reset.
12888  **
12889  ** The current agent parameters will be set to these
12890  ** initial parameters whenever the scenario is reset.
12891  **
12892  ** The agent currently need not be part of a crowd for this function
12893  ** to work.
12894  **
12895  *b Returns:
12896  **
12897  *a pointer to type diguyAgentParams
12898  */
12899  diguyAgentParams* agent_get_initial_params();
12900 
12901  /*l
12902  *b Description:
12903  **
12904  ** This function returns the current agent parameters of
12905  ** this agent. The current parameters of this agent
12906  ** can then be edited through this object.
12907  **
12908  ** Changes to the current parameters should take effect immediately.
12909  **
12910  ** The current agent parameters will be reset to the
12911  ** initial parameters whenever the scenario is reset.
12912  **
12913  ** The agent currently need not be part of a crowd for this function
12914  ** to work.
12915  **
12916  *b Returns:
12917  **
12918  *a pointer to type diguyAgentParams
12919  */
12920  diguyAgentParams* agent_get_current_params();
12921 
12922  /*l
12923  *b Description:
12924  **
12925  ** This function gets the name of the agent's current profile.
12926  **
12927  *b Returns:
12928  **
12929  ** the name of the agent's current profile
12930  */
12931  const char* agent_get_current_params_profile_name();
12932 
12933  /*l
12934  *b Description:
12935  **
12936  ** This function sets this agent's current agent parameters from the
12937  ** specified crowd profile.
12938  **
12939  ** The agent currently need not be part of a crowd for this function
12940  ** to work.
12941  **
12942  *b Arguments:
12943  **
12944  *a profile_name - name of existing crowd profile
12945  *a retain_focus_objects - pass 1 to not change focus object from
12946  *a current focus
12947  *a retain_navigation_values - pass 1 to not change current navigation
12948  *a parameters
12949  *a retain_behavior - pass 1 to not change current behavior
12950  **
12951  ** Navigation values are things like:
12952  **
12953  *- - behavior path
12954  *- - behavior region and subregion
12955  *- - region masks
12956  *- - cost biases
12957  *- - path planner settings
12958  **
12959  *b Returns:
12960  **
12961  ** 0 on success, -1 on failure
12962  **
12963  *b Available as Decision Bead/Event
12964  */
12965  int agent_set_current_params_from_profile(const char* profile_name,
12966  int retain_focus_objects = 1,
12967  int retain_navigation_values = 1,
12968  int retain_behavior = 0);
12969 
12970  /*l
12971  *b Description:
12972  **
12973  ** Similar to agent_set_current_params_from_profile(), but initial
12974  ** parameters are changed.
12975  */
12976  int agent_set_initial_params_from_profile(const char* profile_name);
12977 
12978  /*l
12979  *b Description:
12980  **
12981  ** This function sets the current parameters from the agent's
12982  ** initial parameters.
12983  */
12984  void agent_set_current_params_from_initial_params();
12985 
12986  /*l
12987  *b Description:
12988  **
12989  ** This function sets whether the borders of the current behavior
12990  ** region of the agent is solid.
12991  **
12992  ** If they are, the agent will treat the walls as if they are
12993  ** solid walls in the environment. If not, the agent is free to
12994  ** walk through them.
12995  **
12996  ** The agent currently need not be part of a crowd for this function
12997  ** to work.
12998  **
12999  *b Arguments:
13000  **
13001  *a is_solid - 1 if region border should be solid, 0 if not
13002  **
13003  *b Available as Decision Bead/Event
13004  */
13005  void agent_set_current_behavior_region_border_is_solid(int is_solid);
13006 
13007  /*l
13008  *b Description:
13009  **
13010  ** If the agent is in a behavior that stays in one place before moving
13011  ** to another, such as wander or mingle, this function will request
13012  ** that the agent move on to the next location.
13013  **
13014  *b Available as Decision Bead/Event
13015  */
13016  void agent_move_on();
13017 
13018 
13019  /*l
13020  *b Description:
13021  **
13022  ** This function controls if the AI will attempt to automatically change variants
13023  ** depending on the behavior. This should only change how still motions are performed
13024  ** when the default variant is Normal. Characters in wander and idle will automatically
13025  ** shift to ambient still motions, mingle will alternate between socialize and ambient
13026  ** motions. Attack should automatically switch from aiming to ambient.
13027  ** defaults to being on.
13028  */
13029  int agent_set_auto_variant_selection(int selection_enabled);
13030 
13031  /*l
13032  *b Description:
13033  **
13034  ** Returns if automatic variant selection is enabled, defaults to being on.
13035  */
13036  int agent_get_auto_variant_selection();
13037 
13038  /*l
13039  *b Description:
13040  **
13041  ** Returns current travel path or nav path.
13042  */
13043  diguyPathShape * agent_get_current_traveled_path();
13044 
13045  /*l
13046  *b Description:
13047  **
13048  ** Allows agent to determine speed zone based on distance to endpoint of current
13049  ** path. With this off, speed zones are determined by "desired position", which
13050  ** when following a path is not the endpoint, but a point on the path a short
13051  ** distance ahead of the current position.
13052  **
13053  ** The default value is false.
13054  **
13055  ** Enable this if you want the character to automatically run when following a
13056  ** long path.
13057  */
13058  void agent_set_use_speed_zones_on_paths(int enabled);
13059 
13060  /*l
13061  *b Description:
13062  **
13063  ** Returns the current value set by agent_set_use_speed_zones_on_paths().
13064  */
13065  int agent_get_use_speed_zones_on_paths();
13066 
13067 #ifdef CPLUSPLUS_ONLY
13068 
13124  /*l
13125  *b Description:
13126  **
13127  ** This function sets a feeler function that will be used by this
13128  ** character for environment collision detection. The feeler will
13129  ** replace any existing feeler function (including the default
13130  ** function used in DI-Guy Scenario).
13131  **
13132  ** See the "User-Defined Feelers" information for more information.
13133  **
13134  *b Arguments:
13135  **
13136  *a feeler_function - pointer to user-defined feeler function
13137  **
13138  *b Returns:
13139  **
13140  ** 0 on success, -1 on failure
13141  **
13142  *b Callable From:
13143  **
13144  *- - C++
13145  */
13146  int agent_set_feeler_function(diguyFeelerFunction* feeler_function);
13147 
13148  /*l
13149  *b Returns:
13150  **
13151  ** current feeler function; see set_feeler_function()
13152  **
13153  *b Callable From:
13154  **
13155  *- - C++
13156  */
13157  diguyFeelerFunction* agent_get_feeler_function();
13158 
13159 #endif
13160 
13161 
13162 /*****************************************************************************/
13168  /*l
13169  *b Description:
13170  **
13171  ** Creates a Lua mind object based off of the contents of base_class.
13172  **
13173  *b Arguments:
13174  **
13175  *a base_class - the class to use as the basis for the character's
13176  *a mind
13177  *a init_arg1-2 - experimental optional arguments passed to the init
13178  *a function; your lua init function will need to take
13179  *a arguments
13180  **
13181  */
13182  int create_lua_mind(const char* base_class, const char* init_arg1 = NULL,
13183  const char* init_arg2 = NULL);
13184 
13185  /*l
13186  *b Description:
13187  **
13188  ** Returns the name of the mind, e.g. "luaPedestrian". This is, in other
13189  ** words, the mind's base class
13190  */
13191  const char *get_mind_name();
13192 
13193  /*l
13194  *b Description:
13195  **
13196  ** Agent characters with minds will typically have the mind be in
13197  ** some state, such as "patrolling", "fleeing", "mobbing", etc. This
13198  ** function returns the name of that state.
13199  **
13200  ** Currently this is only applicable to characters with Lua minds.
13201  **
13202  *b Returns:
13203  **
13204  ** the name of the agent's current mind state
13205  */
13206  const char* get_mind_current_state_name();
13207 
13208  /*l
13209  *b Description:
13210  **
13211  ** This function causes callback functions with the callback id
13212  ** CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED to be called.
13213  ** It's intended use is for mind implementations that need to
13214  ** signal that the mind's current state has changed.
13215  **
13216  ** Currently this is only applicable to characters with Lua minds.
13217  */
13218  void do_mind_current_state_changed_callback();
13219 
13220  /*l
13221  *b Description:
13222  **
13223  ** How long until the character's main coroutine thread should be
13224  ** resumed. This function is typically used by various luaCharacter
13225  ** sleep functions.
13226  **
13227  *b Arguments:
13228  **
13229  *a sleep_length - how long relative to the current time the character
13230  *a should sleep
13231  */
13232  int set_sleep_timer(float sleep_length);
13233 
13234  /*l
13235  *b Returns:
13236  **
13237  ** How long until the character's main coroutine thread resumes,
13238  ** relative to the current time.
13239  */
13240  float get_sleep_timer();
13241 
13242  /*l
13243  *b Description:
13244  **
13245  ** The frequency at which the luaCharacter's heartbeat function
13246  ** should run. This defaults to once per second. The character
13247  ** must have a Lua function named heartbeat.
13248  **
13249  *b Arguments:
13250  **
13251  *a heartbeat_dt - frequency of heartbeat
13252  */
13253  int set_heartbeat_dt(float heartbeat_dt);
13254 
13255  /*l
13256  *b Description:
13257  **
13258  ** This function allows the addition of additional heartbeat
13259  ** functions.
13260  **
13261  *b Arguments:
13262  **
13263  *a function_name - the name of the Lua function to treat as a
13264  *a heartbeat; the function_name should not include
13265  *a the name of the character object
13266  *a heartbeat_dt - frequency of heartbeat
13267  **
13268  *b Returns:
13269  **
13270  ** 0 on success, -1 on failure
13271  */
13272  int add_secondary_heartbeat(const char* function_name,
13273  float heartbeat_dt);
13274 
13275  /*l
13276  *b Description:
13277  **
13278  ** This function removes an added heartbeat function.
13279  **
13280  *b Arguments:
13281  **
13282  *a function_name - the name of the Lua function to treat as a
13283  *a heartbeat; the function_name should not include
13284  *a the name of the character object
13285  **
13286  *b Returns:
13287  **
13288  ** 0 on success, -1 on failure
13289  */
13290  int remove_secondary_heartbeat(const char* function_name);
13291 
13292  /*l
13293  *b Description:
13294  **
13295  ** The frequency at which a luaCharacter's secondary heartbeat
13296  ** function should run. The character must have a Lua function named
13297  ** function_name.
13298  **
13299  *b Arguments:
13300  **
13301  *a function_name - heartbeat function to adjust
13302  *a heartbeat_dt - frequency of heartbeat
13303  **
13304  *b Returns:
13305  **
13306  ** 0 on success, -1 on failure
13307  */
13308  int set_secondary_heartbeat_dt(const char* function_name, float heartbeat_dt);
13309 
13310  /*l
13311  *b Description:
13312  **
13313  ** This function creates a request that whenever the specified
13314  ** callback is triggered, the character is woken up with a message.
13315  ** The message will be of the form:
13316  *>
13317  *- - message_type = "callback"
13318  *- - message = the string representation of the callback
13319  *<
13320  ** A good example of the use for this is a flexible "move to"
13321  ** command:
13322  **
13323  *b Lua Example:
13324  **
13325  *e self.character:add_wakeup_callback(diguyCharacter_CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED);
13326  *e -- begin to move to a location
13327  *e self.character:agent_move_to_region_via_subregions("navmesh", "green", "navmesh",
13328  *e DIGUY_SUBREGION_MASK_BASE, 12);
13329  *e -- sleep till arrived
13330  *e self:sleep(100);
13331  *e self.character:remove_wakeup_callback(diguyCharacter_CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED);
13332  **
13333  ** Effectively the character will wake up either after 100 seconds or
13334  ** when they arrive at their desired destination.
13335  **
13336  *b Arguments:
13337  **
13338  *a callback - the callback id that should wake up the character
13339  **
13340  *b Returns:
13341  **
13342  ** 0 on success, -1 on failure
13343  */
13344  int add_wakeup_callback(int callback);
13345 
13346  /*l
13347  *b Description:
13348  **
13349  ** This function removes a request to trigger a message when a
13350  ** callback is triggered.
13351  **
13352  *b Arguments:
13353  **
13354  *a callback - callback id that should no longer wake up the
13355  *a character
13356  **
13357  *b Returns:
13358  **
13359  ** 0 on success, -1 on failure
13360  */
13361  int remove_wakeup_callback(int callback);
13362 
13363  /*l
13364  *b Description:
13365  **
13366  ** This function removes all requests to trigger a message when
13367  ** callbacks are triggered.
13368  **
13369  *b Returns:
13370  **
13371  ** 0 on success, -1 on failure
13372  */
13373  int remove_all_wakeup_callbacks();
13374 
13375  /*l
13376  *b Description:
13377  **
13378  ** This function check for a requests to trigger a message when
13379  ** a given callback is triggered.
13380  **
13381  *b Returns:
13382  **
13383  ** 0 on false, 1 on true
13384  */
13385  int has_wakeup_callback(int callback);
13386 
13387  /*l
13388  *b Description:
13389  **
13390  ** This function wakes up a character and sends them a message.
13391  ** Currently this is only applicable to characters with Lua minds.
13392  **
13393  *b Arguments:
13394  **
13395  *a sender - who is sending the message
13396  *a message_type - what type of message is being sent
13397  *a message - the message string
13398  *a message_params - optional parameter string
13399  **
13400  *b Returns:
13401  **
13402  ** number of times message was successfully parsed
13403  */
13404  int agent_accept_message(const char* sender,
13405  const char* message_type,
13406  const char* message,
13407  const char* message_params = NULL);
13408 
13409  /*l
13410  **
13411  *b Description:
13412  **
13413  ** This function wakes up nearby characters and sends them a message.
13414  ** The sender of the message is implicitly set to the individual
13415  ** calling the broadcast function
13416  **
13417  ** Currently this is only applicable to characters with Lua minds.
13418  **
13419  *b Arguments:
13420  **
13421  *a radius - how far to broadcast the message
13422  *a message_type - what type of message is being sent
13423  *a message - the message string
13424  *a message_params - optional parameter string
13425  **
13426  *b Returns:
13427  **
13428  ** number of times message was successfully parsed
13429  */
13430  int agent_broadcast_message(float radius,
13431  const char* message_type,
13432  const char* message,
13433  const char* message_params = NULL);
13434 
13435  /*l
13436  *b Description:
13437  **
13438  ** This function wakes up nearby characters in the group specified
13439  ** and sends them a message. The sender of the message is implicitly
13440  ** set to the individual calling the broadcast function.
13441  **
13442  ** Currently this is only applicable to characters with Lua minds.
13443  **
13444  *b Arguments:
13445  **
13446  *a group_name - group to broadcast message to
13447  *a radius - how far to broadcast the message
13448  *a message_type - what type of message is being sent
13449  *a message - the message string
13450  *a message_params - optional parameter string
13451  **
13452  **
13453  *b Returns:
13454  **
13455  ** number of times message was successfully parsed,
13456  ** -1 on failure
13457  */
13458  int agent_broadcast_message_to_group(const char* group_name,
13459  float radius,
13460  const char* message_type,
13461  const char* message,
13462  const char* message_params = NULL);
13463 
13464  /*l
13465  **
13466  *b Returns:
13467  **
13468  ** name of character's lua mind object; typically this is the
13469  ** character's name with '-' replaced by '_'
13470  */
13471  const char* get_lua_object_name();
13472 
13473  /*l
13474  *b Description:
13475  **
13476  ** Sets the specified field of the mind to the string field_value.
13477  */
13478  void set_mind_field_as_string(const char* field_name,
13479  const char* field_value);
13480 
13481  /*l
13482  *b Description:
13483  **
13484  ** Queries the luaCharacter object for a specific field, and attempts
13485  ** to convert it into a string. This works for strings and
13486  ** numbers.
13487  **
13488  ** This returned pointer will stay valid until the next time this
13489  ** function is called, so if the results need to be saved they must
13490  ** be copied.
13491  **
13492  *b Returns:
13493  **
13494  ** field_name as string
13495  */
13496  const char* get_mind_field_as_string(const char* field_name,
13497  int warn_if_no_field = 1);
13498 
13499  /*l
13500  *b Description:
13501  **
13502  ** Sets the specified field of the mind to the floating point
13503  ** number field_value.
13504  */
13505  void set_mind_field_as_float(const char* field_name, float field_value);
13506 
13507  /*l
13508  *b Description:
13509  **
13510  ** Similar to get_mind_field_as_string(), but returns field as
13511  ** a float.
13512  **
13513  *b Returns:
13514  **
13515  ** field_name as double
13516  */
13517  float get_mind_field_as_float(const char* field_name,
13518  int warn_if_no_field = 1,
13519  int* found_field = NULL);
13520 
13521  /*l
13522  *b Description:
13523  **
13524  ** Sets the specified field of the mind to the integer number
13525  ** field_value.
13526  */
13527  void set_mind_field_as_int(const char* field_name, int field_value);
13528 
13529  /*l
13530  *b Description:
13531  **
13532  ** Similar to get_mind_field_as_int(), but returns field as
13533  ** an integer.
13534  **
13535  *b Returns:
13536  **
13537  ** field_name as int
13538  */
13539  int get_mind_field_as_int(const char* field_name,
13540  int warn_if_no_field = 1,
13541  int* found_field = NULL);
13542 
13543  /*l
13544  *b Description:
13545  **
13546  ** Attempts to run a luaCharacter member function, and can optionally
13547  ** return the function's result. Lua return values can be converted
13548  ** to strings and numbers -- other data types will cause an error.
13549  **
13550  ** This returned pointer will stay valid until the next time this
13551  ** function is called, so if the results need to be saved they must
13552  ** be copied.
13553  **
13554  *b *Note:* This function should be considered experimental, as the
13555  *b API may change.
13556  **
13557  *b Arguments:
13558  **
13559  *a function_name - luaCharacter function field to invoke
13560  *a argument - optional string argument to the function
13561  *a has_return_string - 0 or 1; determines if lua interface should
13562  *a attempt to retrieve a string value
13563  **
13564  *b Returns:
13565  **
13566  ** Lua function return value
13567  */
13568  const char* evaluate_mind_function(const char* function_name,
13569  const char* argument = NULL,
13570  int has_return_string = 0);
13571 
13572  /*l
13573  *b Description:
13574  **
13575  ** This function produces a string with a long list of character
13576  ** information, including: current path, crowd, behavior, lua state,
13577  ** lua call stack, wakeup callbacks and lua object fields. It is
13578  ** meant to help with debugging agents.
13579  **
13580  ** This returned pointer will stay valid until the next time this
13581  ** function is called, so if the results need to be saved they must
13582  ** be copied.
13583  **
13584  *b Arguments:
13585  **
13586  *a include_stack - pass 1 to include callstack info, 0 to not
13587  *a include_locals - pass 1 to include local variable info, 0 to not
13588  **
13589  *b Returns:
13590  **
13591  ** string containing character information
13592  */
13593  const char* get_ai_state_string(int include_stack = 1, int include_locals = 1);
13594 
13595 
13596 /*****************************************************************************/
13606 /*
13607  *3 Visibility Tests
13608  */
13609 
13610  /*l
13611  *b Description:
13612  **
13613  ** This function tests whether this character can see the passed
13614  ** character. Currently this tests if the cervical link of this
13615  ** character has a clear line of sight to either the cervical or the
13616  ** position links of the target. Currently the orientation of this
13617  ** character isn't factored in.
13618  **
13619  ** This function does not fail if other characters are between the
13620  ** two characters in question.
13621  **
13622  ** Checking visibility is only an option if an octtree is generated
13623  ** from scene objects; typically only DI-Guy Scenario does this.
13624  ** Outside of DI-Guy Scenario set_character_los_function() should be
13625  ** used if no octtree is present.
13626  **
13627  *b Arguments:
13628  **
13629  *a character - character to check
13630  *a los_check_type - currently unused but passed to callback function
13631  *a if end users wish to pass an additional parameter
13632  **
13633  *b Returns:
13634  **
13635  ** 1 if character is visible, 0 if not
13636  */
13637  int check_character_visibility(diguyCharacter* character,
13638  int los_check_type = 0);
13639 
13640  /*l
13641  *b Description:
13642  **
13643  ** This function tests whether this character can see the x, y, z
13644  ** location specified. Currently this tests if the cervical link of
13645  ** this character has a clear line of sight to the x, y, z location.
13646  ** Currently the orientation of this character isn't factored in.
13647  **
13648  ** This function does not fail if other characters are between the
13649  ** character and the location in question.
13650  **
13651  ** Checking visibility is only an option if an octtree is generated
13652  ** from scene objects; typically only DI-Guy Scenario does this.
13653  **
13654  *b Arguments:
13655  **
13656  *a x, y, z - location to check
13657  **
13658  *b Returns:
13659  **
13660  ** 1 if location is visible, 0 if not
13661  */
13662  int check_point_visibility(float x, float y, float z);
13665 
13666 /*****************************************************************************/
13683 #ifdef CPLUSPLUS_ONLY
13684 
13685  /*l
13686  *b Description:
13687  **
13688  ** When a character needs to check if it can see a location, DI-Guy
13689  ** calls this function with a pointer to the diguyCharacter in
13690  ** question, and the coordinates of the point that is being looked
13691  ** at. This currently happens when an agent is told to move to a new
13692  ** region.
13693  **
13694  ** The following prototype should be used for the point line-of-sight
13695  ** function:
13696  **
13697  *e int diguyPointLOSFunction(diguyCharacter* character,
13698  *e float x,
13699  *e float y,
13700  *e float z);
13701  **
13702  ** The function should then check if the desired location is visible.
13703  ** This can be done in a number of ways; a typical approach is to do
13704  ** an intersection test with the static scene.
13705  **
13706  ** The function should return 1 if the path to the target is clear, 0
13707  ** if there is an obstruction.
13708  **
13709  ** A default point line-of-sight function can be set for all
13710  ** subsequently created characters by calling
13711  ** diguyScenario::set_default_point_los_function().
13712  **
13713  *b Callable From:
13714  **
13715  *- - C++
13716  */
13717  int set_point_los_function(diguyPointLOSFunction* point_los_function);
13718 
13719  /*l
13720  *b Returns:
13721  **
13722  ** current point line-of-sight function; see set_point_los_function()
13723  **
13724  *b Callable From:
13725  **
13726  *- - C++
13727  */
13728  diguyPointLOSFunction* get_point_los_function();
13729 
13730  /*l
13731  *b Description:
13732  **
13733  ** When a character needs to check if it can see another character,
13734  ** DI-Guy calls this function with a pointer to the diguyCharacter in
13735  ** question. This can happen when check_character_visibility() is
13736  ** invoked or when AI attack code assesses if it should take a shot.
13737  **
13738  ** The following prototype should be used for the character
13739  ** line-of-sight function:
13740  **
13741  *e int diguyCharacterLOSFunction(diguyCharacter* character,
13742  *e diguyCharacter* target_character,
13743  *e int los_test_type) // (currently unused)
13744  **
13745  ** Currently the los_test_type argument defaults to 0 and is not used
13746  ** internally. It is, however, available in
13747  ** check_character_visibility() and will be passed to the callback.
13748  ** This can be useful if the end user wants to write scripting code
13749  ** that has alternative Line of Sight tests depending on agent
13750  ** conditions. (e.g. a test that factors in the character's field of
13751  ** view.)
13752  **
13753  ** The function then checks if the target character is visible. This
13754  ** can be done in a number of ways; a typical approach is to do an
13755  ** intersection test with the static scene. The default
13756  ** implementation tests the path from the characters head to the
13757  ** target's head and then to the target's feet.
13758  **
13759  ** The function should return 1 if the path to the target is clear,
13760  ** and 0 if there is an obstruction.
13761  **
13762  ** A default character line-of-sight function can be set for all
13763  ** subsequently created characters by calling
13764  ** diguyScenario::set_default_character_los_function().
13765  **
13766  *b Callable From:
13767  **
13768  *- - C++
13769  */
13770  int set_character_los_function(diguyCharacterLOSFunction* character_los_function);
13771 
13772  /*l
13773  *b Returns:
13774  **
13775  ** current character line-of-sight function; see
13776  ** set_character_los_function()
13777  **
13778  *b Callable From:
13779  **
13780  *- - C++
13781  */
13782  diguyCharacterLOSFunction* get_character_los_function();
13783 
13784 #endif
13785 
13786 
13787 /*****************************************************************************/
13804  int get_num_ik_chains();
13806 
13808  const char* get_ik_chain_name_at_index( int index );
13809 
13810  /*b Description:
13811  ** Moves the end effector for the specified ik chain to a location in the world.
13812  **
13813  *b Arguments:
13814  *a ik_chain_target - index of ik chain
13815  *a x,y,z - world location of where to move the IK end effector to.
13816  *a ramp_time - how long to take blending in solution
13817  **
13818  *b Returns:
13819  ** -1 on failure, 0 on success
13820  */
13821  int set_ik_target_world( int ik_chain_target, float x, float y, float z, float ramp_time = 0.25f );
13822 
13823  /*b Description:
13824  ** Moves the end effector for the specified ik chain to a location relative to the character.
13825  **
13826  *b Arguments:
13827  *a ik_chain_target - index of ik chain
13828  *a x,y,z - local location of where to move the IK end effector to.
13829  *a ramp_time - how long to take blending in solution
13830  **
13831  *b Returns:
13832  ** -1 on failure, 0 on success
13833  */
13834  int set_ik_target_local( int ik_chain_target, float x, float y, float z, float ramp_time = 0.25f );
13835 
13836  /*b Description:
13837  ** Moves the end effector for the specified ik chain to location on another character.
13838  **
13839  *b Arguments:
13840  *a ik_chain_target - index of ik chain
13841  *a target - target character.
13842  *a link_name - target joint
13843  *a ramp_time - how long to take blending in solution
13844  **
13845  *b Returns:
13846  ** -1 on failure, 0 on success
13847  */
13848  int set_ik_target_character( int ik_chain_target, diguyCharacter* target, const char* link_name, float ramp_time = 0.25f );
13849 
13850  /*b Description:
13851  ** Gets whether the given ik chain is currently active or not.
13852  **
13853  *b Arguments:
13854  *a ik_chain_target - index of ik chain
13855  **
13856  *b Returns:
13857  ** true if chain is active, false if it's not
13858  */
13859  bool is_ik_target_active( int ik_chain_target ) const;
13860 
13861  /*b Description:
13862  ** Resets the end effector to be solely driven by the animation system
13863  */
13864  int disable_ik_target( int ik_chain_target, float ramp_time = 0.25f );
13865 
13866  /*b Description:
13867  ** Sets the distance to the primary camera, this should be automatically set in OpenGL
13868  ** or if you set the camera position, in retained mode renderers you will need to set this
13869  ** manually. Currently only used by IK system for performance culling.
13870  */
13871  void set_distance_to_primary_camera( float camera_dist );
13872 
13874  float get_distance_to_primary_camera();
13875 
13876 /*****************************************************************************/
13892  /*l
13893  *b Description:
13894  **
13895  ** This function sets the initial character simulator this character
13896  ** will use. The current simulator will be set to this value on
13897  ** scenario reset.
13898  **
13899  ** The current simulator can be set by calling
13900  ** set_current_character_simulator().
13901  **
13902  ** The default simulator is
13903  ** DIGUY_CHARACTER_SIMULATOR_DIGUY_MOTION_ENGINE.
13904  **
13905  ** Requires active physics module if character simulator is set to
13906  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13907  **
13908  *b Arguments:
13909  **
13910  *a character_simulator - which simulator to use at reset
13911  **
13912  *b Returns:
13913  **
13914  ** 0 on success, -1 on failure
13915  */
13916  int set_initial_character_simulator(diguyCharacterSimulator character_simulator);
13917 
13918  /*l
13919  *b Returns:
13920  **
13921  ** initial character simulator
13922  */
13923  diguyCharacterSimulator get_initial_character_simulator();
13924 
13925  /*l
13926  *b Description:
13927  **
13928  ** This function sets the current character simulator this character
13929  ** will use. The current simulator will be reset to the initial
13930  ** character simulator on scenario reset.
13931  **
13932  ** The initial simulator can be set by calling
13933  ** set_initial_character_simulator().
13934  **
13935  *b Arguments:
13936  **
13937  *a character_simulator - new current character simulator
13938  **
13939  *b Returns:
13940  **
13941  ** 0 on success, -1 on failure
13942  */
13943  int set_current_character_simulator(diguyCharacterSimulator character_simulator);
13944 
13945  /*l
13946  *b Returns:
13947  **
13948  ** current character simulator
13949  */
13950  diguyCharacterSimulator get_current_character_simulator();
13951 
13952  /*l
13953  *b Description:
13954  **
13955  ** This function sets the initial physics simulation mode this
13956  ** character will use. The current simulation mode will be set to
13957  ** this value on scenario reset.
13958  **
13959  ** The current simulation mode can be set by calling
13960  ** set_current_physics_simulation_mode().
13961  **
13962  ** The default simulation mode is
13963  ** DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER.
13964  **
13965  ** The physics simulation mode will have no effect unless the current
13966  ** character simulator is
13967  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13968  **
13969  *b Arguments:
13970  **
13971  *a physics_simulation_mode - which simulation mode to use at reset
13972  **
13973  *b Returns:
13974  **
13975  ** 0 on success, -1 on failure
13976  */
13977  int set_initial_physics_simulation_mode(diguyPhysicsSimulationMode physics_simulation_mode);
13978 
13979  /*l
13980  *b Returns:
13981  **
13982  ** initial physics simulation mode
13983  */
13984  diguyPhysicsSimulationMode get_initial_physics_simulation_mode();
13985 
13986  /*l
13987  *b Description:
13988  **
13989  ** This function sets the current physics simulation mode this
13990  ** character will use. The current simulation mode will be reset to
13991  ** the initial physics simulator mode on scenario reset.
13992  **
13993  ** The initial simulation mode can be set by calling
13994  ** set_initial_physics_simulation_mode().
13995  **
13996  ** The physics simulation mode will have no effect unless the current
13997  ** character simulator is
13998  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13999  **
14000  *b Arguments:
14001  **
14002  *a physics_simulation_mode - new current physics simulation mode
14003  **
14004  *b Returns:
14005  **
14006  ** 0 on success, -1 on failure
14007  */
14008  int set_current_physics_simulation_mode(diguyPhysicsSimulationMode physics_simulation_mode);
14009 
14010  /*l
14011  *b Returns:
14012  **
14013  ** initial physics simulation mode
14014  */
14015  diguyPhysicsSimulationMode get_current_physics_simulation_mode();
14016 
14017  /*l
14018  *b Description:
14019  **
14020  ** This function sets the physics collision group this character will
14021  ** be in when being simulated. For improved performance, collision
14022  ** detection between various characters and scene objects will not
14023  ** be performed, based on which collision groups the objects are in.
14024  **
14025  ** By default:
14026  **
14027  *- - characters in character group n collide against props in prop
14028  *- group n and scene objects in scene object group n
14029  *- in group n
14030  *- - characters in group ghost don't collide against any other
14031  *- characters, but do against scene objects and props
14032  *- - characters in group everything collide against all characters,
14033  *- props, and scene objects
14034  *- - all props collide against all other props and scene objects
14035  **
14036  ** Collision group relationships can be modified using
14037  ** diguyApp::set_collision_group_detection_flag().
14038  **
14039  *b Arguments:
14040  **
14041  *a physics_simulation_mode - new current physics simulation mode
14042  **
14043  *b Returns:
14044  **
14045  ** 0 on success, -1 on failure
14046  */
14047  int set_physics_collision_group(diguyPhysicsCollisionGroup collision_group);
14048 
14049  /*l
14050  *b Returns:
14051  **
14052  ** physics collision group
14053  */
14054  diguyPhysicsCollisionGroup get_physics_collision_group();
14055 
14056  /*l
14057  *b Description:
14058  **
14059  ** This function sets a time at which active simulation of a physics
14060  ** controlled character will stop. This is useful for:
14061  **
14062  *- - reducing simulation processing overhead
14063  *- - freezing a simulation that is mostly in steady state, but some
14064  *- small part remains oscillating
14065  **
14066  ** The physics controlled character will remain frozen in the last
14067  ** computed simulated pose.
14068  **
14069  *b Arguments:
14070  **
14071  *a t - scenario t at which simulation will freeze
14072  **
14073  ** t should be large enough for the simulation to reach a reasonably
14074  ** steady state, such as a human lying on the ground. A value that
14075  ** is usually reasonable is around 5 seconds.
14076  */
14077  void set_stop_physics_sim_at_t(float t);
14078 
14079  /*l
14080  *b Description:
14081  **
14082  ** Similar to set_stop_physics_sim_at_t(), but the passed time will
14083  ** be relative to the current simulation time as returned by
14084  ** diguyScenario::get_t().
14085  */
14086  void set_stop_physics_sim_in_t_seconds(float relative_t);
14087 
14088  /*l
14089  *b Returns:
14090  **
14091  ** time at which physics simulation will freeze
14092  */
14093  float get_stop_physics_sim_at_t();
14094 
14095  /*l
14096  *b Description:
14097  **
14098  ** This function applied an impulse force to the character. An
14099  ** impulse is a force that is applied all at one time, such as an
14100  ** explosion shock wave.
14101  **
14102  *b Arguments:
14103  **
14104  *a link - link to which impulse should be applied
14105  *a impulse_magnitude_[xyz] - magnitude of impulse in x direction
14106  *a link_offset_[xyz] - offset on link at which to apply impulse
14107  *a set_simulation_drives_character - pass 1 to automatically change
14108  *a the character's current simulation mode
14109  *a to DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER
14110  */
14111  void apply_impulse_to_physics_sim(const char* link,
14112  float impulse_magnitude_x,
14113  float impulse_magnitude_y,
14114  float impulse_magnitude_z,
14115  float link_offset_x = 0.0f,
14116  float link_offset_y = 0.0f,
14117  float link_offset_z = 0.0f,
14118  int set_simulation_drives_character = 1);
14119 
14120  /*l
14121  *b Description:
14122  **
14123  ** Similar to apply_impulse_to_physics_sim(), but impulse can be
14124  ** calculated relative to a world position. This is useful if, for
14125  ** example, a character should react to a nearby explosion.
14126  **
14127  *b Arguments:
14128  **
14129  *a link - link to which impulse should be applied
14130  *a impulse_magnitude_[xyz] - magnitude of impulse
14131  *a impulse_generator_position_[xyz] - world coordinates of impulse
14132  *a generating object
14133  *a max_distance - maximum distance from above position at
14134  *a which the impulse can affect this
14135  *a character
14136  *a impulse_rolloff - how much the impulse magnitude should
14137  *a decrease as distance from impulse source
14138  *a increases
14139  *a link_offset_[xyz] - offset on link at which to apply impulse
14140  *a set_simulation_drives_character - pass 1 to automatically change
14141  *a the character's current simulation mode
14142  *a to DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER
14143  */
14144  void apply_impulse_to_physics_sim_from_world_position(const char* link,
14145  float impulse_magnitude_x,
14146  float impulse_magnitude_y,
14147  float impulse_magnitude_z,
14148  float impulse_generator_position_x,
14149  float impulse_generator_position_y,
14150  float impulse_generator_position_z,
14151  float max_distance = 20.0f,
14152  float impulse_rolloff = 0.0f,
14153  float link_offset_x = 0.0f,
14154  float link_offset_y = 0.0f,
14155  float link_offset_z = 0.0f,
14156  int set_simulation_drives_character = 1);
14157 
14158 /*****************************************************************************/
14162  /*l
14163  *b Description:
14164  **
14165  ** Sets texture load behavior to DIGUY_LOAD_INSTANTLY, DIGUY_LOAD_PRIORITY_ASYNC, or
14166  ** DIGUY_LOAD_ASYNC
14167  */
14168  static int set_texture_load_behavior(diguyGraphicsTextureLoadingBehavior mode);
14169 
14170  /*l
14171  *b Returns current behavior, as set in set_texture_load_behavior()
14172  */
14173  static diguyGraphicsTextureLoadingBehavior get_texture_load_behavior();
14174 
14175  /*l
14176  *b Description:
14177  **
14178  ** Sets maximum quality of shader to use (actual quality varies
14179  ** by distance from camera). See diguyGraphicsShaderQualityLevel for
14180  ** possible values.
14181  **
14182  *b Arguments:
14183  **
14184  *a quality_level - a value between DIGUY_GRAPHICS_SHADER_QUALITY_UNLIT
14185  *- and DIGUY_GRAPHICS_SHADER_QUALITY_MAX
14186  */
14187  static int set_max_shader_quality_level(int quality_level);
14188 
14190  static int get_max_shader_quality_level();
14191 
14192 
14193 /****************************************************************************/
14200 /****************************************************************************/
14201 
14202  /*l
14203  ** Sets if this character will play back animation events that have been
14204  ** added to motion inits in the action table.
14205  */
14206  int set_animation_events_enabled(int enable);
14207  int get_animation_events_enabled();
14208 
14209 
14210  /*l
14211  *b Description:
14212  **
14213  ** This function returns how many channels the specified action has.
14214  ** If an action has more than one channel, the relative weights of
14215  ** its channels can be set using the set_action_channel_weight()
14216  ** function.
14217  **
14218  *b Arguments:
14219  **
14220  *a action_name - name of action to be queried
14221  **
14222  *b Returns:
14223  **
14224  ** number of channels in specified action
14225  */
14226  int get_action_num_channels(const char* action_name);
14227 
14228  /*l
14229  *b Description:
14230  **
14231  ** This function sets the weight one channel of a multi-channel
14232  ** action.
14233  **
14234  ** The passed weight should be between 0 and 1. The weights of
14235  ** the other channels in the action will be adjusted so that the
14236  ** total weight of all channels is 1.
14237  **
14238  *b Arguments:
14239  **
14240  *a action_name - name of action to be affected
14241  *a channel - which channel's weight to set
14242  *a weight - weight of the channel, between 0 and 1
14243  **
14244  *b Returns:
14245  **
14246  ** 0 on success, -1 on failure
14247  */
14248  int set_action_channel_weight(const char* action_name,
14249  char channel,
14250  float weight);
14251 
14252  /*l
14253  *b Description:
14254  **
14255  ** This function returns the weight of one channel of a multi-channel
14256  ** action.
14257  **
14258  *b Arguments:
14259  **
14260  *a action_name - name of action to be queried
14261  *a channel - which channel's weight to return
14262  **
14263  *b Returns:
14264  **
14265  ** weight of a channel
14266  */
14267  float get_action_channel_weight(const char* action_name,
14268  char channel);
14269 
14270  /*l
14271  *b Description:
14272  **
14273  ** This function returns the number of seconds before the transition
14274  ** to the desired action begins. If the character is already
14275  ** performing the desired action the function returns 0.
14276  **
14277  *b THIS FUNCTION DOES NOT YET RETURN VALID RESULTS.
14278  **
14279  *b Returns:
14280  **
14281  ** time to reach desired action, in seconds
14282  */
14283  float get_time_to_reach_desired_action();
14284 
14285  /*l
14286  *b Description:
14287  **
14288  ** Maps a character type map field to its value. See diguyCharacterTypeMap.
14289  **
14290  ** Returns:
14291  **
14292  ** The value, as a string.
14293  */
14294  const char* get_type_map_field(diguyCharacterTypeMapField field);
14295 
14296  /*l
14297  *b Description:
14298  **
14299  ** Maps a character type map field to its value, using a string version (e.g.
14300  ** "age") of the field name. See diguyCharacterTypeMap.
14301  **
14302  ** Returns:
14303  **
14304  ** The value, as a string.
14305  */
14306  const char* get_type_map_field_using_string(const char* field);
14307 
14310  float get_normalized_age() const;
14311 
14312  /*l
14313  *b Description:
14314  **
14315  ** This function performs a "micro merge", allowing a diguyCharacter
14316  ** to have objects added to it by parsing a .dss file fragment in the
14317  ** form of a string.
14318  **
14319  ** This function can be used, for example, to add paths to
14320  ** dynamically created agents. A Lua Package can contain a number of
14321  ** text strings representing local paths for agents. On character
14322  ** creation these strings can be merged in and turned into
14323  ** per-character objects.
14324  **
14325  ** The DI-Guy Scenario path page has a "Display Asset" button for
14326  ** generating merge_object() compatible strings.
14327  **
14328  ** There is also a diguyScenario::merge_object() function that allows
14329  ** the merging of text blocks that represent sounds and particle
14330  ** systems.
14331  **
14332  ** Note: the parser is very sensitive to tabs and formatting!
14333  */
14334  int merge_object(const char* object);
14335 
14336  /*l
14337  *b Description:
14338  **
14339  ** Returns 1 if any active character in the named group is visible,
14340  ** otherwise 0.
14341  **
14342  *b Arguments:
14343  **
14344  *a group_name
14345  *a max_distance_to_check
14346  */
14347  int is_active_character_in_group_visible(const char* group_name,
14348  float max_distance_to_check = 100000.0f);
14349 
14350  /*l
14351  *b Description:
14352  **
14353  ** Gets local space bounding box, this function is currently expensive
14354  ** and should be used with care.
14355  **
14356  *b Arguments:
14357  **
14358  *a x1,y1,z1,x2,y2,z2 - output parameters
14359  **
14360  *b Returns:
14361  **
14362  ** 0 on success, -1 on failure
14363  ** (float * arguments converted to return values in Lua)
14364  */
14365  int get_local_space_bounding_box(float* x1, float* y1, float* z1,
14366  float* x2, float* y2, float* z2);
14367 
14368  /*l
14369  *b Description:
14370  **
14371  ** This causes a character's mind to get an update call even if time
14372  ** isn't passing in the scenario. This is occasionally useful for
14373  ** characters that are managing the UI.
14374  **
14375  ** Note that there is now a luaUIStateMachine that might be a better
14376  ** solution.
14377  */
14378  void set_mind_always_updates(int force_update);
14379 
14381  int get_mind_always_updates();
14382 
14383  /*l
14384  ** Returns angle in degrees from character's "forward facing" vector
14385  ** to the specified action bead, on the specified path
14386  */
14387  float get_angle_to_path(const char* path_name,
14388  const char* action_bead_name = NULL);
14389 
14390 
14393  void set_scene_graph_mask(unsigned int mask);
14394 
14396  unsigned int get_scene_graph_mask();
14397 
14398 
14403  diguyMotionEngineSnapshot get_motion_engine_snapshot();
14404 
14406  int apply_motion_engine_snapshot( const diguyMotionEngineSnapshot& action_info );
14407 
14412  int set_local_to_world_orientation_matrix( float rz, float rx, float ry);
14414  int set_local_to_world_orientation_matrix(
14415  float a0, float a1, float a2,
14416  float b0, float b1, float b2,
14417  float c0, float c1, float c2, int transpose = 0);
14418 #ifdef CPLUSPLUS_ONLY
14419  const float* get_local_to_world_orientation_matrix();
14421 #endif
14422 
14423  int set_current_IK_world_conversion_matrix(
14424  float a0, float a1, float a2,
14425  float b0, float b1, float b2,
14426  float c0, float c1, float c2,
14427  int transpose = 0 );
14428 
14429 #ifdef CPLUSPLUS_ONLY
14430  const float* get_current_IK_world_conversion_matrix() const;
14431 #endif
14432 
14433  // HACK fix me with generalized system
14434  void set_IK_use_vrv_swizzle( bool );
14435 
14436  void set_ik_debugging_enabled( bool enabled );
14437 
14439  int set_always_update_regardless_of_dt( int val );
14440 
14442  int get_always_update_regardless_of_dt();
14443 
14444  void set_shader_matrices_out_of_date();
14445 
14446  void draw_debugging_visuals();
14447 
14448 /****************************************************************************/
14449 /****************************************************************************/
14460 /****************************************************************************/
14461 /****************************************************************************/
14462 /****************************************************************************/
14463 
14464  // Deprecated as of 13.0;
14466  int aim_converge( int max_iterations = 30 );
14467 
14469  void set_aim_algorithm( int aim_algorithm );
14470 
14472  int get_aim_algorithm();
14473 
14474 
14475  // Deprecated as of 9.1.3; use diguyCharacter::get_position_link() instead.
14476  // diguyGraphicsLink* get_base_link();
14477 
14478  // Deprecated as of 9.0.1; use set_apply_actor_scale_to_action_bead_travel() instead.
14479  // void set_apply_actor_scale_to_action_bead_xy_travel(int apply_scale_flag);
14480 
14481  // Deprecated as of 9.0.1; use get_apply_actor_scale_to_action_bead_travel() instead.
14482  // int get_apply_actor_scale_to_action_bead_xy_travel();
14483 
14484  /*l
14485  ** Deprecated as of 9.1.4. In general setting the weapon sound
14486  ** should no longer be necessary, as weapon sounds are now specified
14487  ** by the weapon's munition type. If this function is called, it
14488  ** will have the same effect as calling
14489  ** diguyCharacter::set_weapon_sound_override().
14490  */
14491  // int set_default_weapon_sound(const char* sound_name);
14492 
14493  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14494  //const char* get_default_weapon_sound();
14495 
14496  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14497  // int set_default_weapon_sound_gain(float gain);
14498 
14499  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14500  // float get_default_weapon_sound_gain();
14501 
14502  // Deprecated as of 9.1.4. Call set_weapon_munition_type_override() instead.
14503  // int set_weapon_munition_type(const char* munition_type);
14504 
14505  // Deprecated as of 9.1.4. Call get_weapon_munition_type_override() instead.
14506  // const char* get_weapon_munition_type();
14507 
14508  // Deprecated as of 10.5.2. Call set_weapon_max_azimuth_error() instead.
14509  // int set_weapon_horizontal_error(float h_error);
14510 
14511  // Deprecated as of 10.5.2. Call get_weapon_max_azimuth_error() instead.
14512  // float get_weapon_horizontal_error();
14513 
14514  // Deprecated as of 10.5.2. Call set_weapon_max_elevation_error() instead.
14515  // int set_weapon_vertical_error(float v_error);
14516 
14517  // Deprecated as of 10.5.2. Call get_weapon_max_elevation_error() instead.
14518  // float get_weapon_vertical_error();
14519 
14520  // Added as of 10.1.6. Invokes the old implementation of
14521  // begin_appearance_effect().
14522  //int begin_legacy_appearance_effect(const char* effect,
14523  // const char* override_link = "",
14524  // float override_scale = DIGUY_DEFAULT_FLOAT,
14525  // float override_offset_x = DIGUY_DEFAULT_FLOAT,
14526  // float override_offset_y = DIGUY_DEFAULT_FLOAT,
14527  // float override_offset_z = DIGUY_DEFAULT_FLOAT);
14528 
14529 
14530  // Added as of 10.1.6. Invokes the old implementation of
14531  // end_appearance_effect().
14532  //
14533  //int end_legacy_appearance_effect(const char* effect);
14534 
14535  // Added as of 10.1.6. Invokes the old implementation of
14536  // appearance_effect_is_active().
14537  //int legacy_appearance_effect_is_active(const char* effect);
14538 
14539  // Deprecated as of 10.1.8. Use set_render_mode_shader() instead.
14540  //int set_shader_program(const char* shader_name);
14541 
14542  // Deprecated as of 10.5.2. Use get_render_mode_shader() instead.
14543  //const char* get_recommended_appearance_shader_program_name();
14544 
14545  // Deprecated as of 10.5.1. Use merge_object() instead.
14546  //int merge_asset(const char* asset);
14547 
14548  // Deprecated as of 10.5.2. Use get_DIS_trailing_effect_state() instead.
14549  // void set_DIS_smoke_trail_state(int state);
14550 
14551  // Deprecated as of 10.5.2. Use get_DIS_trailing_effect_state() instead.
14552  // int get_DIS_smoke_trail_state();
14553 
14554  // Deprecated as of 12.0.0. Not supported in FaceFX.
14555  //int speak(const char* string);
14556 
14557 
14558  // Deprecated as of 12.0.0. Not supported in FaceFX.
14559  //int set_viseme(const char* viseme_name, float weight);
14560 
14561  // Deprecated as of 12.0.0. Not supported in FaceFX.
14562  //float get_viseme(const char* viseme_name);
14563 
14564 
14565  // Deprecated as of 12.0.0. Not supported in FaceFX.
14566  //int set_orientation_eye_left(float azimuth, float elevation);
14567 
14568  // Deprecated as of 12.0.0. Not supported in FaceFX.
14569  //int set_orientation_eye_right(float azimuth, float elevation);
14570 
14571  // Deprecated as of 12.0.0. Not supported in FaceFX.
14572  //float get_azimuth_eye_left();
14573 
14574  // Deprecated as of 12.0.0. Not supported in FaceFX.
14575  //float get_elevation_eye_left();
14576 
14577  // Deprecated as of 12.0.0. Not supported in FaceFX.
14578  //float get_azimuth_eye_right();
14579 
14580  // Deprecated as of 12.0.0. Not supported in FaceFX.
14581  //float get_elevation_eye_right();
14582 
14583  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14584  //int set_weapon_shell_eject_enabled(int enabled);
14585 
14586  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14587  //int get_weapon_shell_eject_enabled();
14588 
14589  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14590  //int set_weapon_smoke_enabled(int enabled);
14591 
14592  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14593  //int get_weapon_smoke_enabled();
14594 
14595  // Deprecated as of 13.5
14596  // int set_shape_switches_disabled(int disabled_flag);
14597  // int get_shape_switches_disabled();
14598 
14599 /****************************************************************************/
14600 /****************************************************************************/
14601 
14606 #ifdef CPLUSPLUS_ONLY
14607 
14608  bdiScenarioCharacter* get_scripted_object();
14609 private:
14610 
14611  /*l
14612  ** A private constructor.
14613  */
14614  diguyCharacter(bdiScenarioCharacter* character);
14615 
14616  /*l
14617  ** A private destructor.
14618  */
14619  ~diguyCharacter();
14620 
14621  /*l
14622  ** A pointer to internal data.
14623  */
14624  bdiScenarioCharacter* m_scripted_object;
14625 
14626  friend class bdiPublishedCharacter;
14627  friend class bdiScenarioCharacter;
14628  friend class diguySensorRegion;
14629  friend class diguyScenario;
14630 
14631 #endif
14632 
14633 };
The diguyViewLabel allows on screen 2D and 3D labels in diguy scenario and the opengl renderer...
Definition: diguyViewLabel.h:52
diguyCharacterTypeMapField
This enumeration allows type map fields to be queried using a numerical value rather than a string na...
Definition: diguy_constants.h:123
A class that represents the unique per-character shader object.
Definition: diguyGraphicsShaderInstance.h:54
diguyGraphicsTextureLoadingBehavior
Definition: diguy_constants.h:432
This class stores a snapshot of a character's motion engine for storing/replicating character positio...
Definition: diguyMotionEngineSnapshot.h:12
#define DIGUY_DEFAULT_FLOAT
This value is a magic number that, when passed to certain functions, means that the function should u...
Definition: diguy_constants.h:62
diguyCallbackReturn diguyCharacterCallback(diguyCharacter *character, int callback_id, void *callback_params, void *callback_user_data)
Definition: diguy_typedefs.h:51
The class that represents what parameters an agent is currently using to carry out their base behavio...
Definition: diguyAgentParams.h:38
wrapper around a chain simulation
Definition: diguyChainSimulation.h:28
diguyHistoryType
DI-Guy history types.
Definition: diguy_constants.h:329
This class represents the patch identifier (country:service:id) for a patch.
Definition: diguyPatchIdentifier.h:26
Represents a scriptable api wrapping a diguy path shape, a curve defined by with a number of waypoint...
Definition: diguyPathShape.h:36
diguyMotionDirection
Definition: diguyMotionDirection.h:26
Definition: diguy_vector_classes.h:154
A class that represents a bullet impact in the world, often used by AIs to make reaction decisions...
Definition: diguyImpact.h:39
A bead that sits on a character's spline path and triggers a new gaze.
Definition: diguyCharacterPathGazeBead.h:34
Definition: diguyMotionPosture.h:40
diguyConnectionPointType
Definition: diguyConnectionPointType.h:26
Definition: diguy_constants.h:214
#define DIGUY_DEFAULT_INT
This value is a magic number that, when passed to certain functions, means that the function should u...
Definition: diguy_constants.h:72
Definition: diguy_constants.h:232
A view is a graphics window wherein the scenario and its characters are animated. Note that views hav...
Definition: diguyView.h:48
diguyMuzzle
This is an enumeration of the different muzzles that can be specified to various DI-Guy function call...
Definition: diguy_constants.h:230
A bead that sits on a character's spline path and triggers a new decision.
Definition: diguyCharacterPathDecisionBead.h:34
An interface for manipulating a character's spline path. A path is typically authored in DI-Guy Scena...
Definition: diguyCharacterPath.h:47
diguyCharacterSimulator
This enumeration lists the ways that data can be generated for DI-Guy characters. ...
Definition: diguy_constants.h:1736
diguyCharacterClass
DI-Guy character classes.
Definition: diguy_constants.h:145
Attached to certain types of more complex vehicles, to manage their behavior.
Definition: diguyVehicleController.h:49
This class encapsulates all parameters for a tasking a character with an action.
Definition: diguyActionParameters.h:12
float diguyAltitudeFunction(diguyCharacter *character, float x, float y, float old_z, int *valid)
Definition: diguy_typedefs.h:57
int diguyCharacterLOSFunction(diguyCharacter *character, diguyCharacter *target_character, int visibility_type)
Definition: diguy_typedefs.h:106
Represents the scenario currently being portrayed.
Definition: diguyScenario.h:99
Contains the diguyMotionVariant enumeration and utility function declarations.
A group of DI-Guy characters, useful for organizing your scenarios.
Definition: diguyCharacterGroup.h:38
The class that represents a DI-Guy Entity in the world.
Definition: diguyCharacter.h:81
Represents a scriptable api wrapping a 3D point on a path.
Definition: diguyWaypoint.h:35
Definition: diguySensorRegion.h:41
int diguyPointLOSFunction(diguyCharacter *character, float x, float y, float z)
Definition: diguy_typedefs.h:111
int diguyFeelerFunction(diguyCharacter *character, float origin_x, float origin_y, float origin_z, float dir_x, float dir_y, float dir_z, float max_distance_to_test, float *intersection_x, float *intersection_y, float *intersection_z, float *normal_x, float *normal_y, float *normal_z)
Definition: diguy_typedefs.h:64
Contains the diguyMotionPosture enumeration and utility function declarations.
Definition: diguy_constants.h:1569
Definition: diguyMotionVariant.h:62
diguyParameterComparison
This is an enumeration of the different parameter comparison options that can be specified to various...
Definition: diguy_constants.h:212
A class that allows end users to override a character's animation on a joint level.
Definition: diguyCharacterPoseOverride.h:35
diguyCallbackReturn
DI-Guy callbacks return a value of type diguyCallbackReturn, which will be DIGUY_CALLBACK_STOP or DIG...
Definition: diguy_constants.h:94
diguyMotionVariant
Definition: diguyMotionVariant.h:28
diguyCharacterMode
This is an enumeration of the different modes a DI-Guy character can be in.
Definition: diguy_constants.h:197
A class that represents the unique per-character non-shared mesh object. DI-Guy encapsulates its text...
Definition: diguyGraphicsShape.h:49
A class representing a overlaid performance on a character's base animation.
Definition: diguyCharacterGesture.h:42
A bead that sits on a character's spline path and triggers a new script evaluation.
Definition: diguyCharacterPathScriptBead.h:34
Definition: diguySoundInstance.h:27
The diguyVariable class allows you to add per character named parameters. This can be handy for track...
Definition: diguyVariable.h:44
diguyCharacterAppearanceTypes
DI-Guy character appearance query API, this is for diguyCharacter::get_num_appearances_of_type() ...
Definition: diguy_constants.h:169
diguyPhysicsSimulationMode
This enumeration lists the modes that a DI-Guy character physics sim can be in, when the character si...
Definition: diguy_constants.h:1753
diguyPhysicsCollisionGroup
This enumeration lists the collision groups that a DI-Guy physics sim object can be in...
Definition: diguy_constants.h:1769
This class implements shader lod system for use with DI-Guy character graphics.
Definition: diguyGraphicsShaderTechnique.h:153
This class implements shader programs for use with DI-Guy character graphics.
Definition: diguyGraphicsShaderProgram.h:94
The class that represents a DI-Guy Crowd, DI-Guy AI agents can be given orders at an individual level...
Definition: diguyCrowd.h:48
Represents algorithm for steering and maneuvering a character towards a goal point.
Definition: diguyCharacterGuide.h:561
diguyMotionPosture
Definition: diguyMotionPosture.h:28
A bead that sits on a character's spline path and triggers a new aim event.
Definition: diguyCharacterPathAimBead.h:34