DI-Guy SDK Documentation  13.6
diguyCharacter.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2022 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 /*********************************************************************
7  **
8  *t diguyCharacter
9  **
10  *b Link against: libdiguy
11  */
12 
13 #ifndef __diguyCharacter_H
14 #define __diguyCharacter_H
15 
16 #ifdef SWIG
17 %module diguyCharacter
18 #else
19 #define CPLUSPLUS_ONLY
20 #endif
21 
22 #ifdef CPLUSPLUS_ONLY
23 #include <declspec_diguy.h>
24 #include <diguy_constants.h>
25 #include <diguy_typedefs.h>
26 #include <diguy_vector_classes.h>
29 #include <diguyCharacterTypeMap.h>
30 #include <diguyMotionDirection.h>
31 #include <diguyMotionPosture.h>
32 #include <diguyMotionVariant.h>
33 
34 class bdiScenarioCharacter;
35 class diguyAgentParams;
37 class diguyCharacter;
41 class diguyCharacterPath;
46 class diguyCrowd;
47 class diguyGraphicsLink;
50 class diguyImpact;
53 class diguyPathShape;
54 class diguyScenario;
55 class diguySoundInstance;
56 class diguyVariable;
58 class diguyView;
59 class diguyViewLabel;
60 class diguyWaypoint;
61 
64 
66 
67 class DtEntityStateRepository;
68 
69 #endif
70 
71 
84 class BDI_DECLSPEC_diguy diguyCharacter
85 {
86 
87 public:
88 
89 /*****************************************************************************/
99  /*l
100  *b Description:
101  **
102  ** Returns the name of the object. This pointer will never be NULL.
103  */
104  const char* get_name();
105 
106  /*l
107  *b Description:
108  **
109  ** This function sets the name of this object.
110  **
111  *b Returns:
112  **
113  ** 0 on success, -1 on failure
114  */
115  int set_name(const char* name);
116 
117  /*l
118  *b Description:
119  **
120  ** Returns the type name of the object, should be 'character'. This pointer will never be
121  ** NULL.
122  */
123  const char* get_type_name();
124 
125  /*l
126  *b Description:
127  **
128  ** All characters are assigned a unique identifier, or uid. This
129  ** function returns this character's uid.
130  **
131  ** *Note*: unique identifiers will change between DI-Guy runs!
132  **
133  */
134  long get_uid();
135 
136  /*l
137  *b Description:
138  **
139  ** Returns the index of the object. This index may change if
140  ** characters are created or destroyed, so it should not be considered
141  ** a unique identifier for the character. See get_uid().
142  */
143  int get_index();
144 
145  /*l
146  *b Description:
147  **
148  ** This function updates the character. The character's position and
149  ** pose will be set to be what it will be (or was) at the specified t.
150  **
151  ** If the scenario has control of t (return value of
152  ** get_t_controlled_by_scenario_t() is 0), then this function's
153  ** effects will be overridden the next time diguyScenario::update() is
154  ** called with a new t.
155  **
156  ** Note: diguyScenario::update() must be called as or more frequently
157  ** than diguyCharacter::update() for proper DI-Guy operation.
158  ** diguyCharacter::update() is intended for load management use, where
159  ** the user intends to update far away or out-of-frustum characters
160  ** less frequently than the overall scenario. This is done in con-
161  ** junction with set_t_controlled_by_scenario_t(0) for the character.
162  ** diguyCharacter::update() is not intended as a replacement for
163  ** diguyScenario::update().
164  **
165  *b Returns:
166  **
167  ** 0 on success, -1 on failure
168  **
169  *b Arguments:
170  **
171  *a t - new time for the character
172  *a full_update - set to 1 to cause full update of character
173  */
174  int update(float t, int full_update = 1);
175 
176  /*l
177  *b Description:
178  **
179  ** This function sets the current type of this character.
180  **
181  *b Arguments:
182  **
183  *a type - name of the new desired type
184  **
185  *b See Also:
186  **
187  ** get_character_type_string()
188  */
189  void set_character_type(const char* type);
190 
191  /*l
192  *b Description:
193  **
194  ** Returns the type of the character (never NULL).
195  **
196  ** Character types specify the types of motions the character will be
197  ** able to perform. Some characters can move like soldiers, others
198  ** can move like civilians, still others can move like specific
199  ** animals.
200  **
201  ** The character type is explicitly specified in the call to
202  ** diguyScenario::create_character().
203  **
204  ** Examples of character types are:
205  *>
206  *- - soldier
207  *- - male_pedestrian
208  *- - horse
209  *- - prop
210  *<
211  */
212  const char* get_character_type_string();
213 
214  /*l
215  *b Description:
216  **
217  ** Returns the class of the character (never NULL).
218  **
219  ** Character classes are a higher level description than character
220  ** types, and allow for more generalized logic. For example, instead
221  ** of having something happen when one of a large set of specific
222  ** character types enters a region, something can happen when any
223  ** human enters the region.
224  **
225  ** Character classes are not specified directly, but are instead
226  ** derived from the character type. (In DI-Guy, all soldiers are
227  ** humans, for example.)
228  **
229  ** Examples of character classes are:
230  *>
231  *- - human
232  *- - vehicle
233  *- - object
234  *- - animal
235  *<
236  */
237  const char* get_character_class();
238 
240  diguyCharacterClass get_character_class_type();
241 
242  /*l
243  *b Description:
244  **
245  ** Returns the scenario that this character is a part of.
246  */
247  diguyScenario* get_scenario();
248 
249  /*l
250  *b Description:
251  **
252  ** This is the top-level on/off switch for the character. A character
253  ** that is not enabled has very little processing overhead: it is
254  ** neither updated during an update() call, nor is it drawn during a
255  ** draw() call. A disabled character will remain disabled until
256  ** set_enabled(1) is called on it; nothing else implicitly re-enables
257  ** the character.
258  **
259  ** There are several other diguyCharacter functions that have somewhat
260  ** similar effects that may be more appropriate at times:
261  **
262  *- - set_current_tin() and set_current_tout(): These functions
263  *- show and animate the character starting at time tin ("T In"),
264  *- and ending at time tout ("T Out")
265  *- - set_invisible_flag(): This function disables drawing of
266  *- the character, but the character still updates and changes
267  *- position.
268  **
269  ** Refer to the documentation of these functions for more information.
270  **
271  *b Returns:
272  **
273  ** always return 0
274  */
275  int set_enabled(int enabled);
276 
277  /*l
278  *b Description:
279  **
280  ** Returns whether the character is enabled, as set by the
281  ** set_enabled() call. New characters are enabled by default.
282  **
283  *b Returns:
284  **
285  ** 1 if the character is enabled, 0 if not
286  */
287  int get_enabled();
288 
289  /*l
290  *b Description:
291  **
292  ** Sets whether this character is drawn automatically by the scenario.
293  **
294  ** Note depending on the rendering environment if this flag is set to 0,
295  ** it is up to the user to call the character draw_pass1() and draw_pass2()
296  ** calls at the appropriate time.
297  **
298  *b Arguments:
299  **
300  *a flag - pass 1 for character drawing to automatically be
301  *a handled by scenario (this is the default);
302  *a 0 for it not to be
303  **
304  *b Returns:
305  **
306  ** 0 on success, -1 on failure
307  */
308  int set_drawn_by_scenario_flag(int flag);
309 
310  /*l
311  *b Description:
312  **
313  ** Returns whether character drawing is done automatically by the
314  ** scenario.
315  **
316  *b Returns:
317  **
318  ** 1 if character drawing is done by the scenario;
319  ** 0 if not
320  **
321  *b See Also:
322  **
323  ** set_drawn_by_scenario_flag()
324  */
325  int get_drawn_by_scenario_flag();
326 
327  /*l
328  *b Description:
329  **
330  ** This function makes the character invisible; i.e., draw() calls
331  ** for the character will have no effect. Note that the character
332  ** will still update its position and pose during update() calls. To
333  ** more thoroughly disable a character, consider the functions
334  ** set_enabled() and set_current_tout().
335  **
336  *b Arguments:
337  **
338  *a invisible_flag - pass 1 to make character invisible, 0 to
339  *a make it visible
340  **
341  *b Available as Decision Bead/Event
342  */
343  void set_invisible_flag(int invisible_flag);
344 
346  int get_invisible_flag();
347 
348  /*l
349  *b Description:
350  **
351  ** Returns whether the character is active. A character is
352  ** active if:
353  **
354  *- - it is enabled as per the set_enabled() call
355  *- - it is within its tin/tout interval as set by the
356  *- set_current_tin() and set_current_tout() calls
357  *- - it is not "network paused" (get_is_network_paused()
358  *- returns 0)
359  **
360  *b Returns:
361  **
362  ** 1 if the character is active, 0 if not
363  **
364  *b Available as Decision Bead
365  */
366  int get_is_active();
367 
368  /*l
369  *b Description:
370  **
371  ** Returns whether the character will be drawn during scenario and
372  ** character draw() calls. A character will be drawn if:
373  **
374  *- - it is enabled as per the set_enabled() call
375  *- - it is within its tin/tout interval as set by the
376  *- set_current_tin() and set_current_tout() calls
377  *- - its invisible flag is 0, as set by the
378  *- set_invisible_flag() call
379  **
380  ** There is no corresponding set_is_drawn() function; use
381  ** set_invisible_flag() to explicitly make a character not be drawn.
382  **
383  *b Returns:
384  **
385  ** 1 if the character will be drawn, 0 if not
386  */
387  int get_is_drawn();
388 
392  int get_was_drawn_last_frame();
393 
395  int set_was_drawn_last_frame(int drawn);
396 
398  int get_is_culled();
399 
405  int set_is_culled(int culled);
406 
407  /*l
408  *b Returns:
409  **
410  ** 1 if the character is temporary (created by diguyScenario::create_temporary_character()
411  ** call; 0 if not
412  */
413  int get_is_temporary();
414 
415  /*l
416  *b Description:
417  **
418  ** This function returns 1 if the character has been recycled from the
419  ** character recycle bin, 0 if not.
420  **
421  ** See diguyScenario::send_character_to_recycle_bin()
422  ** and diguyScenario::retrieve_character_from_recycle_bin().
423  */
424  int get_is_recycled();
425 
426  /*l
427  *b Description:
428  **
429  ** This function sets how the character's t (time) is controlled. If
430  ** 1, the character's t will be set by the scenario on each call to
431  ** diguyScenario::update(). If 0, the character should be updated by
432  ** calls to update().
433  **
434  *b Arguments:
435  **
436  *a t_controlled_by_scenario_t - 1 for controlled by scenario, 0 for
437  *a manual update
438  **
439  *b Returns:
440  **
441  ** 0 on success, -1 on failure
442  */
443  int set_t_controlled_by_scenario_t(int t_controlled_by_scenario_t);
444 
445  /*l
446  *b Returns:
447  **
448  ** whether character's t is controlled by the scenario;
449  ** see set_t_controlled_by_scenario_t()
450  */
451  int get_t_controlled_by_scenario_t();
452 
453  /*l
454  *b Description:
455  **
456  ** This function sets the initial tin ("T In") time of the character.
457  ** See set_current_tin() for a discussion of how tin and tout times
458  ** affect the character.
459  **
460  ** When the scenario is reset or loaded from a .dss file, the current
461  ** tin value will be set to this initial tin value.
462  **
463  ** Note that if the scenario is running (diguyScenario::get_t() returns > 0),
464  ** tin can be set only if override_time_warning is set.
465  **
466  ** Note that both tin and tout times are scenario-relative times, not
467  ** character-relative.
468  **
469  ** This call makes an implicit call to set_current_tin() with the
470  ** same value.
471  **
472  *b Arguments:
473  **
474  *a tin - new value of initial tin in seconds
475  *a override_time_warning - if set, initial_tin can be set at any time
476  **
477  *b Returns:
478  **
479  ** 0 on success, -1 on failure
480  */
481  int set_initial_tin(float tin, int override_time_warning = 0);
482 
483  /*l
484  *b Description:
485  **
486  ** This function sets the initial tout ("T Out") time of the
487  ** character. See set_current_tin() for a discussion of how tin and
488  ** tout times affect the character.
489  **
490  ** When the scenario is reset or loaded from a .dss file, the current
491  ** tout value will be set to this initial tout value.
492  **
493  ** Note that this function cannot be called once the scenario has
494  ** begun running (diguyScenario::get_t() returns > 0).
495  **
496  ** Note that both tin and tout times are scenario-relative times, not
497  ** character-relative.
498  **
499  ** This call makes an implicit call to set_current_tout() with the
500  ** same value.
501  **
502  *b Arguments:
503  **
504  *a tout - new value of initial tout in seconds
505  **
506  *b Returns:
507  **
508  ** 0 on success, -1 on failure
509  */
510  int set_initial_tout(float tout);
511 
512  /*l
513  *b Description:
514  **
515  ** This function sets the current tin ("T In") time of the character.
516  ** The character will not be visible nor will it start moving or
517  ** animating until the scenario reaches this time.
518  **
519  ** There are two ways the tin and tout times of the character can be
520  ** used:
521  **
522  ** The first is to set them to their desired values when the scenario
523  ** begins. If, for example, it is known that this character should
524  ** only be visible and active from 60 seconds to 80 seconds, the tin
525  ** and tout times can be set to 60 and 80, respectively. The
526  ** scenario will then spend very little time for character updates
527  ** and draws outside of these limits.
528  **
529  ** The second is to use them to quickly "trigger" a character to
530  ** become visible and start moving. This is done by setting the
531  ** initial values of tin and tout to very high values, and then
532  ** changing them to lower values when the character should become
533  ** active. Consider the following example: This character is
534  ** waiting just inside a doorway, and should emerge when another
535  ** character comes close. If the tin time of the character is very
536  ** high, very little time will be taken for this character's updates
537  ** and draws. When the other character does come close, this
538  ** character's tin time can be set to "now" (the scenario's current
539  ** t, as returned by diguyScenario::get_t()). This character will
540  ** then become visible and start moving out of the doorway.
541  **
542  ** The default current tin time is the current time of the scenario
543  ** when the character is created.
544  **
545  ** Note that both tin and tout times are scenario-relative times, not
546  ** character-relative.
547  **
548  *b Arguments:
549  **
550  *a tin - new value of current tin in seconds
551  **
552  *b Returns:
553  **
554  ** 0 on success, -1 on failure
555  */
556  int set_current_tin(float tin);
557 
558  /*l
559  *b Description:
560  **
561  ** Same as set_current_tin(), but time is set to current scenario time.
562  **
563  *b Returns:
564  **
565  ** 0 on success, -1 on failure
566  **
567  *b Available as Decision Bead/Event
568  */
569  int set_current_tin_to_now();
570 
571  /*l
572  *b Description:
573  **
574  ** This function returns the current tin time of the character. See
575  ** set_current_tin().
576  **
577  *b Returns:
578  **
579  ** Current tin time in seconds.
580  */
581  float get_current_tin();
582 
583  /*l
584  *b Description:
585  **
586  ** This function sets the current tout ("T Out") time of the
587  ** character. If tout is enabled the character will become invisible
588  ** and will stop moving and animating when the scenario reaches this
589  ** time.
590  **
591  ** Note that both tin and tout times are scenario-relative times, not
592  ** character-relative.
593  **
594  ** Default tout time is 60000 seconds.
595  **
596  *b Arguments:
597  **
598  *a tout - new value of current tout in seconds
599  *a disable_character_at_tout - this argument is present to keep
600  *a the function prototype will remain
601  *a backward compatible; it has no effect
602  */
603  int set_current_tout(float tout,
604  int disable_character_at_tout = 0);
605 
606  /*l
607  *b Description:
608  **
609  ** Same as set_current_tout(), but time is set to current scenario
610  ** time.
611  **
612  *b Returns:
613  **
614  ** 0 on success, -1 on failure
615  **
616  *b Available as Decision Bead
617  */
618  int set_current_tout_to_now();
619 
620  /*l
621  *b Description:
622  **
623  ** This function returns the current tout ("T Out") time of the
624  ** character in seconds. See set_current_tout().
625  */
626  float get_current_tout();
627 
628  /*l
629  *b Description:
630  **
631  ** This function sets what will happen when the character reaches its
632  ** tout time. If set to 0, the character will ignore the tout time
633  ** and continue indefinitely.
634  */
635  void set_tout_enabled(int tout_enabled);
636 
637  /*l
638  *b Description:
639  **
640  ** This function returns the whether tout is enabled.
641  **
642  ** See set_tout_enabled().
643  **
644  *b Returns:
645  **
646  ** 1 if tout enabled, 0 if not
647  */
648  int get_tout_enabled();
649 
651  float get_char_time();
652 
653  /*l
654  *b Description:
655  **
656  ** When the motion data of a character is interpolated a quick
657  ** interpolation method can be used which may yield incorrect results,
658  ** or an expensive interpolation method can be used which will yield
659  ** correct results at the expense of time. The threshold at which
660  ** the interpolation method changes is specified by this function.
661  **
662  *b Arguments:
663  **
664  *a threshold - float between 0 (careful never) and 1 (careful always);
665  ** default is 0.7
666  **
667  ** DI-Guy compares the careful interpolation threshold to the cosine
668  ** of an angle. Both the threshold and the cosine are dimensionless
669  ** and thus have no units.
670  **
671  *b Returns:
672  **
673  ** 0 on success, -1 on failure
674  */
675  int set_careful_interpolation_threshold(float threshold);
676 
677  /*l
678  *b Returns:
679  **
680  ** most recent setting of the careful interpolation threshold;
681  ** see set_careful_interpolation_threshold()
682  */
683  float get_careful_interpolation_threshold();
684 
685  /*l
686  *b Description:
687  **
688  ** Sets whether the motion data of the character is interpolated.
689  ** Interpolation is disabled by default for better performance. For
690  ** applications achieving high frame rates, smoother motion may be
691  ** achieved by turning interpolation on.
692  **
693  *b Arguments:
694  **
695  *a flag - 0 by default
696  **
697  *b Returns:
698  **
699  ** 0 on success, -1 on failure
700  */
701  int set_motion_interpolation_flag(int flag);
702 
703  /*l
704  *b Returns:
705  **
706  ** most recent setting of the motion interpolation flag; see
707  ** set_motion_interpolation_flag()
708  */
709  int get_motion_interpolation_flag();
710 
711  /*l
712  *b Description:
713  **
714  ** Sets the scale of the character on each of the three major axes.
715  **
716  *b Arguments:
717  **
718  *a scale_x, scale_y, scale_z - the factor by which to scale along
719  *a the given axis
720  **
721  *b Returns:
722  **
723  ** 0 on success, -1 on failure
724  */
725  int set_scale(float scale_x, float scale_y, float scale_z);
726 
727  /*l
728  *b Description:
729  **
730  ** Returns the scale of the character.
731  **
732  *b Arguments:
733  **
734  *a sx, sy, sz - scale of the character along each axis
735  **
736  ** Pass NULL for any values that are not needed.
737  **
738  *b Returns:
739  **
740  ** 0 on success, -1 on failure
741  */
742  int get_scale(float* scale_x, float* scale_y, float* scale_z);
743 
744  /*l
745  *b Description:
746  **
747  ** Sets the parent of this character to be the passed character.
748  ** This means that the coordinate system of this character will be
749  ** local to the parent character rather than the world coordinate
750  ** system.
751  **
752  *b Arguments:
753  **
754  *a parent_name - character to which this character should
755  *a be attached; pass NULL to have no parent
756  *a and be attached to the world
757  *a parent_link_name - name of the link or connection point to which this character's
758  *a position link should attach; pass "" to attach
759  *a to the parent's position link
760  **
761  *b Returns:
762  **
763  ** 0 on success, -1 on failure
764  **
765  *b Available as Decision Bead/Event
766  */
767  int set_parent(const char* parent_name, const char* parent_link_name = "");
768 
769  /*l
770  *b Description:
771  **
772  ** Gets the parent of this character.
773  **
774  *b Returns:
775  **
776  ** pointer to type diguyCharacter; NULL if no parent
777  **
778  *b Available as Decision Bead/Event
779  */
780  diguyCharacter* get_parent();
781 
782  /*l
783  *b Description:
784  **
785  ** Gets the link name that the character is parented to, if any.
786  **
787  *b Returns:
788  **
789  ** name of link, NULL if no parent
790  */
791  const char* get_parent_link_name();
792 
793  /*l
794  *b Description:
795  **
796  ** Detaches a character from its parent and reattaches it to the
797  ** world. This is equivalent to diguyCharacter::set_parent(NULL).
798  **
799  *b Returns:
800  **
801  ** 0 on success, -1 on failure
802  **
803  *b Available as Decision Bead/Event
804  */
805  int unset_parent();
806 
807  /*l
808  *b Description:
809  **
810  ** Gets the number of children the character has.
811  */
812  int get_num_children();
813 
814  /*l
815  *b Description:
816  **
817  ** This function returns a pointer to the nth child of the character.
818  **
819  *b Returns:
820  **
821  ** pointer of type diguyCharacter; NULL if no
822  ** child at the specified index
823  **
824  *b Arguments:
825  **
826  *a index - index of the child; indices start at 0
827  */
828  diguyCharacter* get_child_at_index(int index);
829 
830  /*l
831  *b Description:
832  **
833  ** Gets if a character is a static object, by default any blitzed .
834  ** in props are.
835  **
836  *b Returns:
837  **
838  ** 1 if true, 0 if false
839  */
840  int get_is_scene_object();
841 
842  /*l
843  *b Description:
844  **
845  ** Sets if a character is a static object. By default any blitzed
846  ** in props are.
847  **
848  *b Arguments:
849  **
850  *a is_scene_object - pass 1 to make the object a scene object,
851  *a 0 to not
852  **
853  *b Returns:
854  **
855  ** 0 on success, -1 on failure
856  */
857  int set_is_scene_object(int is_scene_object);
858 
859  /*l
860  *b Description:
861  **
862  ** Gets the bounding radius currently used for this character
863  ** for purposes of culling it from the draw operation.
864  **
865  *b Returns:
866  **
867  ** The current draw-culling bounding radius for the character, in
868  ** meters.
869  */
870  float get_bounding_radius();
871 
872  /*l
873  *b Description:
874  **
875  ** Gets the default draw-culling bounding radius for this
876  ** character, as specified in its actor cfg file. See
877  ** actor_vehicle.cfg for an example.
878  **
879  *b Returns:
880  **
881  ** The default draw-culling bounding radius for the character.
882  */
883  float get_default_bounding_radius();
884 
885  /*l
886  *b Description:
887  **
888  ** Sets the current draw-culling bounding radius to be used for
889  ** this character.
890  */
891  void set_bounding_radius(float f);
892 
893  /*l
894  *b Description:
895  **
896  ** This function returns the number of seconds before the blend
897  ** into the next motion begins. If the character is already
898  ** in a blend between motions the function returns 0.
899  **
900  ** Note that this function is of limited practical use; in most
901  ** cases get_time_to_reach_desired_action() returns
902  ** information that is more useful.
903  **
904  *b Returns:
905  **
906  ** time to next blend, in seconds
907  **
908  *b Mode Restrictions:
909  **
910  *- - This function can only be called in free action mode.
911  */
912  float get_time_to_transition();
913 
915  float get_character_local_time();
916 
917  /*l
918  *b Returns:
919  **
920  ** the action mode of the character
921  */
922  diguyCharacterMode get_action_mode();
923 
924  /*l
925  *b Returns:
926  **
927  ** the position mode of the character
928  */
929  diguyCharacterMode get_position_mode();
930 
931  /*l
932  *b Description:
933  **
934  ** This function speeds up or slows down the character. Setting
935  ** this value greater than 1 will cause character actions to
936  ** be played back at a slower pace, setting to less that 1 will
937  ** cause character actions to be played at a faster pace.
938  **
939  ** This will override other factors that may scale the time
940  ** scale factor of a character. (For example, smaller scale
941  ** characters will generally move faster.)
942  **
943  ** Call unset_t_scale_factor() to allow other factors such
944  ** as scale or desired speed to determine the time scale factor.
945  **
946  *b Mode Restrictions:
947  **
948  *- - This function can only be called in free action mode.
949  **
950  *b Arguments:
951  **
952  *a t_scale_factor - time scale factor
953  **
954  *b Returns:
955  **
956  ** 0 on success, -1 on failure
957  */
958  int set_t_scale_factor(float t_scale_factor);
959 
960  /*l
961  *b Description:
962  **
963  ** This function removes the manual setting of the time
964  ** scale factor as set by set_t_scale_factor().
965  **
966  *b Mode Restrictions:
967  **
968  *- - This function can only be called in free action mode.
969  **
970  *b Returns:
971  **
972  ** 0 on success, -1 on failure
973  */
974  int unset_t_scale_factor();
975 
976  /*l
977  *b Description:
978  **
979  ** This function determines whether this character is within the
980  ** specified distance of another.
981  **
982  *b Arguments:
983  **
984  *a character - character to be checked
985  *a distance - distance to character in meters
986  **
987  *b Returns:
988  **
989  ** 1 if within distance; 0 if not
990  */
991  int is_within_distance_n_of_character(const char* character_name,
992  float distance);
993 
994  /*l
995  *b Description:
996  **
997  ** This function determines whether this character is within the
998  ** specified distance of any members of the specified group.
999  **
1000  *b Arguments:
1001  **
1002  *a group_name - name of group to be checked
1003  *a distance - distance in meters
1004  **
1005  *b Returns:
1006  **
1007  ** 1 if member of group is within distance; 0 if not
1008  */
1009  int is_within_distance_n_of_member_of_group(const char* group_name,
1010  float distance);
1011 
1012  /*l
1013  *b Description:
1014  **
1015  ** This function determines whether a character is a member of
1016  ** a particular group.
1017  **
1018  ** Also see diguyCharacterGroup::is_member().
1019  **
1020  *b Arguments:
1021  **
1022  *a group_name - name of group to be checked
1023  **
1024  *b Returns:
1025  **
1026  ** 1 if character is in group, 0 if not
1027  */
1028  int is_group_member(const char* group_name);
1029 
1030  /*l
1031  *b Description:
1032  **
1033  ** This function returns the number of groups that a character is a
1034  ** member of.
1035  **
1036  ** Also see diguyCharacterGroup::is_member().
1037  */
1038  int get_num_group_memberships();
1039 
1040  /*l
1041  *b Description:
1042  **
1043  ** This function returns a pointer to the nth group that this
1044  ** character is a member of.
1045  **
1046  ** Also see diguyCharacterGroup::is_member().
1047  **
1048  *b Returns:
1049  **
1050  ** pointer of type diguyCharacterGroup; NULL if no
1051  ** group at the specified index
1052  **
1053  *b Arguments:
1054  **
1055  *a index - index of the group; indices start at 0
1056  */
1057  diguyCharacterGroup* get_group_membership_at_index(int index);
1058 
1059  /*l
1060  *b Description:
1061  **
1062  ** This function will check all characters in the scenario and return
1063  ** the nearest character that is both alive and enabled. An optional
1064  ** argument specifies whether to skip characters that are invisible
1065  ** to the caller because a scene object is in the way. Checking
1066  ** visibility is only an option if an octtree is generated from scene
1067  ** objects. Typically only DI-Guy Scenario does this.
1068  **
1069  *b Arguments:
1070  **
1071  *a check_visibility - whether to check that characters are
1072  *a visible to calling character; pass 1
1073  *a to check, 0 to not check
1074  *a xy_distance - whether to include the z component
1075  *a in distance calculations; pass 1 to
1076  *a check only XY distance, 0 to check
1077  *a XYZ distance
1078  **
1079  *b Returns:
1080  **
1081  ** pointer of type diguyCharacter; may be NULL
1082  */
1083  diguyCharacter* get_nearest_active_character(int check_visibility,
1084  int xy_distance = 0,
1085  float max_distance_to_check = 100000);
1086 
1087  /*l
1088  *b Description:
1089  **
1090  ** This function will check all characters in a group and return the
1091  ** nearest character that is both alive and enabled. An optional
1092  ** argument specifies whether to skip characters that are invisible
1093  ** to the caller because a scene object is in the way. Checking
1094  ** visibility is only an option if an octtree is generated from scene
1095  ** objects. Typically only DI-Guy Scenario does this.
1096  **
1097  *b Arguments:
1098  **
1099  *a group_name - name of group to check
1100  *a check_visibility - whether to check that characters are
1101  *a visible to calling character; pass 1
1102  *a to check, 0 to not check
1103  *a xy_distance - whether to include the z component
1104  *a in distance calculations; pass 1 to
1105  *a check only XY distance, 0 to check
1106  *a XYZ distance
1107  **
1108  *b Returns:
1109  **
1110  ** pointer of type diguyCharacter; may be NULL
1111  */
1112  diguyCharacter* get_nearest_active_character_in_group(const char* group_name,
1113  int check_visibility = 1,
1114  int xy_distance = 0,
1115  float max_distance_to_check = 100000);
1116 
1117  /*l
1118  *b Description:
1119  **
1120  ** This function will check all characters in the scenario and return
1121  ** a random character within max_distance that is both alive and
1122  ** enabled. An optional argument specifies whether to skip characters
1123  ** that are invisible to the caller because a scene object is in the
1124  ** way. Checking visibility is only an option if an octtree is
1125  ** generated from scene objects. Typically only DI-Guy Scenario does
1126  ** this.
1127  **
1128  *b Arguments:
1129  **
1130  *a check_visibility - whether to check that characters are
1131  *a visible to calling character; pass 1
1132  *a to check, 0 to not check
1133  *a max_distance - how far away the search cut off should be pass
1134  *a in -1.0f to use all characters
1135  *a xy_distance - whether to include the z component
1136  *a in distance calculations; pass 1 to
1137  *a check only XY distance, 0 to check
1138  *a XYZ distance
1139  **
1140  *b Returns:
1141  **
1142  ** pointer of type diguyCharacter; may be NULL
1143  */
1144  diguyCharacter* get_random_active_character(float max_distance = 10.0f,
1145  int check_visibility = 1,
1146  int xy_distance = 0);
1147 
1148  /*l
1149  *b Description:
1150  **
1151  ** This function will check all characters in a group and return a
1152  ** random character within max_distance that is both alive and
1153  ** enabled. An optional argument specifies whether to skip characters
1154  ** that are invisible to the caller because a scene object is in the
1155  ** way. Checking visibility is only an option if an octtree is
1156  ** generated from scene objects. Typically only DI-Guy Scenario does
1157  ** this.
1158  **
1159  *b Arguments:
1160  **
1161  *a group_name - name of group to check
1162  *a max_distance - how far away the search cut off should be, pass
1163  *a in -1.0f to use all characters
1164  *a check_visibility - whether to check that characters are
1165  *a visible to calling character; pass 1
1166  *a to check, 0 to not check
1167  *a xy_distance - whether to include the z component
1168  *a in distance calculations; pass 1 to
1169  *a check only XY distance, 0 to check
1170  *a XYZ distance
1171  **
1172  *b Returns:
1173  **
1174  ** pointer of type diguyCharacter; may be NULL
1175  */
1176  diguyCharacter* get_random_active_character_in_group(const char* group_name,
1177  float max_distance = 10,
1178  int check_visibility = 1,
1179  int xy_distance = 0);
1180 
1181  /*l
1182  *b Description:
1183  **
1184  ** This function returns the 3D distance from this character to the
1185  ** specified character, in meters. The distance is calculated from
1186  ** the characters' idealized positions.
1187  */
1188  float get_distance_to_character(diguyCharacter* character);
1189 
1190  /*l
1191  *b Description:
1192  **
1193  ** This function returns the 2D distance in X and Y coordinates only
1194  ** from this character to the specified character, in meters. The
1195  ** distance is calculated from the characters' idealized positions.
1196  */
1197  float get_distance_xy_to_character(diguyCharacter* character);
1198 
1199  /*l
1200  *b Description:
1201  **
1202  ** This function returns the 3D distance from this character to the
1203  ** specified impact, in meters. The distance is calculated from the
1204  ** characters' idealized positions.
1205  */
1206  float get_distance_to_impact(diguyImpact* impact);
1207 
1208  /*l
1209  *b Description:
1210  **
1211  ** Each character has a "random factor" between 0 and 1. This value
1212  ** is persistent with the character; i.e., the random factor will
1213  ** stay constant for the entire lifetime of the character.
1214  **
1215  ** This random factor can be used to add some variability between
1216  ** different characters.
1217  **
1218  ** Though each character has a random factor that has a very good
1219  ** chance of being different from all other characters' in the
1220  ** scenario, this is not guaranteed and so should not be used as a
1221  ** unique identifier.
1222  **
1223  ** An example of use: Instead of all characters beginning an action
1224  ** or behavior at the same time, have each one begin (random_factor *
1225  ** 2.0) seconds from the current time. This will result in more
1226  ** natural looking behavior as characters one by one begin the new
1227  ** behavior in the next two seconds, rather than all beginning at
1228  ** once.
1229  **
1230  *b Returns:
1231  **
1232  ** the character's random factor, a value between 0 and 1
1233  */
1234  float get_random_factor();
1235 
1236 
1237 /*****************************************************************************/
1242  /*l
1243  *b Description:
1244  **
1245  ** This function draws this character in immediate mode graphics
1246  ** environments (see below). This is the equivalent of calling
1247  ** draw_pass1() immediately followed by draw_pass2().
1248  **
1249  *b Returns:
1250  **
1251  ** 0 on success, -1 on failure
1252  **
1253  *i OpenGL Version:
1254  **
1255  ** This function immediately draws this character. Either this
1256  ** function or draw_pass1() and draw_pass2() should be called once per
1257  ** frame.
1258  */
1259  int draw();
1260 
1261  /*l
1262  *b Description:
1263  **
1264  ** This function, along with draw_pass2(), allows the drawing of
1265  ** opaque and transparent polygons to be separated. This function
1266  ** draws all opaque polygons of this character.
1267  **
1268  *b Returns:
1269  **
1270  ** 0 on success, -1 on failure
1271  **
1272  *i OpenGL Version:
1273  **
1274  ** This function immediately draws the opaque character parts. Either
1275  ** this function or draw() should be called once per frame.
1276  */
1277  int draw_pass1();
1278 
1279  /*l
1280  *b Description:
1281  **
1282  ** Same as draw_pass1(), but draws transparent character parts.
1283  */
1284  int draw_pass2();
1285 
1286 #ifdef CPLUSPLUS_ONLY
1287 
1288  /*l
1289  *b Returns:
1290  **
1291  ** A pointer to the character's graphics.
1292  **
1293  *i Vega Prime Version:
1294  **
1295  ** The return pointer may be cast to point to a vpDiguyCharacter,
1296  ** which is derived from vpObject.
1297  **
1298  *i OpenGL Version:
1299  **
1300  ** This function returns NULL.
1301  **
1302  *i DI-Guy Graphics API:
1303  **
1304  ** This function returns the pointer set from the most recent
1305  ** set_graphics_ptr() call.
1306  */
1307  void* get_graphics_ptr();
1308 
1309  /*l
1310  *b Description:
1311  **
1312  ** Sets a graphics environment-specific pointer to graphics data.
1313  ** The pointer can be retrieved using get_graphics_ptr().
1314  **
1315  *b Arguments:
1316  **
1317  *a graphics_ptr - pointer to graphics data
1318  **
1319  *b Returns:
1320  **
1321  ** 0 on success, -1 on failure
1322  **
1323  *i OpenGL Version:
1324  **
1325  *b This function should not be called for these environments.
1326  **
1327  *i DI-Guy Graphics API Version:
1328  **
1329  ** This function allows graphics environment-specific data to be
1330  ** stored for later retrieval by get_graphics_ptr(). DI-Guy does
1331  ** not directly use the pointer, beyond returning it using the
1332  ** get_graphics_ptr() function.
1333  */
1334  int set_graphics_ptr(void* graphics_ptr);
1335 
1336  /*l
1337  *b Description:
1338  **
1339  ** This function sets a generic node pointer that can later be
1340  ** retrieved by the get_graphics_api_node_ptr() call. The pointer is
1341  ** otherwise not used.
1342  **
1343  *i Callback Info:
1344  **
1345  ** This function can be safely be called in the
1346  ** CALLBACK_ID_SET_GRAPHICS_API_NODE_PTR callback.
1347  **
1348  *b Arguments:
1349  **
1350  *a node_ptr - generic void* pointer
1351  */
1352  void set_graphics_api_node_ptr(void* node_ptr);
1353 
1354  /*l
1355  *b Returns:
1356  **
1357  ** pointer set by most recent call to set_graphics_api_node_ptr
1358  */
1359  void* get_graphics_api_node_ptr();
1360 
1361  /*l
1362  *b Description:
1363  **
1364  ** This function stores a pointer to user data.
1365  **
1366  *b Arguments:
1367  **
1368  *a user_data - pointer for user's own use; DI-Guy will
1369  *a do nothing to the contents of this pointer
1370  *a beyond passing it back when requested
1371  *a by get_user_data()
1372  **
1373  *b Returns:
1374  **
1375  ** 0 on success, -1 on failure
1376  */
1377  int set_user_data(void* user_data);
1378 
1379  /*l
1380  *b Returns:
1381  **
1382  ** The user data pointer set by set_user_data()
1383  */
1384  void* get_user_data();
1385 
1386 #endif
1387 
1388 /*****************************************************************************/
1398  /*l
1399  *b Description:
1400  **
1401  ** This function sets the desired action of the character.
1402  **
1403  ** This function will put the character into free action mode. If
1404  ** the character was in path action mode, actions will no longer be
1405  ** set by action beads on the path.
1406  **
1407  ** If the character is in path position mode and 1 is passed for
1408  ** retain_path_shape, the character will stay in path position mode.
1409  ** If 0 is passed for retain_path_shape, the character will be put
1410  ** into free position mode.
1411  **
1412  ** If the character is in free position mode the retain_path_shape
1413  ** argument will have no effect.
1414  **
1415  ** If this call is interrupting a character in path action mode
1416  ** and path position mode, the character will not be able to resume
1417  ** the interrupted path unless retain_path_shape is set to 1.
1418  ** See resume_interrupted_path().
1419  **
1420  ** This function will have no effect on a dead character (see
1421  ** die_now() and get_dead()).
1422  **
1423  *b Mode Effects:
1424  **
1425  *- - This function will put the character into free action mode.
1426  *- - This function may change the position mode; see Description.
1427  **
1428  *b Arguments:
1429  **
1430  *a action_name - name of the desired action to be performed by
1431  *a the character
1432  *a speed - the speed at which the character should travel
1433  *a while performing the action; pass
1434  *a DIGUY_DEFAULT_FLOAT for the optimal speed to
1435  *a be used
1436  *a retain_path_shape - pass 1 to remain in path position mode; pass
1437  *a 0 to change to free position mode
1438  **
1439  *b Returns:
1440  **
1441  ** 0 on success, -1 on failure
1442  */
1443  int set_desired_action( const char* action_name, float speed = DIGUY_DEFAULT_FLOAT,
1444  int retain_path_shape = 0 );
1445 
1446  /*l
1447  *b Description:
1448  **
1449  ** This function sets the desired action of the character. This function replaces
1450  ** the legacy set_desired_action(const char*,float,int), function. All arguments
1451  ** to the legacy function can be specified using the action parameters.
1452  **
1453  ** This function will have no effect on a dead character (see
1454  ** die_now() and get_dead()).
1455  **
1456  *b Mode Effects:
1457  **
1458  *- - This function will put the character into free action mode.
1459  *- - This function may change the position mode; see Description.
1460  **
1461  *b Arguments:
1462  **
1463  *a action_name - name of the desired action to be performed by the character
1464  *a action_parameters - parameters for setting the action (eg. speeds, path mode retention)
1465  **
1466  *b Returns:
1467  **
1468  ** 0 on success, -1 on failure
1469  */
1470  int set_desired_action( const char* action_name, const diguyActionParameters& action_parameters );
1471 
1476  const char* get_desired_action();
1477 
1479  int get_desired_action_index();
1480 
1482  const char* get_current_action();
1483 
1485  int get_current_action_index();
1486 
1488  diguyMotionDirection get_desired_action_direction();
1489 
1491  diguyMotionDirection get_current_action_direction();
1492 
1493  /*l
1494  *b Description:
1495  **
1496  ** This function returns the transition state of the action
1497  ** of a character. When commanding an action, DI-Guy may
1498  ** transition the character through one or more intermediate
1499  ** actions to reach the final action. For example, a character
1500  ** with the action "walk" that is commanded to "prone" would
1501  ** transition through the intermediate action "stand".
1502  **
1503  *b Returns:
1504  **
1505  ** 1 if the character is transitioning between actions
1506  ** 0 otherwise
1507  */
1508  int get_is_in_action_transition();
1509 
1510  /*l
1511  *b Description:
1512  **
1513  ** This function forces the current action of the character to be the
1514  ** action identified by action_name.
1515  **
1516  ** See set_desired_action() for a discussion of the effects on
1517  ** position mode.
1518  **
1519  ** This function will have no effect on a dead character (see
1520  ** die_now() and get_dead()).
1521  **
1522  ** By passing a value greater than 0 for t_offset_into_new_action,
1523  ** the character can be made to begin the action partway in. This is
1524  ** useful when forcing actions for a lot of characters at the same
1525  ** time; without the offset, the characters would move in lockstep.
1526  **
1527  ** The most recent forced action, the time at which it was forced,
1528  ** and any time offset can be queried using the functions
1529  ** get_most_recent_forced_action(),
1530  ** get_most_recent_forced_action_t(), and
1531  ** get_most_recent_forced_action_t_offset().
1532  **
1533  *b Mode Effects:
1534  **
1535  *- - This function will put the character into free action mode.
1536  *- - This function may change the position mode; see Description.
1537  **
1538  *b Arguments:
1539  **
1540  *a action_name - name of the action to be performed by
1541  *a the character
1542  *a speed - the speed at which the character should
1543  *a travel while performing the action; pass
1544  *a DIGUY_DEFAULT_FLOAT for the optimal speed
1545  *a to be used
1546  *a include_transition_arc - flag for whether the transition
1547  *a motion from the current action to
1548  *a the new action is included;
1549  *a pass 1 for best chance of good looking
1550  *a transition;
1551  *a pass 0 for fastest response
1552  *a max_rampdown_interval - max amount of time spent trying to
1553  *a smooth over any motion seams; set
1554  *a to 0.5 for a smooth transition, set
1555  *a to 0 for a potentially rough transition
1556  *a retain_path_shape - pass 1 to remain in path position mode;
1557  *a pass 0 to change to free position mode
1558  *a t_offset_into_new_action - how much to shift time forward into
1559  *a new action; must be >= 0; see comment
1560  *a above for more info
1561  **
1562  *b Returns:
1563  **
1564  ** 0 on success, -1 on failure
1565  */
1566  int force_action(const char* action_name,
1567  float speed = DIGUY_DEFAULT_FLOAT,
1568  int include_transition_arc = 1,
1569  float max_rampdown_interval = 0.5f,
1570  int retain_path_shape = 0,
1571  float t_offset_into_new_action = 0.0f);
1572 
1573  /*l
1574  *b Description:
1575  **
1576  ** This function is similar to force_action(), but allows the
1577  ** specification of how long the interruption should last.
1578  **
1579  ** This function will have no effect on a dead character (see
1580  ** die_now() and get_dead()).
1581  **
1582  *b Mode Restrictions:
1583  **
1584  *- - This function can only be called if the character is in
1585  *- path action mode *and* path position mode.
1586  **
1587  *b Mode Effects:
1588  **
1589  *- - This function will put the character into free action mode.
1590  *- - This function will not change the position mode.
1591  **
1592  *b Arguments:
1593  **
1594  *a duration - how long the action should be performed before
1595  *a an automatic resume_interrupted_path() call is
1596  *a made
1597  **
1598  *b Returns:
1599  **
1600  ** 0 on success, -1 on failure
1601  */
1602  int force_action_with_duration(const char* action_name,
1603  float duration,
1604  int include_transition_arc = 1,
1605  float max_rampdown_interval = 0.5f);
1606 
1607  /*l
1608  *b Description:
1609  **
1610  ** This function is similar to force_action(), but allows the
1611  ** specification of an offset to apply to the character's position.
1612  **
1613  *b Mode Effects:
1614  **
1615  *- - This function will put the character into free action mode.
1616  *- - This function may change the position mode; see Description.
1617  **
1618  *b Arguments:
1619  **
1620  *a x, y, z - Offset to apply to character's position when transitioning
1621  *a to given action.
1622  **
1623  *b Returns:
1624  **
1625  ** 0 on success, -1 on failure
1626  **
1627  */
1628  int force_action_with_offset( const char* action_name,
1629  float speed = DIGUY_DEFAULT_FLOAT,
1630  int include_transition_arc = 1,
1631  float max_rampdown_interval = 0.5f,
1632  int retain_path_shape = 0,
1633  float t_offset_into_new_action = 0.0f,
1634  float x = 0, float y = 0, float z = 0 );
1635 
1636  /*l
1637  *b Description:
1638  **
1639  ** This function forces the current action of the character to be the
1640  ** action identified by action_name, to be executed along the path
1641  ** shape specified by path_shape_name.
1642  **
1643  ** This function will have no effect on a dead character (see
1644  ** die_now() and get_dead()).
1645  **
1646  *b Mode Effects:
1647  **
1648  *- - This function will put the character into free action mode.
1649  *- - This function will put the character into path position mode.
1650  **
1651  *b Arguments:
1652  **
1653  *a action_name - name of the action to be performed by
1654  *a the character
1655  *a path_shape_name - name of the path shape on which action
1656  *a should be performed
1657  *a waypoint_name - name of waypoint on path shape to begin at;
1658  *a default of NULL will start at first waypoint
1659  *a distance_into_path - distance into path shape to start at, if
1660  *a waypoint_name isn't specified
1661  **
1662  *b Returns:
1663  **
1664  ** 0 on success, -1 on failure
1665  */
1666  int force_action_and_path_shape(const char* action_name,
1667  const char* path_shape_name,
1668  const char* waypoint_name = NULL,
1669  float distance_into_path = 0.0f);
1670 
1671  /*l
1672  *b Description:
1673  **
1674  ** This function forces the current action of the character to be the
1675  ** action identified by action_name. This function replaces the legacy
1676  ** force_action, force_action_with_offset, and force_action_with_duration
1677  ** functions, which each make use of different subsets of the action parameters.
1678  **
1679  ** This function will have no effect on a dead character (see
1680  ** die_now() and get_dead()).
1681  **
1682  ** See set_desired_action() for a discussion of the effects on
1683  ** position mode.
1684  **
1685  *b Mode Effects:
1686  **
1687  *- - This function will put the character into free action mode.
1688  *- - This function will put the character into path position mode.
1689  **
1690  *b Arguments:
1691  **
1692  *a action_name - name of the action to be performed by the character
1693  *a action_parameters - parameters for setting the action (eg. speeds, offset, path)
1694  **
1695  *b Returns:
1696  **
1697  ** 0 on success, -1 on failure
1698  */
1699  int force_action( const char* action_name, const diguyActionParameters& action_parameters );
1700 
1701  /*l
1702  *b Description:
1703  **
1704  ** This function returns the most recently forced action as set by
1705  ** by force_action(), force_action_with_duration(), or
1706  ** force_action_and_path_shape().
1707  **
1708  *b Returns:
1709  **
1710  ** the name of the most recent forced action, or NULL if no action
1711  ** has been forced
1712  */
1713  const char* get_most_recent_forced_action();
1714 
1715  /*l
1716  *b Description:
1717  **
1718  ** This function returns the time at which the most recently forced
1719  ** action occurred.
1720  **
1721  *b Returns:
1722  **
1723  ** time at which force action occurred; -1.0 if no action has been
1724  ** forced
1725  */
1726  float get_most_recent_forced_action_t();
1727 
1728  /*l
1729  *b Description:
1730  **
1731  ** This function returns the action time offset of the most recently
1732  ** forced action. This is typically value of the
1733  ** t_offset_into_new_action argument of the force_action() call.
1734  **
1735  *b Returns:
1736  **
1737  ** time at which force action occurred; -1.0 if no action has been
1738  ** forced
1739  */
1740  float get_most_recent_forced_action_t_offset();
1741 
1742 
1743  /*l
1744  *b Description:
1745  **
1746  ** This function adds a "pending action" to the character. This is
1747  ** essentially a delayed set_desired_action() call. The desired
1748  ** action will be set at the passed scenario t, just as if
1749  ** set_desired_action() is called at that time.
1750  **
1751  ** *Note:* Any call to set_desired_action() or force_action(), or
1752  ** their related variants, will clear any pending actions.
1753  **
1754  *b Arguments:
1755  **
1756  *a action - name of pending desired action
1757  *a scenario_t - time at which to set desired action
1758  *a remove_existing_pending_actions - pass 1 to remove any previously
1759  *a added pending actions, 0 to leave them
1760  *a speed - as passed to set_desired_action()
1761  *a retain_path_shape - as passed to set_desired_action()
1762  **
1763  *b Returns:
1764  **
1765  ** 0 on success, -1 on failure
1766  */
1767  int add_pending_desired_action(const char* action,
1768  float scenario_t,
1769  int remove_existing_pending_actions = 0,
1770  float speed = DIGUY_DEFAULT_FLOAT,
1771  int retain_path_shape = 1);
1772 
1773  /*l
1774  *b Description:
1775  **
1776  ** Similar to add_pending_desired_action(), but will do a
1777  ** force_action() at the passed scenario_t instead of a
1778  ** set_desired_action().
1779  **
1780  ** *Note:* Any call to set_desired_action() or force_action(), or
1781  ** their related variants, will clear any pending actions.
1782  **
1783  *b Returns:
1784  **
1785  ** 0 on success, -1 on failure
1786  */
1787  int add_pending_force_action(const char* action,
1788  float scenario_t,
1789  int remove_existing_pending_actions = 0,
1790  float speed = DIGUY_DEFAULT_FLOAT,
1791  int include_transition_arc = 1,
1792  float max_rampdown_interval = 0.5f,
1793  int retain_path_shape = 1,
1794  float first_arc_time_shift = 0.0f);
1795 
1796  /*l
1797  *b Returns:
1798  **
1799  ** 1 if the passed action name is an action available to this
1800  ** character, 0 if not
1801  */
1802  int is_valid_action(const char* action);
1803 
1804  /*l
1805  *b Description:
1806  **
1807  ** This function sends this character a signal to die as soon as
1808  ** possible. The character will transition to a dead action.
1809  **
1810  ** The following side-effects will also happen:
1811  *>
1812  *- - all aiming is ended
1813  *- - all gazing is ended
1814  *- - all pointing is ended
1815  *- - head nodding and shaking are stopped
1816  *- - all gestures are aborted
1817  *- - all sounds originated by the character are stopped
1818  *- - Destroyed appearance might be switched to.
1819  *<
1820  ** Many function calls will have no effect on dead characters;
1821  ** see individual function descriptions for limitations.
1822  **
1823  ** Use the get_dead() call to retrieve the dead state of a
1824  ** character.
1825  **
1826  *b Mode Effects:
1827  **
1828  *- - This function will put the character into free action mode.
1829  *- - This function will not change the position mode.
1830  **
1831  *b Returns:
1832  **
1833  ** 0 on success, -1 on failure
1834  **
1835  *b Available as Decision Bead/Event
1836  */
1837  int die_now(const char* preferred_dead_action_name = "(default)");
1838 
1839  /*l
1840  *b Description:
1841  **
1842  ** This function revives a dead character. The limitations of dead
1843  ** characters will be lifted from the revived character; e.g., the
1844  ** character will be able to gaze, execute gestures, etc.
1845  **
1846  *b Returns:
1847  **
1848  ** 0 on success, -1 on failure
1849  **
1850  *b Available as Decision Bead/Event
1851  */
1852  int revive_now(const char* preferred_revive_action_name = "(default)");
1853 
1854  /*l
1855  *b Description:
1856  **
1857  ** This function returns whether or not the character is dead.
1858  ** Characters can be killed by die_now() function calls, as well as
1859  ** by being hit by weapon fire.
1860  **
1861  *b Returns:
1862  **
1863  ** 1 if character is dead (die_now() function has been called),
1864  ** 0 if not.
1865  */
1866  int get_dead();
1867 
1868  /*l
1869  *b Description:
1870  **
1871  ** Sets the speed the character should attempt to move, in meters per
1872  ** second.
1873  **
1874  ** This setting takes effect immediately. To set a desired action
1875  ** and a desired speed at the same time, use the speed argument of
1876  ** the set_desired_action() call.
1877  **
1878  ** This desired speed setting can be undone in a couple of ways:
1879  **
1880  *- 1. by calling set_speed() with an argument of
1881  *- DIGUY_DEFAULT_FLOAT, or
1882  *- 2. by calling set_desired_action(), or
1883  *- 3. by calling one of the force_action() functions
1884  **
1885  *b Arguments:
1886  **
1887  *a speed - desired speed in meters per second
1888  **
1889  *b Returns:
1890  **
1891  ** 0 on success, -1 on failure
1892  */
1893  int set_speed(float speed);
1894 
1895  /*l
1896  *b Returns:
1897  **
1898  ** the approximate speed at which the character is moving, in meters
1899  ** per second
1900  */
1901  float get_speed();
1902 
1903  /*l
1904  *b Returns:
1905  **
1906  ** The desired speed of the character, in meters per second. Calls to
1907  ** set_speed(), set_desired_action(), or force_action() assign
1908  ** the character a desired speed, to which it transitions over some
1909  ** amount of time. If the speed-setting was instantaneous, the current
1910  ** speed will be returned.
1911  */
1912  float get_desired_speed();
1913 
1914 /*****************************************************************************/
1931  /*l
1932  *b Description:
1933  **
1934  ** Sets a generic parameter that can be mapped to a blend tree driver.
1935  ** Useful for creating animations that can play back at different vertical angles.
1936  */
1937  int set_animation_target_el(float elevation, float ramp_time = .25f);
1938 
1940  float get_animation_target_el();
1941 
1942  /*l
1943  *b Description:
1944  **
1945  ** Sets a generic parameter that can be mapped to a blend tree driver.
1946  ** Useful for creating animations that can play back at different horizontal angles.
1947  */
1948  int set_animation_target_az(float azimuth, float ramp_time = .25f);
1949 
1951  float get_animation_target_az();
1952 
1953  /*l
1954  *b Description:
1955  **
1956  ** Sets a generic parameter in world space that can be mapped to a blend tree driver.
1957  ** The locomotion actions are driven by these values allowing one action to go
1958  ** many different direction.
1959  ** Internally this is mapped to local space.
1960  **
1961  ** In practical terms, this means that a character with the appropriate animation blend
1962  ** tree can be made to move at an arbitrary speed in an arbitrary direction, provided
1963  ** that the blend tree supports these motions. One example would be a soldier who can
1964  ** "strafe" from side to side while pointing his weapon in a certain direction. Another
1965  ** example would be a car that can travel forwards or backwards at a speed within a
1966  ** continuous range.
1967  **
1968  ** Users can see a demonstration of this feature in the character view by selecting an
1969  ** appropriate character type (e.g. vehicle_09), appearance (e.g. taxi_2013), and
1970  ** action ("movement"). The exercise blend tree widget will allow adjustments.
1971  **
1972  */
1973  void set_animation_velocity(float vel_x, float vel_y, float vel_z, float ramp_time = 0.10f);
1974 
1976  void get_animation_velocity(float *vel_x, float *vel_y, float *vel_z);
1977 
1978  /*l
1979  *b Description:
1980  **
1981  ** Sets a generic parameter in local space that can be mapped to a blend tree driver.
1982  ** The locomotion actions are driven by these values allowing one action to go
1983  ** many different directions.
1984  **
1985  ** Similar to set_animation_velocity() in terms of overall practical details.
1986  ** Note that the local velocity setting will affect the character's world velocity.
1987  */
1988  void set_animation_local_velocity(float vel_x, float vel_y, float vel_z, float ramp_time = 0.10f);
1989 
1991  void get_animation_local_velocity(float *vel_x, float *vel_y, float *vel_z);
1992 
1993  /*l
1994  *b Description:
1995  **
1996  ** Sets a generic parameter in that can be mapped to a blend tree driver.
1997  ** The locomotion actions are driven by these values allowing one action to turn
1998  */
1999  void set_animation_angular_velocity(float vel_rz, float ramp_time = .25f);
2000 
2002  float get_animation_angular_velocity();
2003 
2004 
2005 /*****************************************************************************/
2015  /*l
2016  *b Description:
2017  **
2018  ** Sets the position of the character relative to the origin of the
2019  ** DI-Guy global coordinate system.
2020  **
2021  ** The new settings will take effect immediately, possibly causing
2022  ** the character to "teleport" if the new values are significantly
2023  ** different than the old.
2024  **
2025  ** The DI-Guy global coordinate system is right-handed, with
2026  ** X forward, Z up, and Y to the left. Rotation directions follow
2027  ** standard right-handed coordinate system conventions:
2028  **
2029  *- - positive rotations about X cause a counter-clockwise roll
2030  *- - position rotations about Y cause a forward pitch
2031  *- - positive rotations about Z cause a yaw to the left
2032  **
2033  ** Note that if the character has an altitude function (see
2034  ** set_altitude_function()), the tz argument will effectively be
2035  ** ignored as the altitude function will override it.
2036  **
2037  ** If the magnitude of the numbers is large (say 32000 or higher),
2038  ** the function set_position_double() should be used instead.
2039  **
2040  *b Mode Effects:
2041  **
2042  *- - This function will put the character into free position mode.
2043  *- - This function will put the character into free action mode.
2044  **
2045  *b Arguments:
2046  **
2047  *a tx, ty, tz - position in meters from the origin
2048  **
2049  *b Returns:
2050  **
2051  ** 0 on success, -1 on failure
2052  */
2053  int set_position(float tx, float ty, float tz);
2054 
2055  /*l
2056  *b Description:
2057  **
2058  ** Similar to set_position(), but using double-precision rather than
2059  ** single-precision numbers. If the magnitude of the numbers is large
2060  ** (say 32000 or higher), this function should be used.
2061  **
2062  *b Mode Effects:
2063  **
2064  *- - This function will put the character into free position mode.
2065  *- - This function will put the character into free action mode.
2066  **
2067  *b Arguments:
2068  **
2069  *a tx, ty, tz - position in meters from the origin
2070  **
2071  *b Returns:
2072  **
2073  ** 0 on success, -1 on failure
2074  */
2075  int set_position_double(double tx, double ty, double tz);
2076 
2077  /*l
2078  *b Description:
2079  **
2080  ** Retrieves the position of the character in the DI-Guy
2081  ** global coordinate system.
2082  **
2083  ** See set_position() for a description of the coordinate system.
2084  **
2085  *b Arguments:
2086  **
2087  *a tx, ty, tz - position in meters from the origin
2088  **
2089  ** Pass NULL for any values that are not needed.
2090  **
2091  *b Returns:
2092  **
2093  ** 0 on success, -1 on failure
2094  */
2095  int get_position(float* tx, float* ty, float* tz);
2096 
2097  /*l
2098  *b Description:
2099  **
2100  ** Retrieves the position of the character in the DI-Guy
2101  ** global coordinate system.
2102  **
2103  ** See set_position() for a description of the coordinate system.
2104  **
2105  ** Unlike get_position(), this function returns higher-precision
2106  ** values for the position, which is important when the character is
2107  ** far from the coordinate system origin.
2108  **
2109  *b Arguments:
2110  **
2111  *a tx, ty, tz - position in meters from the origin
2112  **
2113  ** Pass NULL for any values that are not needed.
2114  **
2115  *b Returns:
2116  **
2117  ** 0 on success, -1 on failure
2118  */
2119  int get_position_double(double* tx, double* ty, double* tz);
2120 
2121  /*l
2122  *b Description:
2123  **
2124  ** Sets the position of the character relative to its parent or the
2125  ** origin of the DI-Guy global coordinate system if this
2126  ** character is not parented.
2127  **
2128  ** See set_position() for a description of the coordinate system.
2129  **
2130  ** The new settings will take effect immediately, possibly causing the
2131  ** character to "teleport" if the new values are significantly
2132  ** different than the old.
2133  **
2134  *b Mode Effects:
2135  **
2136  *- - This function will put the character into free position mode.
2137  *- - This function will put the character into free action mode.
2138  **
2139  *b Arguments:
2140  **
2141  *a tx, ty, tz - position in meters from the origin
2142  **
2143  *b Returns:
2144  **
2145  ** 0 on success, -1 on failure
2146  */
2147  int set_position_relative_to_parent(float tx, float ty, float tz);
2148 
2149  /*l
2150  *b Description:
2151  **
2152  ** Retrieves the position of the character relative to its parent, or
2153  ** relative to the origin of the DI-Guy global coordinate
2154  ** system if this character is not parented.
2155  **
2156  ** See set_position() for a description of the coordinate system.
2157  **
2158  *b Arguments:
2159  **
2160  *a tx, ty, tz - position in meters from the origin
2161  **
2162  ** Pass NULL for any values that are not needed.
2163  **
2164  *b Returns:
2165  **
2166  ** 0 on success, -1 on failure
2167  */
2168  int get_position_relative_to_parent(float* tx, float* ty, float* tz);
2169 
2170  /*l
2171  *b Description:
2172  **
2173  ** Similar to set_position_relative_to_parent(), but the position is
2174  ** either from the other character's overall position (if
2175  ** other_link_name is NULL), or the position of the other character's
2176  ** link (if other_link_name specifies a link on the other character).
2177  **
2178  ** The position that is set is relative to this character's parent.
2179  **
2180  *b Mode Effects:
2181  **
2182  *- - This function will put the character into free position mode.
2183  *- - This function will put the character into free action mode.
2184  **
2185  *b Arguments:
2186  **
2187  *a other_character_name - other character from which to read
2188  *a position
2189  *a other_link_name - optional link on other character; if
2190  *a NULL, other character's base position is
2191  *a used
2192  *a offset_x, offset_y, offset_z - offset to apply to position
2193  *a read from other character
2194  *a also_set_orientation - pass 1 to also set this character's
2195  *a orientation from the other character's
2196  *a orientation
2197  **
2198  *b Returns:
2199  **
2200  ** 0 on success, -1 on failure
2201  */
2202  int set_position_to_other_character_position(const char* other_character_name,
2203  const char* other_link_name = NULL,
2204  float offset_x = 0.0f, float offset_y = 0.0f, float offset_z = 0.0f,
2205  int also_set_orientation = 1);
2206 
2207  /*l
2208  *b Description:
2209  **
2210  ** Sets the desired position of the character. How the character
2211  ** moves toward the desired position is determined by its current
2212  ** guides; see add_guide() and create_guide().
2213  **
2214  *b Mode Effects:
2215  **
2216  *- - This function will put the character into free position mode.
2217  *- - This function will put the character into free action mode.
2218  **
2219  *b Arguments:
2220  **
2221  *a tx, ty, tz - desired position in meters from the origin
2222  *a force_guide_unacquired - this optional argument will set any guides
2223  *a the character has to be unacquired
2224  *b Returns:
2225  **
2226  ** 0 on success, -1 on failure
2227  */
2228  int set_desired_position(float tx, float ty, float tz,
2229  int force_guide_unacquired = 0);
2230 
2231  int set_desired_position_double(double tx, double ty, double tz,
2232  int force_guide_unacquired = 0);
2233  /*l
2234  *b Description:
2235  **
2236  ** Like set_desired_position(), but uses the character's current
2237  ** position as the desired position.
2238  **
2239  *b Mode Effects:
2240  **
2241  *- - This function will put the character into free position mode.
2242  *- - This function will put the character into free action mode.
2243  **
2244  *b Arguments:
2245  **
2246  *a also_set_orientation - pass 1 to also set this character's
2247  *a orientation to its current orientation
2248  **
2249  *b Returns:
2250  **
2251  ** 0 on success, -1 on failure
2252  */
2253  int set_desired_position_to_current_position(int also_set_orientation = 1);
2254 
2255  /*l
2256  *b Description:
2257  **
2258  ** Like set_desired_position(), but sets the character's desired
2259  ** position to passed waypoint's position.
2260  **
2261  ** The passed waypoint can be one created by
2262  ** diguyScenario::create_waypoint, a waypoint from a character's
2263  ** diguyCharacterPath, or waypoint from a diguyPathShape.
2264  **
2265  *b Mode Effects:
2266  **
2267  *- - This function will put the character into free position mode.
2268  *- - This function will put the character into free action mode.
2269  **
2270  *b Arguments:
2271  **
2272  *a waypoint - pointer to diguyWaypoint object
2273  *a offset_x, offset_y, offset_z - offset to apply to waypoint
2274  *a position
2275  *a offset_in_world_coords - 1 if offset is to be in world
2276  *a coordinates, 0 if it is to be
2277  *a in waypoint-local coordinates
2278  **
2279  *b Returns:
2280  **
2281  ** 0 on success, -1 on failure
2282  */
2283  int set_desired_position_to_waypoint(diguyWaypoint* waypoint,
2284  float offset_x = 0.0f, float offset_y = 0.0f, float offset_z = 0.0f,
2285  int offset_in_world_coords = 0);
2286 
2287  /*l
2288  *b Description:
2289  **
2290  ** Like set_desired_position(), but finds the specified waypoint on
2291  ** the specified path and sets the character's desired position to the
2292  ** waypoint's position.
2293  **
2294  *b Mode Effects:
2295  **
2296  *- - This function will put the character into free position mode.
2297  *- - This function will put the character into free action mode.
2298  **
2299  *b Arguments:
2300  **
2301  *a path_name - name of path on which to find waypoint
2302  *a waypoint_name - name of waypoint
2303  **
2304  *b Returns:
2305  **
2306  ** 0 on success, -1 on failure
2307  */
2308  int set_desired_position_to_path_waypoint(const char* path_name,
2309  const char* waypoint_name);
2310 
2311  /*l
2312  *b Description:
2313  **
2314  ** Like set_desired_position(), but finds the specified waypoint on
2315  ** the specified path shape and sets the character's desired position
2316  ** to the waypoint's position.
2317  **
2318  *b Mode Effects:
2319  **
2320  *- - This function will put the character into free position mode.
2321  *- - This function will put the character into free action mode.
2322  **
2323  *b Arguments:
2324  **
2325  *a path_shape_name - name of path shape on which to find waypoint
2326  *a waypoint_name - name of waypoint
2327  **
2328  *b Returns:
2329  **
2330  ** 0 on success, -1 on failure
2331  */
2332  int set_desired_position_to_path_shape_waypoint(const char* path_shape_name,
2333  const char* waypoint_name);
2334 
2335  /*l
2336  *b Description:
2337  **
2338  ** Retrieves the desired position of the character.
2339  **
2340  *b Mode Restrictions:
2341  **
2342  *- - This function can only be called in free position mode.
2343  **
2344  *b Arguments:
2345  **
2346  *a tx, ty, tz - desired position in meters from the origin
2347  **
2348  ** Pass NULL for any values that are not needed.
2349  **
2350  *b Returns:
2351  **
2352  ** 0 on success, -1 on failure
2353  */
2354  int get_desired_position(float* tx, float* ty, float* tz);
2355  int get_desired_position_double(double* tx, double* ty, double* tz);
2356 
2357  /*l
2358  *b Description:
2359  **
2360  ** Retrieves the delta vector from current position to desired one.
2361  **
2362  *b Mode Restrictions:
2363  **
2364  *- - This function can only be called in free position mode.
2365  **
2366  *b Arguments:
2367  **
2368  *a tx, ty, tz - delta in meters
2369  **
2370  ** Pass NULL for any values that are not needed.
2371  **
2372  *b Returns:
2373  **
2374  ** 0 on success, -1 on failure
2375  */
2376  int get_delta_to_desired_position(float* tx, float* ty, float* tz);
2377 
2378  /*l
2379  *b Description:
2380  **
2381  ** Sets the initial position the character should move to on a call to
2382  ** diguyScenario::reset().
2383  **
2384  ** If the character has an initial path, that path, not this function
2385  ** call, will determine its initial position.
2386  **
2387  *b Arguments:
2388  **
2389  *a tx, ty, tz - initial position in meters from the origin
2390  **
2391  *b Returns:
2392  **
2393  ** 0 on success, -1 on failure
2394  */
2395  int set_initial_position(float tx, float ty, float tz);
2396 
2397  /*l
2398  *b Description:
2399  **
2400  ** Retrieves the initial position of the character.
2401  **
2402  ** If the character is in free position mode or has no initial path,
2403  ** this will be the position set by set_initial_position().
2404  **
2405  ** Otherwise this will be the position of the first waypoint of the
2406  ** initial path.
2407  **
2408  *b Arguments:
2409  **
2410  *a tx, ty, tz - initial position in meters from the origin
2411  **
2412  ** Pass NULL for any values that are not needed.
2413  **
2414  *b Returns:
2415  **
2416  ** 0 on success, -1 on failure
2417  */
2418  int get_initial_position(float* tx, float* ty, float* tz);
2419 
2420  /*l
2421  *b Description:
2422  **
2423  ** Sets the orientation of the character relative to the origin of the
2424  ** DI-Guy global coordinate system.
2425  **
2426  ** See set_position() for a description of the coordinate system.
2427  **
2428  ** The new settings will take effect immediately, possibly causing the
2429  ** character to "teleport" if the new values are significantly
2430  ** different than the old.
2431  **
2432  ** Note that if the character has an up vector type of 'z' or 'n' or even
2433  ** sometimes 'd' (as set by the set_up_vector_type() call) the rx and ry
2434  ** values will not have any effect. To be able to set rx and ry
2435  ** values, set the up vector type of the character to 'c', for "custom".
2436  **
2437  *b Mode Effects:
2438  **
2439  *- - This function will put the character into free position mode.
2440  *- - This function will put the character into free action mode.
2441  **
2442  *b Arguments:
2443  **
2444  *a rz, rx, ry - orientations in degrees
2445  **
2446  *b Returns:
2447  **
2448  ** 0 on success, -1 on failure
2449  */
2450  int set_orientation(float rz, float rx, float ry);
2451 
2452  /*l
2453  *b Description:
2454  **
2455  ** Retrieves the orientation of the character in the DI-Guy
2456  ** global coordinate system. See set_position() for a description of
2457  ** the coordinate system.
2458  **
2459  *i Note:
2460  **
2461  ** For vehicles, you may want to use the function
2462  ** get_vehicle_body_orientation(). See that function for more
2463  ** information.
2464  **
2465  *b Arguments:
2466  **
2467  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2468  *a positive X axis
2469  **
2470  ** Pass NULL for any values that are not needed.
2471  **
2472  *b Returns:
2473  **
2474  ** 0 on success, -1 on failure
2475  */
2476  int get_orientation(float* rz, float* rx, float* ry);
2477 
2478  /*l
2479  *b Description:
2480  **
2481  ** Sets the orientation of the character relative to its parent or the
2482  ** origin of the DI-Guy global coordinate system if this
2483  ** character is not parented.
2484  **
2485  ** See set_position() for a description of the coordinate system.
2486  **
2487  ** The new settings will take effect immediately, possibly causing the
2488  ** character to "teleport" if the new values are significantly
2489  ** different than the old.
2490  **
2491  *b Mode Effects:
2492  **
2493  *- - This function will put the character into free position mode.
2494  *- - This function will put the character into free action mode.
2495  **
2496  *b Arguments:
2497  **
2498  *a rz, rx, ry - orientations in degrees
2499  **
2500  *b Returns:
2501  **
2502  ** 0 on success, -1 on failure
2503  */
2504  int set_orientation_relative_to_parent(float rz, float rx, float ry);
2505 
2506  /*l
2507  *b Description:
2508  **
2509  ** Retrieves the orientation of the character relative to its parent,
2510  ** or the origin of the DI-Guy global coordinate system if
2511  ** this character does not have a parent.
2512  **
2513  ** See set_position() for a description of the coordinate system.
2514  **
2515  *b Arguments:
2516  **
2517  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2518  *a positive X axis
2519  **
2520  ** Pass NULL for any values that are not needed.
2521  **
2522  *b Returns:
2523  **
2524  ** 0 on success, -1 on failure
2525  */
2526  int get_orientation_relative_to_parent(float* rz, float* rx, float* ry);
2527 
2528  /*l
2529  *b Description:
2530  **
2531  ** This function sets how the character should be oriented relative
2532  ** to its surroundings.
2533  **
2534  ** This function changes the current up vector type, and the up vector type
2535  ** that will be set when the character is reset. To change only the
2536  ** current up vector type (a temporary change that goes away on reset),
2537  ** call set_up_vector_type()).
2538  **
2539  *b Arguments:
2540  **
2541  *a axis - the up vector type the character should use; legal
2542  *a values shown below:
2543  **
2544  *- - 'd' - use default settings; character will change
2545  *- up vector type depending on current action and
2546  *- path shape parameters
2547  *- - 'z' - Z axis is up; character will be oriented
2548  *- so that positive Z in character coordinates is
2549  *- always oriented along the positive world Z axis
2550  *- - 'n' - normal to path; character will be oriented
2551  *- so that positive Z in character coordinates is
2552  *- normal to the path shape the character is on
2553  *- - 'g' - ground-clamped; the vehicle will attempt to cling
2554  *- to the terrain, in an approximation of real rigid
2555  *- body physics
2556  *- - 'c' - custom; character's rx and ry orientation values
2557  *- will not be modified
2558  **
2559  ** Having an up vector type of 'z' effectively zeroes out the rx and ry
2560  ** values of the character's orientation.
2561  **
2562  ** Having an up vector type of 'n' may override rx and ry values of the
2563  ** character's orientation with values derived from the character's
2564  ** path shape.
2565  **
2566  ** Having an up vector type of 'c' allows the pitch and roll of the
2567  ** character to be changed without taking it off the path it in on by
2568  ** calling set_custom_orientation_rx_and_ry(). Calling
2569  ** set_orientation() has the side-effect of putting the character
2570  ** into free position mode, taking it off of any path it's on.
2571  **
2572  *b Returns:
2573  **
2574  ** 0 on success, -1 on failure
2575  */
2576  int set_initial_up_vector_type(char axis);
2577 
2578  /*l
2579  *b Description:
2580  **
2581  ** This function is being deprecated, but remains for backwards compatibility.
2582  ** It does the same thing as set_initial_up_vector_type()
2583  **
2584  */
2585  int set_initial_up_vector(char axis);
2586 
2587  /*l
2588  *b Returns:
2589  **
2590  ** current up vector type; see set_initial_up_vector_type()
2591  */
2592  char get_initial_up_vector_type();
2593 
2594  /*l
2595  *b Description:
2596  **
2597  ** This function is being deprecated, but remains for backwards compatibility.
2598  ** It does the same thing as get_initial_up_vector_type()
2599  **
2600  */
2601  char get_initial_up_vector();
2602 
2603  /*l
2604  *b Description:
2605  **
2606  ** This function sets how the character should be oriented relative
2607  ** to its surroundings.
2608  **
2609  ** This function changes only the current up vector type. To change the
2610  ** up vector type that will be used when the character is reset, call
2611  ** set_initial_up_vector_type().
2612  **
2613  *b Arguments:
2614  **
2615  *a axis - the up vector type the character should use; see
2616  *a set_initial_up_vector_type() for description
2617  **
2618  *b Returns:
2619  **
2620  ** 0 on success, -1 on failure
2621  **
2622  *b Available as Decision Bead/Event
2623  */
2624  int set_up_vector_type(char axis);
2625 
2626  /*l
2627  *b Description:
2628  **
2629  ** This function is being deprecated, but remains for backwards compatibility.
2630  ** It does the same thing as set_up_vector_type()
2631  **
2632  */
2633  int set_up_vector(char axis);
2634 
2635  /*l
2636  *b Returns:
2637  **
2638  ** current up vector type; see set_up_vector_type()
2639  */
2640  char get_up_vector_type();
2641 
2642  /*l
2643  *b Description:
2644  **
2645  ** This function is being deprecated, but remains for backwards compatibility.
2646  ** It does the same thing as get_up_vector_type()
2647  **
2648  */
2649  char get_up_vector();
2650 
2651  /*l
2652  *b Description:
2653  **
2654  ** This function sets the rx and ry components of the character's
2655  ** orientation. Unlike set_orientation(), this function does not
2656  ** put the character into free position mode if it is currently in
2657  ** path position mode.
2658  **
2659  ** Note that if the character has an up vector type of 'z' or 'n' or even
2660  ** sometimes 'd' (as set by the set_up_vector_type() call) this function
2661  ** will not have any effect. To be able to set rx and ry values,
2662  ** set the up vector type of the character to 'c', for "custom".
2663  **
2664  ** The passed rx and ry values are in character-local coordinates,
2665  ** not parent coordinates if the character has a parent.
2666  **
2667  *b Mode Effects:
2668  **
2669  *- - None.
2670  **
2671  *b Arguments:
2672  **
2673  *a rx, ry - orientations in degrees
2674  **
2675  *b Returns:
2676  **
2677  ** 0 on success, -1 on failure
2678  */
2679  int set_custom_orientation_rx_and_ry(float rx,
2680  float ry);
2681 
2682  /*l
2683  *b Description:
2684  **
2685  ** Sets the desired orientation of the character. See
2686  ** set_desired_position().
2687  **
2688  *b Mode Effects:
2689  **
2690  *- - This function will put the character into free position mode.
2691  *- - This function will put the character into free action mode.
2692  **
2693  *b Arguments:
2694  **
2695  *a rz, rx, ry - orientations in degrees counter-clockwise from
2696  *a the positive X axis
2697  **
2698  *b Returns:
2699  **
2700  ** 0 on success, -1 on failure
2701  */
2702  int set_desired_orientation(float rz, float rx, float ry,
2703  int force_guide_unacquired = 0);
2704 
2705  /*l
2706  *b Description:
2707  **
2708  ** Retrieves the desired orientation of the character.
2709  **
2710  *b Mode Restrictions:
2711  **
2712  *- - This function can only be called in free position mode.
2713  **
2714  *b Arguments:
2715  **
2716  *a rz, rx, ry - orientations in degrees counter-clockwise from
2717  *a the positive X axis
2718  **
2719  ** Pass NULL for any values that are not needed.
2720  **
2721  *b Returns:
2722  **
2723  ** 0 on success, -1 on failure
2724  */
2725  int get_desired_orientation(float* rz, float* rx, float* ry);
2726 
2727  /*l
2728  *b Description:
2729  **
2730  ** Retrieves the delta from current orientation of the character
2731  ** to the desired one.
2732  **
2733  *b Mode Restrictions:
2734  **
2735  *- - This function can only be called in free position mode.
2736  **
2737  *b Arguments:
2738  **
2739  *a rz, rx, ry - orientation deltas in degrees counter-clockwise from
2740  *a the positive X axis
2741  **
2742  ** Pass NULL for any values that are not needed.
2743  **
2744  *b Returns:
2745  **
2746  ** 0 on success, -1 on failure
2747  */
2748  int get_delta_to_desired_orientation(float* rz, float* rx, float* ry);
2749 
2750  /*l
2751  *b Description:
2752  **
2753  ** Like set_desired_orientation(), but uses the character's current
2754  ** orientation as the desired orientation.
2755  **
2756  *b Mode Effects:
2757  **
2758  *- - This function will put the character into free position mode.
2759  *- - This function will put the character into free action mode.
2760  **
2761  *b Returns:
2762  **
2763  ** 0 on success, -1 on failure
2764  */
2765  int set_desired_orientation_to_current_orientation();
2766 
2767  /*l
2768  *b Description:
2769  **
2770  ** Like set_desired_orientation(), but orients the character towards
2771  ** the position specified.
2772  **
2773  *b Mode Effects:
2774  **
2775  *- - This function will put the character into free position mode.
2776  *- - This function will put the character into free action mode.
2777  **
2778  *b Returns:
2779  **
2780  ** 0 on success, -1 on failure
2781  */
2782  int set_desired_orientation_towards_position(float x, float y, float z,
2783  int force_guide_unacquired = 0);
2784 
2785  /*l
2786  *b Description:
2787  **
2788  ** Sets the initial orientation the character should move
2789  ** to on a call to diguyScenario::reset().
2790  **
2791  ** If the character is on a path the path, not this function
2792  ** call, will determine its initial orientation.
2793  **
2794  *b Arguments:
2795  **
2796  *a rz, rx, ry - orientations in degrees counter-clockwise from
2797  *a the positive X axis
2798  **
2799  *b Returns:
2800  **
2801  ** 0 on success, -1 on failure
2802  */
2803  int set_initial_orientation(float rz, float rx, float ry);
2804 
2805  /*l
2806  *b Description:
2807  **
2808  ** Retrieves the initial orientation of the character.
2809  **
2810  ** If the character is in free position mode or has no
2811  ** initial path, this will be the orientation set by
2812  ** set_initial_orientation().
2813  **
2814  ** Otherwise this will be the orientation of the first
2815  ** waypoint of the initial path.
2816  **
2817  *b Arguments:
2818  **
2819  *a rz, rx, ry - orientations in degrees counter-clockwise from
2820  *a the positive X axis
2821  **
2822  ** Pass NULL for any values that are not needed.
2823  **
2824  *b Returns:
2825  **
2826  ** 0 on success, -1 on failure
2827  */
2828  int get_initial_orientation(float* rz, float* rx, float* ry);
2829 
2830  /*l
2831  *b Description:
2832  **
2833  ** Returns the location and orientation of a specific link of the
2834  ** character.
2835  **
2836  *b Arguments:
2837  **
2838  *a link_name - name of the link or connection point; links are named after their inbound
2839  *a joint name
2840  *a tx, ty, tz - position in meters from the origin of the world
2841  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2842  *a positive X axis
2843  **
2844  ** Pass NULL for any values that are not needed.
2845  **
2846  *b Returns:
2847  **
2848  ** 0 on success, -1 on failure
2849  */
2850  int get_link_position(const char* link_name,
2851  float* tx, float* ty, float* tz,
2852  float* rz, float* rx, float* ry);
2853 
2854  /*l
2855  *b Description:
2856  **
2857  ** Returns the location and orientation of a specific link
2858  ** of the character.
2859  **
2860  *b Arguments:
2861  **
2862  *a link_name - name of the link or connection point; links are named after their inbound
2863  *a joint name
2864  *a tx, ty, tz - position in meters from the origin of the world
2865  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2866  *a positive X axis
2867  **
2868  ** Pass NULL for any values that are not needed.
2869  **
2870  *b Returns:
2871  **
2872  ** 0 on success, -1 on failure
2873  */
2874  int get_link_position_double(const char* link_name,
2875  double* tx, double* ty, double* tz,
2876  double* rz, double* rx, double* ry);
2877 
2878  /*l
2879  *b Description:
2880  **
2881  ** Similar to get_link_position(), but allows specification
2882  ** of offset into ending link.
2883  **
2884  *b Arguments:
2885  **
2886  *a link_name - name of the link or connection point
2887  *a offset_tx, offset_ty, offset_tz - offset in link
2888  *a tx, ty, tz - position in meters from the origin
2889  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2890  *a positive X axis
2891  **
2892  ** Pass NULL for any values that are not needed.
2893  **
2894  *b Returns:
2895  **
2896  ** 0 on success, -1 on failure
2897  */
2898  int get_link_position_with_offset(const char* link_name,
2899  float offset_tx, float offset_ty, float offset_tz,
2900  float* tx, float* ty, float* tz,
2901  float* rz, float* rx, float* ry);
2902 
2903  /*l
2904  *b Description:
2905  **
2906  ** Similar to get_link_position(), but allows specification
2907  ** of offset into ending link.
2908  **
2909  *b Arguments:
2910  **
2911  *a link_name - name of the link or connection point
2912  *a offset_tx, offset_ty, offset_tz - offset in link
2913  *a tx, ty, tz - position in meters from the origin
2914  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2915  *a positive X axis
2916  **
2917  ** Pass NULL for any values that are not needed.
2918  **
2919  *b Returns:
2920  **
2921  ** 0 on success, -1 on failure
2922  */
2923  int get_link_position_with_offset_double(const char* link_name,
2924  double offset_tx, double offset_ty, double offset_tz,
2925  double* tx, double* ty, double* tz,
2926  double* rz, double* rx, double* ry);
2927 
2928  /*l
2929  *b Description:
2930  **
2931  ** Returns the location and orientation of a specific link
2932  ** of the character relative to the position of another link.
2933  **
2934  *b Arguments:
2935  **
2936  *a beginning_link_name - name of the first link; send NULL to
2937  *a to specify the position link
2938  *a ending_link_name - name of the last link; send NULL to
2939  *a to specify the position link
2940  *a tx, ty, tz - position in meters from the origin
2941  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2942  *a positive X axis
2943  **
2944  ** Pass NULL for any values that are not needed.
2945  **
2946  *b Returns:
2947  **
2948  ** 0 on success, -1 on failure
2949  */
2950  int get_link_relative_position(const char* beginning_link_name,
2951  const char* ending_link_name,
2952  float* tx, float* ty, float* tz,
2953  float* rz, float* rx, float* ry);
2954 
2955  /*l
2956  *b Description:
2957  **
2958  ** Similar to get_link_relative_position(), but allows specification
2959  ** of offset into ending link.
2960  **
2961  *b Arguments:
2962  **
2963  *a beginning_link_name - name of the first link; send NULL to
2964  *a to specify the position link
2965  *a ending_link_name - name of the last link; send NULL to
2966  *a to specify the position link
2967  *a offset_tx, offset_ty, offset_tz - offset in ending link
2968  *a tx, ty, tz - position in meters from the origin
2969  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2970  *a positive X axis
2971  **
2972  ** Pass NULL for any values that are not needed.
2973  **
2974  *b Returns:
2975  **
2976  ** 0 on success, -1 on failure
2977  */
2978  int get_link_relative_position_with_offset(const char* beginning_link_name,
2979  const char* ending_link_name,
2980  float offset_tx, float offset_ty, float offset_tz,
2981  float* tx, float* ty, float* tz,
2982  float* rz, float* rx, float* ry);
2983 
2984  /*l
2985  *b Description:
2986  **
2987  ** By default characters on a path will scale their movement speed
2988  ** and velocity based on the scale of the actor the character is
2989  ** based on. For example, if a tall character and short character
2990  ** are both playing the exact same walk motion, the tall character
2991  ** will move further per motion repetition than the short character.
2992  **
2993  ** Scaling the travel in this way leads to more realistic looking
2994  ** motion, but can cause different characters using the same actions
2995  ** and underlying motions to move at different speeds. At times it
2996  ** is convenient to not scale the travel.
2997  **
2998  ** If actor scaling is disabled, characters of different sizes will
2999  ** all move the same distance, and at the same speed, if they have
3000  ** the same path shapes and action beads. Note that in cases of
3001  ** extreme differences between the actor the motion is based on
3002  ** and the actor the character's current appearance is based on,
3003  ** the characters feet may slip on the ground more than normal.
3004  **
3005  *b Arguments:
3006  **
3007  *a apply_scale_flag - pass 1 to apply actor scale to travel;
3008  *a 0 to not
3009  */
3010  void set_apply_actor_scale_to_action_bead_travel(int apply_scale_flag);
3011 
3012  /*l
3013  *b Returns:
3014  **
3015  ** 1 if actor scale is being applied to travel, 0 if not
3016  */
3017  int get_apply_actor_scale_to_action_bead_travel();
3018 
3019  /*l
3020  *b Description:
3021  **
3022  ** This function transforms a point that is in the local space of the
3023  ** character into a location in the world. Useful for things like
3024  ** navigating AIs to a location near a prop. Or moving to a spot
3025  ** in front of someone else.
3026  **
3027  ** This code presumes up_axis is 'z' and that there is only rotation
3028  ** about that axis.
3029  */
3030  int local_to_global(float x, float y, float z,
3031  float* res_x, float* res_y, float* res_z);
3032 
3033  /*l
3034  *b Description:
3035  **
3036  ** This function transforms a point that is in world space into the
3037  ** local space of a character. Useful for figuring out if something
3038  ** was seen.
3039  **
3040  ** This code presumes up_axis is 'z' and that there is only rotation
3041  ** about that axis.
3042  **
3043  */
3044  int global_to_local(float x, float y, float z,
3045  float* res_x, float* res_y, float* res_z);
3046 
3047  /*l
3048  *b Description:
3049  **
3050  ** Retrieves the current estimated velocity of the character. Note
3051  ** this value may not be valid in environments where characters are
3052  ** transformed independent of DI-Guy function calls. Teleporting
3053  ** characters can also temporarily make this calculation incorrect.
3054  **
3055  *b Arguments:
3056  **
3057  *a vel_x, vel_y, vel_z - meters/sec
3058  **
3059  ** Pass NULL for any values that are not needed.
3060  **
3061  */
3062  void get_velocity(float* vel_x, float* vel_y, float* vel_z);
3063 
3066  void get_acceleration(float* accel_x, float* accel_y, float* accel_z);
3067 
3068  /*l
3069  *b Description:
3070  **
3071  ** Used by the Drift and Adaptive guide
3072  **
3073  *b Arguments:
3074  **
3075  *a vel_x, vel_y, vel_z - meters/sec
3076  */
3077  void set_desired_velocity(float vel_x, float vel_y, float vel_z, float ramp_time = 0.0);
3078  void get_desired_velocity(float *vel_x, float *vel_y, float *vel_z);
3079 
3080  /*l
3081  *b Description:
3082  **
3083  ** Retrieves the current estimated angular velocity of the character.
3084  ** As above, changes made to characters independent of DI-Guy
3085  ** function calls will temporarily make this value incorrect.
3086  **
3087  ** Currently only the angular velocity in yaw is measured.
3088  **
3089  *b Arguments:
3090  **
3091  *a vel_rz - degrees/sec
3092  **
3093  */
3094  void get_angular_velocity(float* vel_rz);
3095 
3096  /*l
3097  ** Used by the Drift and Adaptive guide -- see diguyCharacterGuide.
3098  **
3099  ** The guide attempts to rotate the character at the desired angular
3100  ** velocity.
3101  */
3102  void set_desired_angular_velocity(float vel_rz);
3103  void get_desired_angular_velocity(float* vel_rz);
3104 
3105 /*****************************************************************************/
3111  /*l
3112  *b Description:
3113  **
3114  ** Returns the base appearance of the character, as passed to
3115  ** the function diguyScenario::create_character(). This pointer will
3116  ** never be NULL.
3117  **
3118  ** Note that the current appearance (as returned by
3119  ** get_current_appearance()) may be different than the base
3120  ** appearance. This base appearance is the starting appearance
3121  ** of the character before any calls to set_current_appearance()
3122  ** have been made.
3123  **
3124  *b Returns:
3125  **
3126  ** name of base appearance of the character
3127  */
3128  const char* get_appearance();
3129 
3130  /*l
3131  *b Description:
3132  **
3133  ** This function sets the base appearance of the character.
3134  ** The base appearance is the appearance the character will take
3135  ** if the scenario is reset, undoing any appearance changes made
3136  ** by calls to set_current_appearance().
3137  **
3138  ** Calling this function also makes an implicit call to
3139  ** set_current_appearance().
3140  **
3141  *b Arguments:
3142  **
3143  *a appearance - name of new base appearance
3144  **
3145  *b Returns:
3146  **
3147  ** 0 on success, -1 on failure
3148  */
3149  int set_appearance(const char* appearance);
3150 
3151  /*l
3152  *b Description:
3153  **
3154  ** This function sets the current appearance of this character.
3155  **
3156  ** Note that different appearances may be based on different actors.
3157  ** Different actors represent people of different sizes, so
3158  ** changing to an appearance that has a different actor can
3159  ** cause a pronounced change in character size.
3160  **
3161  ** Also, changing actors can take some time, as more internal
3162  ** character state needs to be updated to support the new size
3163  ** of the character.
3164  **
3165  *b Arguments:
3166  **
3167  *a appearance - name of new desired appearance
3168  *a allow_actor_change - pass 1 to allow the appearance change
3169  *a even if the actor changes, 0 to not
3170  **
3171  *b See Also:
3172  **
3173  ** get_current_appearance(), set_current_head_appearance()
3174  **
3175  *b Returns:
3176  **
3177  ** 0 on success, -1 on failure
3178  **
3179  *b Available as Decision Bead/Event
3180  */
3181  int set_current_appearance(const char* appearance,
3182  int allow_actor_change = 1);
3183 
3185  const char* get_current_appearance();
3186 
3187  /*l
3188  *b Description:
3189  **
3190  ** This function can be used to see if the current appearance
3191  ** has the passed name. This is primarily useful for decisions
3192  ** and other limited logic applications.
3193  **
3194  *b Returns:
3195  **
3196  ** 1 if current appearance has passed name; 0 if not
3197  **
3198  *b Available as Decision Bead/Event
3199  */
3200  int get_current_appearance_is(const char* appearance);
3201 
3202  /*l
3203  *b Description:
3204  **
3205  ** This function sets the head appearance of this character.
3206  ** This will persist past reseting the scenario, see set_appearance()
3207  ** for conceptual similarities.
3208  **
3209  *b Arguments:
3210  **
3211  *a head_appearance - name of the new desired head appearance
3212  **
3213  *b Returns:
3214  **
3215  ** 0 on success, -1 on failure
3216  */
3217  int set_head_appearance(const char* head_appearance);
3218 
3219  /*l
3220  *b Description:
3221  **
3222  ** This function sets the current head appearance of this character.
3223  ** On failure head appearance will be set to "default". see set_head_appearance()
3224  ** for more details
3225  **
3226  *b Available as Decision Bead/Event
3227  */
3228  int set_current_head_appearance(const char* head_appearance);
3229 
3231  const char* get_current_head_appearance();
3232 
3234  int get_num_compatible_head_appearances();
3236  const char* get_compatible_head_appearance_at_index(int index);
3237 
3239  int get_num_compatible_facefx_head_appearances();
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 the both 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 
3555  int get_is_instanced() const;
3556 
3557  // informs the internals that this character wasn't instanced, can cause an update if set_is_culled(0) is called
3558  void set_is_instanced(int val);
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 an error.
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 /*****************************************************************************/
5795  int get_num_articulated_parts();
5797 
5799  const char * get_articulated_part_link_name(int index);
5800 
5802  int get_articulated_part_id(int index);
5803 
5805  const char * map_articulated_part_id_to_link(int id);
5806 
5807 
5808 /*****************************************************************************/
5830 #ifdef CPLUSPLUS_ONLY
5831 
5832  /*l
5833  *b Description:
5834  **
5835  ** The following prototype should be used for the altitude
5836  ** function:
5837  **
5838  *e float altitude_func(diguyCharacter* character,
5839  *e float x,
5840  *e float y,
5841  *e float old_z);
5842  **
5843  ** When a character needs new altitude info, DI-Guy calls this
5844  ** function with a pointer to the diguyCharacter in question,
5845  ** the character's current (x, y) coordinates, and its previous
5846  ** altitude in old_z.
5847  **
5848  ** The altitude function should then compute and return the new
5849  ** altitude based on this information. This can be done in a
5850  ** number of ways; a typical approach is to do an intersection
5851  ** test with the visual scene. Some users might want to implement
5852  ** fairly complex behavior, such as attempting to make all four
5853  ** wheels of a vehicle touch the terrain, or causing a character
5854  ** to drift slowly towards the ground.
5855  **
5856  ** A default altitude function that should be set for all
5857  ** characters can be set by calling
5858  ** diguyScenario::set_default_character_altitude_function().
5859  **
5860  ** This function is normally called for all characters if the flags
5861  ** for enabling it in free movement or path-following mode are
5862  ** set (see below). Some character systems, such as certain kinds
5863  ** of vehicle control code, will also use the scenario altitude
5864  ** function.
5865  **
5866  *b Callable From:
5867  **
5868  *- - C++
5869  */
5870  int set_altitude_function(diguyAltitudeFunction* altitude_function);
5871 
5872  /*l
5873  *b Returns:
5874  **
5875  ** current altitude function; see set_altitude_function()
5876  **
5877  *b Callable From:
5878  **
5879  *- - C++
5880  */
5881  diguyAltitudeFunction* get_altitude_function();
5882 
5883 #endif
5884 
5885  /*l
5886  *b Description:
5887  **
5888  ** This function sets whether the character's altitude function is
5889  ** enabled in free position mode. Altitude functions are set by the
5890  ** functions set_altitude_function() or
5891  ** diguyScenario::set_default_character_altitude_function().
5892  **
5893  *b Arguments:
5894  **
5895  *a enabled - pass 1 to enable, 0 to disable
5896  **
5897  *b Mode Effects:
5898  **
5899  *- - This function will not change the position mode.
5900  **
5901  *b Mode Restrictions:
5902  **
5903  *- - This function will only affect characters in free position mode.
5904  **
5905  *b Returns:
5906  **
5907  ** 0 on success, -1 on failure
5908  */
5909  int set_altitude_function_enabled_in_free_position_mode(int enabled);
5910 
5911  /*l
5912  *b Returns:
5913  **
5914  ** whether the character's altitude function is enabled in free
5915  ** position mode; see
5916  ** set_altitude_function_enabled_in_free_position_mode()
5917  */
5918  int get_altitude_function_enabled_in_free_position_mode();
5919 
5920  /*l
5921  *b Description:
5922  **
5923  ** This function sets whether the character's altitude function is
5924  ** enabled in path position mode. Altitude functions are set by
5925  ** the functions set_altitude_function() or
5926  ** diguyScenario::set_default_character_altitude_function().
5927  **
5928  *b Arguments:
5929  **
5930  *a enabled - pass 1 to enable, 0 to disable
5931  **
5932  *b Mode Effects:
5933  **
5934  *- - This function will not change the position mode.
5935  **
5936  *b Mode Restrictions:
5937  **
5938  *- - This function will only affect characters in path position mode.
5939  **
5940  *b Returns:
5941  **
5942  ** 0 on success, -1 on failure
5943  */
5944  int set_altitude_function_enabled_in_path_position_mode(int value);
5945 
5946  /*l
5947  *b Returns:
5948  **
5949  ** whether the character's altitude function is enabled in path
5950  ** position mode;
5951  ** see set_altitude_function_enabled_in_path_position_mode()
5952  */
5953  int get_altitude_function_enabled_in_path_position_mode();
5954 
5955  /*l
5956  *b Description
5957  **
5958  ** This function sets the altitude update rate of the character.
5959  **
5960  ** The default value for new characters is 100.
5961  **
5962  ** Note that characters that are load managed (get_is_load_managed()
5963  ** returns 1) have this parameter managed automatically. The
5964  ** corresponding function for load managed characters is
5965  ** diguyLoadManager::set_zone_altitude_update_rate().
5966  **
5967  *b Arguments:
5968  **
5969  *a update_rate - percentage of scenario ticks for which altitude
5970  *a should update; can be between 1 and 100
5971  **
5972  ** Passing 100 means altitude will update every tick.
5973  ** Passing 50 means altitude will update every other tick.
5974  **
5975  *b Returns:
5976  **
5977  ** 0 on success, -1 on failure
5978  */
5979  int set_altitude_update_rate(int update_rate);
5980 
5982  int get_altitude_update_rate();
5983 
5984  /*l
5985  *b Description
5986  **
5987  ** This function sets the altitude interpolation rate of the
5988  ** character. This function only has an effect if the character's
5989  ** altitude function is enabled.
5990  **
5991  ** When the altitude function determines that the character's Z
5992  ** position should be updated to bring it closer to the ground, the
5993  ** altitude interpolation rate determines how quickly the Z height
5994  ** is adjusted.
5995  **
5996  ** The default value is 10.
5997  **
5998  *b Arguments:
5999  **
6000  *a interpolation_rate - how much of the error will be made up
6001  *a each second
6002  **
6003  ** An interpolation_rate of 100 means that all error will be made
6004  ** up each frame.
6005  */
6006  void set_altitude_interpolation_rate(float interpolation_rate);
6007 
6009  float get_altitude_interpolation_rate();
6010 
6011 /*****************************************************************************/
6123  /*l
6124  *b Description:
6125  **
6126  ** Returns the number of variables in this character's pose array.
6127  ** See get_pose_in_radians() for an example of use.
6128  **
6129  *b Returns:
6130  **
6131  ** size of this character's pose array
6132  */
6133  int get_pose_array_size();
6134 
6135 #ifdef CPLUSPLUS_ONLY
6136 
6137  /*l
6138  *b Description:
6139  **
6140  ** Fills an array of floats with the character's current joint angles.
6141  ** Angles are expressed in radians. The size of the float array must
6142  ** be at least as large as that returned by get_pose_array_size().
6143  **
6144  *b Arguments:
6145  **
6146  *a pose_array - an array of floats
6147  **
6148  *b Returns:
6149  **
6150  ** 0 on success, -1 on failure
6151  **
6152  *b Callable From:
6153  **
6154  *- - C++
6155  **
6156  *b C++ Example:
6157  **
6158  *e diguyCharacter* ch = scenario->get_character_at_index(0);
6159  *e float* pose_array;
6160  *e
6161  *e // allocate a float array of the proper size
6162  *e int n = ch->get_pose_array_size();
6163  *e pose_array = new float[n];
6164  *e
6165  *e // get the pose array
6166  *e ch->get_pose_in_radians(pose_array);
6167  */
6168  int get_pose_in_radians(float* pose_array);
6169 
6171  int get_pose_in_quaternions(float* pose_array);
6172 
6173 #endif
6174 
6175  /*l
6176  *b Description:
6177  **
6178  ** Creates and returns a pose override object. The newly created
6179  ** pose override object is added to the character's previously
6180  ** created override objects, if any.
6181  **
6182  ** How the pose override interacts with other effects that affect
6183  ** the pose of the character depends on the override stage. See
6184  ** the section "Pose Override Stages" for a discussion of pose
6185  ** override stages.
6186  **
6187  *b Arguments:
6188  **
6189  *a override_stage - the stage in the DI-Guy motion engine at
6190  *a which the override should be applied
6191  **
6192  *b Returns:
6193  **
6194  ** object of type diguyCharacterPoseOverride
6195  */
6196  diguyCharacterPoseOverride* create_pose_override(int override_stage = 3);
6197 
6198  /*l
6199  *b Description:
6200  **
6201  ** Destroys a pose override object, ending its influence on the
6202  ** character.
6203  **
6204  *b Arguments:
6205  **
6206  *a po - pose override object to be destroyed
6207  **
6208  *b Returns:
6209  **
6210  ** 0 on success, -1 on failure
6211  */
6212  int destroy_pose_override(diguyCharacterPoseOverride* po);
6213 
6214  /*l
6215  *b Returns:
6216  **
6217  ** the number of pose overrides belonging to this character
6218  */
6219  int get_num_pose_overrides();
6220 
6221  /*l
6222  *b Returns:
6223  **
6224  ** pointer of type diguyCharacterPoseOverride; NULL if no
6225  ** pose override at the specified index
6226  **
6227  *b Arguments:
6228  **
6229  *a index - index of the pose override; indices start at 0
6230  */
6231  diguyCharacterPoseOverride* get_pose_override_at_index(int index);
6232 
6233  /*l
6234  *b Description:
6235  **
6236  ** Creates and returns a pose override object that completely
6237  ** overrides all other character pose operations, including motions,
6238  ** aiming, gazing, gestures, other pose overrides, etc. The values
6239  ** set in the complete pose override object will be the values used
6240  ** to animate the character.
6241  **
6242  ** Having only one thing that affects a character's pose allows for
6243  ** much faster updating of the character.
6244  **
6245  ** There can only be one complete pose override object per character.
6246  **
6247  ** To remove the complete pose override, call
6248  ** destroy_complete_pose_override().
6249  **
6250  *b Returns:
6251  **
6252  ** object of type diguyCharacterPoseOverride
6253  */
6254  diguyCharacterPoseOverride* create_complete_pose_override();
6255 
6256  /*l
6257  *b Description:
6258  **
6259  ** Removes and destroys the complete pose override created by
6260  ** create_complete_pose_override().
6261  */
6262  void destroy_complete_pose_override();
6263 
6264 
6265 /*****************************************************************************/
6271  /*l
6272  *b Description:
6273  **
6274  ** This function sets the current azimuth, elevation, and
6275  ** distance of the character's gaze. A fixed point in 3D space
6276  ** is then found using the two angles and the given distance
6277  ** from the DI-Guy coordinate system origin. Angles are
6278  ** given with respect to the DI-Guy coordinate system.
6279  **
6280  ** See set_position() for a description of the coordinate
6281  ** system.
6282  **
6283  ** Gazing will continue until end_gaze() is called.
6284  **
6285  ** This function will have no effect on a dead character (see
6286  ** die_now() and get_dead()).
6287  **
6288  *b Arguments:
6289  **
6290  *a azimuth - rotation in degrees about up (vertical) axis;
6291  *a positive rotates to character's left
6292  *a elevation - rotation in degrees about forward (horizontal) axis;
6293  *a positive rotates down
6294  *a distance - deprecated as of 13.2
6295  *a is_new_gaze - set to 1 if this is a new gaze;
6296  *a set to 0 if this is continuing an already started
6297  *a gaze
6298  **
6299  *b Returns:
6300  **
6301  ** 0 on success, -1 on failure
6302  */
6303  int gaze_at_angle(float azimuth,
6304  float elevation,
6305  float distance,
6306  int is_new_gaze = 1);
6307 
6308  /*l
6309  *b Description:
6310  **
6311  ** This function is identical to gaze_at_angle() except that it uses
6312  ** body local coordinates for the character. The angles
6313  ** are given with respect to the idealized position of the
6314  ** character. Use get_position() to learn the idealized position.
6315  ** The distance is between the idealized position of the character
6316  ** and the fixation point.
6317  **
6318  ** This function will have no effect on a dead character (see
6319  ** die_now() and get_dead()).
6320  ** distance argument - deprecated as of 13.2
6321  */
6322  int gaze_at_angle_local(float azimuth,
6323  float elevation,
6324  float distance = 10000.0f,
6325  int is_new_gaze = 1);
6326 
6327  /*l
6328  *b Description:
6329  **
6330  ** This function sets the current fixation point of the character's
6331  ** gaze. Point coordinates are given in meters in the DI-Guy
6332  ** global coordinate system. The function uses default gaze behavior
6333  ** settings. Gazing will continue until end_gaze() is called.
6334  **
6335  ** This function will have no effect on a dead character (see
6336  ** die_now() and get_dead()).
6337  **
6338  *b Arguments:
6339  **
6340  *a tx, ty, tz - position in meters from the DI-Guy global
6341  *a origin
6342  *a is_new_gaze - set to 1 if this is a new gaze;
6343  *a set to 0 if this is continuing an already started
6344  *a gaze
6345  **
6346  *b Returns:
6347  **
6348  ** 0 on success, -1 on failure
6349  */
6350  int gaze_at_point(float tx,
6351  float ty,
6352  float tz,
6353  int is_new_gaze = 1);
6354 
6355  /*l
6356  *b Description:
6357  **
6358  ** This function is identical to gaze_at_point() except that it uses
6359  ** body local coordinates for the character. Use get_position()
6360  ** to learn the idealized position of the character if necessary.
6361  **
6362  ** This function will have no effect on a dead character (see
6363  ** die_now() and get_dead()).
6364  */
6365  int gaze_at_point_local(float tx,
6366  float ty,
6367  float tz,
6368  int is_new_gaze = 1);
6369 
6370  /*l
6371  *b Description:
6372  **
6373  ** This function effectively does a gaze_at_point() each tick.
6374  ** The point to be gazed at is updated each tick to be the position
6375  ** of the specified link on the specified character.
6376  **
6377  ** This function will have no effect on a dead character (see
6378  ** die_now() and get_dead()).
6379  **
6380  *b Arguments:
6381  **
6382  *a target_character_name - name of the character to be
6383  *a gazed at
6384  *a target_character_link_name - link on the character that should
6385  *a be gazed at; pass NULL to gaze at
6386  *a the position link of the character
6387  *a offset_tx, offset_ty, offset_tz - offset onto the link, in meters
6388  **
6389  *b Returns:
6390  **
6391  ** 0 on success, -1 on failure
6392  **
6393  *b Available as Decision Bead/Event
6394  **
6395  *b C++ Example:
6396  **
6397  *e // gaze at the head of character "soldier-1".
6398  *e ch->gaze_at_character("soldier-1",
6399  *e "cervical",
6400  *e 0.0,
6401  *e 0.0,
6402  *e 0.0);
6403  */
6404  int gaze_at_character(const char* target_character_name,
6405  const char* target_character_link_name = NULL,
6406  float offset_tx = 0.0f,
6407  float offset_ty = 0.0f,
6408  float offset_tz = 0.0f);
6409 
6410  /*l
6411  *b Returns:
6412  **
6413  ** 1 if the character is actively gazing, 0 if not
6414  */
6415  int get_gaze_is_active();
6416 
6417  /*l
6418  *b Returns:
6419  **
6420  ** the current gaze point relative to the DI-Guy
6421  ** global coordinate system
6422  */
6423  int get_gaze_point(float* x, float* y, float* z);
6424 
6425  /*l
6426  *b Description:
6427  **
6428  ** A gaze is acquired if the final link in the gaze link chain
6429  ** has fully oriented toward the gaze target, even if other
6430  ** links in the gaze chain are still moving.
6431  **
6432  ** If the gaze is acquired, but any links in the gaze chain
6433  ** are still moving, the gaze is considered acquired but not
6434  ** steady (see get_gaze_is_steady().) If all links have reached
6435  ** a relatively steady state, the gaze is considered acquired
6436  ** and steady.
6437  **
6438  ** If either the acquired or steady status of a gaze has changed
6439  ** (e.g., was acquired but now is not, or was steady but now
6440  ** a link is moving), the diguyCharacter callback with callback_id
6441  ** CALLBACK_ID_GAZE_STATUS will be called.
6442  **
6443  *b Returns:
6444  **
6445  *- - 1 if the final link in the gaze can and has become oriented
6446  *- toward the gaze target
6447  *- - 0 if not
6448  *- - -1 on error
6449  */
6450  int get_gaze_is_acquired();
6451 
6452  /*l
6453  *b Description:
6454  **
6455  ** A gaze is steady if it is acquired, and if all links involved
6456  ** in the gaze have reached a steady state.
6457  **
6458  ** For example, since the eyes move faster than the neck, which
6459  ** moves faster than the back, it's possible for the gaze to
6460  ** be acquired (see get_gaze_is_acquired()) by the eyes as the
6461  ** neck and back are still moving. As the neck and back move into
6462  ** a more natural position, the eyes will not need to be turned
6463  ** as far to keep the gaze acquired.
6464  **
6465  ** If either the acquired or steady status of a gaze has changed
6466  ** (e.g., was acquired but now is not, or was steady but now
6467  ** a link is moving), the diguyCharacter callback with callback_id
6468  ** CALLBACK_ID_GAZE_STATUS will be called.
6469  **
6470  *b Returns:
6471  **
6472  *- - 1 if all links participating in the gaze have reached a
6473  *- relatively steady state
6474  *- - 0 if not
6475  *- - -1 on error
6476  */
6477  int get_gaze_is_steady();
6478 
6479  /*l
6480  *b Description:
6481  **
6482  ** This function removes the fixation target of an ongoing gaze,
6483  ** allowing the character to return to a non-gaze posture and
6484  ** behavior. This effectively frees the character's posture to
6485  ** other influences.
6486  */
6487  int end_gaze();
6488 
6489  /*l
6490  *b Description:
6491  **
6492  ** This function is similar to gaze_at_angle(), but sets the target
6493  ** of left pointing rather than gaze.
6494  **
6495  ** This function will have no effect on a dead character (see
6496  ** die_now() and get_dead()).
6497  **
6498  *b Arguments:
6499  **
6500  *a azimuth - rotation in degrees about up (vertical) axis;
6501  *a positive rotates to character's left
6502  *a elevation - rotation in degrees about forward (horizontal) axis;
6503  *a positive rotates down
6504  *a distance - distance in meters from the position of the character
6505  *a to the lpoint target; positive values only
6506  *a is_new_lpoint - set to 1 if this is a new lpoint;
6507  *a set to 0 if this is continuing an already started
6508  *a lpoint
6509  *a base_gesture_name - the underlying gesture that should be used for
6510  *a motion of the arm; this is a placeholder
6511  *a argument for future functionality and should
6512  *a be set to NULL
6513  */
6514  int lpoint_at_angle(float azimuth,
6515  float elevation,
6516  float distance,
6517  int is_new_lpoint = 1,
6518  const char* base_gesture_name = 0);
6519 
6520  /*l
6521  *b Description:
6522  **
6523  ** This function is identical to gaze_at_local() except that it uses
6524  ** body local coordinates for the character. Use get_position()
6525  ** to learn the idealized position of the character if necessary.
6526  **
6527  ** This function will have no effect on a dead character (see
6528  ** die_now() and get_dead()).
6529  */
6530  int lpoint_at_angle_local(float azimuth,
6531  float elevation,
6532  float distance = 10000.0f,
6533  int is_new_lpoint = 1,
6534  const char* base_gesture_name = 0);
6535 
6536  /*l
6537  *b Description:
6538  **
6539  ** This function sets the current fixation point for the character's
6540  ** left pointing. Point coordinates are given in meters in the
6541  ** DI-Guy global coordinate system.
6542  **
6543  ** See set_position() for a description of the coordinate
6544  ** system.
6545  **
6546  ** Pointing will continue until end_lpoint() is called.
6547  **
6548  ** This function will have no effect on a dead character (see
6549  ** die_now() and get_dead()).
6550  **
6551  *b Arguments:
6552  **
6553  *a tx, ty, tz - position in meters from the DI-Guy global
6554  *a origin of the lpoint target
6555  *a is_new_gaze - set to 1 if this is a new lpoint;
6556  *a set to 0 if this is continuing an already started
6557  *a lpoint
6558  *a base_gesture_name - the underlying gesture that should be used for
6559  *a motion of the arm; this is a placeholder
6560  *a argument for future functionality and should
6561  *a be set to NULL
6562  **
6563  *b Returns:
6564  **
6565  ** 0 on success, -1 on failure
6566  */
6567  int lpoint_at_point(float tx,
6568  float ty,
6569  float tz,
6570  int is_new_lpoint = 1,
6571  const char* base_gesture_name = 0);
6572 
6573  /*l
6574  *b Description:
6575  **
6576  ** This function is identical to lpoint_at_local() except that it uses
6577  ** body local coordinates for the character. Use get_position()
6578  ** to learn the idealized position of the character if necessary.
6579  **
6580  ** This function will have no effect on a dead character (see
6581  ** die_now() and get_dead()).
6582  */
6583  int lpoint_at_point_local(float tx,
6584  float ty,
6585  float tz,
6586  int is_new_lpoint = 1,
6587  const char* base_gesture_name = 0);
6588 
6589  /*l
6590  *b Description:
6591  **
6592  ** This function is identical to gaze_at_character(), but sets the
6593  ** target of left pointing rather than gaze.
6594  **
6595  ** This function will have no effect on a dead character (see
6596  ** die_now() and get_dead()).
6597  */
6598  int lpoint_at_character(const char* target_character_name,
6599  const char* target_character_link_name = NULL,
6600  float offset_tx = 0.0f,
6601  float offset_ty = 0.0f,
6602  float offset_tz = 0.0f);
6603 
6604  /*l
6605  *b Returns:
6606  **
6607  ** the current lpoint target point relative to the DI-Guy
6608  ** global coordinate system
6609  */
6610  int get_lpoint_point(float* x, float* y, float* z);
6611 
6612  /*l
6613  *b Returns:
6614  **
6615  ** the current base gesture of the lpoint
6616  */
6617  const char* get_lpoint_base_gesture_name();
6618 
6619  /*l
6620  *b Returns:
6621  **
6622  ** 1 if the character is actively lpointing, 0 if not
6623  */
6624  int get_lpoint_is_active();
6625 
6626  /*l
6627  *b Returns:
6628  **
6629  ** 1 if the final link in the lpoint can and has become oriented
6630  ** toward the lpoint target;
6631  ** 0 if not;
6632  ** -1 on error
6633  */
6634  int get_lpoint_is_acquired();
6635 
6636  /*l
6637  *b Returns:
6638  **
6639  ** 1 if all links participating in the lpoint have reached a
6640  ** relatively steady state;
6641  ** 0 if not;
6642  ** -1 on error
6643  */
6644  int get_lpoint_is_steady();
6645 
6646  /*l
6647  *b Description:
6648  **
6649  ** This function removes the fixation target of an ongoing lpoint,
6650  ** allowing the character to return to a non-point posture and
6651  ** behavior. This effectively frees the character's posture to
6652  ** other influences.
6653  */
6654  int end_lpoint();
6655 
6656  /*l
6657  *b Description:
6658  **
6659  ** This function sets all gaze control parameters back to their
6660  ** default settings. This undoes modifications to gaze control
6661  ** parameters made by the following calls:
6662  **
6663  *- - set_gaze_param_desired_locate_time()
6664  *- - set_gaze_link_uses_desired_locate_time()
6665  *- - set_gaze_link_azimuth_limits()
6666  *- - set_gaze_link_elevation_limits()
6667  *- - set_gaze_link_azimuth_tolerance()
6668  *- - set_gaze_link_elevation_tolerance()
6669  *- - set_gaze_link_max_angular_vel()
6670  *- - set_gaze_link_scale_factor()
6671  **
6672  *b Returns:
6673  **
6674  ** 0 on success, -1 on failure
6675  */
6676  int set_gaze_params_to_defaults();
6677 
6678  /*l
6679  *b Description:
6680  **
6681  ** This function sets the desired amount of time in seconds it
6682  ** will take for the gaze or point target to be acquired.
6683  **
6684  ** Having a desired locate time effectively limits how fast links
6685  ** in the gaze chain can turn; they will turn as fast as it
6686  ** takes for them to arrive at their proper values, or as fast
6687  ** as their maximum angular velocity, whichever is longer.
6688  **
6689  ** The use of desired locate time can be turned on and off on a
6690  ** link by link bases using the function
6691  ** set_gaze_link_uses_desired_locate_time().
6692  **
6693  ** This value is only a guideline and may be overridden on a link
6694  ** by link basis during the actual gaze, as links try not to
6695  ** exceed their maximum angular velocities.
6696  **
6697  ** The default locate time is 1.0 seconds.
6698  **
6699  *b Arguments:
6700  **
6701  *a t - lower value results in faster turning rate
6702  **
6703  *b Returns:
6704  **
6705  ** 0 on success, -1 on failure
6706  */
6707  int set_gaze_param_desired_locate_time(float t);
6708 
6709  /*l
6710  *b Returns:
6711  **
6712  ** the most recent setting of set_gaze_param_desired_locate_time()
6713  */
6714  float get_gaze_param_desired_locate_time();
6715 
6716  /*l
6717  *b Description:
6718  **
6719  ** This function sets whether the specified link will pay attention
6720  ** to the desired locate time (as set by
6721  ** set_gaze_param_desired_locate_time()), or whether the link turns
6722  ** as fast as its maximum angular velocity allows (as set by
6723  ** set_gaze_link_max_angular_vel()).
6724  **
6725  ** Note that if this value is set to 1, the link still pays attention
6726  ** to its maximum angular velocity as an upper limit on how fast
6727  ** it can turn.
6728  **
6729  ** Valid link names and defaults:
6730  **
6731  *a orientation - 1
6732  *a back - 1
6733  *a cervical - 1
6734  *a eye_l - 0
6735  *a shoulder_l - 1
6736  *a elbow_l - 1
6737  **
6738  *b Arguments:
6739  **
6740  *a link_name - name of the link
6741  *a uses_desired_locate_time - 1 to use desired locate time, 0
6742  *a to disregard
6743  **
6744  *b Returns:
6745  **
6746  ** 0 on success, -1 on failure
6747  */
6748  int set_gaze_link_uses_desired_locate_time(const char* link_name,
6749  int uses_desired_locate_time);
6750 
6751  /*l
6752  *b Returns:
6753  **
6754  ** the most recent setting of set_gaze_link_uses_desired_locate_time()
6755  */
6756  int get_gaze_link_uses_desired_locate_time(const char* link_name);
6757 
6758  /*l
6759  *b Description:
6760  **
6761  ** This function sets the maximum amount the character can turn
6762  ** the specified link horizontally in pursuit of a gaze or point
6763  ** target.
6764  **
6765  ** Valid link names and defaults:
6766  **
6767  *a back - -45 to 45
6768  *a cervical - -80 to 80
6769  *a eye_l - -50 to 50
6770  *a shoulder_l - -30 to 135
6771  *a elbow_l - -30 to 10
6772  **
6773  *b Arguments:
6774  **
6775  *a link_name - name of the link
6776  *a min - value <= 0; in degrees
6777  *a max - value >= 0; in degrees
6778  **
6779  *b Returns:
6780  **
6781  ** 0 on success, -1 on failure
6782  */
6783  int set_gaze_link_azimuth_limits(const char* link_name, float min, float max);
6784 
6785  /*l
6786  *b Returns:
6787  **
6788  ** the most recent setting of set_gaze_link_azimuth_max()
6789  */
6790  int get_gaze_link_azimuth_limits(const char* link_name,
6791  float* min,
6792  float* max);
6793 
6794  /*l
6795  *b Description:
6796  **
6797  ** This function sets the maximum amount the character can turn
6798  ** the specified link vertically in pursuit of a gaze or point
6799  ** target.
6800  **
6801  ** Valid link names and defaults:
6802  **
6803  *a back - -15 to 45
6804  *a cervical - -80 to 45
6805  *a eye_l - -40 to 40
6806  *a shoulder_l - -80 to 80
6807  *a elbow_l - -170 to 0
6808  **
6809  *b Arguments:
6810  **
6811  *a link_name - name of the link
6812  *a min - value <= 0; in degrees
6813  *a max - value >= 0; in degrees
6814  **
6815  *b Returns:
6816  **
6817  ** 0 on success, -1 on failure
6818  */
6819  int set_gaze_link_elevation_limits(const char* link_name,
6820  float min,
6821  float max);
6822 
6824  int get_gaze_link_elevation_limits(const char* link_name,
6825  float* min,
6826  float* max);
6827 
6828  /*l
6829  *b Description:
6830  **
6831  ** This function sets how much difference there can be between
6832  ** the link's current horizontal orientation and the gaze or point
6833  ** target before the link begins to turn to acquire the gaze or
6834  ** point target.
6835  **
6836  ** The combination of this function and
6837  ** set_gaze_link_scale_factor() determine how close the link will
6838  ** turn toward the gaze or point target.
6839  **
6840  ** With a looser (higher) tolerance the link will not turn as much
6841  ** toward the target. With a tighter (lower) tolerance the link
6842  ** will turn more toward the target.
6843  **
6844  ** Valid link names and defaults:
6845  **
6846  *a orientation - -30 to 30
6847  *a back - -45 to 45
6848  *a cervical - -5 to 5
6849  *a eye_l - -1 to 1
6850  *a shoulder_l - -5 to 5
6851  *a elbow_l - -5 to 5
6852  **
6853  *b Arguments:
6854  **
6855  *a link_name - name of the link
6856  *a min - value <= 0; in degrees
6857  *a max - value >= 0; in degrees
6858  **
6859  *b Returns:
6860  **
6861  ** 0 on success, -1 on failure
6862  */
6863  int set_gaze_link_azimuth_tolerance(const char* link_name,
6864  float min,
6865  float max);
6866 
6868  int get_gaze_link_azimuth_tolerance(const char* link_name,
6869  float* min,
6870  float* max);
6871 
6872  /*l
6873  *b Description:
6874  **
6875  ** The elevation equivalent of set_gaze_link_azimuth_tolerance(),
6876  **
6877  ** Valid link names and defaults:
6878  **
6879  *a orientation - -90 to 90
6880  *a back - -45 to 45
6881  *a cervical - -5 to 5
6882  *a eye_l - -1 to 1
6883  *a shoulder_l - -5 to 5
6884  *a elbow_l - -5 to 5
6885  **
6886  *b Arguments:
6887  **
6888  *a link_name - name of the link
6889  *a min - value <= 0; in degrees
6890  *a max - value >= 0; in degrees
6891  **
6892  *b Returns:
6893  **
6894  ** 0 on success, -1 on failure
6895  */
6896  int set_gaze_link_elevation_tolerance(const char* link_name,
6897  float min,
6898  float max);
6899 
6901  int get_gaze_link_elevation_tolerance(const char* link_name,
6902  float* min,
6903  float* max);
6904 
6905  /*l
6906  *b Description:
6907  **
6908  ** This function sets the maximum angular velocity that the
6909  ** back link angles may attain in pursuit of a gaze or point target.
6910  **
6911  ** Valid link names and defaults:
6912  **
6913  *a back - 30 deg/s
6914  *a cervical - 60 deg/s
6915  *a eye_l - 180 deg/s
6916  *a shoulder_l - 180 deg/s
6917  *a elbow_l - 180 deg/s
6918  **
6919  *b Arguments:
6920  **
6921  *a link_name - name of the link
6922  *a angular_vel - angular velocity in degrees per second
6923  **
6924  *b Returns:
6925  **
6926  ** 0 on success, -1 on failure
6927  */
6928  int set_gaze_link_max_angular_vel(const char* link_name, float angular_vel);
6929 
6931  int get_gaze_link_max_angular_vel(const char* link_name, float* angular_vel);
6932 
6933  /*l
6934  *b Description:
6935  **
6936  ** This function sets how much the link will make up the difference
6937  ** toward the gaze or point target.
6938  **
6939  ** The combination of this function and
6940  ** the tolerances determine how close the
6941  ** link will turn toward the gaze or point target.
6942  **
6943  ** With a smaller scale factor the link will not turn as much toward
6944  ** the target. With a higher scale factor the link will turn more
6945  ** toward the target.
6946  **
6947  ** For example, if the gaze or point target is at 60 degrees yaw in
6948  ** back coordinates and the scale factor is 0.5, the back will turn
6949  ** 30 degrees in pursuit of the target.
6950  **
6951  ** Valid link names and defaults:
6952  **
6953  *a back - 0.75
6954  *a cervical - 0.5
6955  *a eye_l - 1.0
6956  *a shoulder_l - 0.9
6957  *a elbow_l - 1.0
6958  **
6959  *b Arguments:
6960  **
6961  *a link_name - name of the link
6962  *a scale_factor - scale factor between 0 and 1
6963  **
6964  *b Returns:
6965  **
6966  ** 0 on success, -1 on failure
6967  */
6968  int set_gaze_link_scale_factor(const char* link_name, float scale_factor);
6969 
6971  int get_gaze_link_scale_factor(const char* link_name, float* scale_factor);
6972 
6973  /*l
6974  *b Description:
6975  **
6976  ** This function sets whether the character can turn the specified
6977  ** link in pursuit of the gaze target.
6978  **
6979  ** Valid link names and defaults:
6980  **
6981  *a orientation - 0
6982  *a back - 1
6983  *a cervical - 1
6984  *a eye_l - 1 if character has movable eyes, else 0
6985  *a shoulder_l - 0
6986  *a elbow_l - 0
6987  **
6988  *b Arguments:
6989  **
6990  *a link_name - name of the link
6991  *a enabled - 1 to enable, 0 to disable
6992  **
6993  *b Returns:
6994  **
6995  ** 0 on success, -1 on failure
6996  */
6997  int set_link_enabled_for_gaze(const char* link_name, int enabled);
6998 
7000  int get_link_enabled_for_gaze(const char* link_name);
7001 
7002  /*l
7003  *b Description:
7004  **
7005  ** This function sets whether the character can change its current
7006  ** posture in pursuit of the gaze target.
7007  **
7008  ** Gaze can change current posture by default.
7009  **
7010  *b Arguments:
7011  **
7012  *a enabled - 1 to enable, 0 to disable
7013  **
7014  *b Returns:
7015  **
7016  ** 0 on success, -1 on failure
7017  */
7018  int set_gaze_can_change_posture(int enabled);
7019 
7021  int get_gaze_can_change_posture();
7022 
7023  /*l
7024  *b Description:
7025  **
7026  ** This function sets whether the character can change its current
7027  ** variant in pursuit of the gaze target.
7028  **
7029  ** Gaze can change current variant by default.
7030  **
7031  *b Arguments:
7032  **
7033  *a enabled - 1 to enable, 0 to disable
7034  **
7035  *b Returns:
7036  **
7037  ** 0 on success, -1 on failure
7038  */
7039  int set_gaze_can_change_variant(int enabled);
7040 
7042  int get_gaze_can_change_variant();
7043 
7044  /*l
7045  *b Description:
7046  **
7047  ** This function sets whether the character can move the specified
7048  ** link in pursuit of the lpoint target.
7049  **
7050  ** Valid link names and defaults:
7051  **
7052  *a orientation - 0
7053  *a back - 1
7054  *a cervical - 0
7055  *a eye_l - 0
7056  *a shoulder_l - 1
7057  *a elbow_l - 1
7058  **
7059  *b Arguments:
7060  **
7061  *a link_name - name of the link
7062  *a enabled - 1 to enable, 0 to disable
7063  **
7064  *b Returns:
7065  **
7066  ** 0 on success, -1 on failure
7067  */
7068  int set_link_enabled_for_lpoint(const char* link_name, int enabled);
7069 
7071  int get_link_enabled_for_lpoint(const char* link_name);
7072 
7073  /*l
7074  *b Description:
7075  **
7076  ** This function adjusts the current azimuth and elevation offsets
7077  ** of the character's head. If a gaze is ongoing, then the nod will
7078  ** be supplemented to the gazing, and the character will attempt to
7079  ** maintain its gaze.
7080  **
7081  ** This function will have no effect on a dead character (see
7082  ** die_now() and get_dead()).
7083  **
7084  *b Arguments:
7085  **
7086  *a azimuth - rotation offset about z (vertical) axis, in degrees;
7087  *a positive rotates to character's left
7088  *a elevation - rotation offset about y (horizontal) axis, in degrees;
7089  *a positive rotates down
7090  *a duration - how long it should take to attain the new azimuth
7091  *a and elevation
7092  **
7093  *b Returns:
7094  **
7095  ** 0 on success, -1 on failure
7096  */
7097  int set_nod(float azimuth,
7098  float elevation,
7099  float duration = 0.5f);
7100 
7101  /*l
7102  *b Description:
7103  **
7104  ** This function causes the character to nod its head for the
7105  ** specified number of times over the specified duration.
7106  **
7107  ** If nod_count is 0.5, the elevation of the head will move from its
7108  ** current elevation straight to nod_elevation_out. The arguments
7109  ** nod_elevation0 and nod_elevation1 will be ignored.
7110  **
7111  ** If nod_count is 1.0, the elevation of the head will move from
7112  ** its current elevation to nod_elevation0, then to
7113  ** nod_elevation_out. The argument nod_elevation1 will be ignored.
7114  **
7115  ** If nod_count is 1.5 or greater, the nod elevation will begin at
7116  ** its current elevation, move to nod_elevation0, then alternate
7117  ** between nod_elevation0 and nod_elevation1, before finally ending
7118  ** at nod_elevation_out.
7119  **
7120  ** The head will maintain an elevation offset of nod_elevation_out
7121  ** until a new call to nod_head() or set_nod() is made.
7122  **
7123  ** This function overrides any nod settings made by the set_nod()
7124  ** function.
7125  **
7126  ** This function will have no effect on a dead character (see
7127  ** die_now() and get_dead()).
7128  **
7129  *b Arguments:
7130  **
7131  *a duration - for how long the nod should be executed
7132  *a nod_count - how many nods the character should perform;
7133  *a this will be rounded to the nearest multiple
7134  *a of 0.5
7135  *a nod_elevation0 - elevation of initial nod in degrees
7136  *a nod_elevation1 - elevation of return nod in degrees
7137  *a nod_elevation_out - ending elevation when nod is complete
7138  **
7139  *b Returns:
7140  **
7141  ** 0 on success, -1 on failure
7142  **
7143  *b Available as Decision Bead/Event
7144  */
7145  int nod_head(float duration,
7146  float nod_count,
7147  float nod_elevation0 = 15.0f,
7148  float nod_elevation1 = 0.0f,
7149  float nod_elevation_out = 0.0f);
7150 
7151  /*l
7152  *b Description:
7153  **
7154  ** This function is similar to nod_head(), except the direction
7155  ** of head movement is side to side rather than up and down.
7156  ** See the nod_head() function for a detailed description of usage.
7157  **
7158  ** This function will have no effect on a dead character (see
7159  ** die_now() and get_dead()).
7160  **
7161  *b Arguments:
7162  **
7163  *a duration - for how long the shake should be executed
7164  *a shake_count - how shakes the character should perform; this
7165  *a will be rounded to the nearest multiple of
7166  *a 0.5
7167  *a shake_azimuth0 - azimuth of initial shake in degrees
7168  *a shake_azimuth1 - azimuth of return shake in degrees
7169  *a shake_azimuth_out - ending azimuth when shake is complete
7170  **
7171  *b Returns:
7172  **
7173  ** 0 on success, -1 on failure
7174  **
7175  *b Available as Decision Bead/Event
7176  */
7177  int shake_head(float duration,
7178  float shake_count,
7179  float shake_azimuth0 = -20.0f,
7180  float shake_azimuth1 = 20.0f,
7181  float shake_azimuth_out = 0.0f);
7182 
7183  /*l
7184  *b Returns:
7185  **
7186  ** current nod azimuth setting; see set_nod(), nod_head(), and
7187  ** shake_head()
7188  */
7189  float get_nod_azimuth();
7190 
7191  /*l
7192  *b Returns:
7193  **
7194  ** current nod elevation setting; see set_nod(), nod_head(), and
7195  ** shake_head()
7196  */
7197  float get_nod_elevation();
7198 
7199 
7200 /*****************************************************************************/
7221  /*l
7222  *b Description:
7223  **
7224  ** This function sets the current desired azimuth and elevation of
7225  ** the character's aim. The angles are in character-local
7226  ** coordinates. Zero values mean straight ahead and level.
7227  ** Aiming will continue until end_aim() is called.
7228  **
7229  ** This function effectively calls aim_at_angle_local(), with a
7230  ** distance of 10000 meters, and is_new_aim set to 1.
7231  **
7232  ** This function will have no effect on a dead character (see
7233  ** die_now() and get_dead()).
7234  **
7235  *b Arguments:
7236  **
7237  *a azimuth - rotation about z (vertical) axis, in degrees;
7238  *a positive rotates to character's left
7239  *a elevation - rotation about y (horizontal) axis, in degrees;
7240  *a positive rotates down
7241  **
7242  *b Returns:
7243  **
7244  ** 0 on success, -1 on failure
7245  */
7246  int set_aim(float azimuth, float elevation);
7247 
7248  /*l
7249  *b Description:
7250  **
7251  ** This function sets the current azimuth, elevation, and
7252  ** distance of the character's aim. A fixed point in 3D space is
7253  ** then found using the two angles and the given distance from
7254  ** the character's idealized position. Angles are given with
7255  ** respect to the DI-Guy global coordinate system.
7256  **
7257  ** See set_position() for a description of the coordinate
7258  ** system.
7259  **
7260  ** Aiming will continue until end_aim() is called.
7261  **
7262  ** This function will have no effect on a dead character (see
7263  ** die_now() and get_dead()).
7264  **
7265  *b Arguments:
7266  **
7267  *a azimuth - rotation in degrees about up (vertical) axis;
7268  *a begins at 0 at the positive X axis of the DI-Guy
7269  *a coordinate system and proceeds counter-clockwise
7270  *a elevation - rotation in degrees about horizontal axis; positive
7271  *a value rotates down
7272  *a distance - distance in meters from the idealized position of the
7273  *a character to the aim target; positive values only,
7274  *a typically this is a large value (e.g. 10,000 meters)
7275  *a is_new_aim - set to 1 if this is a new aim, for jumping to a
7276  *a new target;
7277  *a set to 0 if this is continuing an already
7278  *a started aim, for tracking an existing target
7279  **
7280  *b Returns:
7281  **
7282  ** 0 on success, -1 on failure
7283  */
7284  int aim_at_angle(float azimuth,
7285  float elevation,
7286  float distance,
7287  int is_new_aim = 1);
7288 
7289  /*l
7290  *b Description:
7291  **
7292  ** This function is identical to aim_at_angle() except that the
7293  ** angles are relative to the character's frame of reference. These
7294  ** relative angles will be maintained even if the character rotates.
7295  **
7296  ** Use get_position() to learn the idealized position. The
7297  ** distance is between the idealized position of the character
7298  ** and the fixation point. Aiming will continue until end_aim()
7299  ** is called.
7300  **
7301  ** This function will have no effect on a dead character (see
7302  ** die_now() and get_dead()).
7303  */
7304  int aim_at_angle_local(float azimuth,
7305  float elevation,
7306  float distance,
7307  int is_new_aim = 1);
7308 
7309  /*l
7310  *b Description:
7311  **
7312  ** This function is identical to aim_at_angle() and aim_at_angle_local(),
7313  ** but includes velocity that will modify the angles every frame.
7314  ** This can be useful in networked simulations where targeting velocity is published.
7315  **
7316  ** This function will have no effect on a dead character (see
7317  ** die_now() and get_dead()).
7318  */
7319  int aim_at_angle_with_velocity(float azimuth, float elevation, float az_vel, float el_vel, int local, int is_new_aim = 1);
7320 
7321  /*l
7322  *b Description:
7323  **
7324  ** This function sets the current fixation point of the
7325  ** character's aim. Point coordinates are given in meters in the
7326  ** DI-Guy global coordinate system.
7327  **
7328  ** The function uses default aim behavior settings. Aiming will
7329  ** continue until end_aim() is called.
7330  **
7331  ** This function will have no effect on a dead character (see
7332  ** die_now() and get_dead()).
7333  **
7334  *b Arguments:
7335  **
7336  *a tx, ty, tz - position in meters from the DI-Guy global
7337  *a origin
7338  *a is_new_aim - set to 1 if this is a new aim;
7339  *a set to 0 if this is continuing an already started aim
7340  **
7341  *b Returns:
7342  **
7343  ** 0 on success, -1 on failure
7344  */
7345  int aim_at_point(float x, float y, float z, int is_new_aim = 1);
7346 
7347  /*l
7348  *b Description:
7349  **
7350  ** This function is identical to aim_at_point() except that the
7351  ** coordinates are relative to the character, in its own coordinate
7352  ** system. Use get_position() to learn the idealized position of the
7353  ** character if necessary.
7354  **
7355  ** This function will have no effect on a dead character (see
7356  ** die_now() and get_dead()).
7357  */
7358  int aim_at_point_local(float x, float y, float z, int is_new_aim = 1);
7359 
7360  /*l
7361  *b Description:
7362  **
7363  ** This function effectively does an aim_at_point() each tick.
7364  ** The point to be aimed at is updated each tick to be the position
7365  ** of the specified link on the specified character.
7366  **
7367  ** This function will have no effect on a dead character (see
7368  ** die_now() and get_dead()).
7369  **
7370  *b Arguments:
7371  **
7372  *a target_character_name - name of the character to be
7373  *a aimed at
7374  *a target_character_link_name - link on the character that should
7375  *a be aimed at; pass NULL or "" to
7376  *a aim at the position link of the
7377  *a character. If NULL is passed,
7378  *a function will make best effort to
7379  *a choose a character-appropriate link
7380  *a to target.
7381  *a offset_tx, offset_ty, offset_tz - offset onto the link, in meters
7382  **
7383  *b Returns:
7384  **
7385  ** 0 on success, -1 on failure
7386  **
7387  *b Available as Decision Bead/Event
7388  **
7389  *b C++ Example:
7390  **
7391  *e // aim at the head of character "soldier-1".
7392  *e ch->aim_at_character("soldier-1",
7393  *e "cervical",
7394  *e 0.0,
7395  *e 0.0,
7396  *e 0.0);
7397  */
7398  int aim_at_character(const char* target_character_name,
7399  const char* target_character_link_name = NULL,
7400  float offset_tx = 0.0f,
7401  float offset_ty = 0.0f,
7402  float offset_tz = 0.0f);
7403 
7404  /*l
7405  *b Description:
7406  **
7407  ** This function terminates aiming started by the set_aim(),
7408  ** aim_at_point(), aim_at_point_local(), aim_at_angle(),
7409  ** aim_at_angle_local(), and aim_at_character() functions.
7410  */
7411  void end_aim();
7412 
7414  const char * get_aim_at_character();
7415 
7417  float get_aim_azimuth();
7418 
7420  float get_aim_elevation();
7421 
7422  /*l
7423  *b Description:
7424  **
7425  ** This function returns values that can be used to compute the
7426  ** character's weapon's trajectory, i.e. the mathematical ray that
7427  ** comes out of the end of the barrel.
7428  **
7429  *b Returns:
7430  **
7431  ** 1 if the character is aiming, 0 if not
7432  **
7433  *b Arguments:
7434  **
7435  *a muzzle_x, muzzle_y, muzzle_z - position of muzzle in meters from
7436  *a the origin
7437  *a far_x, far_y, far_z - position of end target in meters from the
7438  *a origin
7439  **
7440  ** Pass NULL for any values that are not needed.
7441  ** Note: values will be zero if the character isn't currently aiming
7442  */
7443  int get_aim_trajectory(float* muzzle_x, float* muzzle_y, float* muzzle_z,
7444  float* far_x, float* far_y, float* far_z);
7445 
7446  /*l
7447  *b Description:
7448  **
7449  ** Not all actions of a character will be affected by aim
7450  ** commands. This function returns 1 if this character
7451  ** is currently in an aim-able action.
7452  **
7453  *b Returns:
7454  **
7455  ** 1 if current action is aim-able; 0 if not
7456  */
7457  int get_aim_is_possible();
7458 
7459  /*l
7460  *b Returns:
7461  **
7462  ** 1 if the aim is acquired, 0 if not
7463  */
7464  int get_aim_is_acquired();
7465 
7466  /*l
7467  *b Returns:
7468  **
7469  ** 1 if all links participating in the aim have reached a
7470  ** relatively steady state, 0 if not, -1 on error
7471  */
7472  int get_aim_is_steady();
7473 
7474 
7475  /*l
7476  *b Returns:
7477  **
7478  ** 1 if character is currently aiming, 0 if not
7479  */
7480  int get_is_aiming();
7481 
7482 
7483  /******************************************************
7484  **
7485  *3 Aim Algorithm 8 Parameters
7486  **
7487  ** This aim algorithm works by adjusting the aiming character's pose
7488  ** such that the difference between the current aim angles and the
7489  ** desired aim angles is decreased each scenario tick.
7490  **
7491  ** How much of that difference that is made up each frame is
7492  ** determined by the factor parameters. The difference between the
7493  ** desired aim angles and the current aim angles, multiplied by a
7494  ** calculated factor, is added to the current aim angles each frame.
7495  ** This causes the aim to "home in" on the desired aim angles.
7496  **
7497  ** For example, if for each frame the calculated factor is 0.5, half
7498  ** of the difference between the desired and current aim angles is
7499  ** made up.
7500  **
7501  ** Unless otherwise specified, all functions callable from:
7502  **
7503  *- - C++
7504  *- - Script
7505  */
7506 
7507  /*l
7508  *b Description:
7509  **
7510  ** This function sets the steady-state factor that is used once
7511  ** an aim is no longer considered "new".
7512  **
7513  ** See the function set_aim_param_new_aim_duration() for information
7514  ** on when an aim is considered new, and how the effective acquire
7515  ** is calculated from this steady-state acquire factor and the
7516  ** new aim factor.
7517  **
7518  *b Arguments:
7519  **
7520  *a factor - unitless value between 0 and 1; default is 0.6
7521  */
7522  void set_aim_param_acquire_factor(float factor);
7523 
7524  /*l
7525  *b Returns:
7526  **
7527  ** the current aim acquire factor parameter
7528  */
7529  float get_aim_param_acquire_factor();
7530 
7531  /*l
7532  *b Description:
7533  **
7534  ** This function sets the factor that is used when an aim is
7535  ** considered new.
7536  **
7537  ** See the function set_aim_param_new_aim_duration() for information
7538  ** on when an aim is considered new, and how the effective acquire
7539  ** is calculated from this new aim factor and the steady-state acquire
7540  ** factor.
7541  **
7542  *b Arguments:
7543  **
7544  *a factor - unitless value between 0 and 1; default is 0.05
7545  */
7546  void set_aim_param_new_aim_factor(float factor);
7547 
7549  float get_aim_param_new_aim_factor();
7550 
7551  /*l
7552  *b Description:
7553  **
7554  ** This function sets how long an aim is considered "new".
7555  **
7556  ** When an aim is brand-new, the effective acquire factor is equal
7557  ** to the new aim factor as set by set_aim_param_new_aim_factor().
7558  ** When the new aim duration has expired, the effective acquire factor
7559  ** is equal to the steady-state acquire factor as set by
7560  ** set_aim_param_acquire_factor(). In between, the effective acquire
7561  ** factor moves smoothly between the two.
7562  **
7563  ** For example, say that the new aim factor is 0.1, the acquire factor
7564  ** is 0.5, and the new aim duration is 0.2 seconds.
7565  ** If a new aim is started, say by a call to aim_at_angle_local(),
7566  ** the effective acquire factor of the first frame will be 0.1. Over
7567  ** the next 0.2 seconds, the effective acquire factor will smoothly
7568  ** ramp up to 0.5, where it will stay until the aim is acquired.
7569  **
7570  *b Arguments:
7571  **
7572  *a duration - how long, in seconds, a new aim should be considered
7573  *a new; default is 1 second
7574  */
7575  void set_aim_param_new_aim_duration(float duration);
7576 
7578  float get_aim_param_new_aim_duration();
7579 
7580  /*l
7581  *b Description:
7582  **
7583  ** This function sets the maximum factor that can be used for any
7584  ** single frame for aim convergence attempts.
7585  **
7586  ** See set_aim_param_acquire_factor() for a discussion of why setting
7587  ** this too close to 1 is not recommended.
7588  **
7589  *b Arguments:
7590  **
7591  *a factor - unitless value between 0 and 1; default is 0.95
7592  */
7593  void set_aim_param_max_per_frame_adj_factor(float factor);
7594 
7596  float get_aim_param_max_per_frame_adj_factor();
7597 
7598  /*l
7599  *b Description:
7600  **
7601  ** This function sets how close the current aim azimuth must be to
7602  ** the desired aim azimuth in order for the aim to be considered
7603  ** acquired.
7604  **
7605  ** Note that the aim isn't fully acquired until both azimuth and
7606  ** elevation are acquired.
7607  **
7608  ** Setting this value too close to 0 will result in the aim never
7609  ** being acquired.
7610  **
7611  *b Arguments:
7612  **
7613  *a range - how close, in degrees, the azimuth must be for the
7614  *a aim to be acquired; default is 0.5 degrees
7615  */
7616  void set_aim_param_azimuth_acquired_range(float range);
7617 
7619  float get_aim_param_azimuth_acquired_range();
7620 
7621  /*l
7622  *b Description:
7623  **
7624  ** This function sets how close the current aim elevation must be to
7625  ** the desired aim elevation in order for the aim to be considered
7626  ** acquired.
7627  **
7628  ** Note that the aim isn't fully acquired until both azimuth and
7629  ** elevation are acquired.
7630  **
7631  ** Setting this value too close to 0 will result in the aim never
7632  ** being acquired.
7633  **
7634  *b Arguments:
7635  **
7636  *a range - how close, in degrees, the elevation must be for the
7637  *a aim to be acquired; default is 1.0 degrees
7638  */
7639  void set_aim_param_elevation_acquired_range(float range);
7640 
7642  float get_aim_param_elevation_acquired_range();
7643 
7644  /*l
7645  *b Description:
7646  **
7647  ** This function attempts to have the character reach its desired
7648  ** aim angles instantly, every frame.
7649  **
7650  ** Set enabled to 0 to disable instant aim convergence.
7651  **
7652  */
7653  void set_aim_converge_every_frame( int enabled );
7654 
7656  int get_aim_converge_every_frame();
7657 
7660  int set_aim_variable_interpolation_time(float time);
7661  float get_aim_variable_interpolation_time();
7662 
7663 /*****************************************************************************/
7667  const char* get_aim_at_link();
7669 
7671  int get_aim_at_link_offset(float* offset_x, float* offset_y, float* offset_z);
7672 
7674  const char* get_gaze_at_link();
7675 
7677  int get_gaze_at_link_offset(float* offset_x, float* offset_y, float* offset_z);
7678 
7679 /*****************************************************************************/
7689  /*l
7690  *b Description:
7691  **
7692  ** This function causes a character to fire his weapon.
7693  **
7694  ** Different weapons have different "munition types", which specify,
7695  ** among other things, the sound to be played, the network info to be
7696  ** sent, and muzzle flash effect. See
7697  ** get_weapon_muzzle_munition_type() for more information on munition
7698  ** types.
7699  **
7700  ** If the weapon fires live rounds (as set by
7701  ** set_weapon_fires_live_rounds()) this function also computes a
7702  ** bullet trajectory, perhaps hitting and killing another character.
7703  **
7704  ** This function will have no effect on a dead character (see
7705  ** die_now() and get_dead()).
7706  **
7707  *b Returns:
7708  **
7709  ** 0 on success, -1 on failure
7710  **
7711  *b Available as Decision Bead/Event
7712  */
7713  int fire_weapon(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
7714 
7715  /*l
7716  *b Description:
7717  **
7718  ** This function causes a character to fire his weapon the
7719  ** specified number of times. This causes a muzzle flash and
7720  ** the weapon's sound (if any) to be played.
7721  **
7722  ** The sound played will be one of, in order:
7723  **
7724  *- - the passed override_sound_name, or
7725  *- - the sound set by set_weapon_sound_override(), or
7726  *- - the default weapon sound based on the character's appearance
7727  **
7728  ** If the weapon fires live rounds (as set by
7729  ** set_weapon_fires_live_rounds()), this function also computes a
7730  ** trajectory for each round, perhaps hitting and killing
7731  ** another character.
7732  **
7733  ** This function will have no effect on a dead character (see
7734  ** die_now() and get_dead()).
7735  **
7736  *b Arguments:
7737  **
7738  *a count - number of times weapon should be fired
7739  *a override_sound_name - override sound to be played
7740  *a dt - time between firings if count > 1
7741  *a muzzle - muzzle on which flash should appear
7742  **
7743  *b Returns:
7744  **
7745  ** 0 on success, -1 on failure
7746  **
7747  *b Available as Decision Bead/Event
7748  */
7749  int fire_weapon_n_times(int count,
7750  float dt = 0.2f,
7751  const char* override_sound_name = NULL,
7753 
7754  /*l
7755  *b Description:
7756  **
7757  ** Fires a bullet at point (x, y) from the camera, using this
7758  ** character as the attacker.
7759  **
7760  *i Currently OpenGL only.
7761  **
7762  ** This function will have no effect on a dead character (see
7763  ** die_now() and get_dead()).
7764  **
7765  *b Returns:
7766  **
7767  ** number of hits
7768  */
7769  int fire_screen_space_bullet(diguyView* view, float x, float y);
7770 
7771  /*l
7772  *b Returns:
7773  **
7774  ** number of times weapon has been fired from specified muzzle
7775  **
7776  *b Available as Decision Bead/Event
7777  */
7778  int get_weapon_fire_count(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
7779 
7780  /*l
7781  *b Description:
7782  **
7783  ** This function sets the default muzzle that will flash when
7784  ** the character fires its weapon due to a call to fire_weapon()
7785  ** or fire_weapon_n_times().
7786  **
7787  ** The default value is DIGUY_MUZZLE_DEFAULT.
7788  **
7789  *b Arguments:
7790  **
7791  *a muzzle - the muzzle that will flash; muzzle 1 is common
7792  **
7793  *b Returns:
7794  **
7795  ** 0 on success, -1 on failure
7796  */
7797  int set_default_weapon_muzzle(diguyMuzzle muzzle);
7798 
7799  /*l
7800  *b Returns:
7801  **
7802  ** current default weapon muzzle that flashes when the character's
7803  ** weapon is fired; see set_default_weapon_muzzle()
7804  */
7805  diguyMuzzle get_default_weapon_muzzle();
7806 
7807  /*l
7808  *b Description:
7809  **
7810  ** When the character fires its weapon, the results depend on the
7811  ** munition type of the muzzle fired from. Munition types specify,
7812  ** among other things:
7813  **
7814  *- - sound played
7815  *- - muzzle flash effect
7816  *- - network data sent (DIS septet)
7817  *- - detonation effect
7818  *- - detonation radius
7819  *- - etc.
7820  **
7821  ** Default munition types for the each muzzle are set automatically
7822  ** when the character's appearance is set. The munition type of the
7823  ** weapon can be overridden by calling
7824  ** set_weapon_munition_type_override().
7825  **
7826  ** Current munition types include:
7827  **
7828  *- - m16
7829  *- - m4
7830  *- - m60
7831  *- - m240
7832  *- - m249
7833  *- - m9
7834  *- - hand_gun
7835  *- - 50cal
7836  *- - m256
7837  *- - ak47
7838  *- - pk74
7839  *- - dragunov
7840  *- - sa80
7841  *- - rpg
7842  *- - m203
7843  *- - 40mm_hedp
7844  *- - javelin
7845  *- - stinger
7846  *- - at4
7847  *- - sa7
7848  *- - molotov_cocktail
7849  *- - 60mm_mortar
7850  *- - 82mm_mortar
7851  *- - 155mm_artillery
7852  *- - IED_mortar
7853  *- - VBIED
7854  *- - m242
7855  *- - 120mm
7856  *- - 125mm
7857  *- - ced
7858  *- - pepper_spray
7859  **
7860  *b Returns:
7861  **
7862  ** munition type of specified muzzle
7863  */
7864  const char* get_weapon_muzzle_munition_type(diguyMuzzle muzzle);
7865 
7867  const char* get_weapon_supplemental_data_name();
7868 
7870  const char* get_default_muzzle_munition_type();
7871 
7872  /*l
7873  *b Description:
7874  **
7875  ** This function allows the default munition type to be overridden.
7876  ** The default value is NULL (don't override default munition type).
7877  **
7878  *b Arguments:
7879  **
7880  *a munition_type - name of a munition type
7881  **
7882  *b Returns:
7883  **
7884  ** 0 on success, -1 on failure
7885  */
7886  int set_weapon_munition_type_override(const char* munition_type);
7887 
7889  const char* get_weapon_munition_type_override();
7890 
7891  /*l
7892  *b Description:
7893  **
7894  ** This function sets whether the character's weapons fire live
7895  ** rounds. If so, when fire_weapon() and fire_weapon_n_times() are
7896  ** called the trajectory of the bullet will be calculated and checked
7897  ** against characters in the scenario.
7898  **
7899  ** The default value is 1.
7900  **
7901  *b Arguments:
7902  **
7903  *a weapon_fires_live_rounds - set to 1 for live rounds; set to 0
7904  *a for "blanks"
7905  **
7906  *b Returns:
7907  **
7908  ** 0 on success, -1 on failure
7909  **
7910  *b Available as Decision Bead/Event
7911  */
7912  int set_weapon_fires_live_rounds(int weapon_fires_live_rounds);
7913 
7914  /*l
7915  *b Returns:
7916  **
7917  ** current setting of whether weapon fires live rounds or blanks; see
7918  ** set_weapon_fires_live_rounds()
7919  **
7920  *b Available as Decision Bead/Event
7921  */
7922  int get_weapon_fires_live_rounds();
7923 
7924  /*l
7925  *b Description:
7926  **
7927  ** A weapon sound is played when the character fires its weapon
7928  ** due to a call to fire_weapon() or fire_weapon_n_times().
7929  ** The sound that is played is generally derived from the weapon's
7930  ** munition type, which can be different for each muzzle.
7931  **
7932  ** This function overrides the default sound that will be played.
7933  ** Note that this overrides the sound for all muzzles.
7934  **
7935  ** The default value is NULL (don't override default sound).
7936  **
7937  ** To *not* play a sound at all, set the weapon sound gain override
7938  ** to 0.
7939  **
7940  *b Arguments:
7941  **
7942  *a sound - name of a sound defined in the scenario;
7943  *a pass NULL to specify that default should be played
7944  **
7945  *b Returns:
7946  **
7947  ** 0 on success, -1 on failure
7948  */
7949  int set_weapon_sound_override(const char* sound_name);
7950 
7951  /*l
7952  *b Description:
7953  **
7954  ** The function returns the current weapon sound override, if one
7955  ** is set; see set_weapon_sound_override().
7956  **
7957  ** This function will not return NULL. The empty string ("") is
7958  ** returned if a weapon sound override is not set.
7959  **
7960  *b Returns:
7961  **
7962  ** name of weapon sound override
7963  */
7964  const char* get_weapon_sound_override();
7965 
7966  /*l
7967  *b Description:
7968  **
7969  ** This function overrides the default gain on the sound played
7970  ** due to a call to fire_weapon() or fire_weapon_n_times().
7971  **
7972  ** Pass 1.0 to use the sound's default amplitude. Lower numbers
7973  ** decrease volume, higher numbers increase volume.
7974  **
7975  ** Pass 0.0 to completely disable playing of weapon sound.
7976  **
7977  ** The default value is 3.0.
7978  **
7979  ** See set_weapon_sound_override().
7980  **
7981  *b Arguments:
7982  **
7983  *a sound_gain - amount by which to change sound volume
7984  **
7985  *b Returns:
7986  **
7987  ** 0 on success, -1 on failure
7988  */
7989  int set_weapon_sound_gain_override(float gain);
7990 
7992  float get_weapon_sound_gain_override();
7993 
7994  /*l
7995  *b Description:
7996  **
7997  ** This function provides aiming assistance by making it possible for
7998  ** roughly-aimed weapons to hit targets. When spread is nonzero,
7999  ** fire_weapon searches for a target within a conical space centered
8000  ** on the muzzle. Within this cone, the live character within weapon
8001  ** range, and with the smallest angular deviation from the weapon, is
8002  ** chosen, by default, as the target. Other function calls may alter
8003  ** this aiming behavior, making it aim only at enemy targets, for
8004  ** example, or making it prefer close targets to far ones.
8005  **
8006  *b Arguments:
8007  **
8008  *a spread - angular deviation from weapon muzzle within which a
8009  *a target will be found
8010  **
8011  ** Spread values above 145 are suicidal (character can shoot himself).
8012  ** 90 is the highest sensible value, which covers everything ahead
8013  ** of the weapon muzzle. A value of 0 is the default, meaning that
8014  ** only targets in line with the muzzle are hit.
8015  */
8016  void set_weapon_spread(float spread);
8017 
8018  /*l
8019  *b Description:
8020  **
8021  ** This function affects how targets are chosen when
8022  ** the character's weapon_spread is nonzero. Only
8023  ** characters more than near_range meters away from the muzzle
8024  ** will be fired upon. Characters which are closer than
8025  ** near_range meters will not be fired upon.
8026  **
8027  ** This value does not affect weapon behavior when weapon_spread
8028  ** is zero.
8029  **
8030  ** If this function is never called for a character, it is as if
8031  ** the function had been called with a value of zero.
8032  **
8033  *b Arguments:
8034  **
8035  *a near_range - distance closer than which no character will be
8036  *a targeted
8037  */
8038  void set_weapon_near_range(float near_range);
8039  float get_weapon_near_range();
8040 
8041  /*l
8042  *b Description:
8043  **
8044  ** This function sets the range of the character's
8045  ** weapon.
8046  **
8047  ** If this function is never called for a character, it is as if
8048  ** the function had been called with a value of 500.0.
8049  **
8050  *b Arguments:
8051  **
8052  *a far_range - range of the weapon in meters
8053  */
8054  void set_weapon_far_range(float far_range);
8055  float get_weapon_far_range();
8056 
8057  /*l
8058  *b Description:
8059  **
8060  ** This function sets a weapon's ratio of hits to fired rounds. A
8061  ** value of 1.0 (the default) means the weapon will hit everything it
8062  ** is aimed at. Values less than 1.0 cause the weapon to
8063  ** probabilistically miss targets, even when perfectly aimed at them.
8064  ** A value of zero means the weapon doesn't hit anything, even if it
8065  ** is perfectly aimed. A value of 0.5 will hit half of the time.
8066  */
8067  void set_weapon_hit_ratio(float hit_ratio);
8068 
8069  /*l
8070  *b Description:
8071  **
8072  ** This function sets the number of potential impacts a fired round
8073  ** can have. The default is 1. Specifying more than 1 means the
8074  ** round will completely go through objects, triggering a
8075  ** CALLBACK_ID_IMPACT callback each time, until the maximum number of
8076  ** impacts has been reached.
8077  */
8078  void set_weapon_max_impacts(int val);
8079 
8080  /*l
8081  *b Returns:
8082  **
8083  ** state of accessory1
8084  */
8085  int get_accessory1_state();
8086 
8087  /*l
8088  *b Returns:
8089  **
8090  ** state of the character's rifle
8091  */
8092  int get_rifle_state();
8093 
8094  /*l
8095  *b Description
8096  **
8097  ** This function sets whether the projectiles of certain appearances'
8098  ** weapons (such as rocket launchers and RPGs) are visible. Note that
8099  ** most weapons do not have visible projectiles and this function will
8100  ** therefore have no effect.
8101  **
8102  *b Arguments:
8103  **
8104  *a muzzle - which muzzle's projectile should be shown/hidden
8105  *a is_visible - pass 1 to show, pass 0 to hide
8106  **
8107  *b Returns:
8108  **
8109  ** 0 on success, -1 on failure
8110  */
8111  int set_weapon_projectile_is_visible(diguyMuzzle muzzle, int is_visible);
8112 
8113  /*l
8114  *b Description
8115  **
8116  ** This function returns the most recent setting of
8117  ** set_weapon_projectile_is_visible().
8118  **
8119  *b Arguments:
8120  **
8121  *a muzzle - which muzzle's projectile should be queried
8122  **
8123  *b Returns:
8124  **
8125  ** 1 if visible, 0 if not
8126  */
8127  int get_weapon_projectile_is_visible(diguyMuzzle muzzle);
8128 
8129  /*l
8130  *b Description:
8131  **
8132  ** Retrieves the position and direction of the character's weapon.
8133  **
8134  *b Arguments:
8135  **
8136  *a muzzle_tx, muzzle_ty, muzzle_tz - muzzle position, and beginning
8137  *a of aim vector
8138  *a end_pt_tx, end_pt_ty, end_pt_tz - end point of aim vector
8139  *a muzzle_rz, muzzle_rx, muzzle_ry - orientation of muzzle in degrees
8140  *a muzzle - the muzzle for which the aim vector is needed
8141  *a in_character_local_coordinates - pass 0 for values in world
8142  *a coordinates (the default), 1 for values in character-local
8143  *a coordinates
8144  **
8145  ** The muzzle position and end point are in meters from the origin
8146  ** (if using world coordinates) or in meters from the character's
8147  ** position (if using character-local coordinates).
8148  **
8149  ** The distance of the end point from the muzzle position should
8150  ** be the weapon's far range, set by set_weapon_far_range().
8151  **
8152  ** Pass NULL for any values that are not needed.
8153  **
8154  ** *Note:* The muzzle argument is currently not used, and is present
8155  ** for future implementation.
8156  **
8157  *b Returns:
8158  **
8159  ** 0 on success, -1 on failure
8160  */
8161  int get_weapon_aim_vector(float* muzzle_tx, float* muzzle_ty, float* muzzle_tz,
8162  float* end_pt_tx = NULL, float* end_pt_ty = NULL, float* end_pt_tz = NULL,
8163  float* muzzle_rz = NULL, float* muzzle_rx = NULL, float* muzzle_ry = NULL,
8164  int in_character_local_coordinates = 0,
8166 
8167  /*l
8168  *b Description
8169  **
8170  ** This function returns the link the passed muzzle is associated
8171  ** with. For example, soldier rifle muzzles are attached to the
8172  ** "rifle_joint" link.
8173  **
8174  ** Call get_muzzle_offset() to get the offset of the muzzle on this
8175  ** link.
8176  **
8177  *b Arguments:
8178  **
8179  *a muzzle - muzzle of interest
8180  **
8181  *b Returns:
8182  **
8183  ** name of link, or NULL if the character doesn't have the specified
8184  ** muzzle
8185  */
8186  const char* get_muzzle_link(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
8187 
8188  /*l
8189  *b Description
8190  **
8191  ** This function returns the offset of the muzzle from the link it
8192  ** is attached to as returned by get_muzzle_link().
8193  **
8194  *b Arguments:
8195  **
8196  *a muzzle - muzzle of interest
8197  *a offset_x, offset_y, offset_z - variables in which to return results
8198  **
8199  *b Returns:
8200  **
8201  ** 0 on success, -1 on failure
8202  */
8203  int get_muzzle_offset(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT,
8204  float* offset_x = NULL,
8205  float* offset_y = NULL,
8206  float* offset_z = NULL);
8207 
8208  /*l
8209  *b Description
8210  **
8211  ** This function sets the highest horizontal error possible when the
8212  ** weapon is fired. If non-0, a random horizontal error angle will
8213  ** be computed and added to the weapon's horizontal aim angle.
8214  **
8215  *b Arguments:
8216  **
8217  *a h_error - highest possible horizontal error
8218  **
8219  *b Returns:
8220  **
8221  ** 0 on success, -1 on failure
8222  */
8223  int set_weapon_max_azimuth_error(float h_error);
8224 
8226  float get_weapon_max_azimuth_error();
8227 
8228  /*l
8229  *b Description:
8230  **
8231  ** Similar to set_weapon_max_azimuth_error(), but for vertical aim.
8232  */
8233  int set_weapon_max_elevation_error(float v_error);
8234 
8236  float get_weapon_max_elevation_error();
8237 
8238  /*l
8239  *b Description
8240  **
8241  ** This function sets whether tracer effects will be shown when
8242  ** the weapon is fired. Not all weapons will support this effect.
8243  **
8244  *b Arguments:
8245  **
8246  *a enabled - pass 1 to enable, 0 to disable
8247  **
8248  *b Returns:
8249  **
8250  ** 0 on success, -1 on failure
8251  */
8252  int set_weapon_tracers_enabled(int enabled);
8253 
8255  int get_weapon_tracers_enabled();
8256 
8257  /*l
8258  *b Returns:
8259  **
8260  ** number of rounds until next tracer
8261  */
8262  int get_weapon_rounds_until_tracer(diguyMuzzle muzzle);
8263 
8264 
8265  /*l
8266  *b Description:
8267  **
8268  ** Similar to diguyScenario::trigger_detonation(), but detonation
8269  ** occurs at character's position.
8270  **
8271  *b Arguments:
8272  **
8273  *a munition_name - name of the munition to detonate
8274  *a attacker_name - this MUST be specified if the detonation is being
8275  *a broadcast over the network
8276  *a radius_override - defaults to the data in the munition config file
8277  *a broadcast_on_network - pass 0 to not broadcast detonation on DIS
8278  *a network
8279  **
8280  ** Note: Overriding the detonation radius will NOT work on broadcast
8281  ** detonations since the override value is not transmitted.
8282  */
8283  int trigger_detonation_on_character(const char* munition_name,
8284  const char* attacker_name = NULL,
8285  float radius_override = -1.0f,
8286  int broadcast_on_network = 1);
8287 
8288 
8289 /*****************************************************************************/
8300  /*l
8301  *b Description:
8302  **
8303  ** This function changes the face of the character to reflect the
8304  ** specified user-defined named facial expression.
8305  **
8306  ** Currently affects only "facefx" appearances.
8307  **
8308  *b Arguments:
8309  **
8310  *a facex_name - name of face expression to be applied
8311  *a blend_duration - how long (in seconds) to take to change the face
8312  *a strength - a multiplier between 0 and 1 on the expression
8313  **
8314  ** Face expressions available by default in new scenarios are:
8315  **
8316  *- - Neutral
8317  *- - Smile_cl
8318  *- - Trust
8319  *- - Sad
8320  *- - Mad
8321  *- - Distrust
8322  *- - Conniving
8323  *- - Smile
8324  *- - BrowsDown
8325  *- - BrowsUp
8326  **
8327  ** New face expressions can be added using the
8328  ** diguyScenario::create_face_expression() function.
8329  **
8330  *b Returns:
8331  **
8332  ** 0 on success, -1 on failure
8333  **
8334  *b Available as Decision Bead/Event
8335  **
8336  *b C++ Example:
8337  **
8338  *e diguyCharacter* ch = scenario->get_character_at_index(0);
8339  *e
8340  *e // take one second to get mad
8341  *e ch->set_face_expression("Mad", 1.0);
8342  */
8343  int set_face_expression(const char* facex_name, float blend_duration, float strength = 1.0f);
8344 
8345  /*l
8346  *b Description:
8347  **
8348  ** This function sets the current azimuth and elevation of the
8349  ** character's eyes.
8350  **
8351  ** Currently affects only "facefx" appearances.
8352  **
8353  *b Arguments:
8354  **
8355  *a azimuth - rotation about up (vertical) axis, in degrees;
8356  *a positive rotates to character's left
8357  *a elevation - rotation about forward (horizontal) axis, in degrees;
8358  *a positive rotates down
8359  *a blend_time - how long to take to reach new orientation
8360  **
8361  *b Returns:
8362  **
8363  ** 0 on success, -1 on failure
8364  **
8365  */
8366  int set_orientation_eyes(float azimuth,
8367  float elevation,
8368  float blend_time = 0.0f);
8369 
8370  /*l
8371  *b Description:
8372  **
8373  ** This function gets the current azimuth and elevation of the
8374  ** character's eyes. It currently doesn't take blending into account.
8375  **
8376  ** Currently affects only "facefx" appearances.
8377  **/
8378  int get_orientation_eyes(float* azimuth, float* elevation);
8379 
8380  /*l
8381  *b Description:
8382  **
8383  ** Sets how open the eyes are. The eyes will stay at this level
8384  ** indefinitely. To get automatic blinking behavior, call blink().
8385  **
8386  *b Arguments:
8387  **
8388  *a droop_amount - 1 = eyes closed, 0 = eyes open, 0.5 = half open
8389  **
8390  *b Returns:
8391  **
8392  ** 0 on success, -1 on failure
8393  **
8394  *b Available as Decision Bead/Event
8395  */
8396  int set_eye_droop(float droop_amount, float blend_time = 0.0f);
8397 
8399  float get_eye_droop();
8400 
8401  /*l
8402  *b Description:
8403  **
8404  ** This function blinks the eyes. To have the eyes close to a
8405  ** specific amount and stay there, call set_eye_droop().
8406  **
8407  ** Only characters with expressive face appearances can blink.
8408  **
8409  *b Arguments:
8410  **
8411  *a duration_in - how long in seconds the first part of the blink
8412  *a (typically eyes closing) should take
8413  *a duration_out - how long in seconds the second part of the blink
8414  *a (typically eyes opening) should take
8415  *a target_in - how closed the eyes should be at duration_in
8416  *a target_out - how open the eyes should be at duration_out and
8417  *a thereafter
8418  *a tin - time at which blink should occur; default is now
8419  **
8420  *b Returns:
8421  **
8422  ** 0 on success, -1 on failure
8423  **
8424  *b Available as Decision Bead/Event
8425  */
8426  int blink(float duration_in = 0.1f,
8427  float duration_out = 0.2f,
8428  float target_in = 1.0f,
8429  float target_out = 0.0f,
8430  float tin = DIGUY_DEFAULT_FLOAT);
8431 
8432  /*l
8433  *b Description:
8434  **
8435  ** This function enables automatic eye blinking, so that blinks
8436  ** will happen without further function calls. The various
8437  ** controlling factors of blinks are set by the following functions:
8438  **
8439  *- - set_automatic_blink_duration_in()
8440  *- - set_automatic_blink_duration_out()
8441  *- - set_automatic_blink_target_in()
8442  *- - set_automatic_blink_target_out()
8443  **
8444  ** See blink() for information on what these factors mean.
8445  **
8446  ** Only characters with expressive face appearances can blink.
8447  **
8448  *b Arguments:
8449  **
8450  *a enabled - pass 1 to enable automatic blinks; 0 to disable
8451  *a period - how many seconds between each blink
8452  *a period_variation - variation on how many seconds between
8453  *a each blink
8454  **
8455  ** If blinks are enabled, the first blink will happen immediately.
8456  ** Successive blinks will happen between times (period -
8457  ** period_variation) and (period + period_variation) after the
8458  ** previous blink ends.
8459  **
8460  *b Returns:
8461  **
8462  ** 0 on success, -1 on failure
8463  **
8464  *b Available as Decision Bead/Event
8465  */
8466  int set_automatic_blinks_enabled(int enabled,
8467  float period = 6.0f,
8468  float period_variation = 3.0f);
8469 
8471  int get_automatic_blinks_enabled();
8472 
8473  /*l
8474  *b Description:
8475  **
8476  ** This function sets how long it will take the eye to close during
8477  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8478  ** blink().
8479  **
8480  *b Arguments:
8481  **
8482  *a duration_in - time in seconds for eye droop to go from droop
8483  *a target in to target out
8484  **
8485  *b Available as Decision Bead/Event
8486  */
8487  void set_automatic_blink_duration_in(float duration_in);
8488 
8490  float get_automatic_blink_duration_in();
8491 
8492  /*l
8493  *b Description:
8494  **
8495  ** This function sets how long it will take the eye to open during
8496  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8497  ** blink().
8498  **
8499  *b Arguments:
8500  **
8501  *a duration_out - time in seconds for eye droop to go from droop
8502  *a target out to target in
8503  **
8504  *b Available as Decision Bead/Event
8505  */
8506  void set_automatic_blink_duration_out(float duration_out);
8507 
8509  float get_automatic_blink_duration_out();
8510 
8511  /*l
8512  *b Description:
8513  **
8514  ** This function sets how much the eye will close during
8515  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8516  ** blink().
8517  **
8518  *b Arguments:
8519  **
8520  *a target_in - how far to close eye; 1.0 is all closed, 0.0 is
8521  *a all open
8522  **
8523  *b Available as Decision Bead/Event
8524  */
8525  void set_automatic_blink_target_in(float target_in);
8526 
8528  float get_automatic_blink_target_in();
8529 
8530  /*l
8531  *b Description:
8532  **
8533  ** This function sets how much the eye will open during
8534  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8535  ** blink().
8536  **
8537  *b Arguments:
8538  **
8539  *a target_out - how far to open eye; 1.0 is all closed, 0.0 is
8540  *a all open
8541  **
8542  *b Available as Decision Bead/Event
8543  */
8544  void set_automatic_blink_target_out(float target_out);
8545 
8547  float get_automatic_blink_target_out();
8548 
8549  /*l
8550  *b Returns:
8551  **
8552  ** 1 if the character is speaking, 0 if not. With a FaceFX character
8553  ** this is true if a character is actively playing a FaceFX animation
8554  */
8555  int is_speaking();
8556 
8557  /*l
8558  *b Description:
8559  **
8560  ** FaceFX animations are referred to as a group/animation name.
8561  ** This function allows you to set the current group once.
8562  ** See diguyScenario::facefx_mount_animset() for how to load a new
8563  ** animset on an actor.
8564  */
8565  int set_current_facefx_animation_group(const char* anim_group);
8566 
8567  /*l
8568  *b Returns:
8569  **
8570  ** the current FaceFX animation group set for this character
8571  */
8572  const char* get_current_facefx_animation_group();
8573 
8574  /*l
8575  *b Returns:
8576  **
8577  ** the name of the FaceFX actor that goes with the current head
8578  ** appearance; returns NULL if there's no FaceFX actor
8579  */
8580  const char* get_facefx_actor();
8581 
8582  /*l
8583  *b Description:
8584  **
8585  ** Mounts an animset on the current FaceFX actor. See also
8586  ** diguyScenario::facefx_mount_animset()
8587  */
8588  int facefx_mount_animset(const char* file_name);
8589 
8590  /*l
8591  *b Description:
8592  **
8593  ** Plays a FaceFX animation. This is the main way a facial animation
8594  ** sequence is triggered. The animation can be named
8595  ** "group_name/animation" or just "animation" if the proper group has
8596  ** been set with set_current_facefx_animation_group().
8597  */
8598  int play_facefx_animation(const char* animation,
8599  float magnitude_scale = 1.0f,
8600  float duration_scale = 1.0f,
8601  float blendin_time = 0.1f,
8602  float blendout_time = 0.1f,
8603  int loop = 0);
8604 
8605  /*l
8606  *b Description:
8607  **
8608  ** Stops all active FaceFX animations.
8609  */
8610  int stop_facefx_animations(float blend_time = 0.25f, int stop_sounds = 1);
8611 
8612  /*****************************************************************************/
8617  /*l
8618  *b Returns:
8619  **
8620  ** the number of nodes in the FaceFX actor's face graph
8621  */
8622  int get_num_facefx_nodes();
8623 
8624  /*l
8625  *b Returns:
8626  **
8627  ** the name of the node with index 'index' in the FaceFX actor's face
8628  ** graph
8629  */
8630  const char* get_facefx_node_name(int index);
8631 
8632  /*l
8633  *b Returns:
8634  **
8635  ** the index of the node with name 'node_name'
8636  */
8637  int find_facefx_node_index(const char* node_name);
8638 
8639  /*l
8640  *b Description:
8641  **
8642  ** Allows low level control of individual nodes of the characters face
8643  ** graph. End users can use this function to get finer grained
8644  ** control over eye direction and emotional state.
8645  */
8646  int set_facefx_node_value(int node_index,
8647  float value,
8648  float blend_time = 0.25f);
8649 
8650  /*l
8651  *b Description:
8652  **
8653  ** Retrieves the current final value of a node
8654  **/
8655  float get_facefx_node_value(int node_index);
8656 
8657 /*****************************************************************************/
8701  /*l
8702  *b Description:
8703  **
8704  ** This function creates (but does not begin) the specified gesture.
8705  ** Exact control over the gesture, such as number of repetitions,
8706  ** when the gesture should begin, when it should end, when it
8707  ** should reach specific points within the gestures, etc., is then
8708  ** possible by making calls through the returned
8709  ** diguyCharacterGesture object.
8710  **
8711  ** To begin execution of the gesture, call the begin_now() function
8712  ** of the diguyCharacterGesture object.
8713  **
8714  ** *Do not* call delete on the returned object. It should be
8715  ** destroyed either by calling destroy_gesture(), or by calling
8716  ** set_automatic_destroy_flag(1) on the diguyCharacterGesture
8717  ** object.
8718  **
8719  *b Arguments:
8720  **
8721  *a gesture_name - name of the gesture of create
8722  **
8723  *b Returns:
8724  **
8725  ** pointer to object of type diguyCharacterGesture
8726  */
8727  diguyCharacterGesture* create_gesture(const char* gesture_name);
8728 
8729  /*l
8730  *b Description:
8731  **
8732  ** This function destroys a gesture object created by
8733  ** create_gesture().
8734  **
8735  *b Arguments:
8736  **
8737  *a gesture - gesture to destroy
8738  **
8739  *b Returns:
8740  **
8741  ** 0 on success, -1 on failure
8742  */
8743  int destroy_gesture(diguyCharacterGesture* gesture);
8744 
8745  /*l
8746  *b Description:
8747  **
8748  ** This function executes the specified gesture or motion file on disk.
8749  **
8750  ** The gesture will automatically begin and end. The only control
8751  ** over the executed gesture is whether is should be ended or aborted
8752  ** early. See end_executing_gesture() and abort_executing_gesture().
8753  ** For full control of gesture attributes, use create_gesture()
8754  ** instead.
8755  **
8756  ** A gesture takes over control of a subset of a character's pose
8757  ** variables and can be overlaid on top of most base actions of the
8758  ** character.
8759  **
8760  ** Note that gestures should be preloaded at the beginning of a
8761  ** scenario to avoid a hitch in frame rate. See the function
8762  ** diguyScenario::preload_gesture().
8763  **
8764  ** This function will have no effect on a dead character (see
8765  ** die_now() and get_dead()).
8766  **
8767  *b Arguments:
8768  **
8769  *a gesture_name - name of the gesture to execute, as of diguy 13.2 this can be
8770  *a a bdm file, and a full body gesture will be created on the fly.
8771  *a reps - how many times the gesture should be
8772  *a repeated; default is 1 if no duration
8773  *a is specified, or best fit if there is
8774  *a a duration specified
8775  *a overall_duration - for how long the gesture should be executed;
8776  *a default is such that no time scaling occurs
8777  *a channel_A_weight - the weight given to channel A of the
8778  *a gesture; ignored if the gesture does not
8779  *a have multiple channels
8780  **
8781  ** If the gesture is a multi-stage gesture, the overall duration
8782  ** will be spread proportionately over each stage.
8783  **
8784  *b Returns:
8785  **
8786  ** 0 on success, -1 on failure
8787  **
8788  *b Available as Decision Bead/Event
8789  */
8790  int execute_gesture(const char* gesture_name,
8791  int reps = DIGUY_DEFAULT_INT,
8792  float overall_duration = DIGUY_DEFAULT_FLOAT,
8793  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8794 
8795  /*l
8796  *b Description:
8797  **
8798  ** The gesture will automatically begin and end. The only control
8799  ** over the executed gesture is whether is should be ended or aborted
8800  ** early. See end_executing_gesture() and abort_executing_gesture().
8801  ** For full control of gesture attributes, use create_gesture()
8802  ** instead.
8803  **
8804  ** If the specified gesture is not a 1 stage gesture, no gesture
8805  ** is executed and an error value is returned.
8806  **
8807  ** The specified gesture can be a one or two channel 1 stage gesture,
8808  ** in which case the specified channel weight will be used over the
8809  ** course of the entire gesture.
8810  **
8811  ** A 1 stage gesture is a comprised of a single motion that begins
8812  ** and ends the gesture.
8813  **
8814  ** n repetitions of a 1 stage gesture will repeat the stage 1
8815  ** motion n times.
8816  **
8817  ** This function will have no effect on a dead character (see
8818  ** die_now() and get_dead()).
8819  **
8820  *b Arguments:
8821  **
8822  *a gesture_name - name of the gesture of execute
8823  *a reps - how many times the gesture should be
8824  *a repeated; default is 1 if no duration
8825  *a is specified, or best fit if there is
8826  *a a duration specified
8827  *a stage1_duration - how long stage 1 of the gesture should take;
8828  *a default is such that no time scaling occurs
8829  *a channel_A_weight - the weight given to channel A of the
8830  *a gesture; ignored if the gesture does not
8831  *a have multiple channels
8832  **
8833  *b Returns:
8834  **
8835  ** 0 on success, -1 on failure
8836  */
8837  int execute_1stage_gesture(const char* gesture_name,
8838  int reps = DIGUY_DEFAULT_INT,
8839  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8840  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8841 
8842  /*l
8843  *b Description:
8844  **
8845  ** This function is similar to execute_1stage_gesture().
8846  **
8847  ** Stage 1 of a 2 stage gesture is a motion that begins the gesture
8848  ** and leads to the "peak" of the gesture.
8849  **
8850  ** Stage 2 of a 2 stage gesture is the motion that returns the
8851  ** gesture from the "peak" to the starting position.
8852  **
8853  ** n repetitions of a 2 stage gesture will repeat the stage 1 motion
8854  ** followed by the stage 2 motion n times.
8855  **
8856  ** This function will have no effect on a dead character (see
8857  ** die_now() and get_dead()).
8858  **
8859  *b Arguments:
8860  **
8861  *a gesture_name - name of the gesture of execute
8862  *a reps - how many times the gesture should be
8863  *a repeated; default is 1 if no duration
8864  *a is specified, or best fit if there is
8865  *a a duration specified
8866  *a stage1_duration - how long stage 1 of the gesture should take,
8867  *a i.e., how far into the gesture the "peak"
8868  *a will occur;
8869  *a default is such that no time scaling occurs
8870  *a stage2_duration - how long stage 2 of the gesture should take;
8871  *a default is such that no time scaling occurs
8872  *a channel_A_weight - the weight given to channel A of the
8873  *a gesture; ignored if the gesture does not
8874  *a have multiple channels
8875  **
8876  *b Returns:
8877  **
8878  ** 0 on success, -1 on failure
8879  */
8880  int execute_2stage_gesture(const char* gesture_name,
8881  int reps = DIGUY_DEFAULT_INT,
8882  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8883  float stage2_duration = DIGUY_DEFAULT_FLOAT,
8884  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8885 
8886  /*l
8887  *b Description:
8888  **
8889  ** This function is similar to execute_1stage_gesture().
8890  **
8891  ** Stage 1 of a 3 stage gesture is a motion that begins the gesture
8892  ** and leads to stage 2; e.g., raising the right arm in preparation
8893  ** for waving.
8894  **
8895  ** Stage 2 of a 3 stage gesture is a motion that can loop
8896  ** indefinitely; e.g., waving the right arm back and forth.
8897  **
8898  ** Stage 3 of a 3 stage gesture is the motion that ends the gesture;
8899  ** e.g., returning the right arm to the side of the body to complete
8900  ** the wave.
8901  **
8902  ** n repetitions of a 3 stage gesture will play the stage 1 motion
8903  ** once, followed by n reps of the stage 2 motion, followed by 1
8904  ** stage 3 motion.
8905  **
8906  ** This function will have no effect on a dead character (see
8907  ** die_now() and get_dead()).
8908  **
8909  *b Arguments:
8910  **
8911  *a gesture_name - name of the gesture of execute
8912  *a reps - how many times the gesture should be
8913  *a repeated; default is 1 if no duration
8914  *a is specified, or best fit if there is
8915  *a a duration specified
8916  *a stage1_duration - how long stage 1 of the gesture should take;
8917  *a default is such that no time scaling occurs
8918  *a stage2_duration - how long each repetition of stage 2 of the
8919  *a gesture should take;
8920  *a default is such that no time scaling occurs
8921  *a stage3_duration - how long stage 3 of the gesture should take;
8922  *a default is such that no time scaling occurs
8923  *a channel_A_weight - the weight given to channel A of the
8924  *a gesture; ignored if the gesture does not
8925  *a have multiple channels
8926  **
8927  *b Returns:
8928  **
8929  ** 0 on success, -1 on failure
8930  */
8931  int execute_3stage_gesture(const char* gesture_name,
8932  int reps = DIGUY_DEFAULT_INT,
8933  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8934  float stage2_duration = DIGUY_DEFAULT_FLOAT,
8935  float stage3_duration = DIGUY_DEFAULT_FLOAT,
8936  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8937 
8938  /*l
8939  *b Description:
8940  **
8941  ** The gesture will automatically begin and end. The only control
8942  ** over the executed gesture is whether is should be ended or aborted
8943  ** early. See end_executing_gesture() and abort_executing_gesture().
8944  ** For full control of gesture attributes, use create_gesture()
8945  ** instead.
8946  **
8947  ** This function serves as a quick way of executing a table gesture.
8948  ** There are many capabilities of table gestures that are accessible
8949  ** only through the full diguyCharacterGesture object.
8950  **
8951  ** If the specified gesture is not a table gesture, no gesture is
8952  ** executed and an error value is returned.
8953  **
8954  ** A table stage gesture is a comprised of a table of gesture actions
8955  ** that can be transitioned between without going through a neutral
8956  ** position.
8957  **
8958  ** n repetitions of a table gesture will repeat the loop action
8959  ** n times.
8960  **
8961  ** This function will have no effect on a dead character (see
8962  ** die_now() and get_dead()).
8963  **
8964  *b Arguments:
8965  **
8966  *a gesture_name - name of the gesture of execute
8967  *a reps - how many times the gesture should be repeated;
8968  *a default is 1
8969  *a loop_action - which action in the gesture should be looped;
8970  *a default is action at index 1 of table
8971  *a begin_action - which action the gesture should begin from;
8972  *a default is action at index 0
8973  *a end_action - which action the gesture should end at;
8974  *a default is action at index 0
8975  **
8976  *b Returns:
8977  **
8978  ** 0 on success, -1 on failure
8979  */
8980  int execute_table_gesture(const char* gesture_name,
8981  int reps = DIGUY_DEFAULT_INT,
8982  const char* loop_action = NULL,
8983  const char* begin_action = NULL,
8984  const char* end_action = NULL);
8985 
8986  /*l
8987  *b Description:
8988  **
8989  ** Executes the given gesture and performs the given action as a table action.
8990  **
8991  *b Arguments:
8992  **
8993  *a gesture_name - name of the gesture to execute
8994  *a desired_action - name of table action to perform
8995  **
8996  *b Returns:
8997  **
8998  ** 0 on success, -1 on failure
8999  **
9000  **/
9001  int set_executing_table_gesture_desired_action(const char* gesture_name,
9002  const char* desired_action);
9003 
9004  /*l
9005  *b Description:
9006  **
9007  ** This function alerts the specified gesture that it should end.
9008  ** The gesture will stop repeating and play its "out" motions as
9009  ** soon as possible.
9010  **
9011  ** In order to immediately stop the gesture, use the
9012  ** abort_executing_gesture() function.
9013  **
9014  *b Arguments:
9015  **
9016  *a gesture_name - name of executing gesture to end
9017  **
9018  *b Returns:
9019  **
9020  ** 0 on success, -1 on failure
9021  **
9022  *b See Also:
9023  **
9024  ** abort_executing_gesture()
9025  */
9026  int end_executing_gesture(const char* gesture_name);
9027 
9028  /*l
9029  *b Description:
9030  **
9031  ** This function aborts a gesture previously executed by one of
9032  ** the execute_*_gesture() calls, if it is currently executing.
9033  ** If a gesture with the given name is not executing, this function
9034  ** will have no effect.
9035  **
9036  ** This call won't cause the gesture to switch to its "out" motion;
9037  ** it is a straight-forward blend out of whatever the gesture is
9038  ** currently doing. Use the end_executing_gesture() call to make
9039  ** the gesture play its "out" motion as soon as possible,
9040  ** therefore ending the gesture in a smoother way.
9041  **
9042  *b Arguments:
9043  **
9044  *a gesture_name - name of executing gesture to abort
9045  *a max_rampdown_interval - max amount of time spent trying to
9046  *a smooth over any motion seams; set
9047  *a to 0.5 for a smooth transition, set
9048  *a to 0 for an immediate abort
9049  **
9050  *b Returns:
9051  **
9052  ** 0 on success, -1 on failure
9053  **
9054  *b See Also:
9055  **
9056  ** end_executing_gesture(), abort_all_gestures()
9057  */
9058  int abort_executing_gesture(const char* gesture_name,
9059  float max_rampdown_interval = .5f);
9060 
9061  /*l
9062  *b Description:
9063  **
9064  ** This function alerts all active gestures that they should end.
9065  ** The gestures will stop repeating and play their "out" motions as
9066  ** soon as possible.
9067  **
9068  ** In order to immediately stop all gestures, use the
9069  ** abort_all_gestures() function.
9070  **
9071  *b Returns:
9072  **
9073  ** 0 on success, -1 on failure
9074  **
9075  *b See Also:
9076  **
9077  ** abort_all_gestures(), diguyCharacterGesture::end_gesture()
9078  */
9079  int end_all_gestures();
9080 
9081  /*l
9082  *b Description:
9083  **
9084  ** This function aborts all active gestures. All gestures will
9085  ** immediately begin to lose their effect on the
9086  ** character's pose.
9087  **
9088  ** This won't cause the gestures to switch to their "out" motions;
9089  ** it is a straight-forward blend out of whatever the gesture is
9090  ** currently doing. Use the end_all_gestures() call to make all
9091  ** active gestures play their "out" motions as soon as possible,
9092  ** therefore ending the gestures in a smoother way.
9093  **
9094  *b Arguments:
9095  **
9096  *a max_rampdown_interval - max amount of time spent trying to
9097  *a smooth over any motion seams; set
9098  *a to 0.5 for a smooth transition, set
9099  *a to 0 for an immediate abort
9100  **
9101  *b Returns:
9102  **
9103  ** 0 on success, -1 on failure
9104  **
9105  *b See Also:
9106  **
9107  ** end_all_gestures(), diguyCharacterGesture::abort_now()
9108  */
9109  int abort_all_gestures(float max_rampdown_interval);
9110 
9111 
9112 /*****************************************************************************/
9144  /*l
9145  *b Description:
9146  **
9147  ** This function will play the specified sound. The sound will be
9148  ** "ambient"; i.e., it will be equally audible from everywhere within
9149  ** the world. Use the function play_3d_sound() to play a sound that
9150  ** moves with the character.
9151  **
9152  ** This function will have no effect on a dead character (see
9153  ** die_now() and get_dead()).
9154  **
9155  ** Unless the sound loops, the sound will play to completion and then
9156  ** stop. To stop the sound early or stop a looping sound call
9157  ** diguyCharacter::stop_all_sounds() or diguyCharacter::stop_sound().
9158  **
9159  *b Arguments
9160  **
9161  *a sound_name - name of sound to play
9162  *a sound_gain - by how much sound's amplitude should be multiplied
9163  *a sound_loop - indicates that sound should loop indefinitely
9164  **
9165  ** There must be a diguySound in the scenario with the passed
9166  ** sound_name. See diguyScenario::create_sound().
9167  **
9168  ** See set_current_voice_actor() for information on how a voice actor
9169  ** can change which sound in the scenario is selected.
9170  **
9171  *b Returns:
9172  **
9173  ** 0 on success, -1 on failure
9174  **
9175  *b Available as Decision Bead/Event
9176  */
9177  int play_sound(const char* sound_name,
9178  float sound_gain = 1.0f,
9179  int sound_loops = 0);
9180 
9181  /*l
9182  *b Description:
9183  **
9184  ** This function will play the specified sound at the character's
9185  ** location. As the character moves, the sound will move with it.
9186  ** Use the function play_sound() to play a sound that is ambient and
9187  ** does not move with the character.
9188  **
9189  ** Note that not all sound modules support 3D sounds.
9190  **
9191  ** This function will have no effect on a dead character (see
9192  ** die_now() and get_dead()).
9193  **
9194  ** Unless the sound loops, the sound will play to completion and then
9195  ** stop. To stop the sound early or stop a looping sound call
9196  ** diguyCharacter::stop_all_sounds() or diguyCharacter::stop_sound().
9197  **
9198  *b Arguments
9199  **
9200  *a sound_name - the name of the sound to play
9201  *a sound_gain - by how much the sound's amplitude
9202  *a should be multiplied
9203  *a sound_loop - indicates that the sound should loop
9204  *a indefinitely
9205  **
9206  ** There must be a diguySound in the scenario with the passed
9207  ** sound_name. See diguyScenario::create_sound().
9208  **
9209  ** See set_current_voice_actor() for information on how a voice actor
9210  ** can change which sound in the scenario is selected.
9211  **
9212  *b Returns:
9213  **
9214  ** 0 on success, -1 on failure
9215  **
9216  *b Available as Decision Bead/Event
9217  */
9218  int play_3d_sound(const char* sound_name,
9219  float sound_gain = 1.0f,
9220  int sound_loops = 0);
9221 
9222  /*l
9223  *b Description:
9224  **
9225  ** This function creates (but does not start playing) an instance of
9226  ** the specified sound.
9227  **
9228  ** Exact control over the sound instance is possible by making calls
9229  ** through the returned diguySoundInstance object.
9230  **
9231  ** To begin playing the sound, call diguySoundInstance::begin_now().
9232  **
9233  ** *Do not* call delete on the returned object. It should be
9234  ** destroyed either by calling diguyCharacter::destroy_sound_instance()
9235  ** or by calling diguySoundInstance::set_automatic_destroy_flag(1) on
9236  ** the returned object.
9237  **
9238  *b Arguments:
9239  **
9240  *a sound_name - name of the sound for which to create an instance
9241  **
9242  ** There must be a diguySound in the scenario with the passed
9243  ** sound_name. See diguyScenario::create_sound().
9244  **
9245  *b Returns:
9246  **
9247  ** pointer to object of type diguySoundInstance
9248  */
9249  diguySoundInstance* create_sound_instance(const char* sound_name);
9250 
9251  /*l
9252  *b Description:
9253  **
9254  ** This function destroys a sound instance object created by
9255  ** create_sound_instance().
9256  **
9257  ** Do not destroy a sound for which the
9258  ** diguySoundInstance::set_automatic_destroy_flag(1) has been called.
9259  **
9260  *b Arguments:
9261  **
9262  *a sound_instance - sound instance to destroy
9263  **
9264  *b Returns:
9265  **
9266  ** 0 on success, -1 on failure
9267  */
9268  int destroy_sound_instance(diguySoundInstance* sound_instance);
9269 
9270  /*l
9271  *b Description:
9272  **
9273  ** This function stops all active sound instances from this character.
9274  ** All sounds being played by this character will fade out and stop
9275  ** after rampdown_time, by default fade out is instant.
9276  **
9277  ** Sound instances that are automatically managed will be destroyed.
9278  ** This includes sound started by a call to
9279  ** diguyCharacter::play_sound() or a sound instance whose
9280  ** set_automatic_destroy_flag() function has been called.
9281  **
9282  ** diguySoundInstance pointers returned by a call to
9283  ** diguyCharacter::create_sound_instance(), which have not been set to
9284  ** be automatically destroyed, will still be valid.
9285  **
9286  *b Arguments:
9287  **
9288  *a rampdown_time - how long to fade out the sound
9289  **
9290  *b Returns:
9291  **
9292  ** 0 on success, -1 on failure
9293  **
9294  *b Available as Decision Bead/Event
9295  */
9296  int stop_all_sounds(float rampdown_time = 0.0f);
9297 
9298  /*l
9299  *b Description:
9300  **
9301  ** This function stops a named sound instance from this character.
9302  **
9303  ** Sound instances that are automatically managed will be destroyed.
9304  ** This includes sound started by a call to
9305  ** diguyCharacter::play_sound() or a sound instance whose
9306  ** set_automatic_destroy_flag() function has been called.
9307  **
9308  ** diguySoundInstance pointers returned by a call to
9309  ** diguyCharacter::create_sound_instance(), which have not been set to
9310  ** be automatically destroyed, will still be valid.
9311  **
9312  *b Arguments:
9313  **
9314  *a sound_name - the name of the sound to stop
9315  *a rampdown_time - how long to fade out the sound
9316  **
9317  *b Returns:
9318  **
9319  ** 0 on success, -1 on failure
9320  **
9321  *b Available as Decision Bead/Event
9322  */
9323  int stop_sound(const char* sound_name, float rampdown_time = 0.0f);
9324 
9325  /*l
9326  *b Returns:
9327  **
9328  ** 1 if the character is playing a the sound specified, 0 if not
9329  */
9330  int is_playing_sound(const char* sound_name);
9331 
9332  /*l
9333  *b Description:
9334  **
9335  ** Sets the "voice actor" for the character.
9336  **
9337  ** Having a voice actor can change which sounds from the scenario a
9338  ** character selects when the diguyCharacter::play_sound() or
9339  ** diguyCharacter::play_3d_sound().
9340  **
9341  ** When play_sound() is called the character asks the scenario for
9342  ** the sound with the specified name. If a voice actor has been set
9343  ** the character will first ask the scenario for the sound name
9344  ** prepended with the voice actor and a slash ("/"). If there isn't
9345  ** a sound with that modified name, it will ask the scenario for a
9346  ** sound with the exact specified name.
9347  **
9348  ** For example, if the character has the voice actor "carl" and is
9349  ** told to play the sound "run_away", the character will first look
9350  ** for a sound named "carl/run_away". If that isn't found, it will
9351  ** look for a sound named "run_away". (If that isn't found no sound
9352  ** is played.)
9353  **
9354  *b Lua Example:
9355  **
9356  ** A more specific example: say that various characters in the
9357  ** scenario need to say "hello". Some of the characters are male,
9358  ** some are female. There are two ways this can be set up.
9359  **
9360  ** The first way, not using a voice actor, is to have two sounds
9361  ** specified in the scenario: "male_hello" and "female_hello". These
9362  ** sounds specify the sound files "male_hello.wav" and
9363  ** "female_hello.wav", respectively. A male character would then do
9364  ** the following to say hello:
9365  **
9366  *e male_character:play_sound("male_hello")
9367  **
9368  ** A female character would do:
9369  **
9370  *e female_character:play_sound("female_hello")
9371  **
9372  ** This is fine, except when one script or character mind needs to be
9373  ** shared by a range of characters, some male and some female.
9374  **
9375  ** In this case it's better to use a voice actor. Say that the sounds
9376  ** specified above have the names "male/hello" and "female/hello";
9377  ** they still have the separate sound files specified. If the
9378  ** character has its voice actor specified as "male" and is told to
9379  ** play the sound "hello", it will select the sound "male/hello" as
9380  ** the sound to play. If its voice actor is "female" and is told to
9381  ** play the sound "hello", it will select the sound "female/hello".
9382  **
9383  *e -- called earlier: character:set_voice_actor("male")
9384  *e character:play_sound("hello") -- plays sound "male/hello"
9385  **
9386  *e -- called earlier: character:set_voice_actor("female")
9387  *e character:play_sound("hello") -- plays sound "female/hello"
9388  **
9389  *b Arguments:
9390  **
9391  *a voice_actor - name of voice actor
9392  **
9393  ** voice_actor can be an arbitrary string. It doesn't need to match
9394  ** any character name, but should have matching sounds specified in
9395  ** the scenario.
9396  **
9397  *b Returns:
9398  **
9399  ** 0 on success, -1 on failure
9400  */
9401  int set_current_voice_actor(const char* voice_actor);
9402 
9404  const char* get_current_voice_actor();
9405 
9406 
9407 /*****************************************************************************/
9443  /*l
9444  *b Description:
9445  **
9446  ** This function returns the state of the character in the form
9447  ** required by DIS.
9448  **
9449  ** Note that there is no corresponding set_DIS_lifeform_state()
9450  ** function. The lifeform state is derived from the character's
9451  ** action, posture, and variant information.
9452  **
9453  *b Returns:
9454  **
9455  ** one of the following values defined in diguy_dis_constants.h:
9456  **
9457  *- DIGUY_DIS_LIFEFORM_UNUSED (0)
9458  *- DIGUY_DIS_LIFEFORM_UPRIGHT_STANDING_STILL (1)
9459  *- DIGUY_DIS_LIFEFORM_UPRIGHT_WALKING (2)
9460  *- DIGUY_DIS_LIFEFORM_UPRIGHT_RUNNING (3)
9461  *- DIGUY_DIS_LIFEFORM_KNEELING (4)
9462  *- DIGUY_DIS_LIFEFORM_PRONE (5)
9463  *- DIGUY_DIS_LIFEFORM_CRAWLING (6)
9464  *- DIGUY_DIS_LIFEFORM_SWIMMING (7)
9465  *- DIGUY_DIS_LIFEFORM_PARACHUTING (8)
9466  *- DIGUY_DIS_LIFEFORM_JUMPING (9)
9467  *- DIGUY_DIS_LIFEFORM_SITTING (10)
9468  *- DIGUY_DIS_LIFEFORM_SQUATTING (11)
9469  *- DIGUY_DIS_LIFEFORM_CROUCHING (12)
9470  *- DIGUY_DIS_LIFEFORM_WADING (13)
9471  **
9472  *b Callable For Networked Entities That Are:
9473  **
9474  *- - DIS published and reflected
9475  */
9476  int get_DIS_lifeform_state();
9477 
9478  /*l
9479  *b Description:
9480  **
9481  ** This function returns the position of the character's
9482  ** primary weapon, in the form required by DIS.
9483  **
9484  *b Returns:
9485  **
9486  ** one of the following values defined in diguy_dis_constants.h:
9487  **
9488  *- DIGUY_DIS_PRIMARY_WEAPON_NOT_PRESENT (0)
9489  *- DIGUY_DIS_PRIMARY_WEAPON_STOWED (1)
9490  *- DIGUY_DIS_PRIMARY_WEAPON_DEPLOYED (2)
9491  *- DIGUY_DIS_PRIMARY_WEAPON_IN_FIRING_POSITION (3)
9492  **
9493  *b Callable For Networked Entities That Are:
9494  **
9495  *- - DIS published
9496  */
9497  int get_DIS_primary_weapon_position();
9498 
9499  /*l
9500  *b Description:
9501  **
9502  ** This function returns the position of the character's
9503  ** secondary weapon, in the form required by DIS.
9504  **
9505  *b Returns:
9506  **
9507  ** one of the following values defined in diguy_dis_constants.h:
9508  **
9509  *- DIGUY_DIS_SECONDARY_WEAPON_NOT_PRESENT (0)
9510  *- DIGUY_DIS_SECONDARY_WEAPON_STOWED (1)
9511  *- DIGUY_DIS_SECONDARY_WEAPON_DEPLOYED (2)
9512  *- DIGUY_DIS_SECONDARY_WEAPON_IN_FIRING_POSITION (3)
9513  **
9514  *b Callable For Networked Entities That Are:
9515  **
9516  *- - DIS published
9517  */
9518  int get_DIS_secondary_weapon_position();
9519 
9520  /*l
9521  *b Description:
9522  **
9523  ** This function sets the Marking Text for characters that are
9524  ** published to the network by DI-Guy Networking. The default
9525  ** network marking is the empty string "".
9526  **
9527  ** This function should only be called for published characters.
9528  ** The Marking Text is set internally for reflected characters.
9529  **
9530  *b Returns:
9531  **
9532  ** 0 on success, -1 on failure
9533  **
9534  *b Callable For Networked Entities That Are:
9535  **
9536  *- - DIS published
9537  *- - HLA published
9538  */
9539  int set_network_marking(const char* network_marking);
9540 
9541  /*l
9542  *b Description:
9543  **
9544  ** This function gets the Marking Text for characters.
9545  **
9546  ** For published characters this value will be what was most
9547  ** recently set by set_network_marking().
9548  **
9549  ** For reflected characters this value will be read from the
9550  ** reflected characters' entity state information.
9551  **
9552  *b Returns:
9553  **
9554  ** character's Marking Text; will never be NULL
9555  **
9556  *b Callable For Networked Entities That Are:
9557  **
9558  *- - DIS published and reflected
9559  *- - HLA published and reflected
9560  */
9561  const char* get_network_marking();
9562 
9563  /*l
9564  *b Description:
9565  **
9566  ** This function sets whether this character will be published
9567  ** by DI-Guy Networking. This value is persistent, and does
9568  ** not depend on whether there actually *is* currently a
9569  ** network connection.
9570  **
9571  ** The default is 1, the character is published.
9572  **
9573  ** This function should *not* be called for reflected characters.
9574  ** It affects to both DIS and HLA networking.
9575  **
9576  *b Returns:
9577  **
9578  ** 0 on success, -1 on failure
9579  **
9580  *b Callable For Networked Entities That Are:
9581  **
9582  *- - DIS published
9583  *- - HLA published
9584  */
9585  int set_is_network_published(int is_network_published);
9586 
9587  /*l
9588  *b Description:
9589  **
9590  ** This function returns whether the character is published
9591  ** by DI-Guy Networking. It will always return 0 for reflected
9592  ** characters.
9593  **
9594  ** This function can be called for any character.
9595  **
9596  *b Returns:
9597  **
9598  ** 1 if published, 0 if not
9599  **
9600  *b Available as Decision Bead/Event
9601  **
9602  *b Callable For Networked Entities That Are:
9603  **
9604  *- - DIS published and reflected
9605  *- - HLA published and reflected
9606  */
9607  int get_is_network_published();
9608 
9609  /*l
9610  *b Description:
9611  **
9612  ** Experimental function that returns a vrlink entity state repository,
9613  ** useful for adding additional information to a diguy that we don't usually
9614  ** model.
9615  */
9616  DtEntityStateRepository * get_vrlink_entity_state_repository();
9617 
9618  /*l
9619  *b Description:
9620  **
9621  ** This function returns whether the character is a
9622  ** reflected character created by DI-Guy Networking.
9623  **
9624  ** This function can be called for any character.
9625  **
9626  *b Returns:
9627  **
9628  ** 1 if reflected, 0 if not
9629  **
9630  *b Available as Decision Bead/Event
9631  **
9632  *b Callable For Networked Entities That Are:
9633  **
9634  *- - DIS published and reflected
9635  *- - HLA published and reflected
9636  */
9637  int get_is_network_reflected();
9638 
9639  /*l
9640  *b Description:
9641  **
9642  ** This function returns whether this character is in a
9643  ** "paused" state. This will only be true for reflected
9644  ** characters.
9645  **
9646  ** A reflected character will be paused if the network
9647  ** entity it is representing is paused; i.e., its personal
9648  ** timeline is not advancing. The most common case of this
9649  ** is when this character is reflecting a published character
9650  ** of a DI-Guy Scenario application that is in a paused or
9651  ** stopped state.
9652  **
9653  ** If DI-Guy Scenario, paused characters will remain frozen
9654  ** in their current postures.
9655  **
9656  *b Returns:
9657  **
9658  ** 1 if paused, 0 if not
9659  **
9660  *b Available as Decision Bead/Event
9661  */
9662  int get_is_network_paused();
9663 
9664  /*l
9665  *b Description:
9666  **
9667  ** Overrides built-in logic for network pausing, becomes end user's responsibility
9668  ** to manage
9669  */
9670  int set_is_network_paused(int paused);
9671 
9672  /*l
9673  *b Description:
9674  **
9675  ** This function returns the character's "network entity number".
9676  ** This number is valid and persistent regardless of whether the
9677  ** character is currently published.
9678  **
9679  ** This number is primarily used internally by DI-Guy Networking
9680  ** for creating entity IDs.
9681  **
9682  *b Returns:
9683  **
9684  ** character's network entity number
9685  **
9686  *b Callable For Networked Entities That Are:
9687  **
9688  *- - DIS published and reflected
9689  *- - HLA published and reflected
9690  */
9691  int get_network_entity_number();
9692 
9693  /*l
9694  *b Description:
9695  **
9696  ** This function returns the name of an action for a character,
9697  ** given the DIS damage state, lifeform state, primary weapon
9698  ** state, speed of the character, and direction of travel.
9699  ** Constants are all defined in diguy_dis_constants.h:
9700  **
9701  *b Arguments:
9702  **
9703  *a damage_state - one of the values listed below
9704  *a life_form_state - one of the values listed below
9705  *a primary_weapon_state - one of the values listed below
9706  *a speed - in meters/second
9707  *a forward - whether the action should move
9708  *a forward (pass 1), or backward (pass 0)
9709  **
9710  ** Valid values for damage_state:
9711  **
9712  *- - DIGUY_DIS_DAMAGE_NONE (0)
9713  *- - DIGUY_DIS_DAMAGE_SLIGHT (1)
9714  *- - DIGUY_DIS_DAMAGE_MODERATE (2)
9715  *- - DIGUY_DIS_DAMAGE_DESTROYED (3)
9716  **
9717  ** Valid values for life_form_state:
9718  **
9719  *- - DIGUY_DIS_LIFEFORM_UNUSED (0)
9720  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_STANDING_STILL (1)
9721  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_WALKING (2)
9722  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_RUNNING (3)
9723  *- - DIGUY_DIS_LIFEFORM_KNEELING (4)
9724  *- - DIGUY_DIS_LIFEFORM_PRONE (5)
9725  *- - DIGUY_DIS_LIFEFORM_CRAWLING (6)
9726  *- - DIGUY_DIS_LIFEFORM_SWIMMING (7)
9727  *- - DIGUY_DIS_LIFEFORM_PARACHUTING (8)
9728  *- - DIGUY_DIS_LIFEFORM_JUMPING (9)
9729  *- - DIGUY_DIS_LIFEFORM_SITTING (10)
9730  *- - DIGUY_DIS_LIFEFORM_SQUATTING (11)
9731  *- - DIGUY_DIS_LIFEFORM_CROUCHING (12)
9732  *- - DIGUY_DIS_LIFEFORM_WADING (13)
9733  **
9734  ** Valid values for primary_weapon_state:
9735  **
9736  *- - DIGUY_DIS_PRIMARY_WEAPON_NOT_PRESENT (0)
9737  *- - DIGUY_DIS_PRIMARY_WEAPON_STOWED (1)
9738  *- - DIGUY_DIS_PRIMARY_WEAPON_DEPLOYED (2)
9739  *- - DIGUY_DIS_PRIMARY_WEAPON_IN_FIRING_POSITION (3)
9740  **
9741  ** Note that a backward motion can be requested in a couple of
9742  ** ways: either by passing a negative speed, or by passing
9743  ** 0 for the forward argument, or both.
9744  **
9745  *b Returns:
9746  **
9747  ** name of an action if a match is found, NULL if not
9748  **
9749  *b Callable For Networked Entities That Are:
9750  **
9751  *- - DIS published
9752  */
9753  const char* get_action_from_entity_state(int damage_state,
9754  int life_form_state,
9755  int primary_weapon_state,
9756  float speed,
9757  int forward);
9758 
9759  /*l
9760  *b Description:
9761  **
9762  ** Sets the damage state for the network published character.
9763  ** Depending on the appearance configuration info the character may automatically switch to a new appearance.
9764  **
9765  *b Arguments:
9766  **
9767  *a state - one of the values listed below
9768  **
9769  ** Valid values for state (defined in diguy_dis_constants.h):
9770  **
9771  *- - DIGUY_DIS_DAMAGE_NONE (0)
9772  *- - DIGUY_DIS_DAMAGE_SLIGHT (1)
9773  *- - DIGUY_DIS_DAMAGE_MODERATE (2)
9774  *- - DIGUY_DIS_DAMAGE_DESTROYED (3)
9775  **
9776  *b Callable For Networked Entities That Are:
9777  **
9778  *- - DIS published
9779  */
9780  void set_DIS_damage_state(int state);
9781 
9784  int get_DIS_damage_state();
9785 
9786  /*l
9787  *b Description:
9788  **
9789  ** Returns the name of damage state appearances based on the base appearance of the character.
9790  ** NULL if there is no appearance specified.
9791  */
9792  const char * get_damage_state_appearance_name(int state);
9793 
9794  /*l
9795  *b Description:
9796  **
9797  ** Sets the smoke state for a network published character.
9798  ** Starts or stops the "smoke" and "engine_smoke" appearance
9799  ** effects as appropriate.
9800  **
9801  *b Arguments:
9802  **
9803  *a state - one of the values listed below
9804  **
9805  ** Valid values for state (defined in diguy_dis_constants.h):
9806  **
9807  *- - DIGUY_DIS_SMOKE_NOT_SMOKING (0)
9808  *- - DIGUY_DIS_SMOKE_SMOKE_PLUME (1)
9809  *- - DIGUY_DIS_SMOKE_ENGINE_SMOKE (2)
9810  *- - DIGUY_DIS_SMOKE_ENGINE_SMOKE_AND_SMOKE_PLUME (3)
9811  **
9812  *b Callable For Networked Entities That Are:
9813  **
9814  *- - DIS published
9815  */
9816  void set_DIS_smoke_state(int state);
9817 
9820  int get_DIS_smoke_state();
9821 
9822  /*l
9823  *b Description:
9824  **
9825  ** Sets the flames state for a network published character.
9826  ** Starts or stops the "flames" appearance effect as appropriate.
9827  **
9828  *b Arguments:
9829  **
9830  ** state - one of the values listed below
9831  **
9832  ** Valid values for state (defined in diguy_dis_constants.h):
9833  **
9834  *- - DIGUY_DIS_FLAMES_NONE (0)
9835  *- - DIGUY_DIS_FLAMES_PRESENT (1)
9836  **
9837  *b Callable For Networked Entities That Are:
9838  **
9839  *- - DIS published
9840  */
9841  void set_DIS_flames_state(int state);
9842 
9845  int get_DIS_flames_state();
9846 
9847  /*l
9848  *b Description:
9849  **
9850  ** Sets the power plant state for a network published character.
9851  ** Vehicle power plants default to being on.
9852  **
9853  *b Arguments:
9854  **
9855  ** state - one of the values listed below
9856  **
9857  ** Valid values for state (defined in diguy_dis_constants.h):
9858  **
9859  *- - DIGUY_DIS_POWER_PLANT_OFF (0)
9860  *- - DIGUY_DIS_POWER_PLANT_ON (1)
9861  **
9862  *b Callable For Networked Entities That Are:
9863  **
9864  *- - DIS published
9865  */
9866  void set_DIS_power_plant_state(int state);
9867 
9870  int get_DIS_power_plant_state();
9871 
9874  void set_emissivity(float r, float g, float b, float lerp_time = .25);
9875 
9878  void get_emissivity(float *r, float *g, float *b);
9879 
9880  /*l
9881  *b Description:
9882  **
9883  ** Sets the trailing effect state for a network published character.
9884  **
9885  *b Arguments:
9886  **
9887  ** state - one of the values listed below
9888  **
9889  ** Valid values for state (defined in diguy_dis_constants.h):
9890  **
9891  *- - DIGUY_DIS_TRAILING_EFFECT_NONE (0)
9892  *- - DIGUY_DIS_TRAILING_EFFECT_SMALL (1)
9893  *- - DIGUY_DIS_TRAILING_EFFECT_MEDIUM (2)
9894  *- - DIGUY_DIS_TRAILING_EFFECT_LARGE (3)
9895  **
9896  *b Callable For Networked Entities That Are:
9897  **
9898  *- - DIS published
9899  */
9900  void set_DIS_trailing_effect_state(int state);
9901 
9904  int get_DIS_trailing_effect_state();
9905 
9907  void set_DIS_station_name(int name);
9908  int get_DIS_station_name() const;
9909 
9911  void set_DIS_station_number(int number);
9912  int get_DIS_station_number() const;
9913 
9916  void set_head_lights_state(int state);
9917 
9919  int get_head_lights_state() const;
9920 
9922  void set_tail_lights_state(int state);
9923 
9925  int get_tail_lights_state() const;
9926 
9927 
9928 /*****************************************************************************/
9938  /*l
9939  *b Description:
9940  **
9941  ** This function will create a new active formation with this
9942  ** character as its leader. The formation followers will fall
9943  ** into the formation given by the formation name.
9944  **
9945  ** The formation is broken up, or disbanded, by calling
9946  ** break_formation().
9947  **
9948  *b Arguments:
9949  **
9950  *a formation_name - the name of the formation
9951  *a snap_to_position_flag - if 1, following characters will
9952  *a immediately snap to their assigned
9953  *a positions; otherwise following characters
9954  *a will move toward their assigned
9955  *a positions from their current positions
9956  *a break_existing_formations_flag - if 1, any formations this
9957  *a character is leading with be broken
9958  *a as if the break_formation() call were
9959  *a made
9960  **
9961  *b Returns:
9962  **
9963  ** 0 on success, -1 on failure
9964  **
9965  *b Available as Decision Bead/Event
9966  */
9967  int call_formation(const char* formation_name,
9968  int snap_to_position_flag = 0,
9969  int break_existing_formations_flag = 1);
9970 
9971  /*l
9972  *b Description:
9973  **
9974  ** This function breaks up a formation initiated by call_formation().
9975  **
9976  *b Arguments:
9977  **
9978  *a formation_name - the name of the formation to break;
9979  *a passing NULL or "(all)" will break all formations
9980  *a this character is leading
9981  **
9982  *b Returns:
9983  **
9984  ** 0 on success, -1 on failure
9985  **
9986  *b Available as Decision Bead/Event
9987  */
9988  int break_formation(const char* formation_name = NULL);
9989 
9990 
9991 /*****************************************************************************/
9999  /*l
10000  *b Description:
10001  **
10002  ** This function adds a copy of the specified scenario guide
10003  ** to the character. Any changes that are subsequently made
10004  ** to the added guide -- for example by a call to
10005  ** diguyCharacterGuide::set_algorithm_float_parameter() -- are
10006  ** private to this copy of the guide and will not affect others.
10007  **
10008  ** The guide will be enabled by default. Guides can be disabled
10009  ** by calling diguyCharacterGuide::set_guide_enabled(0), or by
10010  ** passing 1 for the argument automatically_disable_when_acquired.
10011  **
10012  ** Note that disabling a guide is not the same as removing it.
10013  ** Disabled guides are still a part of the character and can
10014  ** later be re-enabled by calling diguyCharacterGuide::set_enabled().
10015  **
10016  *b Arguments:
10017  **
10018  *a guide_name - name of guide to find and copy
10019  *a automatically_disable_when_acquired - set to 1 to have the guide
10020  *a be automatically disabled when it has acquired
10021  *a its target
10022  **
10023  *b Returns:
10024  **
10025  ** object of type diguyCharacterGuide; if a guide with guide_name
10026  ** is not found, returns NULL
10027  */
10028  diguyCharacterGuide* add_guide(const char* guide_name,
10029  int automatically_disable_when_acquired = 0);
10030 
10031  /*l
10032  *b Description:
10033  **
10034  ** This function creates a new guide and adds it to the character.
10035  **
10036  ** The guide will be enabled by default. Guides can be disabled
10037  ** by calling diguyCharacterGuide::set_guide_enabled(), or by
10038  ** passing 1 for the argument automatically_disable_when_acquired.
10039  **
10040  ** Important note: a new guide will always be created, even if one with
10041  ** the same name already exists
10042  **
10043  *b Arguments:
10044  **
10045  *a guide_name - name of guide to find and copy
10046  *a guide_algorithm - name of guide algorithm to be used
10047  *a automatically_disable_when_acquired - set to 1 to have the guide
10048  *a be automatically disabled when it has
10049  *a acquired its target
10050  **
10051  *b Returns:
10052  **
10053  ** object of type diguyCharacterGuide; if a guide with guide_name
10054  ** is not found, returns NULL
10055  */
10056  diguyCharacterGuide* create_guide(const char* guide_name,
10057  const char* guide_algorithm,
10058  int automatically_disable_when_acquired = 0);
10059 
10060  /*l
10061  *b Description:
10062  **
10063  ** Like create_guide(), but returns guide if it already exists
10064  **
10065  *b Arguments:
10066  **
10067  *a guide_name - name of guide to find and copy
10068  *a guide_algorithm - name of guide algorithm to be used
10069  *a automatically_disable_when_acquired - set to 1 to have the guide
10070  *a be automatically disabled when it has
10071  *a acquired its target
10072  **
10073  *b Returns:
10074  **
10075  ** object of type diguyCharacterGuide; if a guide with guide_name
10076  ** is not found, returns NULL
10077  */
10078  diguyCharacterGuide* find_or_create_guide(const char* guide_name,
10079  const char* guide_algorithm,
10080  int automatically_disable_when_acquired = 0);
10081 
10082  /*l
10083  *b Description:
10084  **
10085  ** This function returns a pointer to the specified guide
10086  ** of the character, if is exists.
10087  **
10088  *b Arguments:
10089  **
10090  *a guide_name - name of guide to find
10091  **
10092  *b Returns:
10093  **
10094  ** object of type diguyCharacterGuide; if a guide with guide_name
10095  ** is not found, returns NULL
10096  */
10097  diguyCharacterGuide* find_guide(const char* guide_name);
10098 
10099  /*l
10100  *b Description:
10101  **
10102  ** This function removes the specified guide from the
10103  ** character.
10104  **
10105  *b Arguments:
10106  **
10107  *a guide_name - name of the guide to remove; must match name
10108  *a used by add_guide() or create_guide() call
10109  **
10110  *b Returns:
10111  **
10112  ** 0 on success, -1 on failure
10113  */
10114  int remove_guide_with_name(const char* guide_name);
10115 
10116  /*l
10117  *b Description:
10118  **
10119  ** This function removes the specified guide from the
10120  ** character.
10121  **
10122  *b Arguments:
10123  **
10124  *a guide - object returned by add_guide() call
10125  **
10126  *b Returns:
10127  **
10128  ** 0 on success, -1 on failure
10129  */
10130  int remove_guide(diguyCharacterGuide* guide);
10131 
10132  /*l
10133  *b Description:
10134  **
10135  ** This function removes all guides from the character.
10136  **
10137  *b Returns:
10138  **
10139  ** 0 on success, -1 on failure
10140  */
10141  int remove_all_guides();
10142 
10143  /*l
10144  *b Description:
10145  **
10146  ** This function removes all guides that are disabled.
10147  **
10148  *b Returns:
10149  **
10150  ** 0 on success, -1 on failure
10151  */
10152  int remove_all_disabled_guides();
10153 
10154 
10155 /*****************************************************************************/
10165  /*l
10166  *b Description:
10167  **
10168  ** This function adds a "motion texture" to the character. A
10169  ** motion texture is a relatively long (usually 10 seconds or
10170  ** more) loop that will add natural-looking, low amplitude
10171  ** joint angle adjustments.
10172  **
10173  ** This function will have no effect on a dead character (see
10174  ** die_now() and get_dead()).
10175  **
10176  *b Arguments:
10177  **
10178  *a motex_name - name of the motion texture to add; see below
10179  *a texture_gain - the relative amplitude of the motion texture;
10180  *a higher numbers result in more pronounced
10181  *a movements
10182  *a end_previous_motex - flag denoting whether this motion texture
10183  *a replaces all previously added motion
10184  *a textures; pass 1 to end existing textures
10185  *a rampup_interval - how long, in seconds, to take ramping up
10186  *a into the motion texture
10187  **
10188  ** List of currently available motion textures:
10189  **
10190  *- - "default"
10191  *- - "motex_stand_casual"
10192  **
10193  ** If 1 is passed for the argument end_previous_motex, the
10194  ** rampup_interval argument will be used as the interval for
10195  ** ending existing motion textures.
10196  **
10197  *b Returns:
10198  **
10199  ** 0 on success, -1 on failure
10200  **
10201  */
10202  int add_motion_texture(const char* motex_name = "default",
10203  float texture_gain = 1.0f,
10204  int end_previous_motex = 1,
10205  float rampup_interval = 0.2f);
10206 
10207  /*l
10208  *b Description:
10209  **
10210  ** This function gradually ends any active motion textures added by
10211  ** add_motion_texture().
10212  **
10213  *b Arguments:
10214  **
10215  *a rampdown_interval - how long, in seconds, to take ending the
10216  *a motion texture
10217  **
10218  *b Returns:
10219  **
10220  ** 0 on success, -1 on failure
10221  */
10222  int end_motion_texture(float rampdown_interval = 0.2f);
10223 
10224  /*l
10225  *b Description:
10226  **
10227  ** This function sets an initial motion texture that should be
10228  ** used by the character whenever the character is loaded from
10229  ** a scenario or the character's scenario is reset.
10230  **
10231  ** The gain of the motion texture can be set by calling
10232  ** set_initial_motion_texture_gain(). The initial motion
10233  ** texture gain is 1.0 by default.
10234  **
10235  *b See Also:
10236  **
10237  ** add_motion_texture(), set_initial_motion_texture_gain()
10238  **
10239  *b Arguments:
10240  **
10241  *a motex_name - name of the motion texture
10242  **
10243  *b Returns:
10244  **
10245  ** 0 on success, -1 on failure
10246  */
10247  int set_initial_motion_texture(const char* motex_name);
10248 
10249  /*l
10250  *b Description:
10251  **
10252  ** This function returns the initial motion texture as set
10253  ** by a call to set_initial_motion_texture().
10254  **
10255  *b Returns:
10256  **
10257  ** name of initial motion texture
10258  */
10259  const char* get_initial_motion_texture();
10260 
10261  /*l
10262  *b Description:
10263  **
10264  ** This function sets the gain of the initial motion texture
10265  ** of the character. The initial motion texture can be set
10266  ** by calling set_initial_motion_texture().
10267  **
10268  *b Arguments:
10269  **
10270  *a motex_gain - gain of the motion texture; higher gains
10271  *a result in more pronounced motion
10272  **
10273  *b Returns:
10274  **
10275  ** 0 on success, -1 on failure
10276  */
10277  int set_initial_motion_texture_gain(float motex_gain);
10278 
10279  /*l
10280  *b Description:
10281  **
10282  ** This function returns the initial motion texture gain as set
10283  ** by a call to set_initial_motion_texture_gain().
10284  **
10285  *b Returns:
10286  **
10287  ** gain of initial motion texture
10288  */
10289  float get_initial_motion_texture_gain();
10290 
10291 
10292 /*****************************************************************************/
10302  /*l
10303  *b Description:
10304  **
10305  ** This function sets what type of "history" will be kept for the
10306  ** character.
10307  **
10308  ** If time is run backwards in a scenario, characters
10309  ** with history will replay the motions they performed at that
10310  ** time. Characters without history will stay frozen in place
10311  ** until time advances past the point from which it was run
10312  ** backwards.
10313  **
10314  ** The default is DIGUY_HISTORY_TYPE_NONE for characters created
10315  ** using the diguyScenario::create_character() function.
10316  ** Characters loaded from a .dss file will retain their history
10317  ** settings from the DI-Guy Scenario editing session.
10318  **
10319  *b Arguments:
10320  **
10321  *a history_type - history type to be used for the character
10322  **
10323  ** history_type should be one of the following values:
10324  **
10325  *i DIGUY_HISTORY_TYPE_NONE
10326  **
10327  ** This history type saves no history.
10328  **
10329  *i DIGUY_HISTORY_TYPE_COMPLETE
10330  **
10331  ** This history type saves all of a character's history.
10332  **
10333  ** The initial amount of history to be saved, before memory buffers
10334  ** need to be resized, can be set by the function
10335  ** set_history_size_t(). The size by which memory buffers grow each
10336  ** time they do need to get resized by be set by
10337  ** set_history_size_increment_t().
10338  **
10339  *i DIGUY_HISTORY_TYPE_FIRST
10340  **
10341  ** This history type is no longer supported. Characters from
10342  ** a .dss that have this history type will have their history
10343  ** type set to DIGUY_HISTORY_TYPE_COMPLETE.
10344  **
10345  *i DIGUY_HISTORY_TYPE_LAST
10346  **
10347  ** This history type is no longer supported. Characters from
10348  ** a .dss that have this history type will have their history
10349  ** type set to DIGUY_HISTORY_TYPE_COMPLETE.
10350  **
10351  *b Returns:
10352  **
10353  ** 0 on success, -1 on failure
10354  */
10355  int set_history_type(diguyHistoryType history_type);
10356 
10357  /*l
10358  *b Returns:
10359  **
10360  ** the current history type of the character; see
10361  ** set_history_type()
10362  */
10363  diguyHistoryType get_history_type();
10364 
10365  /*l
10366  *b Description:
10367  **
10368  ** This function sets the size of the character's history
10369  ** buffer, in seconds.
10370  **
10371  *b Arguments:
10372  **
10373  *a t - length of history buffer, in seconds
10374  **
10375  *b Returns:
10376  **
10377  ** 0 on success, -1 on failure
10378  */
10379  int set_history_size_t(float t);
10380 
10381  /*l
10382  *b Description:
10383  **
10384  ** This function returns the current history buffer size.
10385  ** See set_history_size_t().
10386  **
10387  *b Returns:
10388  **
10389  ** current history size
10390  */
10391  float get_history_size_t();
10392 
10393  /*l
10394  *b Description:
10395  **
10396  ** This function sets the size of the character's history
10397  ** buffer increment, in seconds.
10398  **
10399  *b Arguments:
10400  **
10401  *a t - length of history buffer increment, in seconds
10402  **
10403  *b Returns:
10404  **
10405  ** 0 on success, -1 on failure
10406  */
10407  int set_history_size_increment_t(float t);
10408 
10409  /*l
10410  *b Description:
10411  **
10412  ** This function returns the current history buffer size increment.
10413  ** See set_history_size_increment_t().
10414  **
10415  *b Returns:
10416  **
10417  ** current history size increment
10418  */
10419  float get_history_size_increment_t();
10420 
10421 
10422 /*****************************************************************************/
10432  /*l
10433  *b Description:
10434  **
10435  ** This function sets the desired posture of the character. This,
10436  ** along with the desired variant, is used primarily by some guides.
10437  ** Specifically, to help choose which actions are used to reach the
10438  ** desired position and orientation of the character.
10439  **
10440  ** Pass DIGUY_MOTION_POSTURE_ANY for there to be no desired posture.
10441  **
10442  *b Arguments:
10443  **
10444  *a posture - new desired posture
10445  */
10446  void set_desired_posture(diguyMotionPosture desired_posture);
10447 
10448  /*l
10449  *b Returns:
10450  **
10451  ** current desired posture of the character
10452  */
10453  diguyMotionPosture get_desired_posture();
10454 
10455  /*l
10456  *b Description:
10457  **
10458  ** This function sets the desired variant of the character. This,
10459  ** along with the desired posture, is used primarily by some guides.
10460  ** Specifically, to help choose which actions are used to reach the
10461  ** desired position and orientation of the character.
10462  **
10463  ** Pass DIGUY_MOTION_VARIANT_ANY for there to be no desired variant.
10464  **
10465  *b Arguments:
10466  **
10467  *a variant - new desired variant
10468  */
10469  void set_desired_variant(diguyMotionVariant desired_variant);
10470 
10472  diguyMotionVariant get_desired_variant();
10473 
10474  /*l
10475  *b Description:
10476  **
10477  ** This function looks up the character action that most closely
10478  ** matches the given criteria.
10479  **
10480  *b Arguments:
10481  **
10482  *a direction - the direction of travel relative to
10483  *a the character's facing direction
10484  *a posture - overall desired posture; pass
10485  *a DIGUY_MOTION_POSTURE_ANY
10486  *a to specify that any posture will do
10487  *a variant - overall desired variant; pass
10488  *a DIGUY_MOTION_VARIANT_ANY
10489  *a to specify that any variant will do
10490  *a speed - speed in meters per second
10491  *a comparison - how the passed speed should compare
10492  *a to the action's speed
10493  *a comparison_tolerance - tolerance of comparison
10494  *a match_posture_before_variant - pass 1 if posture should be matched
10495  *a before variant if an exact match is
10496  *a not found; pass 0 if variant should
10497  *a be matched before posture
10498  *a posture_alternate1 - if an exact match is not found, use this
10499  *a as the first alternate posture; pass
10500  *a DIGUY_MOTION_POSTURE_UNKNOWN
10501  *a to specify that no alternate should be used
10502  *a posture_alternate2 - if an exact match is not found, use this
10503  *a as the second alternate posture; pass
10504  *a DIGUY_MOTION_POSTURE_UNKNOWN
10505  *a to specify that no alternate should be used
10506  *a variant_alternate1 - if an exact match is not found, use this
10507  *a as the first alternate variant; pass
10508  *a DIGUY_MOTION_VARIANT_UNKNOWN
10509  *a to specify that no alternate should be used
10510  *a variant_alternate2 - if an exact match is not found, use this
10511  *a as the second alternate variant; pass
10512  *a DIGUY_MOTION_VARIANT_UNKNOWN
10513  *a to specify that no alternate should be used
10514  *a return_random_match - (Experimental) if multiple actions match the
10515  *a specified criteria randomly return one of
10516  *a them. Typically only used for still motions
10517  *a and restricted to EQUAL and NEAREST
10518  *a comparisons
10519  **
10520  ** The direction argument should be one of the following:
10521  **
10522  *- - DIGUY_MOTION_DIRECTION_NONE - does not move character
10523  *- - DIGUY_MOTION_DIRECTION_FORWARD - moves character forward
10524  *- - DIGUY_MOTION_DIRECTION_BACKWARD - moves character backward
10525  *- - DIGUY_MOTION_DIRECTION_LEFT - moves character left
10526  *- - DIGUY_MOTION_DIRECTION_RIGHT - moves character right
10527  *- - DIGUY_MOTION_DIRECTION_UP - moves character up
10528  *- - DIGUY_MOTION_DIRECTION_DOWN - moves character down
10529  *- - DIGUY_MOTION_DIRECTION_TURN_LEFT - turns character left
10530  *- - DIGUY_MOTION_DIRECTION_TURN_RIGHT - turns character right
10531  *- - DIGUY_MOTION_DIRECTION_NONLINEAR - moves character in
10532  *- multiple directions
10533  *- - DIGUY_MOTION_DIRECTION_LINEAR_OFFAXIS - moves character in a
10534  *- line, but not on any
10535  *- of the principle axes
10536  **
10537  ** Not every direction is supported by every character. If the
10538  ** character does not have any actions that move in the specified
10539  ** direction, the returned action will be NULL.
10540  **
10541  ** Use the calls diguyScenario::get_character_type_num_directions()
10542  ** and diguyScenario::get_character_type_direction_at_index() to
10543  ** enumerate which directions a character can travel.
10544  **
10545  ** The posture arguments should be one of the following:
10546  **
10547  *- - DIGUY_MOTION_POSTURE_UNKNOWN - unknown posture
10548  *- - DIGUY_MOTION_POSTURE_ANY - any posture; a wildcard
10549  *- - DIGUY_MOTION_POSTURE_UPRIGHT - upright posture; e.g., standing,
10550  *- walking, or running
10551  *- - DIGUY_MOTION_POSTURE_CROUCHED - crouched posture; e.g., kneeling
10552  *- or walking low
10553  *- - DIGUY_MOTION_POSTURE_PRONE - prone posture; e.g., lying prone
10554  *- or crawling
10555  *- - DIGUY_MOTION_POSTURE_SITTING - sitting posture
10556  *- - DIGUY_MOTION_POSTURE_KNEELING - kneeling posture
10557  *- - DIGUY_MOTION_POSTURE_SWIMMING - swimming posture
10558  *- - DIGUY_MOTION_POSTURE_PARACHUTING - parachuting posture
10559  *- - DIGUY_MOTION_POSTURE_JUMPING - jumping posture
10560  *- - DIGUY_MOTION_POSTURE_SQUATTING - jumping posture
10561  *- - DIGUY_MOTION_POSTURE_WADING - wading posture
10562  **
10563  ** The posture arguments specify the overall posture the action
10564  ** should have. Most characters have an upright posture.
10565  ** The other postures a character has is dependent on character type.
10566  ** Passing DIGUY_MOTION_POSTURE_ANY for the arguments posture,
10567  ** posture_alternate1, or posture_alternate2 means that the posture of
10568  ** the action should not be used to determine a match.
10569  **
10570  ** Use the calls diguyScenario::get_character_type_num_postures()
10571  ** and diguyScenario::get_character_type_posture_at_index() to
10572  ** enumerate which postures a specific character type has.
10573  **
10574  ** The variant arguments specify the overall mood the action should
10575  ** convey. Most characters have a "normal" variant. The other
10576  ** variants a character has is dependent on character type. Passing
10577  ** DIGUY_MOTION_VARIANT_ANY for the arguments variant,
10578  ** variant_alternate1, or variant_alternate2 means that the variant of
10579  ** the action should not be used to determine a match.
10580  **
10581  ** Use the calls diguyScenario::get_character_type_num_variants()
10582  ** and diguyScenario::get_character_type_variant_at_index() to
10583  ** enumerate which variants a specific character type has.
10584  **
10585  ** The comparison argument should be one of the following:
10586  **
10587  *- - DIGUY_PARAMETER_COMPARISON_EQUAL - matched action's speed
10588  *- must be within
10589  *- comparison_tolerance of
10590  *- passed speed
10591  *- - DIGUY_PARAMETER_COMPARISON_NEAREST - matched action's speed
10592  *- is closer than any other
10593  *- potential match's, but
10594  *- still within
10595  *- comparison_tolerance
10596  *- - DIGUY_PARAMETER_COMPARISON_GREATER - matched action's speed
10597  *- faster than passed speed,
10598  *- but still within
10599  *- comparison_tolerance
10600  *- - DIGUY_PARAMETER_COMPARISON_LESS - matched action's speed
10601  *- slower than passed speed,
10602  *- but still within
10603  *- comparison_tolerance
10604  *-
10605  ** The difference between DIGUY_PARAMETER_COMPARISON_EQUAL and
10606  ** DIGUY_PARAMETER_COMPARISON_NEAREST is largely in the
10607  ** value used for comparison_tolerance if DIGUY_DEFAULT_FLOAT is
10608  ** passed; the comparison_tolerance argument defaults to 0.001 for
10609  ** DIGUY_PARAMETER_COMPARISON_EQUAL, and 16384.0 for all
10610  ** other comparison types. Otherwise these two comparison types
10611  ** operate the same.
10612  **
10613  *b Returns:
10614  **
10615  ** name of an action if a match is found, NULL if not
10616  **
10617  *b C++ Example:
10618  **
10619  *e diguyCharacter* ch = scenario->get_character_at_index(0);
10620  *e const char* new_action;
10621  *e
10622  *e //
10623  *e // Get an action that moves forward in an upright posture,
10624  *e // whose speed move at least 2.0 meters per second:
10625  *e //
10626  *e new_action = ch->get_action_from_description(
10627  *e DIGUY_MOTION_DIRECTION_FORWARD,
10628  *e DIGUY_MOTION_POSTURE_UPRIGHT,
10629  *e DIGUY_MOTION_VARIANT_ANY,
10630  *e 2.0,
10631  *e DIGUY_PARAMETER_COMPARISON_GREATER, DIGUY_DEFAULT_FLOAT);
10632  *e
10633  *e //
10634  *e // Get an action that is standing still, with the variant
10635  *e // DIGUY_MOTION_VARIANT_READY. If no action has that variant,
10636  *e // try DIGUY_MOTION_VARIANT_AIM as variant_alternate1,
10637  *e // and DIGUY_MOTION_VARIANT_ANY as variant_alternate2:
10638  *e //
10639  *e new_action = ch->get_action_from_description(
10640  *e DIGUY_MOTION_DIRECTION_NONE,
10641  *e DIGUY_MOTION_POSTURE_ANY,
10642  *e DIGUY_MOTION_VARIANT_READY,
10643  *e 0.0,
10644  *e DIGUY_PARAMETER_COMPARISON_NEAREST, DIGUY_DEFAULT_FLOAT,
10645  *e 0,
10646  *e DIGUY_MOTION_POSTURE_UNKNOWN,
10647  *e DIGUY_MOTION_POSTURE_UNKNOWN,
10648  *e DIGUY_MOTION_VARIANT_AIM,
10649  *e DIGUY_MOTION_VARIANT_ANY);
10650  **
10651  */
10652  const char* get_action_from_description(diguyMotionDirection direction,
10653  diguyMotionPosture posture,
10654  diguyMotionVariant variant,
10655  float speed,
10657  float comparison_tolerance = DIGUY_DEFAULT_FLOAT,
10658  int match_posture_before_variant = 1,
10659  diguyMotionPosture posture_alternate1 = DIGUY_MOTION_POSTURE_UNKNOWN,
10660  diguyMotionPosture posture_alternate2 = DIGUY_MOTION_POSTURE_UNKNOWN,
10661  diguyMotionVariant variant_alternate1 = DIGUY_MOTION_VARIANT_UNKNOWN,
10662  diguyMotionVariant variant_alternate2 = DIGUY_MOTION_VARIANT_UNKNOWN,
10663  int return_random_match = 0);
10664 
10665  /*l
10666  *b Description:
10667  **
10668  ** This function is very similar to get_action_from_description(),
10669  ** but substitutes turn amount per action iteration for speed.
10670  **
10671  *b Arguments:
10672  **
10673  *a direction - the direction of travel relative to
10674  *a the character's facing direction
10675  *a posture - overall desired posture; pass
10676  *a DIGUY_MOTION_POSTURE_ANY
10677  *a to specify that any posture will do
10678  *a variant - overall desired variant; pass
10679  *a DIGUY_MOTION_VARIANT_ANY
10680  *a to specify that any variant will do
10681  *a turn_amount - how many degrees each iteration of the
10682  *a action should turn the character
10683  *a comparison - how the passed turn amount should compare
10684  *a to the action's turn amount
10685  *a comparison_tolerance - tolerance of comparison
10686  *a match_posture_before_variant - pass 1 if posture should be matched
10687  *a before variant if an exact match is
10688  *a not found; pass 0 if variant should
10689  *a be matched before posture
10690  *a posture_alternate1 - if an exact match is not found, use this
10691  *a as the first alternate posture; pass
10692  *a DIGUY_MOTION_POSTURE_UNKNOWN
10693  *a to specify that no alternate should be used
10694  *a posture_alternate2 - if an exact match is not found, use this
10695  *a as the second alternate posture; pass
10696  *a DIGUY_MOTION_POSTURE_UNKNOWN
10697  *a to specify that no alternate should be used
10698  *a variant_alternate1 - if an exact match is not found, use this
10699  *a as the first alternate variant; pass
10700  *a DIGUY_MOTION_VARIANT_UNKNOWN
10701  *a to specify that no alternate should be used
10702  *a variant_alternate2 - if an exact match is not found, use this
10703  *a as the second alternate variant; pass
10704  *a DIGUY_MOTION_VARIANT_UNKNOWN
10705  *a to specify that no alternate should be used
10706  **
10707  ** The direction argument should be one of the following:
10708  **
10709  *- - DIGUY_MOTION_DIRECTION_TURN_LEFT - turns character left
10710  *- - DIGUY_MOTION_DIRECTION_TURN_RIGHT - turns character right
10711  **
10712  ** Not every direction is supported by every character. If the
10713  ** character does not have any actions that move in the specified
10714  ** direction, the returned action will be NULL.
10715  **
10716  ** The turn amount argument should be a positive number.
10717  **
10718  ** Refer to get_action_from_description() for more information on
10719  ** other arguments.
10720  **
10721  *b Returns:
10722  **
10723  ** name of an action if a match is found, NULL if not
10724  **
10725  */
10726  const char* get_turning_action_from_description(diguyMotionDirection direction,
10727  diguyMotionPosture posture,
10728  diguyMotionVariant variant,
10729  float turn_amount,
10731  float comparison_tolerance = DIGUY_DEFAULT_FLOAT,
10732  int match_posture_before_variant = 1,
10733  diguyMotionPosture posture_alternate1 = DIGUY_MOTION_POSTURE_UNKNOWN,
10734  diguyMotionPosture posture_alternate2 = DIGUY_MOTION_POSTURE_UNKNOWN,
10735  diguyMotionVariant variant_alternate1 = DIGUY_MOTION_VARIANT_UNKNOWN,
10736  diguyMotionVariant variant_alternate2 = DIGUY_MOTION_VARIANT_UNKNOWN);
10737 
10738 
10739 /*****************************************************************************/
10749  /*l
10750  *b Returns:
10751  **
10752  ** number of variables the character has
10753  */
10754  int get_num_variables();
10755 
10756  /*l
10757  *b Returns:
10758  **
10759  ** pointer of type diguyVariable; NULL if no
10760  ** variable at the specified index
10761  **
10762  *b Arguments:
10763  **
10764  *a index - index of the variable; indices start at 0
10765  */
10766  diguyVariable* get_variable_at_index(int index);
10767 
10768  /*l
10769  *b Description:
10770  **
10771  ** This function returns a pointer to the specified variable.
10772  **
10773  *b Arguments:
10774  **
10775  *a name - name of variable to be found
10776  **
10777  *b Returns:
10778  **
10779  ** pointer of type diguyVariable; NULL if not found
10780  */
10781  diguyVariable* find_variable(const char* name);
10782 
10783  /*l
10784  *b Description:
10785  **
10786  ** This function finds the variable with the given name or
10787  ** creates it if it doesn't exist.
10788  **
10789  *b Arguments:
10790  **
10791  *a name - name of the variable to find or create
10792  **
10793  *b Returns:
10794  **
10795  ** pointer of type diguyVariable; should never be NULL
10796  */
10797  diguyVariable* find_or_create_variable(const char* name);
10798 
10799  /*l
10800  *b Description:
10801  **
10802  ** This function destroys the passed variable.
10803  **
10804  *b Arguments:
10805  **
10806  *a variable - pointer to a diguyVariable
10807  **
10808  *b Returns:
10809  **
10810  ** 0 on success, -1 on failure
10811  */
10812  int destroy_variable(diguyVariable* variable);
10813 
10814  /*l
10815  *b Returns:
10816  **
10817  ** 1 if variable is equal to passed value,
10818  ** 0 if not
10819  **
10820  *b Arguments:
10821  **
10822  *a varname - name of variable to compare
10823  *a value - value to compare against
10824  **
10825  *b Available as Decision Bead/Event
10826  */
10827  int variable_equal_to_int(const char* varname, int value);
10828 
10829  /*l
10830  *b Returns:
10831  **
10832  ** 1 if variable is greater than passed value,
10833  ** 0 if not
10834  **
10835  *b Arguments:
10836  **
10837  *a varname - name of variable to compare
10838  *a value - value to compare against
10839  **
10840  *b Available as Decision Bead/Event
10841  */
10842  int variable_greater_than_int(const char* varname, int value);
10843 
10844  /*l
10845  *b Returns:
10846  **
10847  ** 1 if variable is less than passed value,
10848  ** 0 if not
10849  **
10850  *b Arguments:
10851  **
10852  *a varname - name of variable to compare
10853  *a value - value to compare against
10854  **
10855  *b Available as Decision Bead/Event
10856  */
10857  int variable_less_than_int(const char* varname, int value);
10858 
10859  /*l
10860  *b Returns:
10861  **
10862  ** 1 if variable is equal to passed value,
10863  ** 0 if not
10864  **
10865  *b Arguments:
10866  **
10867  *a varname - name of variable to compare
10868  *a value - value to compare against
10869  **
10870  *b Available as Decision Bead/Event
10871  */
10872  int variable_equal_to_float(const char* varname, float value);
10873 
10874  /*l
10875  *b Returns:
10876  **
10877  ** 1 if variable is greater than passed value,
10878  ** 0 if not
10879  **
10880  *b Arguments:
10881  **
10882  *a varname - name of variable to compare
10883  *a value - value to compare against
10884  **
10885  *b Available as Decision Bead/Event
10886  */
10887  int variable_greater_than_float(const char* varname, float value);
10888 
10889  /*l
10890  *b Returns:
10891  **
10892  ** 1 if variable is less than passed value,
10893  ** 0 if not
10894  **
10895  *b Arguments:
10896  **
10897  *a varname - name of variable to compare
10898  *a value - value to compare against
10899  **
10900  *b Available as Decision Bead/Event
10901  */
10902  int variable_less_than_float(const char* varname, float value);
10903 
10904  /*l
10905  *b Returns:
10906  **
10907  ** 1 if variable is equal than passed value,
10908  ** 0 if not
10909  **
10910  *b Arguments:
10911  **
10912  *a varname - name of variable to compare
10913  *a value - value to compare against
10914  **
10915  *b Available as Decision Bead/Event
10916  */
10917  int variable_equal_to_string(const char* varname, const char* value);
10918 
10919  /*l
10920  *b Returns:
10921  **
10922  ** 1 if variable is greater than passed value (comes
10923  ** later alphabetically), 0 if not
10924  **
10925  *b Arguments:
10926  **
10927  *a varname - name of variable to compare
10928  *a value - value to compare against
10929  **
10930  *b Available as Decision Bead/Event
10931  */
10932  int variable_greater_than_string(const char* varname, const char* value);
10933 
10934  /*l
10935  *b Returns:
10936  **
10937  ** 1 if variable is less than passed value (comes
10938  ** sooner alphabetically), 0 if not
10939  **
10940  *b Arguments:
10941  **
10942  *a varname - name of variable to compare
10943  *a value - value to compare against
10944  **
10945  *b Available as Decision Bead/Event
10946  */
10947  int variable_less_than_string(const char* varname, const char* value);
10948 
10949  /*l
10950  *b Description:
10951  **
10952  ** This function decrements the variable by the passed amount.
10953  **
10954  *b Arguments:
10955  **
10956  *a varname - name of variable to modify
10957  *a value - amount to decrement
10958  **
10959  *b Returns:
10960  **
10961  ** 0 on success, -1 on failure
10962  **
10963  *b Available as Decision Bead/Event
10964  */
10965  int variable_decrement_value_as_int(const char* varname, int value = 1);
10966 
10967  /*l
10968  *b Description:
10969  **
10970  ** This function increments the variable by the passed amount.
10971  **
10972  *b Arguments:
10973  **
10974  *a varname - name of variable to modify
10975  *a value - amount to increment
10976  **
10977  *b Returns:
10978  **
10979  ** 0 on success, -1 on failure
10980  **
10981  *b Available as Decision Bead/Event
10982  */
10983  int variable_increment_value_as_int(const char* varname, int value = 1);
10984 
10985  /*l
10986  *b Description:
10987  **
10988  ** This function is a convenience function for setting the variable
10989  ** to a new integer value without retrieving the diguyVariable
10990  ** object.
10991  **
10992  *b Arguments:
10993  **
10994  *a varname - name of variable to modify
10995  *a value - new value
10996  *a create_if_doesnt_exist - pass 1 to create the variable if it
10997  *a doesn't exist
10998  **
10999  *b Returns:
11000  **
11001  ** 0 on success, -1 on failure
11002  **
11003  *b Available as Decision Bead/Event
11004  */
11005  int variable_set_value_as_int(const char* varname,
11006  int value,
11007  int create_if_doesnt_exist = 1);
11008 
11009  /*l
11010  *b Description:
11011  **
11012  ** Short form of variable_set_value_as_int().
11013  */
11014  int set_ivar(const char* varname,
11015  int value,
11016  int create_if_doesnt_exist = 1);
11017 
11018  /*l
11019  *b Description:
11020  **
11021  ** This function is a convenience function for retrieving the
11022  ** value of a variable without retrieving the diguyVariable
11023  ** object.
11024  **
11025  ** If the variable doesn't exist and create_if_doesnt_exist is
11026  ** 0, the returned value will be 0.
11027  **
11028  *b Arguments:
11029  **
11030  *a varname - name of variable to query
11031  *a create_if_doesnt_exist - pass 1 to create the variable if it
11032  *a doesn't exist
11033  **
11034  *b Returns:
11035  **
11036  ** value of variable as int
11037  */
11038  int get_ivar(const char* varname,
11039  int create_if_doesnt_exist = 1);
11040 
11041  /*l
11042  *b Description:
11043  **
11044  ** Similar to variable_set_value_as_int(), for sets a
11045  ** floating point value instead.
11046  */
11047  int variable_set_value_as_float(const char* varname,
11048  float value,
11049  int create_if_doesnt_exist = 1);
11050 
11051  /*l
11052  *b Description:
11053  **
11054  ** Short form of variable_set_value_as_float().
11055  */
11056  int set_fvar(const char* varname,
11057  float value,
11058  int create_if_doesnt_exist = 1);
11059 
11060  /*l
11061  *b Description:
11062  **
11063  ** Similar to variable_get_value_as_int(), for returns a
11064  ** floating point value instead.
11065  **
11066  ** If the variable doesn't exist and create_if_doesnt_exist is
11067  ** 0, the returned value will be 0.0.
11068  */
11069  float get_fvar(const char* varname,
11070  int create_if_doesnt_exist = 1);
11071 
11072  /*l
11073  *b Description:
11074  **
11075  ** Similar to variable_set_value_as_int(), for sets a
11076  ** string value instead.
11077  */
11078  int variable_set_value_as_string(const char* varname,
11079  const char* value,
11080  int create_if_doesnt_exist = 1);
11081 
11082  /*l
11083  *b Description:
11084  **
11085  ** Short form of variable_set_value_as_string().
11086  */
11087  int set_svar(const char* varname,
11088  const char* value,
11089  int create_if_doesnt_exist = 1);
11090 
11091  /*l
11092  *b Description:
11093  **
11094  ** Similar to variable_get_value_as_int(), for returns a
11095  ** string value instead.
11096  **
11097  ** If the variable doesn't exist and create_if_doesnt_exist is
11098  ** 0, the returned value will be "".
11099  */
11100  const char* get_svar(const char* varname,
11101  int create_if_doesnt_exist = 1);
11102 
11103 
11104 /*****************************************************************************/
11119  /*l
11120  *b Description:
11121  **
11122  ** This function returns a pointer to the label object of
11123  ** the character.
11124  **
11125  ** Currently character labels are only enabled in DI-Guy Scenario.
11126  **
11127  *b Returns:
11128  **
11129  ** pointer to the character's label
11130  */
11131  diguyViewLabel* get_name_label();
11132 
11133  /*l
11134  *b Description:
11135  **
11136  ** This function sets the text of the character's label.
11137  ** By default the label text matches the character's name.
11138  **
11139  ** Currently character labels are only enabled in DI-Guy Scenario.
11140  **
11141  *b Arguments:
11142  **
11143  *a label_text - new text for the label
11144  **
11145  *b Returns:
11146  **
11147  ** 0 on success, -1 on failure
11148  */
11149  int set_label_text(const char* label_text);
11150 
11151  /*l
11152  *b Description:
11153  **
11154  ** This function returns the character's label text.
11155  ** See set_label_text().
11156  **
11157  *b Returns:
11158  **
11159  ** current label text; the returned pointer will never be NULL
11160  */
11161  const char* get_label_text();
11162 
11163  /*l
11164  *b Description:
11165  **
11166  ** This function sets whether the label of this character
11167  ** is visible. This setting will only be taken into account
11168  ** if the visibility flag for Character Labels is set to
11169  ** "Per Object".
11170  **
11171  ** Currently character labels are only enabled in DI-Guy Scenario.
11172  **
11173  *b Arguments:
11174  **
11175  *a is_visible - pass 1 to show, pass 0 to hide
11176  **
11177  *b Returns:
11178  **
11179  ** 0 on success, -1 on failure
11180  */
11181  int set_label_is_visible(int is_visible);
11182 
11183  /*l
11184  *b Description:
11185  **
11186  ** This function returns the most recent setting of
11187  ** set_label_is_visible().
11188  **
11189  *b Returns:
11190  **
11191  ** 1 if visible, 0 if not
11192  */
11193  int get_label_is_visible();
11194 
11195  /*l
11196  *b Description:
11197  **
11198  ** This function sets the text color of the character's label. By
11199  ** default the label text color is opaque white.
11200  **
11201  ** Currently character labels are only enabled in DI-Guy Scenario.
11202  **
11203  *b Arguments:
11204  **
11205  *a r, g, b, a - the red, green, blue, and alpha
11206  *a components of the text color
11207  **
11208  ** An alpha component of 0 makes the text completely transparent.
11209  ** An alpha component of 1 makes the text completely opaque.
11210  ** Values in between result in varying levels of transparency.
11211  **
11212  *b Returns:
11213  **
11214  ** 0 on success, -1 on failure
11215  */
11216  int set_label_text_color(float r, float g, float b, float a);
11217 
11218  /*l
11219  *b Description:
11220  **
11221  ** Alternate version of set_label_text_color().
11222  */
11223  int set_label_text_color_vec4(const diguyVec4f & color);
11224 
11225  /*l
11226  *b Description:
11227  **
11228  ** This function returns, in the passed variable pointers, the
11229  ** most recent setting of set_label_text_color().
11230  **
11231  *b Returns:
11232  **
11233  ** 0 on success, -1 on failure
11234  */
11235  int get_label_text_color(float* r, float* g, float* b, float* a);
11236 
11237  /*l
11238  *b Description:
11239  **
11240  ** Alternate version of get_label_text_color().
11241  */
11242  diguyVec4f get_label_text_color_vec4();
11243 
11244  /*l
11245  *b Description:
11246  **
11247  ** This function sets the text shadow color of the character's label.
11248  ** By default the label text shadow color is gray.
11249  **
11250  ** Currently character labels are only enabled in DI-Guy Scenario.
11251  **
11252  *b Arguments:
11253  **
11254  *a r, g, b, a - the red, green, blue, and alpha
11255  *a components of the text shadow color
11256  **
11257  ** An alpha component of 0 makes the text completely transparent.
11258  ** An alpha component of 1 makes the text completely opaque.
11259  ** Values in between result in varying levels of transparency.
11260  **
11261  *b Returns:
11262  **
11263  ** 0 on success, -1 on failure
11264  */
11265  int set_label_text_shadow_color(float r, float g, float b, float a);
11266 
11267  /*l
11268  *b Description:
11269  **
11270  ** Alternate version of set_label_text_shadow_color().
11271  */
11272  int set_label_text_shadow_color_vec4(const diguyVec4f & color);
11273 
11274  /*l
11275  *b Description:
11276  **
11277  ** This function returns, in the passed variable pointers, the
11278  ** most recent setting of set_label_text_shadow_color().
11279  **
11280  *b Returns:
11281  **
11282  ** 0 on success, -1 on failure
11283  */
11284  int get_label_text_shadow_color(float* r, float* g, float* b, float* a);
11285 
11286  /*l
11287  *b Description:
11288  **
11289  ** Alternate version of get_label_text_shadow_color().
11290  */
11291  diguyVec4f get_label_text_shadow_color_vec4();
11292 
11293  /*l
11294  *b Description:
11295  **
11296  ** This function sets the whether the text shadow is visible.
11297  **
11298  *b Arguments:
11299  **
11300  *a visible - pass 1 to make shadow visible, 0 to make it invisible
11301  **
11302  *b Returns:
11303  **
11304  ** 0 on success, -1 on failure
11305  */
11306  int set_label_text_shadow_is_visible(int is_visible);
11307 
11308  /*l
11309  *b Returns:
11310  **
11311  ** 1 if text shadow is visible, 0 if not
11312  */
11313  int get_label_text_shadow_is_visible();
11314 
11315  /*l
11316  *b Description:
11317  **
11318  ** This function sets the background color of the character's
11319  ** label. By default the label background color is transparent
11320  ** blue.
11321  **
11322  ** Currently character labels are only enabled in DI-Guy Scenario.
11323  **
11324  *b Arguments:
11325  **
11326  *a r, g, b, a - the red, green, blue, and alpha
11327  *a components of the text color
11328  **
11329  ** An alpha component of 0 makes the text completely transparent.
11330  ** An alpha component of 1 makes the text completely opaque.
11331  ** Values in between result in varying levels of transparency.
11332  **
11333  *b Returns:
11334  **
11335  ** 0 on success, -1 on failure
11336  */
11337  int set_label_background_color(float r, float g, float b, float a);
11338 
11339  /*l
11340  *b Description:
11341  **
11342  ** Alternate version of set_label_background_color().
11343  */
11344  int set_label_background_color_vec4(const diguyVec4f & color);
11345 
11346  /*l
11347  *b Description:
11348  **
11349  ** This function returns, in the passed variable pointers, the
11350  ** most recent setting of set_label_background_color().
11351  **
11352  *b Returns:
11353  **
11354  ** 0 on success, -1 on failure
11355  */
11356  int get_label_background_color(float* r, float* g, float* b, float* a);
11357 
11358  /*l
11359  *b Description:
11360  **
11361  ** Alternate version of get_label_background_color().
11362  */
11363  diguyVec4f get_label_background_color_vec4();
11364 
11365  /*l
11366  *b Description:
11367  **
11368  ** This function sets how high the label of the character will float
11369  ** above the character.
11370  **
11371  *b Arguments:
11372  **
11373  *a offset - offset, in meters, of label above character
11374  */
11375  void set_label_link_offset_override(float offset);
11376 
11377  /*l
11378  *b Returns:
11379  **
11380  ** how high the label of the character will float above the character
11381  */
11382  float get_label_link_offset_override();
11383 
11384  /*l
11385  *b Description:
11386  **
11387  ** This function sets whether the label text should show some basic
11388  ** state information about the character instead of its name or
11389  ** the text set by set_label_text().
11390  **
11391  ** The state shown is: Character name, current path, current action.
11392  ** The current path and current action will change as the character
11393  ** moves through paths and actions.
11394  **
11395  *b Arguments:
11396  **
11397  *a show_state - pass 1 to show state, 0 to show original text
11398  */
11399  int set_label_shows_character_state(int show_state);
11400 
11401  /*l
11402  *b Returns:
11403  **
11404  ** whether character state information is shown instead of the
11405  ** character's name or other label text
11406  */
11407  int get_label_shows_character_state();
11408 
11409 
11410 /*****************************************************************************/
11423  /*l
11424  *b Returns:
11425  **
11426  ** pointer of type diguyImpact; NULL if there has been no recent
11427  ** impact recorded; useful for finding out who or what was hit
11428  */
11429  diguyImpact* get_last_impact_record();
11430 
11431  /*l
11432  *b Returns:
11433  **
11434  ** the last impact number
11435  */
11436  int get_last_impact_number();
11437 
11438  /*l
11439  *b Returns:
11440  **
11441  ** the processed flag on the diguyImpact class
11442  */
11443  int get_last_impact_been_processed();
11444 
11445  /*l
11446  *b Description:
11447  **
11448  ** Sets the processed flag on the diguyImpact object.
11449  */
11450  void set_last_impact_been_processed();
11451 
11452  /*l
11453  *b Description:
11454  **
11455  ** Sets the maximum number of unprocessed impacts there can be.
11456  **
11457  ** The unprocessed impact array is a first-in-first-out queue. If an
11458  ** impact occurs that pushes the number of unprocessed impacts past
11459  ** this maximum number, earlier impacts will be dropped from the
11460  ** array.
11461  **
11462  ** The initial value is 10.
11463  */
11464  void set_max_unprocessed_impacts(int max_unprocessed_impacts);
11465 
11466  /*l
11467  *b Returns:
11468  **
11469  ** maximum number of unprocessed impacts
11470  */
11471  int get_max_unprocessed_impacts();
11472 
11473  /*l
11474  *b Returns:
11475  **
11476  ** the last impact link
11477  */
11478  const char* get_last_impact_link();
11479 
11480  /*l
11481  *b Returns:
11482  **
11483  ** 1 if the last impact link is the link named
11484  */
11485  int get_last_impact_link_is(const char* link_name);
11486 
11487  /*l
11488  *b Returns:
11489  **
11490  ** 1 if the last impact resulted from an impact with a vehicle,
11491  ** 0 if not
11492  */
11493  int get_last_impact_is_from_vehicle();
11494 
11495  /*l
11496  *b Returns:
11497  **
11498  ** 1 if the last impact speed is greater than the passed speed,
11499  ** 0 if not
11500  */
11501  int get_last_impact_speed_is_greater_than(float impact_speed);
11502 
11503  /*l
11504  *b Description:
11505  **
11506  ** Sets if impacts are ever processed on this character.
11507  ** Useful for temporary effects and the like.
11508  */
11509  void set_is_immune_to_impacts(int immune);
11510 
11511  /*l
11512  *b Returns:
11513  **
11514  ** 1 if the character is immune to impacts
11515  ** 0 if not
11516  */
11517  int get_is_immune_to_impacts();
11518 
11519 
11520 /*****************************************************************************/
11542  /*l
11543  *b Description:
11544  **
11545  ** This function starts the specified appearance effect on
11546  ** the character.
11547  **
11548  ** The following appearance effects are available:
11549  **
11550  *- - "brake_lights"
11551  *- - "debris"
11552  *- - "debris_dark"
11553  *- - "dust"
11554  *- - "engine_smoke"
11555  *- - "explosion"
11556  *- - "explosion_dark"
11557  *- - "flames"
11558  *- - "flashing_lights"
11559  *- - "ground_dust_burst"
11560  *- - "headlights"
11561  *- - "rotor_wash"
11562  *- - "smoke"
11563  *- - "smoke_dark"
11564  *- - "smoke_trail"
11565  **
11566  *b Arguments:
11567  **
11568  *a effect - name of appearance effect to be started
11569  *a override_link - link to attach to; overrides default
11570  *a override_scale - scale to use for effect; overrides default
11571  *a override_offset_x - x offset to use for effect; overrides default
11572  *a override_offset_y - y offset to use for effect; overrides default
11573  *a override_offset_z - z offset to use for effect; overrides default
11574  *a override_duration - overrides how long the effect should show
11575  *a before automatically ending
11576  **
11577  *b Returns:
11578  **
11579  ** 0 on success, -1 on failure
11580  **
11581  *b Available as Decision Bead/Event
11582  */
11583  int begin_appearance_effect(const char* effect,
11584  const char* override_link = NULL,
11585  float override_scale = DIGUY_DEFAULT_FLOAT,
11586  float override_offset_x = DIGUY_DEFAULT_FLOAT,
11587  float override_offset_y = DIGUY_DEFAULT_FLOAT,
11588  float override_offset_z = DIGUY_DEFAULT_FLOAT,
11589  float override_duration = DIGUY_DEFAULT_FLOAT);
11590 
11591  /*l
11592  *b Description:
11593  **
11594  ** This function ends the specified appearance effect on the
11595  ** character.
11596  **
11597  ** The active particles of the effect will go to completion. Use
11598  ** stop_all_appearance_effects() to immediately stop effects,
11599  ** including their active particles.
11600  **
11601  ** If the effect hasn't been started, nothing happens.
11602  **
11603  *b Arguments:
11604  **
11605  *a effect - name of appearance effect to be ended
11606  *a override_link - optional override link effect is attached to
11607  **
11608  ** Pass "all" for the effect argument to end all of this character's
11609  ** appearance effects.
11610  **
11611  *b Returns:
11612  **
11613  ** 0 on success, -1 on failure
11614  **
11615  *b Available as Decision Bead/Event
11616  */
11617  int end_appearance_effect(const char* effect,
11618  const char* override_link = NULL);
11619 
11620  /*l
11621  *b Description:
11622  **
11623  ** This function stops the specified appearance effect on the
11624  ** character.
11625  **
11626  ** The active particle systems of the effect will immediately be
11627  ** removed. Use end_appearance_effect() to gradually stop effects;
11628  ** that function lets active particles move to completion.
11629  **
11630  ** If the effect hasn't been started, nothing happens.
11631  **
11632  *b Arguments:
11633  **
11634  *a effect - name of appearance effect to be ended
11635  *a override_link - optional override link effect is attached to
11636  **
11637  ** Pass "all" for the effect argument to stop all of this character's
11638  ** appearance effects.
11639  **
11640  *b Returns:
11641  **
11642  ** 0 on success, -1 on failure
11643  **
11644  *b Available as Decision Bead/Event
11645  */
11646  int stop_appearance_effect(const char* effect,
11647  const char* override_link = NULL);
11648 
11649  /*l
11650  *b Description:
11651  **
11652  ** Equivalent to stop_appearance_effect("all");
11653  */
11654  int stop_all_appearance_effects();
11655 
11656  /*l
11657  *b Description:
11658  **
11659  ** This function checks to see if the specified appearance effect
11660  ** has been started with begin_appearance_effect().
11661  **
11662  *b Arguments:
11663  **
11664  *a effect - name of appearance effect to check
11665  *a override_link - optional override link effect is attached to
11666  **
11667  *b Returns:
11668  **
11669  ** 1 if appearance is active, 0 if not
11670  */
11671  int appearance_effect_is_active(const char* effect,
11672  const char* override_link = NULL);
11673 
11674 
11675 /*****************************************************************************/
11688  /*l
11689  *b Description:
11690  **
11691  ** This function returns a pointer to a diguyChainSimulation if the
11692  ** character is a chain_simulation type of character.
11693  **
11694  *b Returns:
11695  **
11696  ** pointer to a diguyChainSimulation
11697  */
11698  diguyChainSimulation* get_chain_simulation();
11699 
11700 
11701 /*****************************************************************************/
11714  /*l
11715  *b Description:
11716  **
11717  ** This function returns a pointer to a diguyVehicleController if the
11718  ** character has one.
11719  **
11720  *b Returns:
11721  **
11722  ** pointer to a diguyVehicleController; may return NULL if character
11723  ** does not have a vehicle controller object
11724  */
11725  diguyVehicleController* get_vehicle_controller();
11726 
11727  /*l
11728  *b Description:
11729  **
11730  ** For most characters playing a travel forward action, the
11731  ** character's facing direction matches the direction of travel. For
11732  ** example, when humans walk forward their pelvis is generally
11733  ** aligned in the direction of travel.
11734  **
11735  ** Some vehicle characters behave differently. For vehicles whose
11736  ** front wheels steer, when turning the vehicle body will pivot around
11737  ** the rear axle. Only gradually will the rear of the vehicle swing
11738  ** in behind the direction of travel. Think of a car making a very
11739  ** sharp turn, and how the rear of the car swings in behind the front
11740  ** as the turn is completed.
11741  **
11742  ** This function will return the orientation of the body of the
11743  ** vehicle; i.e., the orientation of the forward vector along the
11744  ** vehicle's long axis. As mentioned above this may be different
11745  ** than the orientation of the direction of travel.
11746  **
11747  ** This function will return valid results for all characters, though
11748  ** the returned values from this function and that of
11749  ** get_orientation() will be the same for non-vehicle characters.
11750  **
11751  *b Returns:
11752  **
11753  ** 0 on success, -1 on failure
11754  */
11755  int get_vehicle_body_orientation(float* rz, float* rx, float* ry);
11756 
11757 
11758 /*****************************************************************************/
11775  /*l
11776  *b Description:
11777  **
11778  ** This function sets the name of the shader technique that will be
11779  ** used by the character when the scenario is using the specified
11780  ** render mode. See diguyScenario::set_current_render_mode().
11781  **
11782  ** Note that care should be taken when changing the shader of
11783  ** characters with skinned appearances. A shader capable of properly
11784  ** transforming vertices must be used for such characters.
11785  **
11786  ** The shader with the given name should be loaded first. If the
11787  ** shader technique is not one of DI-Guy's stock shaders, a custom
11788  ** shader technique can be loaded explicitly by calling
11789  ** the diguyApp::load_shader_program() function.
11790  **
11791  *b NOTE:
11792  **
11793  ** The specified shader technique may not take effect immediately,
11794  ** if the scenario's current render mode is different than the
11795  ** passed render mode. See
11796  ** diguyScenario::set_current_render_mode().
11797  **
11798  *b Arguments:
11799  **
11800  *a shader_name - shader technique name; can be NULL
11801  *a render_mode - render mode to modify; passing NULL will
11802  *a modify shader "normal" render mode
11803  **
11804  *b Returns:
11805  **
11806  ** 0 on success, -1 on failure
11807  */
11808  int set_render_mode_shader(const char* shader_name,
11809  const char* render_mode = NULL);
11810 
11811  /*l
11812  *b Description:
11813  **
11814  ** This function resets the shader technique for the specified render
11815  ** mode to its default. This will be the shader technique name
11816  ** returned by
11817  ** diguyScenario::get_default_character_shader_program_name().
11818  **
11819  ** If the specified render mode is the current scenario render mode,
11820  ** the current shader will change immediately. If not, the change
11821  ** will not take effect until the specified render mode becomes the
11822  ** current scenario render mode. See
11823  ** diguyScenario::set_current_render_mode().
11824  **
11825  *b Arguments:
11826  **
11827  *a render_mode - render mode to modify; passing NULL will
11828  *a modify shader of "normal" render mode
11829  */
11830  void reset_render_mode_shader_to_default(const char* render_mode = NULL);
11831 
11832  /*l
11833  *b Description:
11834  **
11835  ** This function returns the name of the shader technique that will be used by
11836  ** the character when the scenario is using the specified render
11837  ** mode.
11838  **
11839  *b Arguments:
11840  **
11841  *a render_mode - render mode for which to get technique name;
11842  *a pass NULL for "normal" render mode
11843  **
11844  *b Returns:
11845  **
11846  ** name of shader technique; NULL if none or error
11847  */
11848  const char* get_render_mode_shader(const char* render_mode = NULL);
11849 
11850  /*l
11851  *b Description:
11852  **
11853  ** This function returns the shader program that is in use by the
11854  ** character. Shader programs are shared objects that can be used
11855  ** by multiple characters. This is here for backwards compatibility,
11856  ** and just returns the highest quality shader technique shader.
11857  **
11858  *b Returns:
11859  **
11860  ** object of type diguyGraphicsShaderProgram; NULL if none
11861  */
11862  diguyGraphicsShaderProgram* get_shader_program();
11863 
11864  /*l
11865  *b Description:
11866  **
11867  ** This function returns the shader technique that is in use by the
11868  ** character. Shader techniques own a number of shader objects.
11869  **
11870  *b Returns:
11871  **
11872  ** object of type diguyGraphicsShaderTechnique; NULL if none
11873  */
11874  diguyGraphicsShaderTechnique* get_shader_technique();
11875 
11876  /*l
11877  *b Description:
11878  **
11879  ** This function overrides the current shader with the specified
11880  ** temporary shader. This temporary shader will remain in effect
11881  ** until:
11882  **
11883  *- - the scenario is reset
11884  *- - reset_current_shader_to_default() is called
11885  *- - set_temporary_current_shader() is called with NULL
11886  **
11887  *b Arguments:
11888  **
11889  *a shader_name - shader name; can be NULL
11890  **
11891  ** Passing NULL for the shader name will un-set the temporary shader,
11892  ** resetting the render mode shader to its default.
11893  **
11894  *b Returns:
11895  **
11896  ** 0 on success, -1 on failure
11897  */
11898  int set_temporary_current_shader(const char* shader_name);
11899 
11900  /*l
11901  *b Description:
11902  **
11903  ** This is a convenience function for resetting the current render
11904  ** mode shader to its default.
11905  **
11906  ** It is equivalent to retrieving the current render mode using
11907  ** diguyScenario::get_current_render_mode(), and calling
11908  ** reset_render_mode_shader_to_default() with that render mode.
11909  */
11910  void reset_current_shader_to_default();
11911 
11912  /*l
11913  *b Description:
11914  **
11915  ** This is a convenience function for refreshing the shader
11916  ** of a character. Usually used in conjunction with logic
11917  ** provided by the user with the graphics API.
11918  */
11919  void trigger_shader_refresh();
11920 
11921  /*l
11922  *b Description:
11923  **
11924  ** This function returns the shader instance that is in use by the
11925  ** character. Each character has its own shader instance.
11926  **
11927  ** Note that the shader instance of a character can change over the
11928  ** lifetime of the character. For example, it will change if the
11929  ** appearance of the character changes. Therefore the returned
11930  ** pointer should not be stored, but should be re-read each time
11931  ** it is needed.
11932  **
11933  *b Returns:
11934  **
11935  ** object of type diguyGraphicsShaderInstance; NULL if none
11936  */
11937  diguyGraphicsShaderInstance* get_shader_instance();
11938 
11939  /*l
11940  *b Description:
11941  **
11942  ** This function resets current values of the variables of the shader
11943  ** back to their initial reset values.
11944  */
11945  void reset_shader_instance_variables_to_initial_values();
11946 
11947  /*l
11948  *b Description:
11949  **
11950  ** This function resets the current and initial values of variables
11951  ** of the shader to the built-in DI-Guy configuration defaults.
11952  */
11953  void reset_shader_instance_variables_to_program_defaults();
11954 
11955 
11956 /*****************************************************************************/
11980  /*l
11981  *b Description:
11982  **
11983  ** This function sets the named character as the attack
11984  ** target of this agent. This agent will pursue the
11985  ** target until it is within range, and then will fire its
11986  ** weapon in an attempt to kill the target.
11987  **
11988  ** This function will implicitly put this agent into the
11989  ** attack behavior.
11990  **
11991  ** The current focus character will be set the specified character.
11992  ** Pass NULL or the empty string ("") to not change the focus
11993  ** character, but still change to the pursue behavior.
11994  **
11995  ** The current focus group will be un-set.
11996  **
11997  *b Arguments:
11998  **
11999  *a character_name - character to attack
12000  **
12001  *b Returns:
12002  **
12003  ** 0 on success, -1 on failure
12004  **
12005  *b Available as Decision Bead/Event
12006  */
12007  int agent_attack_character(const char* character_name);
12008 
12009  /*l
12010  *b Description:
12011  **
12012  ** This function is similar to agent_attack_character(), but instead
12013  ** will choose attack targets from the characters in the specified
12014  ** group.
12015  **
12016  ** This function will implicitly put this agent into the attack
12017  ** behavior.
12018  **
12019  ** The current focus group will be set to the specified group. Pass
12020  ** NULL or the empty string ("") to not change the focus group, but
12021  ** still change to the attack behavior.
12022  **
12023  ** The current focus character will be un-set.
12024  **
12025  *b Arguments:
12026  **
12027  *a group_name - name of group from which attack targets should
12028  *a be chosen
12029  **
12030  *b Returns:
12031  **
12032  ** 0 on success, -1 on failure
12033  **
12034  *b Available as Decision Bead/Event
12035  */
12036  int agent_attack_group(const char* group_name);
12037 
12038  /*l
12039  *b Description:
12040  **
12041  ** See diguyAgentParams::set_attack_zone_enabled().
12042  */
12043  int agent_set_attack_zone_enabled(int use_attack_zone);
12044 
12045  /*l
12046  *b Description:
12047  **
12048  ** See diguyAgentParams::get_attack_zone_enabled().
12049  */
12050  int agent_get_attack_zone_enabled();
12051 
12052  /*l
12053  *b Description:
12054  **
12055  ** See diguyAgentParams::set_attack_zone().
12056  */
12057  int agent_set_attack_zone(float x, float y, float z, float radius);
12058 
12059  /*l
12060  *b Description:
12061  **
12062  ** See diguyAgentParams::get_attack_zone().
12063  */
12064  int agent_get_attack_zone(float* x, float* y, float* z, float* radius);
12065 
12072  /*l
12073  *b Description:
12074  **
12075  ** This function adds a flee object to this agent.
12076  ** This agent will attempt to move away from the specified
12077  ** character until it is beyond the specified flee distance.
12078  **
12079  ** Note: Currently there can only be one flee object. This
12080  ** restriction will be lifted in a future version.
12081  **
12082  ** This function will implicitly put this agent into the
12083  ** flee behavior.
12084  **
12085  ** Neither the current focus character nor group will be
12086  ** changed by this function.
12087  **
12088  *b Arguments:
12089  **
12090  *a character_name - character from which to flee
12091  *a distance - minimum distance to move away from character
12092  *a danger_level - how "strong" the flee should be; set from
12093  *a 0 to 100
12094  **
12095  ** The danger_level argument is not currently used, but will be in
12096  ** a future version.
12097  **
12098  *b Returns:
12099  **
12100  ** 0 on success, -1 on failure
12101  **
12102  *b Available as Decision Bead/Event
12103  */
12104  int agent_flee_character(const char* character_name,
12105  float distance,
12106  int danger_level = 50);
12107 
12108  /*l
12109  *b Description:
12110  **
12111  ** This function adds a flee object to this agent. This agent
12112  ** will attempt to move away from the specified group until it is
12113  ** beyond the specified flee distance.
12114  **
12115  ** This function will implicitly put this agent into the flee
12116  ** behavior.
12117  **
12118  ** Neither the current focus character nor group will be changed
12119  ** by this function.
12120  **
12121  *b Arguments:
12122  **
12123  *a group_name - group from which to flee
12124  *a distance - minimum distance to move away from character
12125  *a danger_level - how "strong" the flee should be; set from
12126  *a 0 to 100
12127  **
12128  ** The danger_level argument is not currently used, but will be in
12129  ** a future version.
12130  **
12131  *b Returns:
12132  **
12133  ** 0 on success, -1 on failure
12134  **
12135  *b Available as Decision Bead/Event
12136  */
12137  int agent_flee_group(const char* group_name,
12138  float distance,
12139  int danger_level = 50);
12140 
12141  /*l
12142  *b Description:
12143  **
12144  ** This function is similar to agent_flee_group(), but the
12145  ** agent will instead flee the members of the specified
12146  ** crowd.
12147  */
12148  int agent_flee_crowd(const char* crowd_name,
12149  float distance,
12150  int danger_level = 50);
12151 
12152  /*l
12153  *b Description:
12154  **
12155  ** This function adds a flee object to this agent.
12156  ** This agent will attempt to move away from the specified
12157  ** location until it is beyond the specified flee distance.
12158  **
12159  ** Note: Currently there can only be one flee object. This
12160  ** restriction will be lifted in a future version.
12161  **
12162  ** This function will implicitly put this agent into the
12163  ** flee behavior.
12164  **
12165  ** Neither the current focus character nor group will be
12166  ** changed by this function.
12167  **
12168  *b Arguments:
12169  **
12170  *a x, y, z - location from which to flee
12171  *a distance - minimum distance to move away from character
12172  *a danger_level - how "strong" the flee should be; set from
12173  *a 0 to 100
12174  **
12175  ** The danger_level argument is not currently used, but will be in
12176  ** a future version.
12177  **
12178  *b Returns:
12179  **
12180  ** 0 on success, -1 on failure
12181  */
12182  int agent_flee_location(float x, float y, float z,
12183  float distance,
12184  int danger_level = 50);
12185 
12186  /*l
12187  *b Description:
12188  **
12189  ** This function removes all flee objects.
12190  **
12191  ** This function has no effect on current behavior.
12192  **
12193  *b Returns:
12194  **
12195  ** 0 on success, -1 on failure
12196  **
12197  *b Available as Decision Bead/Event
12198  */
12199  void agent_remove_all_flee_objects();
12200 
12211  /*l
12212  *b Description:
12213  **
12214  ** This function puts this agent into the mingle behavior, in which
12215  ** it will choose semi-random points in the specified region and
12216  ** subregion to move to. The agent will remain at the selected
12217  ** points for some amount of time, and the select a new point.
12218  **
12219  ** If all members of a crowd have this behavior they will tend to get
12220  ** together in small groups.
12221  **
12222  ** Use diguyAgentParams::set_move_on_t_min() and
12223  ** diguyAgentParams::set_move_on_t_max() for setting how long the
12224  ** agent will remain at the selected mingle points.
12225  **
12226  *b Arguments:
12227  **
12228  *a region_name - region in which to mingle
12229  *a subregion_name - subregion in which to mingle
12230  **
12231  ** The behavior region will be set the specified region. Pass NULL
12232  ** or "(current)" to not change the current behavior region.
12233  **
12234  *b Returns:
12235  **
12236  ** 0 on success, -1 on failure
12237  **
12238  *b Available as Decision Bead/Event
12239  */
12240  int agent_mingle_in_region(const char* region_name = "(current)",
12241  const char* subregion_name = "base");
12242 
12253  /*l
12254  *b Description:
12255  **
12256  ** This function is similar to agent_mingle_in_region(), but agents
12257  ** will pick completely random points and not try to clump together
12258  ** in small groups.
12259  **
12260  *b Returns:
12261  **
12262  ** 0 on success, -1 on failure
12263  **
12264  *b Available as Decision Bead/Event
12265  */
12266  int agent_wander_region(const char* region_name = "(current)",
12267  const char* subregion_name = "base");
12268 
12279  /*l
12280  *b Description:
12281  **
12282  ** This function will cause this agent to pursue the specified
12283  ** character. This agent will attempt to move toward the specified
12284  ** character until it is within its still distance as specified in
12285  ** its agent params.
12286  **
12287  ** This function will implicitly put this agent into the pursue
12288  ** behavior.
12289  **
12290  ** The current focus group will be set to the specified group. Pass
12291  ** NULL or the empty string ("") to not change the focus group, but
12292  ** still change to the attack behavior.
12293  **
12294  ** The current focus character will be un-set.
12295  **
12296  *b Arguments:
12297  **
12298  *a character_name - character to pursue
12299  **
12300  *b Returns:
12301  **
12302  ** 0 on success, -1 on failure
12303  **
12304  *b Available as Decision Bead/Event
12305  */
12306  int agent_pursue_character(const char* character_name);
12307 
12308  /*l
12309  *b Description:
12310  **
12311  ** This function is similar to agent_pursue_character(), but the
12312  ** point toward the agent will move will be offset from the pursued
12313  ** character by the passed offset.
12314  */
12315  int agent_pursue_character_with_offset(const char* character_name,
12316  float offset_x,
12317  float offset_y);
12318 
12319  /*l
12320  *b Description:
12321  **
12322  ** This function is similar to agent_pursue_character(), but instead
12323  ** will choose pursue characters from the characters in the specified
12324  ** group.
12325  **
12326  ** This function will implicitly put this agent into the pursue
12327  ** behavior.
12328  **
12329  ** The current focus group will be set to the specified group. Pass
12330  ** NULL or the empty string ("") to not change the focus group, but
12331  ** still change to the pursue behavior.
12332  **
12333  ** The current focus character will be un-set.
12334  **
12335  *b Arguments:
12336  **
12337  *a group_name - name of group from which pursue characters should
12338  *a be chosen
12339  **
12340  *b Returns:
12341  **
12342  ** 0 on success, -1 on failure
12343  **
12344  *b Available as Decision Bead/Event
12345  */
12346  int agent_pursue_group(const char* group_name);
12347 
12348  /*l
12349  *b Description:
12350  **
12351  ** Calls a formation with this character as a leader, oriented towards
12352  ** (target_x, target_y).
12353  **
12354  *b Returns:
12355  **
12356  ** 0 on success, -1 on failure
12357  */
12358  int agent_call_formation(const char* formation_name,
12359  float target_x,
12360  float target_y);
12361 
12372  /*l
12373  *b Description:
12374  **
12375  ** This function has the character travel along its behavior path
12376  ** shape, typically to the end and then back to the beginning. It
12377  ** will put the agent into the travel behavior.
12378  **
12379  *b Arguments:
12380  **
12381  *a direction - should be either "forward" or "backward"; pass NULL
12382  *a for default forward
12383  *a at_end - what to do when end of path reached
12384  *a waypoint_index - index of waypoint to start at; -1 for nearest,
12385  *a -2 for random
12386  *a offset_y - sideways offset from behavior path
12387  **
12388  ** Valid values for at_end are:
12389  **
12390  *- - "reverse"
12391  *- - "loop"
12392  *- - "stop"
12393  *- - "teleport"
12394  **
12395  ** See the documentation for diguyNavPathAtEnd for information on
12396  ** what each value means.
12397  */
12398  int agent_travel_behavior_path(const char* direction = NULL,
12399  const char* at_end = NULL,
12400  int waypoint_index = -1,
12401  float offset_y = 0.5f);
12402 
12403  /*l
12404  *b Description:
12405  **
12406  ** Similar to agent_travel_behavior_path(), but specific path can be
12407  ** set rather than using behavior path.
12408  */
12409  int agent_travel_path_shape(const char* path_shape_name,
12410  const char* direction = NULL,
12411  const char* at_end = NULL,
12412  int waypoint_index = -1,
12413  float offset_y = 0.5f);
12414 
12415  /*l
12416  *b Description:
12417  **
12418  ** The agent will create a travel path around the border of the
12419  ** region specified. A CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED
12420  ** callback will be triggered every time a character completes a loop
12421  ** around the border.
12422  **
12423  *b Arguments:
12424  **
12425  *a region_name - the name of the region to patrol; leaving blank or
12426  *a passing NULL will use the agent's current region
12427  *a subregion - name of the subregion to use; defaults to the base
12428  *a subregion
12429  **
12430  *b Returns:
12431  **
12432  ** 0 on success, -1 on failure
12433  */
12434  int agent_travel_region_border(const char* region_name = NULL,
12435  const char* subregion_name = "base");
12436 
12437  /*l
12438  *b Description:
12439  **
12440  ** Agent will attempt to create a navigation path on the via_region
12441  ** and then travel it. An A* path planning algorithm is used to find
12442  ** the path, cost preferences from the character's current
12443  ** diguyAgentParams are used in the search.
12444  **
12445  *b Note: as of DI-Guy 12 there is a version of this function
12446  ** agent_move_to_point_bg() that uses a multi-threaded infrastructure.
12447  ** We strongly recommend using it for future developments.
12448  **
12449  *b Arguments:
12450  **
12451  *a x, y, z - the target location
12452  *a via_region - the name of the region to run A* on (pass in "*"
12453  *a to have the code attempt to find the nearest
12454  *a region automatically.)
12455  *a subregion_name - the name of the subregion to restrict search to
12456  **
12457  *b Returns:
12458  **
12459  ** 0 on success, -1 on failure
12460  */
12461  int agent_move_to_point(float x, float y, float z,
12462  const char* via_region = NULL,
12463  const char* subregion_name = "base");
12464 
12465  /*l
12466  *b Description:
12467  **
12468  ** A multi-threaded version of agent_move_to_point(). See that
12469  ** function for more information.
12470  **
12471  ** We recommend switching to using this over the single threaded
12472  ** version. When the path result has been computed a callback with id
12473  ** CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED is triggered and the result is
12474  ** stored in get_path_planning_result(). You can also poll for
12475  ** completion via get_is_path_planning().
12476  **
12477  *b Returns:
12478  **
12479  ** diguyNavPathSearchResults enum value
12480  **
12481  ** The return value is typically DIGUY_NAV_PATH_ERROR_NONE (0) on
12482  ** success, DIGUY_NAV_PATH_ERROR_SEARCH_QUEUED if this has been queued
12483  ** for multi-threading, or a negative value on failure.
12484  */
12485  int agent_move_to_point_bg(float x, float y, float z,
12486  const char* via_region = NULL,
12487  const char* subregion_name = "base");
12488 
12489  /*l
12490  *b Description:
12491  **
12492  ** Agent will attempt to create a navigation path on the region
12493  ** via_region and then travel it. An A* path planning algorithm is
12494  ** used to find the path.
12495  **
12496  ** The subregion masks are used to specify which subregions to use or
12497  ** avoid. Cost bias values can be used to make tweak how strong the
12498  ** repulsion values are.
12499  **
12500  *b Note:
12501  **
12502  ** As of DI-Guy 12 there is a version of this function
12503  ** agent_move_to_point_via_subregions_bg that uses a multi-threaded
12504  ** infrastructure. We strongly recommend using it for future
12505  ** developments.
12506  **
12507  ** This function will fail and return -1 if a path cannot be found.
12508  **
12509  *b Arguments:
12510  **
12511  *a x, y, z - the target location
12512  *a via_region - the name of the region to run A* on (pass in "*"
12513  *a to have the code attempt to find the nearest
12514  *a region automatically)
12515  *a preferred_subregions_mask - diguySubregionMask value of regions
12516  *a preferred for travel
12517  *a cost_bias_for_preferred_regions - how much cheaper it will be
12518  *a to cross spaces that are part of desired subregion;
12519  *a should be < 1.0
12520  *a cost_bias_for_neutral_regions - how much more expensive it will be
12521  *a to cross spaces that are not part of desired subregion; see
12522  *a below for more information
12523  *a repulsed_regions_mask - diguySubregionMask value of regions *not*
12524  *a preferred for travel
12525  *a cost_bias_for_repulsed_regions - how much more expensive it will be
12526  *a to cross regions that are marked as repulsive; pass
12527  *a DIGUY_DEFAULT_FLOAT to avoid completely
12528  **
12529  ** Pass DIGUY_DEFAULT_FLOAT for cost_bias_for_neutral_regions and
12530  ** cost_bias_for_repulsed_regions to specify that they should be
12531  ** avoided completely.
12532  **
12533  ** The preferred_subregions_mask and repulsed_regions_mask use
12534  ** DI-Guy subregion mask values combined together. For example,
12535  ** DIGUY_SUBREGION_MASK_SIDEWALK | DIGUY_SUBREGION_MASK_CROSSWALK.
12536  **
12537  ** For cost_bias_for_neutral_regions, specifying a non-zero value for
12538  ** this lowers the likelihood that searches fail on disjointed
12539  ** subregions. A value < 1 will cause the planner to run faster but
12540  ** explore fewer points, possibly missing preferred regions. Values
12541  ** greater then 1 will explore more points but will be slower.
12542  **
12543  *b NOTE:
12544  **
12545  *b THIS API has changed for DI-GUY 11.
12546  **
12547  ** cost_bias_for_preferred_regions has been added and the neutral and
12548  ** repulsed default values have changed.
12549  **
12550  *b Returns:
12551  **
12552  ** 0 on success, -1 on failure
12553  */
12554  int agent_move_to_point_via_subregions(float x, float y, float z,
12555  const char* via_region = NULL,
12556  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12557  float cost_bias_for_preferred_regions = 0.25f,
12558  float cost_bias_for_neutral_regions = 1.1f,
12559  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12560  float cost_bias_for_repulsed_regions = 10.0f,
12561  int cost_rule = 0);
12562 
12563  /*l
12564  *b Description:
12565  **
12566  ** A multi-threaded version of agent_move_to_point_via_subregions().
12567  ** We recommend switching to using this over the single threaded
12568  ** version. When the result is found a
12569  ** CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED is triggered and the result is
12570  ** stored in get_path_planning_result(), you can also poll for
12571  ** completion via get_is_path_planning().
12572  **
12573  *b Returns:
12574  **
12575  ** diguyNavPathSearchResults enum value
12576  **
12577  ** The return value is typically DIGUY_NAV_PATH_ERROR_NONE (0) on
12578  ** success, DIGUY_NAV_PATH_ERROR_SEARCH_QUEUED if this has been queued
12579  ** for multi-threading, or a negative value on failure.
12580  */
12581  int agent_move_to_point_via_subregions_bg(float x, float y, float z,
12582  const char* via_region = NULL,
12583  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12584  float cost_bias_for_preferred_regions = 0.25f,
12585  float cost_bias_for_neutral_regions = 1.1f,
12586  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12587  float cost_bias_for_repulsed_regions = 10.0f,
12588  int cost_rule = 0);
12589 
12590  /*l
12591  *b Returns:
12592  **
12593  ** diguyNavPathSearchResults value after agent_move_to_point_bg()
12594  ** or agent_move_to_point_via_subregions_bg() has been called when
12595  ** the multi-threaded path planner has completed.
12596  */
12597  int get_path_planning_result();
12598 
12599  /*l
12600  *b Returns:
12601  **
12602  ** 1 if character is currently waiting for a result from the
12603  ** multi-threaded path planner, else 0
12604  */
12605  int get_is_path_planning();
12606 
12607  /*l
12608  *b Description:
12609  **
12610  ** Agent will attempt to create a navigation path on the via_region
12611  ** to a point in the target region, and then travel it. An A* path
12612  ** planning algorithm is used to find the path. Cost preferences from
12613  ** the character's current diguyAgentParams are used in the search.
12614  **
12615  *b Arguments:
12616  **
12617  *a region - target region
12618  *a subregion_name - target subregion
12619  *a via_region - name of the region travel in
12620  **
12621  *b Returns:
12622  **
12623  ** 0 on success, -1 on failure
12624  **
12625  *b Available as Decision Bead/Event
12626  */
12627  int agent_move_to_region(const char* region,
12628  const char* subregion_name = "base",
12629  const char* via_region = NULL);
12630 
12631  /*l
12632  *b Description:
12633  **
12634  ** Similar to agent_move_to_point_via_subregions(), but for moving to
12635  ** another region.
12636  **
12637  *b NOTE:
12638  **
12639  *b THIS API has changed for DI-GUY 11.
12640  **
12641  ** cost_bias_for_preferred_regions has been added and the neutral and
12642  ** repulsed default values have changed.
12643  **
12644  *b See Also:
12645  **
12646  ** diguyScenario::set_max_distance_planning_multiplier();
12647  ** diguyScenario::get_time_spent_path_planning_this_frame();
12648  **
12649  *b Returns:
12650  **
12651  ** 0 on success, -1 on failure
12652  */
12653  int agent_move_to_region_via_subregions(const char* region_name,
12654  const char* subregion_name = "base",
12655  const char* via_region = NULL,
12656  float cost_bias_for_preferred_regions = 0.25f,
12657  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12658  float cost_bias_for_neutral_regions = 1.1f,
12659  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12660  float cost_bias_for_repulsed_regions = 10.0f);
12661 
12672  /*l
12673  *b Description:
12674  **
12675  ** The agent will begin following the specified path, using the path
12676  ** follow behavior (DIGUY_AGENT_BEHAVIOR_PATH_FOLLOW).
12677  **
12678  ** The path follow behavior allows an agent to approximately follow a
12679  ** diguyCharacterPath without being in path position mode. The agent
12680  ** can respond to external stimuli (e.g., run away from gunfire), and
12681  ** later return to and resume the path.
12682  **
12683  ** Currently the path must be a path previously defined for the
12684  ** character, through either DI-Guy Scenario or via path API calls.
12685  **
12686  *b Arguments:
12687  **
12688  *a path_name - name of a path of this character
12689  **
12690  *b Returns:
12691  **
12692  ** 0 on success, -1 on failure
12693  **
12694  *b Available as Decision Bead/Event
12695  */
12696  int agent_path_follow(const char* path_name);
12697 
12698  /*l
12699  *b Description:
12700  **
12701  ** The agent will resume following the path specified by a previous
12702  ** call to agent_path_follow(). This will put the agent back into
12703  ** the path follow behavior.
12704  **
12705  *b Returns:
12706  **
12707  ** 0 on success, -1 on failure
12708  **
12709  *b Available as Decision Bead/Event
12710  */
12711  int agent_resume_path_follow();
12712 
12713  /*l
12714  *b Returns:
12715  **
12716  ** the path being followed in path behavior mode
12717  */
12718  diguyCharacterPath* agent_get_path_follow_path();
12719 
12720  /*l
12721  *b Description:
12722  **
12723  ** In path follow behavior the agent moves along the path specified
12724  ** in agent_path_follow(). How far along the agent is on the path is
12725  ** specified in seconds. This function returns that time.
12726  **
12727  ** Note that advancing along the path may be paused for some reason,
12728  ** typically because the agent is resuming path follow behavior
12729  ** after being in a different behavior, or the agent is too far away
12730  ** from the current desired position on the path. In this case the
12731  ** returned time may not advance for awhile until the agent is close
12732  ** enough to the path to resume advancing along it.
12733  **
12734  ** Call diguyAgentParams::set_path_follow_pause_t_when_off_path()
12735  ** to set whether time will be paused when off of the path.
12736  **
12737  ** Call diguyAgentParams::set_path_follow_unpause_t_at_radius() to
12738  ** set how close the agent must be to the last point on the path
12739  ** before time will resume.
12740  **
12741  *b Returns:
12742  **
12743  ** how far, in seconds, the agent is along its path follow path
12744  */
12745  float agent_get_path_follow_path_t();
12746 
12747  /*l
12748  *b Returns:
12749  **
12750  ** 1 if time along the path is not advancing, else 0
12751  */
12752  int agent_get_path_follow_path_t_paused();
12753 
12764  /*l
12765  *b Returns:
12766  **
12767  ** the crowd this agent is a part of, if any; returns NULL if not in
12768  ** a crowd
12769  */
12770  diguyCrowd* agent_get_crowd();
12771 
12772  /*l
12773  *b Description:
12774  **
12775  ** This function allows the end user to directly change an agent's
12776  ** current behavior. This function currently the only way to start
12777  ** an agent "idling".
12778  */
12779  int agent_begin_behavior(const char* behavior_name);
12780 
12781  /*l
12782  *b Description:
12783  **
12784  ** This function sets the behavior of the agent to "none".
12785  */
12786  int agent_stop_behavior();
12787 
12788  /*l
12789  *b Description:
12790  **
12791  ** This function is a convenience function that changes the focus
12792  ** character of this agent's current crowd params.
12793  **
12794  ** This can also be done by getting the character's current params
12795  ** using get_agent_current_params(), and then calling
12796  ** set_focus_character() on that object. This function
12797  ** call, however, is available in decisions.
12798  **
12799  ** The agent currently need not be part of a crowd for this function
12800  ** to work.
12801  **
12802  *b Arguments:
12803  **
12804  *a character_name - name of character to become new focus
12805  *a character; pass NULL or "" to un-set
12806  *a the focus character
12807  **
12808  *b Returns:
12809  **
12810  ** 0 on success, -1 on failure
12811  **
12812  *b Available as Decision Bead/Event
12813  */
12814  int agent_set_current_focus_character(const char* character_name);
12815 
12816  /*l
12817  *b Description:
12818  **
12819  ** This function returns the current character this agent
12820  ** is focused on. This will either be the character named
12821  ** by the focus character, or the character chosen from the
12822  ** focus group to be the current focus character.
12823  **
12824  ** The agent currently need not be part of a crowd for this function
12825  ** to work.
12826  **
12827  *b Returns:
12828  **
12829  *a pointer to type diguyCharacter
12830  */
12831  diguyCharacter* agent_get_current_focus_character();
12832 
12833  /*l
12834  *b Description:
12835  **
12836  ** Similar to set_current_focus_character(), but sets
12837  ** the current focus group instead of character.
12838  **
12839  ** The agent currently need not be part of a crowd for this function
12840  ** to work.
12841  **
12842  *b Arguments:
12843  **
12844  *a group_name - name of group to become new focus
12845  *a group; pass NULL or "" to un-set
12846  *a the focus group
12847  **
12848  *b Returns:
12849  **
12850  ** 0 on success, -1 on failure
12851  **
12852  *b Available as Decision Bead/Event
12853  */
12854  int agent_set_current_focus_group(const char* group_name);
12855 
12856  /*l
12857  *b Description:
12858  **
12859  ** This function returns the initial agent parameters of
12860  ** this agent. The initial parameters of this agent
12861  ** can then be edited through this object.
12862  **
12863  ** Changes to the initial parameters will have no effect until
12864  ** the scenario is reset.
12865  **
12866  ** The current agent parameters will be set to these
12867  ** initial parameters whenever the scenario is reset.
12868  **
12869  ** The agent currently need not be part of a crowd for this function
12870  ** to work.
12871  **
12872  *b Returns:
12873  **
12874  *a pointer to type diguyAgentParams
12875  */
12876  diguyAgentParams* agent_get_initial_params();
12877 
12878  /*l
12879  *b Description:
12880  **
12881  ** This function returns the current agent parameters of
12882  ** this agent. The current parameters of this agent
12883  ** can then be edited through this object.
12884  **
12885  ** Changes to the current parameters should take effect immediately.
12886  **
12887  ** The current agent parameters will be reset to the
12888  ** initial parameters whenever the scenario is reset.
12889  **
12890  ** The agent currently need not be part of a crowd for this function
12891  ** to work.
12892  **
12893  *b Returns:
12894  **
12895  *a pointer to type diguyAgentParams
12896  */
12897  diguyAgentParams* agent_get_current_params();
12898 
12899  /*l
12900  *b Description:
12901  **
12902  ** This function gets the name of the agent's current profile.
12903  **
12904  *b Returns:
12905  **
12906  ** the name of the agent's current profile
12907  */
12908  const char* agent_get_current_params_profile_name();
12909 
12910  /*l
12911  *b Description:
12912  **
12913  ** This function sets this agent's current agent parameters from the
12914  ** specified crowd profile.
12915  **
12916  ** The agent currently need not be part of a crowd for this function
12917  ** to work.
12918  **
12919  *b Arguments:
12920  **
12921  *a profile_name - name of existing crowd profile
12922  *a retain_focus_objects - pass 1 to not change focus object from
12923  *a current focus
12924  *a retain_navigation_values - pass 1 to not change current navigation
12925  *a parameters
12926  *a retain_behavior - pass 1 to not change current behavior
12927  **
12928  ** Navigation values are things like:
12929  **
12930  *- - behavior path
12931  *- - behavior region and subregion
12932  *- - region masks
12933  *- - cost biases
12934  *- - path planner settings
12935  **
12936  *b Returns:
12937  **
12938  ** 0 on success, -1 on failure
12939  **
12940  *b Available as Decision Bead/Event
12941  */
12942  int agent_set_current_params_from_profile(const char* profile_name,
12943  int retain_focus_objects = 1,
12944  int retain_navigation_values = 1,
12945  int retain_behavior = 0);
12946 
12947  /*l
12948  *b Description:
12949  **
12950  ** Similar to agent_set_current_params_from_profile(), but initial
12951  ** parameters are changed.
12952  */
12953  int agent_set_initial_params_from_profile(const char* profile_name);
12954 
12955  /*l
12956  *b Description:
12957  **
12958  ** This function sets the current parameters from the agent's
12959  ** initial parameters.
12960  */
12961  void agent_set_current_params_from_initial_params();
12962 
12963  /*l
12964  *b Description:
12965  **
12966  ** This function sets whether the borders of the current behavior
12967  ** region of the agent is solid.
12968  **
12969  ** If they are, the agent will treat the walls as if they are
12970  ** solid walls in the environment. If not, the agent is free to
12971  ** walk through them.
12972  **
12973  ** The agent currently need not be part of a crowd for this function
12974  ** to work.
12975  **
12976  *b Arguments:
12977  **
12978  *a is_solid - 1 if region border should be solid, 0 if not
12979  **
12980  *b Available as Decision Bead/Event
12981  */
12982  void agent_set_current_behavior_region_border_is_solid(int is_solid);
12983 
12984  /*l
12985  *b Description:
12986  **
12987  ** If the agent is in a behavior that stays in one place before moving
12988  ** to another, such as wander or mingle, this function will request
12989  ** that the agent move on to the next location.
12990  **
12991  *b Available as Decision Bead/Event
12992  */
12993  void agent_move_on();
12994 
12995 
12996  /*l
12997  *b Description:
12998  **
12999  ** This function controls if the AI will attempt to automatically change variants
13000  ** depending on the behavior. This should only change how still motions are performed
13001  ** when the default variant is Normal. Characters in wander and idle will automatically
13002  ** shift to ambient still motions, mingle will alternate between socialize and ambient
13003  ** motions. Attack should automatically switch from aiming to ambient.
13004  ** defaults to being on.
13005  */
13006  int agent_set_auto_variant_selection(int selection_enabled);
13007 
13008  /*l
13009  *b Description:
13010  **
13011  ** Returns if automatic variant selection is enabled, defaults to being on.
13012  */
13013  int agent_get_auto_variant_selection();
13014 
13015  /*l
13016  *b Description:
13017  **
13018  ** Returns current travel path or nav path.
13019  */
13020  diguyPathShape * agent_get_current_traveled_path();
13021 
13022  /*l
13023  *b Description:
13024  **
13025  ** Allows agent to determine speed zone based on distance to endpoint of current
13026  ** path. With this off, speed zones are determined by "desired position", which
13027  ** when following a path is not the endpoint, but a point on the path a short
13028  ** distance ahead of the current position.
13029  **
13030  ** The default value is false.
13031  **
13032  ** Enable this if you want the character to automatically run when following a
13033  ** long path.
13034  */
13035  void agent_set_use_speed_zones_on_paths(int enabled);
13036 
13037  /*l
13038  *b Description:
13039  **
13040  ** Returns the current value set by agent_set_use_speed_zones_on_paths().
13041  */
13042  int agent_get_use_speed_zones_on_paths();
13043 
13044 #ifdef CPLUSPLUS_ONLY
13045 
13101  /*l
13102  *b Description:
13103  **
13104  ** This function sets a feeler function that will be used by this
13105  ** character for environment collision detection. The feeler will
13106  ** replace any existing feeler function (including the default
13107  ** function used in DI-Guy Scenario).
13108  **
13109  ** See the "User-Defined Feelers" information for more information.
13110  **
13111  *b Arguments:
13112  **
13113  *a feeler_function - pointer to user-defined feeler function
13114  **
13115  *b Returns:
13116  **
13117  ** 0 on success, -1 on failure
13118  **
13119  *b Callable From:
13120  **
13121  *- - C++
13122  */
13123  int agent_set_feeler_function(diguyFeelerFunction* feeler_function);
13124 
13125  /*l
13126  *b Returns:
13127  **
13128  ** current feeler function; see set_feeler_function()
13129  **
13130  *b Callable From:
13131  **
13132  *- - C++
13133  */
13134  diguyFeelerFunction* agent_get_feeler_function();
13135 
13136 #endif
13137 
13138 
13139 /*****************************************************************************/
13145  /*l
13146  *b Description:
13147  **
13148  ** Creates a Lua mind object based off of the contents of base_class.
13149  **
13150  *b Arguments:
13151  **
13152  *a base_class - the class to use as the basis for the character's
13153  *a mind
13154  *a init_arg1-2 - experimental optional arguments passed to the init
13155  *a function; your lua init function will need to take
13156  *a arguments
13157  **
13158  */
13159  int create_lua_mind(const char* base_class, const char* init_arg1 = NULL,
13160  const char* init_arg2 = NULL);
13161 
13162  /*l
13163  *b Description:
13164  **
13165  ** Returns the name of the mind, e.g. "luaPedestrian". This is, in other
13166  ** words, the mind's base class
13167  */
13168  const char *get_mind_name();
13169 
13170  /*l
13171  *b Description:
13172  **
13173  ** Agent characters with minds will typically have the mind be in
13174  ** some state, such as "patrolling", "fleeing", "mobbing", etc. This
13175  ** function returns the name of that state.
13176  **
13177  ** Currently this is only applicable to characters with Lua minds.
13178  **
13179  *b Returns:
13180  **
13181  ** the name of the agent's current mind state
13182  */
13183  const char* get_mind_current_state_name();
13184 
13185  /*l
13186  *b Description:
13187  **
13188  ** This function causes callback functions with the callback id
13189  ** CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED to be called.
13190  ** It's intended use is for mind implementations that need to
13191  ** signal that the mind's current state has changed.
13192  **
13193  ** Currently this is only applicable to characters with Lua minds.
13194  */
13195  void do_mind_current_state_changed_callback();
13196 
13197  /*l
13198  *b Description:
13199  **
13200  ** How long until the character's main coroutine thread should be
13201  ** resumed. This function is typically used by various luaCharacter
13202  ** sleep functions.
13203  **
13204  *b Arguments:
13205  **
13206  *a sleep_length - how long relative to the current time the character
13207  *a should sleep
13208  */
13209  int set_sleep_timer(float sleep_length);
13210 
13211  /*l
13212  *b Returns:
13213  **
13214  ** How long until the character's main coroutine thread resumes,
13215  ** relative to the current time.
13216  */
13217  float get_sleep_timer();
13218 
13219  /*l
13220  *b Description:
13221  **
13222  ** The frequency at which the luaCharacter's heartbeat function
13223  ** should run. This defaults to once per second. The character
13224  ** must have a Lua function named heartbeat.
13225  **
13226  *b Arguments:
13227  **
13228  *a heartbeat_dt - frequency of heartbeat
13229  */
13230  int set_heartbeat_dt(float heartbeat_dt);
13231 
13232  /*l
13233  *b Description:
13234  **
13235  ** This function allows the addition of additional heartbeat
13236  ** functions.
13237  **
13238  *b Arguments:
13239  **
13240  *a function_name - the name of the Lua function to treat as a
13241  *a heartbeat; the function_name should not include
13242  *a the name of the character object
13243  *a heartbeat_dt - frequency of heartbeat
13244  **
13245  *b Returns:
13246  **
13247  ** 0 on success, -1 on failure
13248  */
13249  int add_secondary_heartbeat(const char* function_name,
13250  float heartbeat_dt);
13251 
13252  /*l
13253  *b Description:
13254  **
13255  ** This function removes an added heartbeat function.
13256  **
13257  *b Arguments:
13258  **
13259  *a function_name - the name of the Lua function to treat as a
13260  *a heartbeat; the function_name should not include
13261  *a the name of the character object
13262  **
13263  *b Returns:
13264  **
13265  ** 0 on success, -1 on failure
13266  */
13267  int remove_secondary_heartbeat(const char* function_name);
13268 
13269  /*l
13270  *b Description:
13271  **
13272  ** The frequency at which a luaCharacter's secondary heartbeat
13273  ** function should run. The character must have a Lua function named
13274  ** function_name.
13275  **
13276  *b Arguments:
13277  **
13278  *a function_name - heartbeat function to adjust
13279  *a heartbeat_dt - frequency of heartbeat
13280  **
13281  *b Returns:
13282  **
13283  ** 0 on success, -1 on failure
13284  */
13285  int set_secondary_heartbeat_dt(const char* function_name, float heartbeat_dt);
13286 
13287  /*l
13288  *b Description:
13289  **
13290  ** This function creates a request that whenever the specified
13291  ** callback is triggered, the character is woken up with a message.
13292  ** The message will be of the form:
13293  *>
13294  *- - message_type = "callback"
13295  *- - message = the string representation of the callback
13296  *<
13297  ** A good example of the use for this is a flexible "move to"
13298  ** command:
13299  **
13300  *b Lua Example:
13301  **
13302  *e self.character:add_wakeup_callback(diguyCharacter_CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED);
13303  *e -- begin to move to a location
13304  *e self.character:agent_move_to_region_via_subregions("navmesh", "green", "navmesh",
13305  *e DIGUY_SUBREGION_MASK_BASE, 12);
13306  *e -- sleep till arrived
13307  *e self:sleep(100);
13308  *e self.character:remove_wakeup_callback(diguyCharacter_CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED);
13309  **
13310  ** Effectively the character will wake up either after 100 seconds or
13311  ** when they arrive at their desired destination.
13312  **
13313  *b Arguments:
13314  **
13315  *a callback - the callback id that should wake up the character
13316  **
13317  *b Returns:
13318  **
13319  ** 0 on success, -1 on failure
13320  */
13321  int add_wakeup_callback(int callback);
13322 
13323  /*l
13324  *b Description:
13325  **
13326  ** This function removes a request to trigger a message when a
13327  ** callback is triggered.
13328  **
13329  *b Arguments:
13330  **
13331  *a callback - callback id that should no longer wake up the
13332  *a character
13333  **
13334  *b Returns:
13335  **
13336  ** 0 on success, -1 on failure
13337  */
13338  int remove_wakeup_callback(int callback);
13339 
13340  /*l
13341  *b Description:
13342  **
13343  ** This function removes all requests to trigger a message when
13344  ** callbacks are triggered.
13345  **
13346  *b Returns:
13347  **
13348  ** 0 on success, -1 on failure
13349  */
13350  int remove_all_wakeup_callbacks();
13351 
13352  /*l
13353  *b Description:
13354  **
13355  ** This function check for a requests to trigger a message when
13356  ** a given callback is triggered.
13357  **
13358  *b Returns:
13359  **
13360  ** 0 on false, 1 on true
13361  */
13362  int has_wakeup_callback(int callback);
13363 
13364  /*l
13365  *b Description:
13366  **
13367  ** This function wakes up a character and sends them a message.
13368  ** Currently this is only applicable to characters with Lua minds.
13369  **
13370  *b Arguments:
13371  **
13372  *a sender - who is sending the message
13373  *a message_type - what type of message is being sent
13374  *a message - the message string
13375  *a message_params - optional parameter string
13376  **
13377  *b Returns:
13378  **
13379  ** number of times message was successfully parsed
13380  */
13381  int agent_accept_message(const char* sender,
13382  const char* message_type,
13383  const char* message,
13384  const char* message_params = NULL);
13385 
13386  /*l
13387  **
13388  *b Description:
13389  **
13390  ** This function wakes up nearby characters and sends them a message.
13391  ** The sender of the message is implicitly set to the individual
13392  ** calling the broadcast function
13393  **
13394  ** Currently this is only applicable to characters with Lua minds.
13395  **
13396  *b Arguments:
13397  **
13398  *a radius - how far to broadcast the message
13399  *a message_type - what type of message is being sent
13400  *a message - the message string
13401  *a message_params - optional parameter string
13402  **
13403  *b Returns:
13404  **
13405  ** number of times message was successfully parsed
13406  */
13407  int agent_broadcast_message(float radius,
13408  const char* message_type,
13409  const char* message,
13410  const char* message_params = NULL);
13411 
13412  /*l
13413  *b Description:
13414  **
13415  ** This function wakes up nearby characters in the group specified
13416  ** and sends them a message. The sender of the message is implicitly
13417  ** set to the individual calling the broadcast function.
13418  **
13419  ** Currently this is only applicable to characters with Lua minds.
13420  **
13421  *b Arguments:
13422  **
13423  *a group_name - group to broadcast message to
13424  *a radius - how far to broadcast the message
13425  *a message_type - what type of message is being sent
13426  *a message - the message string
13427  *a message_params - optional parameter string
13428  **
13429  **
13430  *b Returns:
13431  **
13432  ** number of times message was successfully parsed,
13433  ** -1 on failure
13434  */
13435  int agent_broadcast_message_to_group(const char* group_name,
13436  float radius,
13437  const char* message_type,
13438  const char* message,
13439  const char* message_params = NULL);
13440 
13441  /*l
13442  **
13443  *b Returns:
13444  **
13445  ** name of character's lua mind object; typically this is the
13446  ** character's name with '-' replaced by '_'
13447  */
13448  const char* get_lua_object_name();
13449 
13450  /*l
13451  *b Description:
13452  **
13453  ** Sets the specified field of the mind to the string field_value.
13454  */
13455  void set_mind_field_as_string(const char* field_name,
13456  const char* field_value);
13457 
13458  /*l
13459  *b Description:
13460  **
13461  ** Queries the luaCharacter object for a specific field, and attempts
13462  ** to convert it into a string. This works for strings and
13463  ** numbers.
13464  **
13465  ** This returned pointer will stay valid until the next time this
13466  ** function is called, so if the results need to be saved they must
13467  ** be copied.
13468  **
13469  *b Returns:
13470  **
13471  ** field_name as string
13472  */
13473  const char* get_mind_field_as_string(const char* field_name,
13474  int warn_if_no_field = 1);
13475 
13476  /*l
13477  *b Description:
13478  **
13479  ** Sets the specified field of the mind to the floating point
13480  ** number field_value.
13481  */
13482  void set_mind_field_as_float(const char* field_name, float field_value);
13483 
13484  /*l
13485  *b Description:
13486  **
13487  ** Similar to get_mind_field_as_string(), but returns field as
13488  ** a float.
13489  **
13490  *b Returns:
13491  **
13492  ** field_name as double
13493  */
13494  float get_mind_field_as_float(const char* field_name,
13495  int warn_if_no_field = 1,
13496  int* found_field = NULL);
13497 
13498  /*l
13499  *b Description:
13500  **
13501  ** Sets the specified field of the mind to the integer number
13502  ** field_value.
13503  */
13504  void set_mind_field_as_int(const char* field_name, int field_value);
13505 
13506  /*l
13507  *b Description:
13508  **
13509  ** Similar to get_mind_field_as_int(), but returns field as
13510  ** an integer.
13511  **
13512  *b Returns:
13513  **
13514  ** field_name as int
13515  */
13516  int get_mind_field_as_int(const char* field_name,
13517  int warn_if_no_field = 1,
13518  int* found_field = NULL);
13519 
13520  /*l
13521  *b Description:
13522  **
13523  ** Attempts to run a luaCharacter member function, and can optionally
13524  ** return the function's result. Lua return values can be converted
13525  ** to strings and numbers -- other data types will cause an error.
13526  **
13527  ** This returned pointer will stay valid until the next time this
13528  ** function is called, so if the results need to be saved they must
13529  ** be copied.
13530  **
13531  *b *Note:* This function should be considered experimental, as the
13532  *b API may change.
13533  **
13534  *b Arguments:
13535  **
13536  *a function_name - luaCharacter function field to invoke
13537  *a argument - optional string argument to the function
13538  *a has_return_string - 0 or 1; determines if lua interface should
13539  *a attempt to retrieve a string value
13540  **
13541  *b Returns:
13542  **
13543  ** Lua function return value
13544  */
13545  const char* evaluate_mind_function(const char* function_name,
13546  const char* argument = NULL,
13547  int has_return_string = 0);
13548 
13549  /*l
13550  *b Description:
13551  **
13552  ** This function produces a string with a long list of character
13553  ** information, including: current path, crowd, behavior, lua state,
13554  ** lua call stack, wakeup callbacks and lua object fields. It is
13555  ** meant to help with debugging agents.
13556  **
13557  ** This returned pointer will stay valid until the next time this
13558  ** function is called, so if the results need to be saved they must
13559  ** be copied.
13560  **
13561  *b Arguments:
13562  **
13563  *a include_stack - pass 1 to include callstack info, 0 to not
13564  *a include_locals - pass 1 to include local variable info, 0 to not
13565  **
13566  *b Returns:
13567  **
13568  ** string containing character information
13569  */
13570  const char* get_ai_state_string(int include_stack = 1, int include_locals = 1);
13571 
13572 
13573 /*****************************************************************************/
13583 /*
13584  *3 Visibility Tests
13585  */
13586 
13587  /*l
13588  *b Description:
13589  **
13590  ** This function tests whether this character can see the passed
13591  ** character. Currently this tests if the cervical link of this
13592  ** character has a clear line of sight to either the cervical or the
13593  ** position links of the target. Currently the orientation of this
13594  ** character isn't factored in.
13595  **
13596  ** This function does not fail if other characters are between the
13597  ** two characters in question.
13598  **
13599  ** Checking visibility is only an option if an octtree is generated
13600  ** from scene objects; typically only DI-Guy Scenario does this.
13601  ** Outside of DI-Guy Scenario set_character_los_function() should be
13602  ** used if no octtree is present.
13603  **
13604  *b Arguments:
13605  **
13606  *a character - character to check
13607  *a los_check_type - currently unused but passed to callback function
13608  *a if end users wish to pass an additional parameter
13609  **
13610  *b Returns:
13611  **
13612  ** 1 if character is visible, 0 if not
13613  */
13614  int check_character_visibility(diguyCharacter* character,
13615  int los_check_type = 0);
13616 
13617  /*l
13618  *b Description:
13619  **
13620  ** This function tests whether this character can see the x, y, z
13621  ** location specified. Currently this tests if the cervical link of
13622  ** this character has a clear line of sight to the x, y, z location.
13623  ** Currently the orientation of this character isn't factored in.
13624  **
13625  ** This function does not fail if other characters are between the
13626  ** character and the location in question.
13627  **
13628  ** Checking visibility is only an option if an octtree is generated
13629  ** from scene objects; typically only DI-Guy Scenario does this.
13630  **
13631  *b Arguments:
13632  **
13633  *a x, y, z - location to check
13634  **
13635  *b Returns:
13636  **
13637  ** 1 if location is visible, 0 if not
13638  */
13639  int check_point_visibility(float x, float y, float z);
13640 
13641 
13642 
13643 /*****************************************************************************/
13660 #ifdef CPLUSPLUS_ONLY
13661 
13662  /*l
13663  *b Description:
13664  **
13665  ** When a character needs to check if it can see a location, DI-Guy
13666  ** calls this function with a pointer to the diguyCharacter in
13667  ** question, and the coordinates of the point that is being looked
13668  ** at. This currently happens when an agent is told to move to a new
13669  ** region.
13670  **
13671  ** The following prototype should be used for the point line-of-sight
13672  ** function:
13673  **
13674  *e int diguyPointLOSFunction(diguyCharacter* character,
13675  *e float x,
13676  *e float y,
13677  *e float z);
13678  **
13679  ** The function should then check if the desired location is visible.
13680  ** This can be done in a number of ways; a typical approach is to do
13681  ** an intersection test with the static scene.
13682  **
13683  ** The function should return 1 if the path to the target is clear, 0
13684  ** if there is an obstruction.
13685  **
13686  ** A default point line-of-sight function can be set for all
13687  ** subsequently created characters by calling
13688  ** diguyScenario::set_default_point_los_function().
13689  **
13690  *b Callable From:
13691  **
13692  *- - C++
13693  */
13694  int set_point_los_function(diguyPointLOSFunction* point_los_function);
13695 
13696  /*l
13697  *b Returns:
13698  **
13699  ** current point line-of-sight function; see set_point_los_function()
13700  **
13701  *b Callable From:
13702  **
13703  *- - C++
13704  */
13705  diguyPointLOSFunction* get_point_los_function();
13706 
13707  /*l
13708  *b Description:
13709  **
13710  ** When a character needs to check if it can see another character,
13711  ** DI-Guy calls this function with a pointer to the diguyCharacter in
13712  ** question. This can happen when check_character_visibility() is
13713  ** invoked or when AI attack code assesses if it should take a shot.
13714  **
13715  ** The following prototype should be used for the character
13716  ** line-of-sight function:
13717  **
13718  *e int diguyCharacterLOSFunction(diguyCharacter* character,
13719  *e diguyCharacter* target_character,
13720  *e int los_test_type) // (currently unused)
13721  **
13722  ** Currently the los_test_type argument defaults to 0 and is not used
13723  ** internally. It is, however, available in
13724  ** check_character_visibility() and will be passed to the callback.
13725  ** This can be useful if the end user wants to write scripting code
13726  ** that has alternative Line of Sight tests depending on agent
13727  ** conditions. (e.g. a test that factors in the character's field of
13728  ** view.)
13729  **
13730  ** The function then checks if the target character is visible. This
13731  ** can be done in a number of ways; a typical approach is to do an
13732  ** intersection test with the static scene. The default
13733  ** implementation tests the path from the characters head to the
13734  ** target's head and then to the target's feet.
13735  **
13736  ** The function should return 1 if the path to the target is clear,
13737  ** and 0 if there is an obstruction.
13738  **
13739  ** A default character line-of-sight function can be set for all
13740  ** subsequently created characters by calling
13741  ** diguyScenario::set_default_character_los_function().
13742  **
13743  *b Callable From:
13744  **
13745  *- - C++
13746  */
13747  int set_character_los_function(diguyCharacterLOSFunction* character_los_function);
13748 
13749  /*l
13750  *b Returns:
13751  **
13752  ** current character line-of-sight function; see
13753  ** set_character_los_function()
13754  **
13755  *b Callable From:
13756  **
13757  *- - C++
13758  */
13759  diguyCharacterLOSFunction* get_character_los_function();
13760 
13761 #endif
13762 
13763 
13764 /*****************************************************************************/
13781  int get_num_ik_chains();
13783 
13785  const char * get_ik_chain_name_at_index(int index);
13786 
13787  /*b Description:
13788  ** Moves the end effector for the specified ik chain to a location in the world.
13789  **
13790  *b Arguments:
13791  *a ik_chain_target - index of ik chain
13792  *a x,y,z - world location of where to move the IK end effector to.
13793  *a ramp_time - how long to take blending in solution
13794  **
13795  *b Returns:
13796  ** -1 on failure, 0 on success
13797  */
13798  int set_ik_target_world(int ik_chain_target, float x, float y, float z, float ramp_time = .25f);
13799 
13800  /*b Description:
13801  ** Moves the end effector for the specified ik chain to a location relative to the character.
13802  **
13803  *b Arguments:
13804  *a ik_chain_target - index of ik chain
13805  *a x,y,z - local location of where to move the IK end effector to.
13806  *a ramp_time - how long to take blending in solution
13807  **
13808  *b Returns:
13809  ** -1 on failure, 0 on success
13810  */
13811  int set_ik_target_local(int ik_chain_target, float x, float y, float z, float ramp_time = .25f);
13812 
13813  /*b Description:
13814  ** Moves the end effector for the specified ik chain to location on another character.
13815  **
13816  *b Arguments:
13817  *a ik_chain_target - index of ik chain
13818  *a target - target character.
13819  *a link_name - target joint
13820  *a ramp_time - how long to take blending in solution
13821  **
13822  *b Returns:
13823  ** -1 on failure, 0 on success
13824  */
13825  int set_ik_target_character(int ik_chain_target, diguyCharacter * target, const char * link_name, float ramp_time = .25f);
13826 
13827 
13828  /*b Description:
13829  ** Resets the end effector to be solely driven by the animation system */
13830  int disable_ik_target(int ik_chain_target, float ramp_time = .25f);
13831 
13832  /*b Description:
13833  ** Sets the distance to the primary camera, this should be automatically set in OpenGL
13834  ** or if you set the camera position, in retained mode renderers you will need to set this
13835  ** manually. Currently only used by IK system for performance culling.
13836  */
13837  void set_distance_to_primary_camera(float camera_dist);
13838 
13840  float get_distance_to_primary_camera();
13841 
13842 /*****************************************************************************/
13858  /*l
13859  *b Description:
13860  **
13861  ** This function sets the initial character simulator this character
13862  ** will use. The current simulator will be set to this value on
13863  ** scenario reset.
13864  **
13865  ** The current simulator can be set by calling
13866  ** set_current_character_simulator().
13867  **
13868  ** The default simulator is
13869  ** DIGUY_CHARACTER_SIMULATOR_DIGUY_MOTION_ENGINE.
13870  **
13871  ** Requires active physics module if character simulator is set to
13872  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13873  **
13874  *b Arguments:
13875  **
13876  *a character_simulator - which simulator to use at reset
13877  **
13878  *b Returns:
13879  **
13880  ** 0 on success, -1 on failure
13881  */
13882  int set_initial_character_simulator(diguyCharacterSimulator character_simulator);
13883 
13884  /*l
13885  *b Returns:
13886  **
13887  ** initial character simulator
13888  */
13889  diguyCharacterSimulator get_initial_character_simulator();
13890 
13891  /*l
13892  *b Description:
13893  **
13894  ** This function sets the current character simulator this character
13895  ** will use. The current simulator will be reset to the initial
13896  ** character simulator on scenario reset.
13897  **
13898  ** The initial simulator can be set by calling
13899  ** set_initial_character_simulator().
13900  **
13901  *b Arguments:
13902  **
13903  *a character_simulator - new current character simulator
13904  **
13905  *b Returns:
13906  **
13907  ** 0 on success, -1 on failure
13908  */
13909  int set_current_character_simulator(diguyCharacterSimulator character_simulator);
13910 
13911  /*l
13912  *b Returns:
13913  **
13914  ** current character simulator
13915  */
13916  diguyCharacterSimulator get_current_character_simulator();
13917 
13918  /*l
13919  *b Description:
13920  **
13921  ** This function sets the initial physics simulation mode this
13922  ** character will use. The current simulation mode will be set to
13923  ** this value on scenario reset.
13924  **
13925  ** The current simulation mode can be set by calling
13926  ** set_current_physics_simulation_mode().
13927  **
13928  ** The default simulation mode is
13929  ** DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER.
13930  **
13931  ** The physics simulation mode will have no effect unless the current
13932  ** character simulator is
13933  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13934  **
13935  *b Arguments:
13936  **
13937  *a physics_simulation_mode - which simulation mode to use at reset
13938  **
13939  *b Returns:
13940  **
13941  ** 0 on success, -1 on failure
13942  */
13943  int set_initial_physics_simulation_mode(diguyPhysicsSimulationMode physics_simulation_mode);
13944 
13945  /*l
13946  *b Returns:
13947  **
13948  ** initial physics simulation mode
13949  */
13950  diguyPhysicsSimulationMode get_initial_physics_simulation_mode();
13951 
13952  /*l
13953  *b Description:
13954  **
13955  ** This function sets the current physics simulation mode this
13956  ** character will use. The current simulation mode will be reset to
13957  ** the initial physics simulator mode on scenario reset.
13958  **
13959  ** The initial simulation mode can be set by calling
13960  ** set_initial_physics_simulation_mode().
13961  **
13962  ** The physics simulation mode will have no effect unless the current
13963  ** character simulator is
13964  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13965  **
13966  *b Arguments:
13967  **
13968  *a physics_simulation_mode - new current physics simulation mode
13969  **
13970  *b Returns:
13971  **
13972  ** 0 on success, -1 on failure
13973  */
13974  int set_current_physics_simulation_mode(diguyPhysicsSimulationMode physics_simulation_mode);
13975 
13976  /*l
13977  *b Returns:
13978  **
13979  ** initial physics simulation mode
13980  */
13981  diguyPhysicsSimulationMode get_current_physics_simulation_mode();
13982 
13983  /*l
13984  *b Description:
13985  **
13986  ** This function sets the physics collision group this character will
13987  ** be in when being simulated. For improved performance, collision
13988  ** detection between various characters and scene objects will not
13989  ** be performed, based on which collision groups the objects are in.
13990  **
13991  ** By default:
13992  **
13993  *- - characters in character group n collide against props in prop
13994  *- group n and scene objects in scene object group n
13995  *- in group n
13996  *- - characters in group ghost don't collide against any other
13997  *- characters, but do against scene objects and props
13998  *- - characters in group everything collide against all characters,
13999  *- props, and scene objects
14000  *- - all props collide against all other props and scene objects
14001  **
14002  ** Collision group relationships can be modified using
14003  ** diguyApp::set_collision_group_detection_flag().
14004  **
14005  *b Arguments:
14006  **
14007  *a physics_simulation_mode - new current physics simulation mode
14008  **
14009  *b Returns:
14010  **
14011  ** 0 on success, -1 on failure
14012  */
14013  int set_physics_collision_group(diguyPhysicsCollisionGroup collision_group);
14014 
14015  /*l
14016  *b Returns:
14017  **
14018  ** physics collision group
14019  */
14020  diguyPhysicsCollisionGroup get_physics_collision_group();
14021 
14022  /*l
14023  *b Description:
14024  **
14025  ** This function sets a time at which active simulation of a physics
14026  ** controlled character will stop. This is useful for:
14027  **
14028  *- - reducing simulation processing overhead
14029  *- - freezing a simulation that is mostly in steady state, but some
14030  *- small part remains oscillating
14031  **
14032  ** The physics controlled character will remain frozen in the last
14033  ** computed simulated pose.
14034  **
14035  *b Arguments:
14036  **
14037  *a t - scenario t at which simulation will freeze
14038  **
14039  ** t should be large enough for the simulation to reach a reasonably
14040  ** steady state, such as a human lying on the ground. A value that
14041  ** is usually reasonable is around 5 seconds.
14042  */
14043  void set_stop_physics_sim_at_t(float t);
14044 
14045  /*l
14046  *b Description:
14047  **
14048  ** Similar to set_stop_physics_sim_at_t(), but the passed time will
14049  ** be relative to the current simulation time as returned by
14050  ** diguyScenario::get_t().
14051  */
14052  void set_stop_physics_sim_in_t_seconds(float relative_t);
14053 
14054  /*l
14055  *b Returns:
14056  **
14057  ** time at which physics simulation will freeze
14058  */
14059  float get_stop_physics_sim_at_t();
14060 
14061  /*l
14062  *b Description:
14063  **
14064  ** This function applied an impulse force to the character. An
14065  ** impulse is a force that is applied all at one time, such as an
14066  ** explosion shock wave.
14067  **
14068  *b Arguments:
14069  **
14070  *a link - link to which impulse should be applied
14071  *a impulse_magnitude_[xyz] - magnitude of impulse in x direction
14072  *a link_offset_[xyz] - offset on link at which to apply impulse
14073  *a set_simulation_drives_character - pass 1 to automatically change
14074  *a the character's current simulation mode
14075  *a to DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER
14076  */
14077  void apply_impulse_to_physics_sim(const char* link,
14078  float impulse_magnitude_x,
14079  float impulse_magnitude_y,
14080  float impulse_magnitude_z,
14081  float link_offset_x = 0.0f,
14082  float link_offset_y = 0.0f,
14083  float link_offset_z = 0.0f,
14084  int set_simulation_drives_character = 1);
14085 
14086  /*l
14087  *b Description:
14088  **
14089  ** Similar to apply_impulse_to_physics_sim(), but impulse can be
14090  ** calculated relative to a world position. This is useful if, for
14091  ** example, a character should react to a nearby explosion.
14092  **
14093  *b Arguments:
14094  **
14095  *a link - link to which impulse should be applied
14096  *a impulse_magnitude_[xyz] - magnitude of impulse
14097  *a impulse_generator_position_[xyz] - world coordinates of impulse
14098  *a generating object
14099  *a max_distance - maximum distance from above position at
14100  *a which the impulse can affect this
14101  *a character
14102  *a impulse_rolloff - how much the impulse magnitude should
14103  *a decrease as distance from impulse source
14104  *a increases
14105  *a link_offset_[xyz] - offset on link at which to apply impulse
14106  *a set_simulation_drives_character - pass 1 to automatically change
14107  *a the character's current simulation mode
14108  *a to DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER
14109  */
14110  void apply_impulse_to_physics_sim_from_world_position(const char* link,
14111  float impulse_magnitude_x,
14112  float impulse_magnitude_y,
14113  float impulse_magnitude_z,
14114  float impulse_generator_position_x,
14115  float impulse_generator_position_y,
14116  float impulse_generator_position_z,
14117  float max_distance = 20.0f,
14118  float impulse_rolloff = 0.0f,
14119  float link_offset_x = 0.0f,
14120  float link_offset_y = 0.0f,
14121  float link_offset_z = 0.0f,
14122  int set_simulation_drives_character = 1);
14123 
14124 /*****************************************************************************/
14128  /*l
14129  *b Description:
14130  **
14131  ** Sets texture load behavior to DIGUY_LOAD_INSTANTLY, DIGUY_LOAD_PRIORITY_ASYNC, or
14132  ** DIGUY_LOAD_ASYNC
14133  */
14134  static int set_texture_load_behavior(diguyGraphicsTextureLoadingBehavior mode);
14135 
14136  /*l
14137  *b Returns current behavior, as set in set_texture_load_behavior()
14138  */
14139  static diguyGraphicsTextureLoadingBehavior get_texture_load_behavior();
14140 
14141  /*l
14142  *b Description:
14143  **
14144  ** Sets maximum quality of shader to use (actual quality varies
14145  ** by distance from camera). See diguyGraphicsShaderQualityLevel for
14146  ** possible values.
14147  **
14148  *b Arguments:
14149  **
14150  *a quality_level - a value between DIGUY_GRAPHICS_SHADER_QUALITY_UNLIT
14151  *- and DIGUY_GRAPHICS_SHADER_QUALITY_MAX
14152  */
14153  static int set_max_shader_quality_level(int quality_level);
14154 
14156  static int get_max_shader_quality_level();
14157 
14158 
14159 /****************************************************************************/
14166 /****************************************************************************/
14167 
14168  /*l
14169  ** Sets if this character will play back animation events that have been
14170  ** added to motion inits in the action table.
14171  */
14172  int set_animation_events_enabled(int enable);
14173  int get_animation_events_enabled();
14174 
14175 
14176  /*l
14177  *b Description:
14178  **
14179  ** This function returns how many channels the specified action has.
14180  ** If an action has more than one channel, the relative weights of
14181  ** its channels can be set using the set_action_channel_weight()
14182  ** function.
14183  **
14184  *b Arguments:
14185  **
14186  *a action_name - name of action to be queried
14187  **
14188  *b Returns:
14189  **
14190  ** number of channels in specified action
14191  */
14192  int get_action_num_channels(const char* action_name);
14193 
14194  /*l
14195  *b Description:
14196  **
14197  ** This function sets the weight one channel of a multi-channel
14198  ** action.
14199  **
14200  ** The passed weight should be between 0 and 1. The weights of
14201  ** the other channels in the action will be adjusted so that the
14202  ** total weight of all channels is 1.
14203  **
14204  *b Arguments:
14205  **
14206  *a action_name - name of action to be affected
14207  *a channel - which channel's weight to set
14208  *a weight - weight of the channel, between 0 and 1
14209  **
14210  *b Returns:
14211  **
14212  ** 0 on success, -1 on failure
14213  */
14214  int set_action_channel_weight(const char* action_name,
14215  char channel,
14216  float weight);
14217 
14218  /*l
14219  *b Description:
14220  **
14221  ** This function returns the weight of one channel of a multi-channel
14222  ** action.
14223  **
14224  *b Arguments:
14225  **
14226  *a action_name - name of action to be queried
14227  *a channel - which channel's weight to return
14228  **
14229  *b Returns:
14230  **
14231  ** weight of a channel
14232  */
14233  float get_action_channel_weight(const char* action_name,
14234  char channel);
14235 
14236  /*l
14237  *b Description:
14238  **
14239  ** This function returns the number of seconds before the transition
14240  ** to the desired action begins. If the character is already
14241  ** performing the desired action the function returns 0.
14242  **
14243  *b THIS FUNCTION DOES NOT YET RETURN VALID RESULTS.
14244  **
14245  *b Returns:
14246  **
14247  ** time to reach desired action, in seconds
14248  */
14249  float get_time_to_reach_desired_action();
14250 
14251  /*l
14252  *b Description:
14253  **
14254  ** Maps a character type map field to its value. See diguyCharacterTypeMap.
14255  **
14256  ** Returns:
14257  **
14258  ** The value, as a string.
14259  */
14260  const char* get_type_map_field(diguyCharacterTypeMapField field);
14261 
14262  /*l
14263  *b Description:
14264  **
14265  ** Maps a character type map field to its value, using a string version (e.g.
14266  ** "age") of the field name. See diguyCharacterTypeMap.
14267  **
14268  ** Returns:
14269  **
14270  ** The value, as a string.
14271  */
14272  const char* get_type_map_field_using_string(const char* field);
14273 
14276  float get_normalized_age() const;
14277 
14278  /*l
14279  *b Description:
14280  **
14281  ** This function performs a "micro merge", allowing a diguyCharacter
14282  ** to have objects added to it by parsing a .dss file fragment in the
14283  ** form of a string.
14284  **
14285  ** This function can be used, for example, to add paths to
14286  ** dynamically created agents. A Lua Package can contain a number of
14287  ** text strings representing local paths for agents. On character
14288  ** creation these strings can be merged in and turned into
14289  ** per-character objects.
14290  **
14291  ** The DI-Guy Scenario path page has a "Display Asset" button for
14292  ** generating merge_object() compatible strings.
14293  **
14294  ** There is also a diguyScenario::merge_object() function that allows
14295  ** the merging of text blocks that represent sounds and particle
14296  ** systems.
14297  **
14298  ** Note: the parser is very sensitive to tabs and formatting!
14299  */
14300  int merge_object(const char* object);
14301 
14302  /*l
14303  *b Description:
14304  **
14305  ** Returns 1 if any active character in the named group is visible,
14306  ** otherwise 0.
14307  **
14308  *b Arguments:
14309  **
14310  *a group_name
14311  *a max_distance_to_check
14312  */
14313  int is_active_character_in_group_visible(const char* group_name,
14314  float max_distance_to_check = 100000.0f);
14315 
14316  /*l
14317  *b Description:
14318  **
14319  ** Gets local space bounding box, this function is currently expensive
14320  ** and should be used with care.
14321  **
14322  *b Arguments:
14323  **
14324  *a x1,y1,z1,x2,y2,z2 - output parameters
14325  **
14326  *b Returns:
14327  **
14328  ** 0 on success, -1 on failure
14329  ** (float * arguments converted to return values in Lua)
14330  */
14331  int get_local_space_bounding_box(float* x1, float* y1, float* z1,
14332  float* x2, float* y2, float* z2);
14333 
14334  /*l
14335  *b Description:
14336  **
14337  ** This causes a character's mind to get an update call even if time
14338  ** isn't passing in the scenario. This is occasionally useful for
14339  ** characters that are managing the UI.
14340  **
14341  ** Note that there is now a luaUIStateMachine that might be a better
14342  ** solution.
14343  */
14344  void set_mind_always_updates(int force_update);
14345 
14347  int get_mind_always_updates();
14348 
14349  /*l
14350  ** Returns angle in degrees from character's "forward facing" vector
14351  ** to the specified action bead, on the specified path
14352  */
14353  float get_angle_to_path(const char* path_name,
14354  const char* action_bead_name = NULL);
14355 
14356 
14359  void set_scene_graph_mask(unsigned int mask);
14360 
14362  unsigned int get_scene_graph_mask();
14363 
14364 
14369  diguyMotionEngineSnapshot get_motion_engine_snapshot();
14370 
14372  int apply_motion_engine_snapshot( const diguyMotionEngineSnapshot& action_info );
14373 
14374 
14379  int set_local_to_world_orientation_matrix( float rz, float rx, float ry);
14381  int set_local_to_world_orientation_matrix(
14382  float a0, float a1, float a2,
14383  float b0, float b1, float b2,
14384  float c0, float c1, float c2, int transpose = 0);
14385 
14386 #ifdef CPLUSPLUS_ONLY
14387  const float * get_local_to_world_orientation_matrix();
14389 #endif
14390  int set_current_IK_world_conversion_matrix(
14391  float a0, float a1, float a2,
14392  float b0, float b1, float b2,
14393  float c0, float c1, float c2, int transpose = 0);
14394  // HACK fix me with generalized system
14395  void set_IK_use_vrv_swizzle(bool);
14396 
14397 
14400  int set_always_update_regardless_of_dt(int val);
14402  int get_always_update_regardless_of_dt();
14403 
14404  void set_shader_matrixes_out_of_date();
14405 
14406  void draw_debugging_visuals();
14407 
14408 /****************************************************************************/
14409 /****************************************************************************/
14420 /****************************************************************************/
14421 /****************************************************************************/
14422 /****************************************************************************/
14423 
14424  // Deprecated as of 13.0;
14426  int aim_converge(int max_iterations = 30);
14427 
14429  void set_aim_algorithm(int aim_algorithm);
14430 
14432  int get_aim_algorithm();
14433 
14434 
14435  // Deprecated as of 9.1.3; use diguyCharacter::get_position_link() instead.
14436  // diguyGraphicsLink* get_base_link();
14437 
14438  // Deprecated as of 9.0.1; use set_apply_actor_scale_to_action_bead_travel() instead.
14439  // void set_apply_actor_scale_to_action_bead_xy_travel(int apply_scale_flag);
14440 
14441  // Deprecated as of 9.0.1; use get_apply_actor_scale_to_action_bead_travel() instead.
14442  // int get_apply_actor_scale_to_action_bead_xy_travel();
14443 
14444  /*l
14445  ** Deprecated as of 9.1.4. In general setting the weapon sound
14446  ** should no longer be necessary, as weapon sounds are now specified
14447  ** by the weapon's munition type. If this function is called, it
14448  ** will have the same effect as calling
14449  ** diguyCharacter::set_weapon_sound_override().
14450  */
14451  // int set_default_weapon_sound(const char* sound_name);
14452 
14453  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14454  //const char* get_default_weapon_sound();
14455 
14456  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14457  // int set_default_weapon_sound_gain(float gain);
14458 
14459  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14460  // float get_default_weapon_sound_gain();
14461 
14462  // Deprecated as of 9.1.4. Call set_weapon_munition_type_override() instead.
14463  // int set_weapon_munition_type(const char* munition_type);
14464 
14465  // Deprecated as of 9.1.4. Call get_weapon_munition_type_override() instead.
14466  // const char* get_weapon_munition_type();
14467 
14468  // Deprecated as of 10.5.2. Call set_weapon_max_azimuth_error() instead.
14469  // int set_weapon_horizontal_error(float h_error);
14470 
14471  // Deprecated as of 10.5.2. Call get_weapon_max_azimuth_error() instead.
14472  // float get_weapon_horizontal_error();
14473 
14474  // Deprecated as of 10.5.2. Call set_weapon_max_elevation_error() instead.
14475  // int set_weapon_vertical_error(float v_error);
14476 
14477  // Deprecated as of 10.5.2. Call get_weapon_max_elevation_error() instead.
14478  // float get_weapon_vertical_error();
14479 
14480  // Added as of 10.1.6. Invokes the old implementation of
14481  // begin_appearance_effect().
14482  //int begin_legacy_appearance_effect(const char* effect,
14483  // const char* override_link = "",
14484  // float override_scale = DIGUY_DEFAULT_FLOAT,
14485  // float override_offset_x = DIGUY_DEFAULT_FLOAT,
14486  // float override_offset_y = DIGUY_DEFAULT_FLOAT,
14487  // float override_offset_z = DIGUY_DEFAULT_FLOAT);
14488 
14489 
14490  // Added as of 10.1.6. Invokes the old implementation of
14491  // end_appearance_effect().
14492  //
14493  //int end_legacy_appearance_effect(const char* effect);
14494 
14495  // Added as of 10.1.6. Invokes the old implementation of
14496  // appearance_effect_is_active().
14497  //int legacy_appearance_effect_is_active(const char* effect);
14498 
14499  // Deprecated as of 10.1.8. Use set_render_mode_shader() instead.
14500  //int set_shader_program(const char* shader_name);
14501 
14502  // Deprecated as of 10.5.2. Use get_render_mode_shader() instead.
14503  //const char* get_recommended_appearance_shader_program_name();
14504 
14505  // Deprecated as of 10.5.1. Use merge_object() instead.
14506  //int merge_asset(const char* asset);
14507 
14508  // Deprecated as of 10.5.2. Use get_DIS_trailing_effect_state() instead.
14509  // void set_DIS_smoke_trail_state(int state);
14510 
14511  // Deprecated as of 10.5.2. Use get_DIS_trailing_effect_state() instead.
14512  // int get_DIS_smoke_trail_state();
14513 
14514  // Deprecated as of 12.0.0. Not supported in FaceFX.
14515  //int speak(const char* string);
14516 
14517 
14518  // Deprecated as of 12.0.0. Not supported in FaceFX.
14519  //int set_viseme(const char* viseme_name, float weight);
14520 
14521  // Deprecated as of 12.0.0. Not supported in FaceFX.
14522  //float get_viseme(const char* viseme_name);
14523 
14524 
14525  // Deprecated as of 12.0.0. Not supported in FaceFX.
14526  //int set_orientation_eye_left(float azimuth, float elevation);
14527 
14528  // Deprecated as of 12.0.0. Not supported in FaceFX.
14529  //int set_orientation_eye_right(float azimuth, float elevation);
14530 
14531  // Deprecated as of 12.0.0. Not supported in FaceFX.
14532  //float get_azimuth_eye_left();
14533 
14534  // Deprecated as of 12.0.0. Not supported in FaceFX.
14535  //float get_elevation_eye_left();
14536 
14537  // Deprecated as of 12.0.0. Not supported in FaceFX.
14538  //float get_azimuth_eye_right();
14539 
14540  // Deprecated as of 12.0.0. Not supported in FaceFX.
14541  //float get_elevation_eye_right();
14542 
14543  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14544  //int set_weapon_shell_eject_enabled(int enabled);
14545 
14546  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14547  //int get_weapon_shell_eject_enabled();
14548 
14549  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14550  //int set_weapon_smoke_enabled(int enabled);
14551 
14552  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14553  //int get_weapon_smoke_enabled();
14554 
14555  // Deprecated as of 13.5
14556  // int set_shape_switches_disabled(int disabled_flag);
14557  // int get_shape_switches_disabled();
14558 
14559 /****************************************************************************/
14560 /****************************************************************************/
14561 
14566 #ifdef CPLUSPLUS_ONLY
14567 
14568  bdiScenarioCharacter* get_scripted_object();
14569 private:
14570 
14571  /*l
14572  ** A private constructor.
14573  */
14574  diguyCharacter(bdiScenarioCharacter* character);
14575 
14576  /*l
14577  ** A private destructor.
14578  */
14579  ~diguyCharacter();
14580 
14581  /*l
14582  ** A pointer to internal data.
14583  */
14584  bdiScenarioCharacter* m_scripted_object;
14585 
14586  friend class bdiPublishedCharacter;
14587  friend class bdiScenarioCharacter;
14588  friend class diguySensorRegion;
14589  friend class diguyScenario;
14590 
14591 #endif
14592 
14593 };
14594 
14595 
14596 #endif /* __diguyCharacter_H */
14597 
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:55
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:39
wrapper around a chain simulation
Definition: diguyChainSimulation.h:35
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:41
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:27
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:11
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:82
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.
static double t
4 Header files and forward declarations
Definition: simple_playback_ogl.cpp:56
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:37
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:43
A bead that sits on a character's spline path and triggers a new script evaluation.
Definition: diguyCharacterPathScriptBead.h:34
Definition: diguySoundInstance.h:29
The diguyVariable class allows you to add per character named parameters. This can be handy for track...
Definition: diguyVariable.h:46
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:154
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:47
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