DI-Guy SDK Documentation  13.7.1
diguyCharacter.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2023 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 /*********************************************************************
7  **
8  *t diguyCharacter
9  **
10  *b Link against: libdiguy
11  */
12 
13 #pragma once
14 
15 #ifdef SWIG
16 %module diguyCharacter
17 #else
18 #define CPLUSPLUS_ONLY
19 #endif
20 
21 #ifdef CPLUSPLUS_ONLY
22 #include <declspec_diguy.h>
23 #include <diguy_constants.h>
24 #include <diguy_typedefs.h>
25 #include <diguy_vector_classes.h>
28 #include <diguyCharacterTypeMap.h>
29 #include <diguyMotionDirection.h>
30 #include <diguyMotionPosture.h>
31 #include <diguyMotionVariant.h>
32 
33 class bdiScenarioCharacter;
34 class diguyAgentParams;
36 class diguyCharacter;
40 class diguyCharacterPath;
45 class diguyCrowd;
46 class diguyGraphicsLink;
49 class diguyImpact;
52 class diguyPathShape;
53 class diguyScenario;
54 class diguySoundInstance;
55 class diguyVariable;
57 class diguyView;
58 class diguyViewLabel;
59 class diguyWaypoint;
60 
63 
65 
66 class DtEntityStateRepository;
67 
68 #endif
69 
70 
83 class BDI_DECLSPEC_diguy diguyCharacter
84 {
85 
86 public:
87 
88 /*****************************************************************************/
98  /*l
99  *b Description:
100  **
101  ** Returns the name of the object. This pointer will never be NULL.
102  */
103  const char* get_name();
104 
105  /*l
106  *b Description:
107  **
108  ** This function sets the name of this object.
109  **
110  *b Returns:
111  **
112  ** 0 on success, -1 on failure
113  */
114  int set_name(const char* name);
115 
116  /*l
117  *b Description:
118  **
119  ** Returns the type name of the object, should be 'character'. This pointer will never be
120  ** NULL.
121  */
122  const char* get_type_name();
123 
124  /*l
125  *b Description:
126  **
127  ** All characters are assigned a unique identifier, or uid. This
128  ** function returns this character's uid.
129  **
130  ** *Note*: unique identifiers will change between DI-Guy runs!
131  **
132  */
133  long get_uid();
134 
135  /*l
136  *b Description:
137  **
138  ** Returns the index of the object. This index may change if
139  ** characters are created or destroyed, so it should not be considered
140  ** a unique identifier for the character. See get_uid().
141  */
142  int get_index();
143 
144  /*l
145  *b Description:
146  **
147  ** This function updates the character. The character's position and
148  ** pose will be set to be what it will be (or was) at the specified t.
149  **
150  ** If the scenario has control of t (return value of
151  ** get_t_controlled_by_scenario_t() is 0), then this function's
152  ** effects will be overridden the next time diguyScenario::update() is
153  ** called with a new t.
154  **
155  ** Note: diguyScenario::update() must be called as or more frequently
156  ** than diguyCharacter::update() for proper DI-Guy operation.
157  ** diguyCharacter::update() is intended for load management use, where
158  ** the user intends to update far away or out-of-frustum characters
159  ** less frequently than the overall scenario. This is done in con-
160  ** junction with set_t_controlled_by_scenario_t(0) for the character.
161  ** diguyCharacter::update() is not intended as a replacement for
162  ** diguyScenario::update().
163  **
164  *b Returns:
165  **
166  ** 0 on success, -1 on failure
167  **
168  *b Arguments:
169  **
170  *a t - new time for the character
171  *a full_update - set to 1 to cause full update of character
172  */
173  int update(float t, int full_update = 1);
174 
175  /*l
176  *b Description:
177  **
178  ** This function sets the current type of this character.
179  **
180  *b Arguments:
181  **
182  *a type - name of the new desired type
183  **
184  *b See Also:
185  **
186  ** get_character_type_string()
187  */
188  void set_character_type(const char* type);
189 
190  /*l
191  *b Description:
192  **
193  ** Returns the type of the character (never NULL).
194  **
195  ** Character types specify the types of motions the character will be
196  ** able to perform. Some characters can move like soldiers, others
197  ** can move like civilians, still others can move like specific
198  ** animals.
199  **
200  ** The character type is explicitly specified in the call to
201  ** diguyScenario::create_character().
202  **
203  ** Examples of character types are:
204  *>
205  *- - soldier
206  *- - male_pedestrian
207  *- - horse
208  *- - prop
209  *<
210  */
211  const char* get_character_type_string();
212 
213  /*l
214  *b Description:
215  **
216  ** Returns the class of the character (never NULL).
217  **
218  ** Character classes are a higher level description than character
219  ** types, and allow for more generalized logic. For example, instead
220  ** of having something happen when one of a large set of specific
221  ** character types enters a region, something can happen when any
222  ** human enters the region.
223  **
224  ** Character classes are not specified directly, but are instead
225  ** derived from the character type. (In DI-Guy, all soldiers are
226  ** humans, for example.)
227  **
228  ** Examples of character classes are:
229  *>
230  *- - human
231  *- - vehicle
232  *- - object
233  *- - animal
234  *<
235  */
236  const char* get_character_class();
237 
239  diguyCharacterClass get_character_class_type();
240 
241  /*l
242  *b Description:
243  **
244  ** Returns the scenario that this character is a part of.
245  */
246  diguyScenario* get_scenario();
247 
248  /*l
249  *b Description:
250  **
251  ** This is the top-level on/off switch for the character. A character
252  ** that is not enabled has very little processing overhead: it is
253  ** neither updated during an update() call, nor is it drawn during a
254  ** draw() call. A disabled character will remain disabled until
255  ** set_enabled(1) is called on it; nothing else implicitly re-enables
256  ** the character.
257  **
258  ** There are several other diguyCharacter functions that have somewhat
259  ** similar effects that may be more appropriate at times:
260  **
261  *- - set_current_tin() and set_current_tout(): These functions
262  *- show and animate the character starting at time tin ("T In"),
263  *- and ending at time tout ("T Out")
264  *- - set_invisible_flag(): This function disables drawing of
265  *- the character, but the character still updates and changes
266  *- position.
267  **
268  ** Refer to the documentation of these functions for more information.
269  **
270  *b Returns:
271  **
272  ** always return 0
273  */
274  int set_enabled(int enabled);
275 
276  /*l
277  *b Description:
278  **
279  ** Returns whether the character is enabled, as set by the
280  ** set_enabled() call. New characters are enabled by default.
281  **
282  *b Returns:
283  **
284  ** 1 if the character is enabled, 0 if not
285  */
286  int get_enabled();
287 
288  /*l
289  *b Description:
290  **
291  ** Sets whether this character is drawn automatically by the scenario.
292  **
293  ** Note depending on the rendering environment if this flag is set to 0,
294  ** it is up to the user to call the character draw_pass1() and draw_pass2()
295  ** calls at the appropriate time.
296  **
297  *b Arguments:
298  **
299  *a flag - pass 1 for character drawing to automatically be
300  *a handled by scenario (this is the default);
301  *a 0 for it not to be
302  **
303  *b Returns:
304  **
305  ** 0 on success, -1 on failure
306  */
307  int set_drawn_by_scenario_flag(int flag);
308 
309  /*l
310  *b Description:
311  **
312  ** Returns whether character drawing is done automatically by the
313  ** scenario.
314  **
315  *b Returns:
316  **
317  ** 1 if character drawing is done by the scenario;
318  ** 0 if not
319  **
320  *b See Also:
321  **
322  ** set_drawn_by_scenario_flag()
323  */
324  int get_drawn_by_scenario_flag();
325 
326  /*l
327  *b Description:
328  **
329  ** This function makes the character invisible; i.e., draw() calls
330  ** for the character will have no effect. Note that the character
331  ** will still update its position and pose during update() calls. To
332  ** more thoroughly disable a character, consider the functions
333  ** set_enabled() and set_current_tout().
334  **
335  *b Arguments:
336  **
337  *a invisible_flag - pass 1 to make character invisible, 0 to
338  *a make it visible
339  **
340  *b Available as Decision Bead/Event
341  */
342  void set_invisible_flag(int invisible_flag);
343 
345  int get_invisible_flag();
346 
347  /*l
348  *b Description:
349  **
350  ** Returns whether the character is active. A character is
351  ** active if:
352  **
353  *- - it is enabled as per the set_enabled() call
354  *- - it is within its tin/tout interval as set by the
355  *- set_current_tin() and set_current_tout() calls
356  *- - it is not "network paused" (get_is_network_paused()
357  *- returns 0)
358  **
359  *b Returns:
360  **
361  ** 1 if the character is active, 0 if not
362  **
363  *b Available as Decision Bead
364  */
365  int get_is_active();
366 
367  /*l
368  *b Description:
369  **
370  ** Returns whether the character will be drawn during scenario and
371  ** character draw() calls. A character will be drawn if:
372  **
373  *- - it is enabled as per the set_enabled() call
374  *- - it is within its tin/tout interval as set by the
375  *- set_current_tin() and set_current_tout() calls
376  *- - its invisible flag is 0, as set by the
377  *- set_invisible_flag() call
378  **
379  ** There is no corresponding set_is_drawn() function; use
380  ** set_invisible_flag() to explicitly make a character not be drawn.
381  **
382  *b Returns:
383  **
384  ** 1 if the character will be drawn, 0 if not
385  */
386  int get_is_drawn();
387 
391  int get_was_drawn_last_frame();
392 
394  int set_was_drawn_last_frame(int drawn);
395 
397  int get_is_culled();
398 
404  int set_is_culled(int culled);
405 
406  /*l
407  *b Returns:
408  **
409  ** 1 if the character is temporary (created by diguyScenario::create_temporary_character()
410  ** call; 0 if not
411  */
412  int get_is_temporary();
413 
414  /*l
415  *b Description:
416  **
417  ** This function returns 1 if the character has been recycled from the
418  ** character recycle bin, 0 if not.
419  **
420  ** See diguyScenario::send_character_to_recycle_bin()
421  ** and diguyScenario::retrieve_character_from_recycle_bin().
422  */
423  int get_is_recycled();
424 
425  /*l
426  *b Description:
427  **
428  ** This function sets how the character's t (time) is controlled. If
429  ** 1, the character's t will be set by the scenario on each call to
430  ** diguyScenario::update(). If 0, the character should be updated by
431  ** calls to update().
432  **
433  *b Arguments:
434  **
435  *a t_controlled_by_scenario_t - 1 for controlled by scenario, 0 for
436  *a manual update
437  **
438  *b Returns:
439  **
440  ** 0 on success, -1 on failure
441  */
442  int set_t_controlled_by_scenario_t(int t_controlled_by_scenario_t);
443 
444  /*l
445  *b Returns:
446  **
447  ** whether character's t is controlled by the scenario;
448  ** see set_t_controlled_by_scenario_t()
449  */
450  int get_t_controlled_by_scenario_t();
451 
452  /*l
453  *b Description:
454  **
455  ** This function sets the initial tin ("T In") time of the character.
456  ** See set_current_tin() for a discussion of how tin and tout times
457  ** affect the character.
458  **
459  ** When the scenario is reset or loaded from a .dss file, the current
460  ** tin value will be set to this initial tin value.
461  **
462  ** Note that if the scenario is running (diguyScenario::get_t() returns > 0),
463  ** tin can be set only if override_time_warning is set.
464  **
465  ** Note that both tin and tout times are scenario-relative times, not
466  ** character-relative.
467  **
468  ** This call makes an implicit call to set_current_tin() with the
469  ** same value.
470  **
471  *b Arguments:
472  **
473  *a tin - new value of initial tin in seconds
474  *a override_time_warning - if set, initial_tin can be set at any time
475  **
476  *b Returns:
477  **
478  ** 0 on success, -1 on failure
479  */
480  int set_initial_tin(float tin, int override_time_warning = 0);
481 
482  /*l
483  *b Description:
484  **
485  ** This function sets the initial tout ("T Out") time of the
486  ** character. See set_current_tin() for a discussion of how tin and
487  ** tout times affect the character.
488  **
489  ** When the scenario is reset or loaded from a .dss file, the current
490  ** tout value will be set to this initial tout value.
491  **
492  ** Note that this function cannot be called once the scenario has
493  ** begun running (diguyScenario::get_t() returns > 0).
494  **
495  ** Note that both tin and tout times are scenario-relative times, not
496  ** character-relative.
497  **
498  ** This call makes an implicit call to set_current_tout() with the
499  ** same value.
500  **
501  *b Arguments:
502  **
503  *a tout - new value of initial tout in seconds
504  **
505  *b Returns:
506  **
507  ** 0 on success, -1 on failure
508  */
509  int set_initial_tout(float tout);
510 
511  /*l
512  *b Description:
513  **
514  ** This function sets the current tin ("T In") time of the character.
515  ** The character will not be visible nor will it start moving or
516  ** animating until the scenario reaches this time.
517  **
518  ** There are two ways the tin and tout times of the character can be
519  ** used:
520  **
521  ** The first is to set them to their desired values when the scenario
522  ** begins. If, for example, it is known that this character should
523  ** only be visible and active from 60 seconds to 80 seconds, the tin
524  ** and tout times can be set to 60 and 80, respectively. The
525  ** scenario will then spend very little time for character updates
526  ** and draws outside of these limits.
527  **
528  ** The second is to use them to quickly "trigger" a character to
529  ** become visible and start moving. This is done by setting the
530  ** initial values of tin and tout to very high values, and then
531  ** changing them to lower values when the character should become
532  ** active. Consider the following example: This character is
533  ** waiting just inside a doorway, and should emerge when another
534  ** character comes close. If the tin time of the character is very
535  ** high, very little time will be taken for this character's updates
536  ** and draws. When the other character does come close, this
537  ** character's tin time can be set to "now" (the scenario's current
538  ** t, as returned by diguyScenario::get_t()). This character will
539  ** then become visible and start moving out of the doorway.
540  **
541  ** The default current tin time is the current time of the scenario
542  ** when the character is created.
543  **
544  ** Note that both tin and tout times are scenario-relative times, not
545  ** character-relative.
546  **
547  *b Arguments:
548  **
549  *a tin - new value of current tin in seconds
550  **
551  *b Returns:
552  **
553  ** 0 on success, -1 on failure
554  */
555  int set_current_tin(float tin);
556 
557  /*l
558  *b Description:
559  **
560  ** Same as set_current_tin(), but time is set to current scenario time.
561  **
562  *b Returns:
563  **
564  ** 0 on success, -1 on failure
565  **
566  *b Available as Decision Bead/Event
567  */
568  int set_current_tin_to_now();
569 
570  /*l
571  *b Description:
572  **
573  ** This function returns the current tin time of the character. See
574  ** set_current_tin().
575  **
576  *b Returns:
577  **
578  ** Current tin time in seconds.
579  */
580  float get_current_tin();
581 
582  /*l
583  *b Description:
584  **
585  ** This function sets the current tout ("T Out") time of the
586  ** character. If tout is enabled the character will become invisible
587  ** and will stop moving and animating when the scenario reaches this
588  ** time.
589  **
590  ** Note that both tin and tout times are scenario-relative times, not
591  ** character-relative.
592  **
593  ** Default tout time is 60000 seconds.
594  **
595  *b Arguments:
596  **
597  *a tout - new value of current tout in seconds
598  *a disable_character_at_tout - this argument is present to keep
599  *a the function prototype will remain
600  *a backward compatible; it has no effect
601  */
602  int set_current_tout(float tout,
603  int disable_character_at_tout = 0);
604 
605  /*l
606  *b Description:
607  **
608  ** Same as set_current_tout(), but time is set to current scenario
609  ** time.
610  **
611  *b Returns:
612  **
613  ** 0 on success, -1 on failure
614  **
615  *b Available as Decision Bead
616  */
617  int set_current_tout_to_now();
618 
619  /*l
620  *b Description:
621  **
622  ** This function returns the current tout ("T Out") time of the
623  ** character in seconds. See set_current_tout().
624  */
625  float get_current_tout();
626 
627  /*l
628  *b Description:
629  **
630  ** This function sets what will happen when the character reaches its
631  ** tout time. If set to 0, the character will ignore the tout time
632  ** and continue indefinitely.
633  */
634  void set_tout_enabled(int tout_enabled);
635 
636  /*l
637  *b Description:
638  **
639  ** This function returns the whether tout is enabled.
640  **
641  ** See set_tout_enabled().
642  **
643  *b Returns:
644  **
645  ** 1 if tout enabled, 0 if not
646  */
647  int get_tout_enabled();
648 
650  float get_char_time();
651 
652  /*l
653  *b Description:
654  **
655  ** When the motion data of a character is interpolated a quick
656  ** interpolation method can be used which may yield incorrect results,
657  ** or an expensive interpolation method can be used which will yield
658  ** correct results at the expense of time. The threshold at which
659  ** the interpolation method changes is specified by this function.
660  **
661  *b Arguments:
662  **
663  *a threshold - float between 0 (careful never) and 1 (careful always);
664  ** default is 0.7
665  **
666  ** DI-Guy compares the careful interpolation threshold to the cosine
667  ** of an angle. Both the threshold and the cosine are dimensionless
668  ** and thus have no units.
669  **
670  *b Returns:
671  **
672  ** 0 on success, -1 on failure
673  */
674  int set_careful_interpolation_threshold(float threshold);
675 
676  /*l
677  *b Returns:
678  **
679  ** most recent setting of the careful interpolation threshold;
680  ** see set_careful_interpolation_threshold()
681  */
682  float get_careful_interpolation_threshold();
683 
684  /*l
685  *b Description:
686  **
687  ** Sets whether the motion data of the character is interpolated.
688  ** Interpolation is disabled by default for better performance. For
689  ** applications achieving high frame rates, smoother motion may be
690  ** achieved by turning interpolation on.
691  **
692  *b Arguments:
693  **
694  *a flag - 0 by default
695  **
696  *b Returns:
697  **
698  ** 0 on success, -1 on failure
699  */
700  int set_motion_interpolation_flag(int flag);
701 
702  /*l
703  *b Returns:
704  **
705  ** most recent setting of the motion interpolation flag; see
706  ** set_motion_interpolation_flag()
707  */
708  int get_motion_interpolation_flag();
709 
710  /*l
711  *b Description:
712  **
713  ** Sets the scale of the character on each of the three major axes.
714  **
715  *b Arguments:
716  **
717  *a scale_x, scale_y, scale_z - the factor by which to scale along
718  *a the given axis
719  **
720  *b Returns:
721  **
722  ** 0 on success, -1 on failure
723  */
724  int set_scale(float scale_x, float scale_y, float scale_z);
725 
726  /*l
727  *b Description:
728  **
729  ** Returns the scale of the character.
730  **
731  *b Arguments:
732  **
733  *a sx, sy, sz - scale of the character along each axis
734  **
735  ** Pass NULL for any values that are not needed.
736  **
737  *b Returns:
738  **
739  ** 0 on success, -1 on failure
740  */
741  int get_scale(float* scale_x, float* scale_y, float* scale_z);
742 
743  /*l
744  *b Description:
745  **
746  ** Sets the parent of this character to be the passed character.
747  ** This means that the coordinate system of this character will be
748  ** local to the parent character rather than the world coordinate
749  ** system.
750  **
751  *b Arguments:
752  **
753  *a parent_name - character to which this character should
754  *a be attached; pass NULL to have no parent
755  *a and be attached to the world
756  *a parent_link_name - name of the link or connection point to which this character's
757  *a position link should attach; pass "" to attach
758  *a to the parent's position link
759  **
760  *b Returns:
761  **
762  ** 0 on success, -1 on failure
763  **
764  *b Available as Decision Bead/Event
765  */
766  int set_parent(const char* parent_name, const char* parent_link_name = "");
767 
768  /*l
769  *b Description:
770  **
771  ** Gets the parent of this character.
772  **
773  *b Returns:
774  **
775  ** pointer to type diguyCharacter; NULL if no parent
776  **
777  *b Available as Decision Bead/Event
778  */
779  diguyCharacter* get_parent();
780 
781  /*l
782  *b Description:
783  **
784  ** Gets the link name that the character is parented to, if any.
785  **
786  *b Returns:
787  **
788  ** name of link, NULL if no parent
789  */
790  const char* get_parent_link_name();
791 
792  /*l
793  *b Description:
794  **
795  ** Detaches a character from its parent and reattaches it to the
796  ** world. This is equivalent to diguyCharacter::set_parent(NULL).
797  **
798  *b Returns:
799  **
800  ** 0 on success, -1 on failure
801  **
802  *b Available as Decision Bead/Event
803  */
804  int unset_parent();
805 
806  /*l
807  *b Description:
808  **
809  ** Gets the number of children the character has.
810  */
811  int get_num_children();
812 
813  /*l
814  *b Description:
815  **
816  ** This function returns a pointer to the nth child of the character.
817  **
818  *b Returns:
819  **
820  ** pointer of type diguyCharacter; NULL if no
821  ** child at the specified index
822  **
823  *b Arguments:
824  **
825  *a index - index of the child; indices start at 0
826  */
827  diguyCharacter* get_child_at_index(int index);
828 
829  /*l
830  *b Description:
831  **
832  ** Gets if a character is a static object, by default any blitzed .
833  ** in props are.
834  **
835  *b Returns:
836  **
837  ** 1 if true, 0 if false
838  */
839  int get_is_scene_object();
840 
841  /*l
842  *b Description:
843  **
844  ** Sets if a character is a static object. By default any blitzed
845  ** in props are.
846  **
847  *b Arguments:
848  **
849  *a is_scene_object - pass 1 to make the object a scene object,
850  *a 0 to not
851  **
852  *b Returns:
853  **
854  ** 0 on success, -1 on failure
855  */
856  int set_is_scene_object(int is_scene_object);
857 
858  /*l
859  *b Description:
860  **
861  ** Gets the bounding radius currently used for this character
862  ** for purposes of culling it from the draw operation.
863  **
864  *b Returns:
865  **
866  ** The current draw-culling bounding radius for the character, in
867  ** meters.
868  */
869  float get_bounding_radius();
870 
871  /*l
872  *b Description:
873  **
874  ** Gets the default draw-culling bounding radius for this
875  ** character, as specified in its actor cfg file. See
876  ** actor_vehicle.cfg for an example.
877  **
878  *b Returns:
879  **
880  ** The default draw-culling bounding radius for the character.
881  */
882  float get_default_bounding_radius();
883 
884  /*l
885  *b Description:
886  **
887  ** Sets the current draw-culling bounding radius to be used for
888  ** this character.
889  */
890  void set_bounding_radius(float f);
891 
892  /*l
893  *b Description:
894  **
895  ** This function returns the number of seconds before the blend
896  ** into the next motion begins. If the character is already
897  ** in a blend between motions the function returns 0.
898  **
899  ** Note that this function is of limited practical use; in most
900  ** cases get_time_to_reach_desired_action() returns
901  ** information that is more useful.
902  **
903  *b Returns:
904  **
905  ** time to next blend, in seconds
906  **
907  *b Mode Restrictions:
908  **
909  *- - This function can only be called in free action mode.
910  */
911  float get_time_to_transition();
912 
914  float get_character_local_time();
915 
916  /*l
917  *b Returns:
918  **
919  ** the action mode of the character
920  */
921  diguyCharacterMode get_action_mode();
922 
923  /*l
924  *b Returns:
925  **
926  ** the position mode of the character
927  */
928  diguyCharacterMode get_position_mode();
929 
930  /*l
931  *b Description:
932  **
933  ** This function speeds up or slows down the character. Setting
934  ** this value greater than 1 will cause character actions to
935  ** be played back at a slower pace, setting to less that 1 will
936  ** cause character actions to be played at a faster pace.
937  **
938  ** This will override other factors that may scale the time
939  ** scale factor of a character. (For example, smaller scale
940  ** characters will generally move faster.)
941  **
942  ** Call unset_t_scale_factor() to allow other factors such
943  ** as scale or desired speed to determine the time scale factor.
944  **
945  *b Mode Restrictions:
946  **
947  *- - This function can only be called in free action mode.
948  **
949  *b Arguments:
950  **
951  *a t_scale_factor - time scale factor
952  **
953  *b Returns:
954  **
955  ** 0 on success, -1 on failure
956  */
957  int set_t_scale_factor(float t_scale_factor);
958 
959  /*l
960  *b Description:
961  **
962  ** This function removes the manual setting of the time
963  ** scale factor as set by set_t_scale_factor().
964  **
965  *b Mode Restrictions:
966  **
967  *- - This function can only be called in free action mode.
968  **
969  *b Returns:
970  **
971  ** 0 on success, -1 on failure
972  */
973  int unset_t_scale_factor();
974 
975  /*l
976  *b Description:
977  **
978  ** This function determines whether this character is within the
979  ** specified distance of another.
980  **
981  *b Arguments:
982  **
983  *a character - character to be checked
984  *a distance - distance to character in meters
985  **
986  *b Returns:
987  **
988  ** 1 if within distance; 0 if not
989  */
990  int is_within_distance_n_of_character(const char* character_name,
991  float distance);
992 
993  /*l
994  *b Description:
995  **
996  ** This function determines whether this character is within the
997  ** specified distance of any members of the specified group.
998  **
999  *b Arguments:
1000  **
1001  *a group_name - name of group to be checked
1002  *a distance - distance in meters
1003  **
1004  *b Returns:
1005  **
1006  ** 1 if member of group is within distance; 0 if not
1007  */
1008  int is_within_distance_n_of_member_of_group(const char* group_name,
1009  float distance);
1010 
1011  /*l
1012  *b Description:
1013  **
1014  ** This function determines whether a character is a member of
1015  ** a particular group.
1016  **
1017  ** Also see diguyCharacterGroup::is_member().
1018  **
1019  *b Arguments:
1020  **
1021  *a group_name - name of group to be checked
1022  **
1023  *b Returns:
1024  **
1025  ** 1 if character is in group, 0 if not
1026  */
1027  int is_group_member(const char* group_name);
1028 
1029  /*l
1030  *b Description:
1031  **
1032  ** This function returns the number of groups that a character is a
1033  ** member of.
1034  **
1035  ** Also see diguyCharacterGroup::is_member().
1036  */
1037  int get_num_group_memberships();
1038 
1039  /*l
1040  *b Description:
1041  **
1042  ** This function returns a pointer to the nth group that this
1043  ** character is a member of.
1044  **
1045  ** Also see diguyCharacterGroup::is_member().
1046  **
1047  *b Returns:
1048  **
1049  ** pointer of type diguyCharacterGroup; NULL if no
1050  ** group at the specified index
1051  **
1052  *b Arguments:
1053  **
1054  *a index - index of the group; indices start at 0
1055  */
1056  diguyCharacterGroup* get_group_membership_at_index(int index);
1057 
1058  /*l
1059  *b Description:
1060  **
1061  ** This function will check all characters in the scenario and return
1062  ** the nearest character that is both alive and enabled. An optional
1063  ** argument specifies whether to skip characters that are invisible
1064  ** to the caller because a scene object is in the way. Checking
1065  ** visibility is only an option if an octtree is generated from scene
1066  ** objects. Typically only DI-Guy Scenario does this.
1067  **
1068  *b Arguments:
1069  **
1070  *a check_visibility - whether to check that characters are
1071  *a visible to calling character; pass 1
1072  *a to check, 0 to not check
1073  *a xy_distance - whether to include the z component
1074  *a in distance calculations; pass 1 to
1075  *a check only XY distance, 0 to check
1076  *a XYZ distance
1077  **
1078  *b Returns:
1079  **
1080  ** pointer of type diguyCharacter; may be NULL
1081  */
1082  diguyCharacter* get_nearest_active_character(int check_visibility,
1083  int xy_distance = 0,
1084  float max_distance_to_check = 100000);
1085 
1086  /*l
1087  *b Description:
1088  **
1089  ** This function will check all characters in a group and return the
1090  ** nearest character that is both alive and enabled. An optional
1091  ** argument specifies whether to skip characters that are invisible
1092  ** to the caller because a scene object is in the way. Checking
1093  ** visibility is only an option if an octtree is generated from scene
1094  ** objects. Typically only DI-Guy Scenario does this.
1095  **
1096  *b Arguments:
1097  **
1098  *a group_name - name of group to check
1099  *a check_visibility - whether to check that characters are
1100  *a visible to calling character; pass 1
1101  *a to check, 0 to not check
1102  *a xy_distance - whether to include the z component
1103  *a in distance calculations; pass 1 to
1104  *a check only XY distance, 0 to check
1105  *a XYZ distance
1106  **
1107  *b Returns:
1108  **
1109  ** pointer of type diguyCharacter; may be NULL
1110  */
1111  diguyCharacter* get_nearest_active_character_in_group(const char* group_name,
1112  int check_visibility = 1,
1113  int xy_distance = 0,
1114  float max_distance_to_check = 100000);
1115 
1116  /*l
1117  *b Description:
1118  **
1119  ** This function will check all characters in the scenario and return
1120  ** a random character within max_distance that is both alive and
1121  ** enabled. An optional argument specifies whether to skip characters
1122  ** that are invisible to the caller because a scene object is in the
1123  ** way. Checking visibility is only an option if an octtree is
1124  ** generated from scene objects. Typically only DI-Guy Scenario does
1125  ** this.
1126  **
1127  *b Arguments:
1128  **
1129  *a check_visibility - whether to check that characters are
1130  *a visible to calling character; pass 1
1131  *a to check, 0 to not check
1132  *a max_distance - how far away the search cut off should be pass
1133  *a in -1.0f to use all characters
1134  *a xy_distance - whether to include the z component
1135  *a in distance calculations; pass 1 to
1136  *a check only XY distance, 0 to check
1137  *a XYZ distance
1138  **
1139  *b Returns:
1140  **
1141  ** pointer of type diguyCharacter; may be NULL
1142  */
1143  diguyCharacter* get_random_active_character(float max_distance = 10.0f,
1144  int check_visibility = 1,
1145  int xy_distance = 0);
1146 
1147  /*l
1148  *b Description:
1149  **
1150  ** This function will check all characters in a group and return a
1151  ** random character within max_distance that is both alive and
1152  ** enabled. An optional argument specifies whether to skip characters
1153  ** that are invisible to the caller because a scene object is in the
1154  ** way. Checking visibility is only an option if an octtree is
1155  ** generated from scene objects. Typically only DI-Guy Scenario does
1156  ** this.
1157  **
1158  *b Arguments:
1159  **
1160  *a group_name - name of group to check
1161  *a max_distance - how far away the search cut off should be, pass
1162  *a in -1.0f to use all characters
1163  *a check_visibility - whether to check that characters are
1164  *a visible to calling character; pass 1
1165  *a to check, 0 to not check
1166  *a xy_distance - whether to include the z component
1167  *a in distance calculations; pass 1 to
1168  *a check only XY distance, 0 to check
1169  *a XYZ distance
1170  **
1171  *b Returns:
1172  **
1173  ** pointer of type diguyCharacter; may be NULL
1174  */
1175  diguyCharacter* get_random_active_character_in_group(const char* group_name,
1176  float max_distance = 10,
1177  int check_visibility = 1,
1178  int xy_distance = 0);
1179 
1180  /*l
1181  *b Description:
1182  **
1183  ** This function returns the 3D distance from this character to the
1184  ** specified character, in meters. The distance is calculated from
1185  ** the characters' idealized positions.
1186  */
1187  float get_distance_to_character(diguyCharacter* character);
1188 
1189  /*l
1190  *b Description:
1191  **
1192  ** This function returns the 2D distance in X and Y coordinates only
1193  ** from this character to the specified character, in meters. The
1194  ** distance is calculated from the characters' idealized positions.
1195  */
1196  float get_distance_xy_to_character(diguyCharacter* character);
1197 
1198  /*l
1199  *b Description:
1200  **
1201  ** This function returns the 3D distance from this character to the
1202  ** specified impact, in meters. The distance is calculated from the
1203  ** characters' idealized positions.
1204  */
1205  float get_distance_to_impact(diguyImpact* impact);
1206 
1207  /*l
1208  *b Description:
1209  **
1210  ** Each character has a "random factor" between 0 and 1. This value
1211  ** is persistent with the character; i.e., the random factor will
1212  ** stay constant for the entire lifetime of the character.
1213  **
1214  ** This random factor can be used to add some variability between
1215  ** different characters.
1216  **
1217  ** Though each character has a random factor that has a very good
1218  ** chance of being different from all other characters' in the
1219  ** scenario, this is not guaranteed and so should not be used as a
1220  ** unique identifier.
1221  **
1222  ** An example of use: Instead of all characters beginning an action
1223  ** or behavior at the same time, have each one begin (random_factor *
1224  ** 2.0) seconds from the current time. This will result in more
1225  ** natural looking behavior as characters one by one begin the new
1226  ** behavior in the next two seconds, rather than all beginning at
1227  ** once.
1228  **
1229  *b Returns:
1230  **
1231  ** the character's random factor, a value between 0 and 1
1232  */
1233  float get_random_factor();
1234 
1235 
1236 /*****************************************************************************/
1241  /*l
1242  *b Description:
1243  **
1244  ** This function draws this character in immediate mode graphics
1245  ** environments (see below). This is the equivalent of calling
1246  ** draw_pass1() immediately followed by draw_pass2().
1247  **
1248  *b Returns:
1249  **
1250  ** 0 on success, -1 on failure
1251  **
1252  *i OpenGL Version:
1253  **
1254  ** This function immediately draws this character. Either this
1255  ** function or draw_pass1() and draw_pass2() should be called once per
1256  ** frame.
1257  */
1258  int draw();
1259 
1260  /*l
1261  *b Description:
1262  **
1263  ** This function, along with draw_pass2(), allows the drawing of
1264  ** opaque and transparent polygons to be separated. This function
1265  ** draws all opaque polygons of this character.
1266  **
1267  *b Returns:
1268  **
1269  ** 0 on success, -1 on failure
1270  **
1271  *i OpenGL Version:
1272  **
1273  ** This function immediately draws the opaque character parts. Either
1274  ** this function or draw() should be called once per frame.
1275  */
1276  int draw_pass1();
1277 
1278  /*l
1279  *b Description:
1280  **
1281  ** Same as draw_pass1(), but draws transparent character parts.
1282  */
1283  int draw_pass2();
1284 
1285 #ifdef CPLUSPLUS_ONLY
1286 
1287  /*l
1288  *b Returns:
1289  **
1290  ** A pointer to the character's graphics.
1291  **
1292  *i Vega Prime Version:
1293  **
1294  ** The return pointer may be cast to point to a vpDiguyCharacter,
1295  ** which is derived from vpObject.
1296  **
1297  *i OpenGL Version:
1298  **
1299  ** This function returns NULL.
1300  **
1301  *i DI-Guy Graphics API:
1302  **
1303  ** This function returns the pointer set from the most recent
1304  ** set_graphics_ptr() call.
1305  */
1306  void* get_graphics_ptr();
1307 
1308  /*l
1309  *b Description:
1310  **
1311  ** Sets a graphics environment-specific pointer to graphics data.
1312  ** The pointer can be retrieved using get_graphics_ptr().
1313  **
1314  *b Arguments:
1315  **
1316  *a graphics_ptr - pointer to graphics data
1317  **
1318  *b Returns:
1319  **
1320  ** 0 on success, -1 on failure
1321  **
1322  *i OpenGL Version:
1323  **
1324  *b This function should not be called for these environments.
1325  **
1326  *i DI-Guy Graphics API Version:
1327  **
1328  ** This function allows graphics environment-specific data to be
1329  ** stored for later retrieval by get_graphics_ptr(). DI-Guy does
1330  ** not directly use the pointer, beyond returning it using the
1331  ** get_graphics_ptr() function.
1332  */
1333  int set_graphics_ptr(void* graphics_ptr);
1334 
1335  /*l
1336  *b Description:
1337  **
1338  ** This function sets a generic node pointer that can later be
1339  ** retrieved by the get_graphics_api_node_ptr() call. The pointer is
1340  ** otherwise not used.
1341  **
1342  *i Callback Info:
1343  **
1344  ** This function can be safely be called in the
1345  ** CALLBACK_ID_SET_GRAPHICS_API_NODE_PTR callback.
1346  **
1347  *b Arguments:
1348  **
1349  *a node_ptr - generic void* pointer
1350  */
1351  void set_graphics_api_node_ptr(void* node_ptr);
1352 
1353  /*l
1354  *b Returns:
1355  **
1356  ** pointer set by most recent call to set_graphics_api_node_ptr
1357  */
1358  void* get_graphics_api_node_ptr();
1359 
1360  /*l
1361  *b Description:
1362  **
1363  ** This function stores a pointer to user data.
1364  **
1365  *b Arguments:
1366  **
1367  *a user_data - pointer for user's own use; DI-Guy will
1368  *a do nothing to the contents of this pointer
1369  *a beyond passing it back when requested
1370  *a by get_user_data()
1371  **
1372  *b Returns:
1373  **
1374  ** 0 on success, -1 on failure
1375  */
1376  int set_user_data(void* user_data);
1377 
1378  /*l
1379  *b Returns:
1380  **
1381  ** The user data pointer set by set_user_data()
1382  */
1383  void* get_user_data();
1384 
1385 #endif
1386 
1387 /*****************************************************************************/
1397  /*l
1398  *b Description:
1399  **
1400  ** This function sets the desired action of the character.
1401  **
1402  ** This function will put the character into free action mode. If
1403  ** the character was in path action mode, actions will no longer be
1404  ** set by action beads on the path.
1405  **
1406  ** If the character is in path position mode and 1 is passed for
1407  ** retain_path_shape, the character will stay in path position mode.
1408  ** If 0 is passed for retain_path_shape, the character will be put
1409  ** into free position mode.
1410  **
1411  ** If the character is in free position mode the retain_path_shape
1412  ** argument will have no effect.
1413  **
1414  ** If this call is interrupting a character in path action mode
1415  ** and path position mode, the character will not be able to resume
1416  ** the interrupted path unless retain_path_shape is set to 1.
1417  ** See resume_interrupted_path().
1418  **
1419  ** This function will have no effect on a dead character (see
1420  ** die_now() and get_dead()).
1421  **
1422  *b Mode Effects:
1423  **
1424  *- - This function will put the character into free action mode.
1425  *- - This function may change the position mode; see Description.
1426  **
1427  *b Arguments:
1428  **
1429  *a action_name - name of the desired action to be performed by
1430  *a the character
1431  *a speed - the speed at which the character should travel
1432  *a while performing the action; pass
1433  *a DIGUY_DEFAULT_FLOAT for the optimal speed to
1434  *a be used
1435  *a retain_path_shape - pass 1 to remain in path position mode; pass
1436  *a 0 to change to free position mode
1437  **
1438  *b Returns:
1439  **
1440  ** 0 on success, -1 on failure
1441  */
1442  int set_desired_action( const char* action_name, float speed = DIGUY_DEFAULT_FLOAT,
1443  int retain_path_shape = 0 );
1444 
1445  /*l
1446  *b Description:
1447  **
1448  ** This function sets the desired action of the character. This function replaces
1449  ** the legacy set_desired_action(const char*,float,int), function. All arguments
1450  ** to the legacy function can be specified using the action parameters.
1451  **
1452  ** This function will have no effect on a dead character (see
1453  ** die_now() and get_dead()).
1454  **
1455  *b Mode Effects:
1456  **
1457  *- - This function will put the character into free action mode.
1458  *- - This function may change the position mode; see Description.
1459  **
1460  *b Arguments:
1461  **
1462  *a action_name - name of the desired action to be performed by the character
1463  *a action_parameters - parameters for setting the action (eg. speeds, path mode retention)
1464  **
1465  *b Returns:
1466  **
1467  ** 0 on success, -1 on failure
1468  */
1469  int set_desired_action( const char* action_name, const diguyActionParameters& action_parameters );
1470 
1475  const char* get_desired_action();
1476 
1478  int get_desired_action_index();
1479 
1481  const char* get_current_action();
1482 
1484  int get_current_action_index();
1485 
1487  diguyMotionDirection get_desired_action_direction();
1488 
1490  diguyMotionDirection get_current_action_direction();
1491 
1492  /*l
1493  *b Description:
1494  **
1495  ** This function returns the transition state of the action
1496  ** of a character. When commanding an action, DI-Guy may
1497  ** transition the character through one or more intermediate
1498  ** actions to reach the final action. For example, a character
1499  ** with the action "walk" that is commanded to "prone" would
1500  ** transition through the intermediate action "stand".
1501  **
1502  *b Returns:
1503  **
1504  ** 1 if the character is transitioning between actions
1505  ** 0 otherwise
1506  */
1507  int get_is_in_action_transition();
1508 
1509  /*l
1510  *b Description:
1511  **
1512  ** This function forces the current action of the character to be the
1513  ** action identified by action_name.
1514  **
1515  ** See set_desired_action() for a discussion of the effects on
1516  ** position mode.
1517  **
1518  ** This function will have no effect on a dead character (see
1519  ** die_now() and get_dead()).
1520  **
1521  ** By passing a value greater than 0 for t_offset_into_new_action,
1522  ** the character can be made to begin the action partway in. This is
1523  ** useful when forcing actions for a lot of characters at the same
1524  ** time; without the offset, the characters would move in lockstep. In
1525  ** general, the offset shouldn't be more than half the blend interval.
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();
3235 
3237  const char* get_compatible_head_appearance_at_index(int index);
3238 
3240  int get_num_compatible_facefx_head_appearances();
3241 
3243  const char* get_compatible_facefx_head_appearance_at_index(int index);
3244 
3245 
3246  /*l
3247  *b Description:
3248  **
3249  ** Similar to get_current_appearance_is(), but for head appearance.
3250  **
3251  *b Returns:
3252  **
3253  ** 1 if current head appearance has passed name; 0 if not
3254  **
3255  *b Available as Decision Bead/Event
3256  */
3257  int get_current_head_appearance_is(const char* head_appearance);
3258 
3259 
3260  /*b Description:
3261  **
3262  ** This function sets the both base and current hand item appearance
3263  ** of this character. The base hand item is the one it will have upon
3264  ** reset.
3265  **
3266  *b Arguments:
3267  **
3268  *a hand_item_appearance -- name of the desired hand item or "default"
3269  **
3270  *b Returns:
3271  **
3272  ** 0 on success, -1 on failure
3273  **
3274  *b Available as Decision Bead/Event
3275  */
3276  int set_hand_item(const char* hand_item_appearance);
3277 
3278  /*l
3279  *b Returns:
3280  **
3281  ** Hand item appearance; see set_hand_item()
3282  **
3283  ** Might return "default"
3284  */
3285  const char* get_hand_item();
3286 
3287  /*b Description:
3288  **
3289  ** This function sets the current hand item appearance of this character.
3290  ** The base hand item will remain unaffected.
3291  **
3292  *b Arguments:
3293  **
3294  *a hand_item_appearance -- name of the desired hand item or "default"
3295  **
3296  *b Returns:
3297  **
3298  ** 0 on success, -1 on failure
3299  **
3300  *b Available as Decision Bead/Event
3301  */
3302  int set_current_hand_item(const char* hand_item_appearance);
3303 
3304  /*l
3305  *b Returns:
3306  **
3307  ** Current hand item appearance. Will be the actual appearance
3308  ** displayed, not "default"
3309  */
3310  const char* get_current_hand_item();
3311 
3312  /*l
3313  *b Returns:
3314  **
3315  ** generic catagory of the hand item appearance.
3316  */
3317  const char* get_current_hand_item_type();
3318 
3320  const char* get_actor();
3321 
3324  int add_equipment_appearance( const char* equipment_appearance );
3325 
3327  int reset_equipment_appearance( const char* class_type );
3328 
3330  int reset_equipment_appearance();
3331 
3333  int get_num_equipment();
3334 
3336  const char* get_equipment_name_at_index( int index );
3337 
3339  const char* get_equipment_type_at_index( int index );
3340 
3342  int get_equipment_index_at_index( int index );
3343 
3345  int add_equipment_by_index( int index );
3346 
3347  /*l
3348  *b Description:
3349  **
3350  ** Turns on texture modulation system that tries to make all characters look
3351  ** unique. Only supported by some appearances. See diguyGraphicsShape Texture Variation API
3352  ** for fine grained control of this feature
3353  */
3354  int set_use_texture_variations(int value);
3355 
3356  /*l
3357  *b Returns:
3358  ** If texture variations have been enabled for this character. Note: only some
3359  ** appearances support this feature
3360  */
3361  int get_use_texture_variations();
3362 
3365  void set_texture_variation_seed(float seed);
3366 
3368  int get_supports_texture_variations();
3369 
3372  int get_supports_weight_variations();
3373 
3377  void set_weight_scale( float weight );
3378 
3380  float get_weight_scale();
3381 
3384  int set_blend_shape_weight(const char * name, float weight);
3385 
3389 
3390  bool set_unit_patch_by_name( const char* name, bool set_personal_patch = false );
3391  const char* get_unit_patch_name() const;
3392 
3393  bool set_personal_unit_patch_by_name( const char* name );
3394  const char* get_personal_unit_patch_name() const;
3395 
3397 
3402 
3403  bool set_unit_patch( const diguyPatchIdentifier& patch_id, bool set_personal_patch = false );
3404  const diguyPatchIdentifier& get_unit_patch() const;
3405 
3406  bool set_personal_unit_patch( const diguyPatchIdentifier& patch_id );
3407  const diguyPatchIdentifier& get_personal_unit_patch() const;
3408 
3410 
3414 
3415  bool set_rank_patch_by_name( const char* name );
3416  const char* get_rank_patch_name() const;
3417 
3419 
3423 
3424  bool set_rank_patch( const diguyPatchIdentifier& patch_id );
3425  const diguyPatchIdentifier& get_rank_patch() const;
3426 
3428 
3431 
3432  bool set_uniform_label_text( const char* name );
3433  const char* get_uniform_label_text() const;
3434 
3436 
3437  /*l
3438  *b Arguments:
3439  **
3440  *a appearance_type - a value indicating the type of supplementary appearance of concern,
3441  ** ie DIGUY_APPEARANCE_BODY, DIGUY_APPEARANCE_HEAD, DIGUY_APPEARANCE_EXPRESSIVE_HEAD,
3442  ** DIGUY_APPEARANCE_HAND_ITEM
3443  *b Returns:
3444  **
3445  ** The number of available supplementary appearances of given type
3446  */
3447  int get_num_appearances_of_type( diguyCharacterAppearanceTypes appearance_type );
3448 
3449  /*l
3450  *b Returns:
3451  **
3452  ** The name of the supplementary appearance (body, head, expressive head, hand item) or NULL
3453  **
3454  *b Arguments:
3455  **
3456  *a appearance_type - a value indicating the type of appearance of concern
3457  *a index - a value indicating the type of supplementary appearance of concern
3458  **
3459  */
3460  const char* get_appearance_name_at_index(diguyCharacterAppearanceTypes appearance_type, int index);
3461 
3462  /*****************************************************************************/
3485  /*l
3486  *b Description:
3487  **
3488  ** Sets the graphics level of detail (LOD) ranges for this character.
3489  ** Compare with diguyScenario::set_default_lod_ranges(), which sets
3490  ** the LOD ranges for newly created characters of a particular type.
3491  ** In both cases, ranges must be a static array of 8 floats,
3492  ** each larger than the one before.
3493  **
3494  ** This function sets graphics LOD ranges only. Motion levels of
3495  ** detail can be set by calling set_motion_lod().
3496  **
3497  *b Arguments:
3498  **
3499  *a lod_ranges - new lod ranges for this character;
3500  **
3501  ** See diguyScenario::set_default_lod_ranges() for a description
3502  ** of what to pass in lod_ranges.
3503  **
3504  *b Returns:
3505  **
3506  ** 0 on success, -1 on failure
3507  **
3508  *b Callable From:
3509  **
3510  *- - C++
3511  */
3512  int set_lod_ranges(float* lod_ranges);
3513 
3514 #ifdef CPLUSPLUS_ONLY
3515  float* get_lod_ranges();
3517 
3518 #endif
3519 
3521  int get_num_lods();
3522 
3523  /*l
3524  *b Description:
3525  **
3526  ** Set the desired graphics level of detail (LOD) for this character.
3527  ** This may be overridden if this character uses automatic LOD
3528  ** switching. See diguyScenario::set_automatic_graphics_lod_switching().
3529  **
3530  ** DI-Guy graphics LODs are numbered 1 (most detail) through 7 (least detail).
3531  **
3532  *b Arguments:
3533  **
3534  *a lod - an float between 1 and 7... fractional part represent percentage through the lod
3535  **
3536  *b Returns:
3537  **
3538  ** 0 on success, -1 on failure
3539  */
3540  int set_graphics_lod(float lod);
3541 
3543  int get_graphics_lod();
3544 
3546  float get_graphics_lod_fraction();
3547 
3550  int set_allow_instancing(int value);
3551 
3553  int get_allow_instancing() const;
3554 
3557  int get_is_instanced() const;
3558 
3559  // informs the internals that this character wasn't instanced, can cause an update if set_is_culled(0) is called
3560  void set_is_instanced(int val);
3561 
3563  int can_lod_be_instanced(int lod);
3564 
3565  /*l
3566  *b Description:
3567  **
3568  ** For scene graph renderers it can be necessary to patch the texture buffer object after
3569  ** the scene graph finishes updating various post processes (ground clamping for instance),
3570  ** or modifying the TBO with a local space camera.
3571  **
3572  ** This function allows the end user to pre-multiply the matrix in the TBO for each shape
3573  ** the character has. It requires diguyScenario::set_use_user_position_matrices() is called
3574  ** so that DI-Guy knows to keep track of TBO shape index data.
3575  */
3576  int set_final_tbo_position_matrix(int include_local_to_global_transform,
3577  float a0, float a1, float a2, float a3,
3578  float b0, float b1, float b2, float b3,
3579  float c0, float c1, float c2, float c3);
3580 
3581  /*l
3582  *b Description:
3583  **
3584  ** Set the desired shader level of detail (LOD) for this character.
3585  ** By default this is -1 and the shader is automatically picked by distance.
3586  **
3587  ** DI-Guy shaders LODs are numbered 1 (most quality) through the number of shaders in the
3588  ** current technique.
3589  **
3590  *b Arguments:
3591  **
3592  *a lod - an integer between 1 and the number of shaders in the current technique
3593  **
3594  *b Returns:
3595  **
3596  ** 0 on success, -1 on failure
3597  */
3598  int set_shader_lod(int lod);
3599 
3601  int get_shader_lod();
3602 
3605  int get_has_bump_maps();
3606 
3607  /*l
3608  *b Description:
3609  **
3610  *b Note: As of DI-Guy 12.5 we strongly recommend using the
3611  ** multi-threaded pipeline for increasing performance.
3612  **
3613  ** Sets the motion level of detail (LOD) for this character.
3614  ** LOD 1 animates all joints of a character. Higher LODs
3615  ** animate fewer joints.
3616  **
3617  ** For LOD 6, *nothing* in the pose is updated. The character's
3618  ** pose will remain whatever it was the last time pose data
3619  ** was changed.
3620  **
3621  *a LOD - Effect
3622  *a 1 - animate all joints
3623  *a 2 - stop animating wrists and ankles
3624  *a 3 - stop animating elbows and knees
3625  *a 4 - stop animating everything but pelvis and position
3626  *a 5 - stop animating everything but position
3627  *a 6 - stop animating everything but position
3628  **
3629  ** Note that characters that are load managed
3630  ** (get_is_load_managed() returns 1) have this parameter managed
3631  ** automatically. The corresponding function for load managed
3632  ** characters is diguyLoadManager::set_zone_motion_lod().
3633  **
3634  *b Arguments:
3635  **
3636  *a motion_lod - an integer between 1 and 6
3637  **
3638  *b Returns:
3639  **
3640  ** 0 on success, -1 on failure
3641  */
3642  int set_motion_lod(int motion_lod);
3643 
3645  int get_motion_lod();
3646 
3648  int get_current_motion_lod();
3649 
3650  /*l
3651  *b Description:
3652  **
3653  *b Note: As of DI-Guy 12.5 we strongly recommend using the
3654  ** multi-threaded pipeline for increasing performance.
3655  **
3656  ** This function sets the minimum CPL (character performance
3657  ** level) of the character.
3658  **
3659  ** A higher CPL will limit the types of operations that the character
3660  ** can perform, but will allow for more optimized update() calls.
3661  **
3662  ** The following CPL limitations are cumulative:
3663  **
3664  *- - CPL 1: all character function calls are available
3665  *- - CPL 2: the character cannot save history
3666  *- - CPL 3: no advanced pose operations that alter the basic pose
3667  *- of the character, including:
3668  *>
3669  *- - gazing
3670  *- - pointing
3671  *- - aiming
3672  *- - gestures
3673  *- - head nodding and shaking
3674  *- - pose overrides
3675  *- - features relying on link matrices
3676  *- - wheel rolling and turning on vehicles
3677  **
3678  ** Since link matrices are not computed, the DI-Guy Graphics API
3679  ** function diguyGraphicsLink::get_transformation_matrix() will
3680  ** not return valid results.
3681  *<
3682  *- - CPL 4: no blends between motions
3683  *- - CPL 5: (not currently implemented)
3684  **
3685  ** Note that characters that are load managed (get_is_load_managed()
3686  ** returns 1) have this parameter managed automatically. The
3687  ** corresponding function for load managed characters is
3688  ** diguyLoadManager::set_zone_minimum_cpl().
3689  **
3690  ** The passed minimum_cpl may not be achievable if the character
3691  ** is already in the process of doing something not allowed by the
3692  ** new CPL. For example, if the character is already gazing, trying
3693  ** to set the minimum CPL to 3 will fail, as CPL 3 would disable
3694  ** gazing. In this case the minimum CPL will be set to the current
3695  ** highest possible CPL based on what the character is already doing.
3696  ** In this example the minimum CPL would be set to 2, as gazing is
3697  ** allowed at that CPL.
3698  **
3699  ** Conversely, if the minimum CPL has been successfully been set to
3700  ** 3 or higher, any gaze calls such as diguyCharacter::gaze_at_point()
3701  ** will fail.
3702  **
3703  *b Arguments:
3704  **
3705  *a cpl - minimum CPL allowed for this character
3706  **
3707  *b Returns:
3708  **
3709  ** 0 on success, -1 on failure
3710  */
3711  int set_minimum_cpl(int minimum_cpl);
3712 
3714  int get_minimum_cpl();
3715 
3716  /*l
3717  *b Description:
3718  **
3719  ** This function returns that maximum possible CPL the character
3720  ** can attain based on what it is currently doing. Advanced pose
3721  ** operations like gazing and pose overrides will limit the maximum
3722  ** CPL that can be achieved.
3723  **
3724  ** See diguyCharacter::set_minimum_cpl() for a description of
3725  ** what is possible under the different CPL levels.
3726  **
3727  *b Returns:
3728  **
3729  ** maximum possible current CPL
3730  */
3731  int get_maximum_possible_current_cpl();
3732 
3733  /*l
3734  *b Description:
3735  **
3736  ** This function puts the character into the maximum possible CPL
3737  ** that can be achieved based on what the character is currently
3738  ** doing.
3739  **
3740  ** This current CPL does not prevent the character from starting
3741  ** operations that will potentially lower the CPL. e.g., if the
3742  ** character starts gazing, the CPL will potentially go down.
3743  ** Use set_minimum_cpl() to prevent that character from starting
3744  ** such operations.
3745  **
3746  ** See diguyCharacter::set_minimum_cpl() for a description of
3747  ** what is possible under the different CPL levels.
3748  **
3749  *b Returns:
3750  **
3751  ** 0 on success, -1 on failure
3752  */
3753  int maximize_current_cpl();
3754 
3755  /*l
3756  *b Description:
3757  **
3758  ** This function sets a flag that determines whether the character
3759  ** should raise and lower its CPL automatically. If automatic
3760  ** CPL switching is enabled then any time a potential CPL-changing
3761  ** operation is performed, the character will check the maximum
3762  ** possible current CPL (as per a call to maximize_current_cpl())
3763  ** and set its current CPL to the maximum possible.
3764  **
3765  *b Arguments:
3766  **
3767  *a enabled - pass 1 to enable automatic CPL switching, 0 to
3768  *a disable it
3769  **
3770  *b Returns:
3771  **
3772  ** 0 on success, -1 on failure
3773  */
3774  int set_automatic_cpl_switching_enabled(int enabled);
3775 
3777  int get_automatic_cpl_switching_enabled();
3778 
3779  /*l
3780  *b Description:
3781  **
3782  ** This function sets the current CPL of the character. Trying
3783  ** to set the CPL lower than the minimum (as set by
3784  ** set_minimum_cpl()) of higher than the maximum (as returned by
3785  ** get_maximum_possible_current_cpl()) will fail.
3786  **
3787  ** Note that characters that have automatic CPL switching enabled
3788  ** (get_automatic_cpl_switching_enabled() returns 1) will override
3789  ** this value.
3790  **
3791  ** See diguyCharacter::set_minimum_cpl() for a description of
3792  ** what is possible under the different CPL levels.
3793  **
3794  *b Arguments:
3795  **
3796  *a cpl - new current CPL
3797  **
3798  *b Returns:
3799  **
3800  ** 0 on success, -1 on failure
3801  */
3802  int set_current_cpl(int current_cpl);
3803 
3805  int get_current_cpl();
3806 
3807  /*l
3808  *b Description:
3809  **
3810  ** This function sets the position update rate of the character. If
3811  ** the character's position is not updated on a particular update
3812  ** tick, its position will not change for that tick. This can
3813  ** result is a modest performance increase.
3814  **
3815  ** The default value for new characters is 100.
3816  **
3817  ** This value may be overridden by the minimum full update period, as
3818  ** set by set_minimum_full_update_period().
3819  **
3820  ** Note that if the character's pose is updated, (see
3821  ** diguyCharacter::set_pose_update_rate()) its position will be
3822  ** updated as well.
3823  **
3824  ** Note that characters that are load managed
3825  ** (get_is_load_managed() returns 1) have this parameter managed
3826  ** automatically. The corresponding function for load managed
3827  ** characters is diguyLoadManager::set_zone_position_update_rate().
3828  **
3829  *b Arguments:
3830  **
3831  *a update_rate - percentage of scenario ticks for which
3832  *a position should update; can be between
3833  *a 1 and 100
3834  **
3835  ** Passing 100 means position will update every tick.
3836  ** Passing 50 means position will update every other tick.
3837  **
3838  *b Returns:
3839  **
3840  ** 0 on success, -1 on failure
3841  */
3842  int set_position_update_rate(int update_rate);
3843 
3845  int get_position_update_rate();
3846 
3847  /*l
3848  *b Description:
3849  **
3850  ** This function is very similar to set_position_update_rate(), but
3851  ** sets the percentage of ticks for which the character's pose is
3852  ** updated.
3853  **
3854  ** The default value for new characters is 100.
3855  **
3856  ** This value may be overridden by the minimum full update period,
3857  ** as set by set_minimum_full_update_period().
3858  **
3859  ** Note that if the character's pose is updated, its position will
3860  ** be updated as well.
3861  **
3862  ** Note that characters that are load managed (get_is_load_managed()
3863  ** returns 1) have this parameter managed automatically. The
3864  ** corresponding function for load managed characters is
3865  ** diguyLoadManager::set_zone_pose_update_rate().
3866  **
3867  *b Arguments:
3868  **
3869  *a update_rate - percentage of scenario ticks for which
3870  *a pose should update; can be between
3871  *a 1 and 100
3872  **
3873  ** Passing 100 means pose will update every tick.
3874  ** Passing 50 means pose will update every other tick.
3875  **
3876  *b Returns:
3877  **
3878  ** 0 on success, -1 on failure
3879  */
3880  int set_pose_update_rate(int update_rate);
3881 
3883  int get_pose_update_rate();
3884 
3885  /*l
3886  *b Description:
3887  **
3888  ** This function sets the minimum period for position or pose
3889  ** updates. If the passed amount of time passes with no position or
3890  ** pose update (see set_position_update_rate() and
3891  ** set_pose_update_rate()), the character's position and potentially
3892  ** pose will be updated.
3893  **
3894  ** Note that characters that are load managed (get_is_load_managed()
3895  ** returns 1) have this parameter managed automatically. The
3896  ** corresponding function for load managed characters is
3897  ** diguyLoadManager::set_minimum_full_update_period().
3898  **
3899  ** The default for new characters is 1.0 seconds.
3900  **
3901  *b Arguments:
3902  **
3903  *a min_period - in seconds
3904  **
3905  *b Returns:
3906  **
3907  ** 0 on success, -1 on failure
3908  */
3909  int set_minimum_full_update_period(float min_period);
3910 
3912  float get_minimum_full_update_period();
3913 
3914  /*l
3915  *b Description:
3916  **
3917  ** This function disables position accumulation due to played
3918  ** actions. The character will stay in whatever position has most
3919  ** recently been set by set_position(), regardless of action.
3920  ** Because of this the character will, for example, walk in place.
3921  ** It is up to the user application to correctly set and update the
3922  ** character's position.
3923  **
3924  ** This function can be used when a host application provides
3925  ** absolute control over character positions.
3926  **
3927  ** Disabling position accumulation will result in a modest
3928  ** performance increase.
3929  **
3930  *b Arguments:
3931  **
3932  *a disabled_flag - pass 1 to disable position accumulation, 0
3933  *a to enable it
3934  **
3935  *b Returns:
3936  **
3937  ** 0 on success, -1 on failure
3938  */
3939  int set_position_accumulation_disabled(int disabled_flag);
3940 
3942  int get_position_accumulation_disabled();
3943 
3944  /*l
3945  *b Description:
3946  **
3947  ** This function disables all blends between motions of the
3948  ** character. This will speed up performance at the expense of
3949  ** visual quality of the motions. If the character is far from the
3950  ** current camera position, however, the lack of blends may be
3951  ** visually acceptable.
3952  **
3953  ** Note that characters that are load managed (get_is_load_managed()
3954  ** returns 1) have this parameter managed automatically.
3955  **
3956  *b Arguments:
3957  **
3958  *a disabled_flag - pass 1 to disable all blends, 0
3959  *a to enable them
3960  **
3961  *b Returns:
3962  **
3963  ** 0 on success, -1 on failure
3964  */
3965  int set_all_blends_disabled(int disabled_flag);
3966 
3968  int get_all_blends_disabled();
3969 
3970 
3971  /*l
3972  *b Description:
3973  **
3974  *b Note: This function is not recommended. There is minimal perf gain.
3975  ** This function disables all shape callbacks. Shape callbacks are
3976  ** used internally for updating some advanced visual effects.
3977  **
3978  ** Shape callbacks currently control:
3979  **
3980  *- - expressive faces
3981  *- - particle systems
3982  **
3983  ** Disabling shape callbacks will make these visual effects work
3984  ** incorrectly but will result in a performance increase for
3985  ** characters that do not use them.
3986  **
3987  ** Note that characters that are load managed (get_is_load_managed()
3988  ** returns 1) have this parameter managed automatically.
3989  **
3990  *b Arguments:
3991  **
3992  *a disabled_flag - pass 1 to disable shape callbacks, 0
3993  *a to enable them
3994  **
3995  *b Returns:
3996  **
3997  ** 0 on success, -1 on failure
3998  */
3999  int set_shape_callbacks_disabled(int disabled_flag);
4000 
4002  int get_shape_callbacks_disabled();
4003 
4004  /*l
4005  *b Description:
4006  **
4007  *b Note: This function is not recommend. There is minimal perf gain.
4008  ** This function disables all calls to the virtual diguyGraphicsShape::update()
4009  ** function.
4010  **
4011  ** Note that characters that are load managed (get_is_load_managed()
4012  ** returns 1) have this parameter managed automatically.
4013  **
4014  *b Arguments:
4015  **
4016  *a disabled_flag - pass 1 to disable update calls, 0
4017  *a to enable them
4018  **
4019  *b Returns:
4020  **
4021  ** 0 on success, -1 on failure
4022  */
4023  int set_graphics_api_shape_update_disabled(int disabled_flag);
4024 
4026  int get_graphics_api_shape_update_disabled();
4027 
4028  /*l
4029  *b Description:
4030  **
4031  ** This function is a stripped-down version of the normal update()
4032  ** function. This function is for high performance applications that
4033  ** are willing to sacrifice advanced character functionality in
4034  ** exchange for faster performance.
4035  **
4036  ** Characters using optimized_update() must not do any of the
4037  ** following:
4038  **
4039  *- - change character types (e.g., set_character_type())
4040  *- - play sounds (e.g., play_sound())
4041  *- - use history (e.g., set_history_type())
4042  *- - use paths (e.g., push_path())
4043  *- - weapon firing (e.g., fire_weapon())
4044  *- - advanced pose operations (as per CPL 3)
4045  *- - be a DI-Guy Network Module character
4046  *- - need to use character callbacks
4047  *- - use advanced visual effects, such as expressive faces and particle systems
4048  **
4049  ** Like update(), the scenario must not call the character's update()
4050  ** function (return value of get_t_controlled_by_scenario_t() is 0)
4051  ** for this function to work properly.
4052  **
4053  ** In some cases the regular update() call can be used for a time in
4054  ** place of optimized_update() if one of the above operations is
4055  ** desired.
4056  **
4057  *b Arguments:
4058  **
4059  *a t - new time for the character
4060  **
4061  *b Returns:
4062  **
4063  ** 0 on success, -1 on failure
4064  */
4065  int optimized_update(float t);
4066 
4067  /*l
4068  *b Description:
4069  **
4070  ** This function sets whether many of the performance tuning
4071  ** functions above are automatically managed by a diguyLoadManager
4072  ** object, which can be obtained by calling
4073  ** diguyApp::create_load_manager().
4074  **
4075  ** Note that this function will have no effect if the load manager has
4076  ** not been enabled.
4077  **
4078  ** The default for new characters is to be load managed if the load
4079  ** manager has been enabled.
4080  **
4081  *b Arguments:
4082  **
4083  *a is_load_managed - pass 1 to have character automatically
4084  *a load managed, 0 for manual management
4085  **
4086  *b Returns:
4087  **
4088  ** 0 on success, -1 on failure
4089  */
4090  int set_is_load_managed(int is_load_managed);
4091 
4093  int get_is_load_managed();
4094 
4097  void get_load_manager_current_update_rates(float & zone, int & pose_update_rate,
4098  int & position_update_rate, int & alt_update_rate);
4099 
4100 /*****************************************************************************/
4106  /*l
4107  *b Description:
4108  **
4109  ** This is an enumeration of the different callbacks that can be
4110  ** registered with add_callback() and add_callback_script().
4111  **
4112  ** Callbacks return a value of type diguyCallbackReturn, which will
4113  ** be DIGUY_CALLBACK_STOP or DIGUY_CALLBACK_CONTINUE. If the
4114  ** callback returns DIGUY_CALLBACK_STOP, in some cases the default
4115  ** handler of the function will not be called; the callback is
4116  ** asserting that it has done everything necessary for the function
4117  ** call. If the callback returns DIGUY_CALLBACK_CONTINUE, the default
4118  ** handler for the function will be called after the callback.
4119  **
4120  *b Usable From:
4121  **
4122  *- - C++
4123  *- - Script
4124  **
4125  *************************************************************************
4126  *4 Callback Enums:
4127  **
4128  *i CALLBACK_ID_CREATE
4129  **
4130  ** This callback will be called when a new character is created,
4131  ** *after* the character is fully initialized.
4132  **
4133  ** Note that this callback can only be added by calling
4134  ** diguyScenario::add_default_character_callback(); adding it with
4135  ** diguyCharacter::add_callback() will have no effect, as by that
4136  ** time the character has already been created.
4137  **
4138  *i CALLBACK_ID_DESTROY
4139  **
4140  ** This callback will be called when a character is
4141  ** destroyed.
4142  **
4143  *i CALLBACK_ID_PRE_CREATE
4144  **
4145  ** Like CALLBACK_ID_CREATE, this callback will be called when a
4146  ** new character is created; however, it is called *before* the
4147  ** character is fully initialized.
4148  **
4149  *b NOTE: Care must be taken when using this callback!
4150  ** As mentioned above, the character is not fully initialized,
4151  ** meaning that most member functions of the diguyCharacter object
4152  ** should not be called. Those member functions that are safe
4153  ** to call will be mentioned in the documentation for the function;
4154  ** e.g., set_graphics_api_node_ptr().
4155  **
4156  ** Note that this callback can only be added by calling
4157  ** diguyScenario::add_default_character_callback(); adding it
4158  ** with diguyCharacter::add_callback() will have no effect, as
4159  ** by that time the character has already been created.
4160  **
4161  *i CALLBACK_ID_CURRENT_APPEARANCE_CHANGED
4162  **
4163  ** This callback will be called when a character's current
4164  ** appearance is changed.
4165  **
4166  *i CALLBACK_ID_CURRENT_HEAD_APPEARANCE_CHANGED
4167  **
4168  ** This callback will be called when a character's current head
4169  ** appearance is changed.
4170  **
4171  *i CALLBACK_ID_PRE_UPDATE
4172  **
4173  ** This callback will be called before the character is updated as
4174  ** a result of the diguyScenario::update() function.
4175  **
4176  *i CALLBACK_ID_POST_UPDATE
4177  **
4178  ** This callback will be called after the character is updated as a
4179  ** result of the diguyScenario::update() function.
4180  **
4181  *i CALLBACK_ID_DONE_SPEAKING
4182  **
4183  ** This callback will be called when the character has finished
4184  ** speaking the contents of a speak() function call.
4185  **
4186  *i CALLBACK_ID_GAZE_STATUS
4187  **
4188  ** This callback will be called after the character's gaze has
4189  ** experienced a status change.
4190  **
4191  *i CALLBACK_ID_LPOINT_STATUS
4192  **
4193  ** This callback will be called after the character's lpoint (left
4194  ** arm pointing) has experienced a status change.
4195  **
4196  *i CALLBACK_ID_SHOW
4197  **
4198  ** This callback will be called when the character is being shown
4199  ** for any reason.
4200  **
4201  *i CALLBACK_ID_HIDE
4202  **
4203  ** This callback will be called when the character is being hidden
4204  ** for any reason.
4205  **
4206  *i CALLBACK_ID_PRE_DIE
4207  **
4208  ** This callback will be called when the character has been told to
4209  ** die, before a die action has been selected and initiated.
4210  **
4211  ** If the returned diguyCallbackReturn value is
4212  ** DIGUY_CALLBACK_STOP, the character will not die.
4213  **
4214  *i CALLBACK_ID_POST_DIE
4215  **
4216  ** This callback will be called when the character has been told to
4217  ** die, after a die action has been selected and initiated.
4218  **
4219  *i CALLBACK_ID_PRE_FIRE_WEAPON
4220  **
4221  ** This callback will be called when the character has been told to
4222  ** fire its weapon, before a final decision has been made to fire.
4223  **
4224  ** If the returned diguyCallbackReturn value is
4225  ** DIGUY_CALLBACK_STOP, the character will not fire.
4226  **
4227  *i CALLBACK_ID_IMPACT
4228  **
4229  ** This callback will be called when the character has been hit.
4230  ** diguyCharacter::get_last_impact_record() contains a pointer to
4231  ** the impact information. If a character has this callback the
4232  ** standard behavior (killing the character) is skipped and the
4233  ** system assumes the end user has handled the impact.
4234  **
4235  ** Similar behavior results if
4236  ** diguyCrowd::CALLBACK_ID_CROWD_MEMBER_IMPACT is registered.
4237  **
4238  *i CALLBACK_ID_POST_FIRE_WEAPON
4239  **
4240  ** This callback will be called when the character has been told to
4241  ** fire its weapon, after a final decision has been made to fire.
4242  **
4243  *i CALLBACK_ID_CURRENT_ARC_CHANGED
4244  **
4245  ** This callback will be called whenever the character's current
4246  ** motion arc changes, typically after a call to set_desired_action()
4247  ** or force_action(), or when transitioning to the next motion arc.
4248  **
4249  *i CALLBACK_ID_CURRENT_ACTION_CHANGED
4250  **
4251  ** This callback will be called whenever the character's current
4252  ** action changes, typically after a call to set_desired_action()
4253  ** or force_action().
4254  **
4255  *i CALLBACK_ID_DESIRED_ACTION_CHANGED
4256  **
4257  ** This callback will be called whenever the character's desired
4258  ** action changes, typically after a call to set_desired_action().
4259  **
4260  *i CALLBACK_ID_DESIRED_ACTION_REACHED
4261  **
4262  ** This callback will be called when the character reaches its
4263  ** desired action as set by a call to set_desired_action().
4264  **
4265  *i CALLBACK_ID_MANUALLY_INVOKED
4266  **
4267  ** This callback id will be supplied to event handlers invoked by a
4268  ** call to manually_invoke_event_handler().
4269  **
4270  *i CALLBACK_ID_USER_SELECTED
4271  **
4272  ** This callback will be called when the character is selected in DI-Guy Scenario.
4273  **
4274  *i CALLBACK_ID_USER_UNSELECTED
4275  **
4276  ** This callback will be called on a currently selected character when a different
4277  ** character is selected in DI-Guy Scenario.
4278  **
4279  *i CALLBACK_ID_IGUY_INTERACT
4280  **
4281  ** This callback will be called when the character has been clicked
4282  ** on while DI-Guy Scenario is in I-Guy Input Mode. Note that this
4283  ** is called on the character clicked, not the I-Guy character.
4284  **
4285  *i CALLBACK_ID_IGUY_INTERACT_WITH_SUBJECT
4286  **
4287  ** This callback will be called when the character, as the I-Guy
4288  ** character, has clicked another character in I-Guy Input Mode.
4289  ** Note that this is called for the I-Guy character, not the
4290  ** clicked character.
4291  **
4292  *i CALLBACK_ID_GUIDE_POSITION_ACQUIRED
4293  **
4294  ** This callback will be called when the character has reached its
4295  ** desired position as set by set_desired_position(). The
4296  ** diguyCharacterGuide is responsible for moving the character towards
4297  ** this position.
4298  **
4299  *i CALLBACK_ID_GUIDE_POSITION_UNACQUIRED
4300  **
4301  ** This callback will be called if the character moves too far away
4302  ** from its desired position after it has been previously reached.
4303  **
4304  *i CALLBACK_ID_GUIDE_ORIENTATION_ACQUIRED
4305  **
4306  ** This callback will be called when the character has reached its
4307  ** desired orientation as set by set_desired_orientation(). The
4308  ** diguyCharacterGuide is responsible for moving the character towards
4309  ** this orientation.
4310  **
4311  *i CALLBACK_ID_GUIDE_ORIENTATION_UNACQUIRED
4312  **
4313  ** This callback will be called if the character turns too far away
4314  ** from its desired orientation after it has been previously
4315  ** reached.
4316  **
4317  *i CALLBACK_ID_GUIDE_ALTITUDE_ACQUIRED
4318  **
4319  ** This callback will be called when the character has reached its
4320  ** desired altitude as set by set_desired_orientation() or other functions.
4321  ** The callback is most meaningful for vehicles that need to achieve
4322  ** some sort "cruising altitude" while moving to a destination.
4323  **
4324  *i CALLBACK_ID_GUIDE_ALTITUDE_UNACQUIRED
4325  **
4326  ** This callback will be called if the character turns too far away
4327  ** from its desired orientation after it has been previously
4328  ** reached.
4329  **
4330  *i CALLBACK_ID_GUIDE_TARGET_LOST
4331  **
4332  ** This callback will be called when the character guide has determined
4333  ** that the character can't reach its desired position/orientation. An
4334  ** example would be a missile that has flown past its target
4335  **
4336  *i CALLBACK_ID_CURRENT_TOUT_REACHED
4337  **
4338  ** This callback will be called when scenario time reaches this
4339  ** character's tout time as set by set_current_tout().
4340  **
4341  *i CALLBACK_ID_POST_CREATE_GEOMETRY
4342  **
4343  ** This callback will be called just after the character's geometry
4344  ** has been created.
4345  **
4346  *i CALLBACK_ID_PRE_DESTROY_GEOMETRY
4347  **
4348  ** This callback will be called just before the character's
4349  ** geometry is broken down and destroyed.
4350  **
4351  *i CALLBACK_ID_END_OF_PATH_REACHED
4352  **
4353  ** This callback will be called when a character reaches the end of
4354  ** their current path. Note the path must finish, forcing to other
4355  ** paths will not trigger this callback.
4356  **
4357  **
4358  *************************************************************************
4359  *4 DI-Guy Scenario UI Callback enums:
4360  **
4361  *i CALLBACK_ID_UI_PRE_TRANSLATION
4362  **
4363  ** This callback will be called when the user interface starts
4364  ** moving a character.
4365  **
4366  *i CALLBACK_ID_UI_POST_TRANSLATION
4367  **
4368  ** This callback will be called when the user interface finishes
4369  ** moving a character.
4370  **
4371  *i CALLBACK_ID_UI_MOUSE_DOWN
4372  **
4373  ** This callback will be called when the user interface gets a
4374  ** mouse click in the DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT input
4375  ** mode.
4376  **
4377  *i CALLBACK_ID_UI_MOUSE_UP
4378  **
4379  ** This callback will be called when the user interface gets a
4380  ** mouse release in the DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT
4381  ** input mode.
4382  **
4383  *************************************************************************
4384  *4 DI-Guy AI Agent Callback enums:
4385  **
4386  *i CALLBACK_ID_AGENT_NEW_BEHAVIOR
4387  **
4388  ** This callback will be called when an agent changes its current
4389  ** behavior.
4390  **
4391  *i CALLBACK_ID_AGENT_NEW_FOCUS_CHARACTER
4392  **
4393  ** This callback will be called when an agent changes its current
4394  ** focus character; this happens most frequently when it is focused
4395  ** on a group.
4396  **
4397  *i CALLBACK_ID_AGENT_ATTACK_OUT_OF_TARGETS
4398  **
4399  ** This callback will be called when an agent in attack behavior
4400  ** evaluates the group it's focused on and cannot find an
4401  ** appropriate target. This can happen if all group members are
4402  ** dead.
4403  **
4404  *i CALLBACK_ID_AGENT_ATTACK_NO_VISIBLE_TARGETS
4405  **
4406  ** This callback will be called when an agent in attack behavior
4407  ** can't see any potential members of the group it's focused on.
4408  **
4409  *i CALLBACK_ID_AGENT_PURSUE_TARGET_REACHED
4410  **
4411  ** This callback will be called when an agent in pursue behavior
4412  ** has come within the pursuit distance of its pursuit target.
4413  **
4414  *i CALLBACK_ID_AGENT_PURSUE_TARGET_LOST
4415  **
4416  ** This callback will be called when an agent in pursue behavior
4417  ** is no longer within the pursuit distance of its pursuit target.
4418  **
4419  *i CALLBACK_ID_AGENT_MINGLE_TARGET_REACHED
4420  **
4421  ** This callback will be called when an agent in mingle behavior
4422  ** has reached its mingle target.
4423  **
4424  *i CALLBACK_ID_AGENT_MINGLE_TARGET_LOST
4425  **
4426  ** This callback will be called when an agent in mingle behavior
4427  ** is no longer is range of its mingle target.
4428  **
4429  *i CALLBACK_ID_AGENT_WANDER_TARGET_REACHED
4430  **
4431  ** This callback will be called when an agent in wander behavior
4432  ** has reached its wander target.
4433  **
4434  *i CALLBACK_ID_AGENT_WANDER_TARGET_LOST
4435  **
4436  ** This callback will be called when an agent in wander behavior
4437  ** is no longer is range of its wander target.
4438  **
4439  *i CALLBACK_ID_AGENT_FLEE_AREA_LEFT
4440  **
4441  ** This callback will be called when an agent in flee behavior has
4442  ** successfully moved out range of all fled characters or
4443  ** locations. This will only be called when the agent is
4444  ** transitioning from inside the flee area to outside of it.
4445  **
4446  *i CALLBACK_ID_AGENT_FLEE_AREA_ENTERED
4447  **
4448  ** This callback will be called when an agent in flee behavior has
4449  ** moved inside of the range of any fled characters or locations.
4450  ** This will only be called when the agent is transitioning from
4451  ** outside the flee area to inside of it.
4452  **
4453  *i CALLBACK_ID_AGENT_TRAVEL_WAYPOINT_REACHED
4454  **
4455  ** This callback will be called when an agent in travel behavior
4456  ** has reached in intermediate waypoint and is about to move
4457  ** on to the next.
4458  **
4459  *i CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED
4460  **
4461  ** This callback will be called when an agent in travel behavior
4462  ** has reached the end of its travel path when moving forward
4463  ** along the path.
4464  **
4465  *i CALLBACK_ID_AGENT_TRAVEL_BACKWARD_DEST_REACHED
4466  **
4467  ** This callback will be called when an agent in travel behavior
4468  ** has reached the beginning of its travel path when moving
4469  ** backward along the path.
4470  **
4471  *i CALLBACK_ID_AGENT_TRAVEL_NEAR_FORWARD_DEST
4472  **
4473  ** This callback will be called when an agent gets within a specified
4474  ** distance of the end of the travel path
4475  **
4476  *i CALLBACK_ID_AGENT_CROWD_MEMBER_KILLED
4477  **
4478  ** This callback will be called when fellow member of the crowd is
4479  ** killed.
4480  **
4481  *- - This is the character version of
4482  *- diguyCrowd::CALLBACK_ID_CROWD_MEMBER_KILLED
4483  *- - The crowd's callback character is the crowd member that was
4484  *- killed.
4485  *- - The crowd's callback impact contains the impact information.
4486  **
4487  *i CALLBACK_ID_AGENT_CROWD_MEMBER_IMPACT
4488  **
4489  ** This callback will be called when a fellow member of the crowd
4490  ** is hit by a detonation. This callback does not replace
4491  ** diguyCharacter::CALLBACK_ID_IMPACT, which still needs to be
4492  ** handled to implement damage models.
4493  **
4494  *- - The crowd's callback character is the crowd member that was
4495  *- hit.
4496  *- - The crowd's callback impact contains the impact information.
4497  **
4498  *i CALLBACK_ID_AGENT_NEARBY_SCENE_OBJECT_IMPACT
4499  **
4500  ** This callback will be called when a detonation occurs within the
4501  ** awareness radius (as set by set_awareness_radius()) of the
4502  ** crowd's current bounds.
4503  **
4504  *- - This is the character version of
4505  *- diguyCrowd::CALLBACK_ID_NEARBY_SCENE_OBJECT_IMPACT
4506  *- - The crowd's callback character is the character that caused
4507  *- the detonation.
4508  *- - The crowd's callback impact contains the impact information.
4509  **
4510  *i CALLBACK_ID_AGENT_NEARBY_WEAPON_FIRED
4511  **
4512  ** This callback will be called when a weapon is fired within the
4513  ** awareness radius (as set by set_awareness_radius()) of the
4514  ** crowd's current bounds.
4515  **
4516  *- - The crowd's callback character is the character that fired the
4517  *- weapon.
4518  **
4519  *i CALLBACK_ID_AGENT_VEHICLE_COLLISION
4520  **
4521  ** This callback will be called on a vehicle agent when it hits a
4522  ** member of a companion crowd.
4523  **
4524  *i CALLBACK_ID_AGENT_VEHICLE_NEAR_COLLISION
4525  **
4526  ** This callback will be called on a vehicle agent when it
4527  ** approaches another vehicle.
4528  **
4529  *i CALLBACK_ID_AGENT_NON_ZERO_REPULSION
4530  **
4531  ** This callback will be called when an agent character's repulsion
4532  ** forces become non-zero.
4533  **
4534  *i CALLBACK_ID_AGENT_ZERO_REPULSION
4535  **
4536  ** This callback will be called when an agent character's repulsion
4537  ** forces become zero.
4538  **
4539  *i CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED
4540  **
4541  ** This callback will be called when a character who's requested a
4542  ** path plan via the background path planner
4543  ** (agent_move_to_point_bg) gets a path result. Call
4544  ** diguyCharacter::get_path_planning_result() to get the status of
4545  ** the result.
4546  **
4547  *i CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED
4548  **
4549  ** This callback will be called when the current state the agent's
4550  ** mind, if it has one, has changed. Call
4551  ** diguyCharacter::get_mind_current_state_name() to get the new
4552  ** state name.
4553  */
4554  enum {
4555  CALLBACK_ID_CREATE = 1,
4556  CALLBACK_ID_DESTROY,
4557  CALLBACK_ID_PRE_CREATE,
4558  CALLBACK_ID_CURRENT_APPEARANCE_CHANGED,
4559  CALLBACK_ID_CURRENT_HEAD_APPEARANCE_CHANGED,
4560  CALLBACK_ID_CURRENT_HAND_ITEM_APPEARANCE_CHANGED,
4561  CALLBACK_ID_CURRENT_EQUIPMENT_APPEARANCE_CHANGED,
4562  CALLBACK_ID_SHAPE_VARIATIONS_CHANGED,
4563  CALLBACK_ID_SHAPE_VISIBILITY_CHANGED,
4564  CALLBACK_ID_PRE_UPDATE,
4565  CALLBACK_ID_POST_UPDATE,
4566  CALLBACK_ID_DONE_SPEAKING,
4567  CALLBACK_ID_GAZE_STATUS,
4568  CALLBACK_ID_LPOINT_STATUS,
4569  CALLBACK_ID_SHOW,
4570  CALLBACK_ID_HIDE,
4571  CALLBACK_ID_PRE_DIE,
4572  CALLBACK_ID_POST_DIE,
4573  CALLBACK_ID_PRE_FIRE_WEAPON,
4574  CALLBACK_ID_POST_FIRE_WEAPON,
4575  CALLBACK_ID_IMPACT,
4576  CALLBACK_ID_FIRE_WEAPON_SUCCESS,
4577  CALLBACK_ID_CURRENT_ARC_CHANGED,
4578  CALLBACK_ID_CURRENT_ACTION_CHANGED,
4579  CALLBACK_ID_DESIRED_ACTION_CHANGED,
4580  CALLBACK_ID_DESIRED_ACTION_REACHED,
4581  CALLBACK_ID_MANUALLY_INVOKED,
4582  CALLBACK_ID_USER_SELECTED,
4583  CALLBACK_ID_USER_UNSELECTED,
4584  CALLBACK_ID_IGUY_INTERACT,
4585  CALLBACK_ID_IGUY_INTERACT_WITH_SUBJECT,
4586  CALLBACK_ID_GUIDE_POSITION_ACQUIRED,
4587  CALLBACK_ID_GUIDE_POSITION_UNACQUIRED,
4588  CALLBACK_ID_GUIDE_ORIENTATION_ACQUIRED,
4589  CALLBACK_ID_GUIDE_ORIENTATION_UNACQUIRED,
4590  CALLBACK_ID_GUIDE_ALTITUDE_ACQUIRED,
4591  CALLBACK_ID_GUIDE_ALTITUDE_UNACQUIRED,
4592  CALLBACK_ID_GUIDE_TARGET_LOST,
4593  CALLBACK_ID_CURRENT_TOUT_REACHED,
4594  CALLBACK_ID_POST_CREATE_GEOMETRY,
4595  CALLBACK_ID_PRE_DESTROY_GEOMETRY,
4596  CALLBACK_ID_END_OF_PATH_REACHED,
4597  CALLBACK_ID_CHARACTER_CLICKED,
4598 
4599  // DI-Guy Scenario UI callbacks:
4600  CALLBACK_ID_UI_PRE_TRANSLATION,
4601  CALLBACK_ID_UI_POST_TRANSLATION,
4602  CALLBACK_ID_UI_MOUSE_DOWN,
4603  CALLBACK_ID_UI_MOUSE_UP,
4604  CALLBACK_ID_UI_RIGHT_MOUSE_DOWN,
4605  CALLBACK_ID_UI_RIGHT_MOUSE_UP,
4606  CALLBACK_ID_UI_LEFT_CLICK,
4607  CALLBACK_ID_UI_RIGHT_CLICK,
4608  CALLBACK_ID_UI_DOUBLE_CLICK,
4609  CALLBACK_ID_UI_MIDDLE_CLICK,
4610  CALLBACK_ID_UI_SCROLL_UP,
4611  CALLBACK_ID_UI_SCROLL_DOWN,
4612  //CALLBACK_ID_UI_DRAG,
4613 
4614  // DI-Guy AI agent callbacks:
4615  CALLBACK_ID_AGENT_NEW_BEHAVIOR,
4616  CALLBACK_ID_AGENT_NEW_PATH_SHAPE,
4617  CALLBACK_ID_AGENT_NEW_FOCUS_CHARACTER,
4618  CALLBACK_ID_AGENT_ATTACK_OUT_OF_TARGETS,
4619  CALLBACK_ID_AGENT_ATTACK_NO_VISIBLE_TARGETS,
4620  CALLBACK_ID_AGENT_PURSUE_TARGET_REACHED,
4621  CALLBACK_ID_AGENT_PURSUE_TARGET_LOST,
4622  CALLBACK_ID_AGENT_MINGLE_TARGET_REACHED,
4623  CALLBACK_ID_AGENT_MINGLE_TARGET_LOST,
4624  CALLBACK_ID_AGENT_WANDER_TARGET_REACHED,
4625  CALLBACK_ID_AGENT_WANDER_TARGET_LOST,
4626  CALLBACK_ID_AGENT_FLEE_AREA_LEFT,
4627  CALLBACK_ID_AGENT_FLEE_AREA_ENTERED,
4628  CALLBACK_ID_AGENT_TRAVEL_WAYPOINT_REACHED,
4629  CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED,
4630  CALLBACK_ID_AGENT_TRAVEL_BACKWARD_DEST_REACHED,
4631  CALLBACK_ID_AGENT_TRAVEL_NEAR_FORWARD_DEST,
4632  CALLBACK_ID_AGENT_CROWD_MEMBER_KILLED,
4633  CALLBACK_ID_AGENT_CROWD_MEMBER_IMPACT,
4634  CALLBACK_ID_AGENT_NEARBY_SCENE_OBJECT_IMPACT,
4635  CALLBACK_ID_AGENT_NEARBY_WEAPON_FIRED,
4636  CALLBACK_ID_AGENT_VEHICLE_COLLISION,
4637  CALLBACK_ID_AGENT_VEHICLE_NEAR_COLLISION,
4638  CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED,
4639  CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED,
4640  CALLBACK_ID_AGENT_NON_ZERO_REPULSION,
4641  CALLBACK_ID_AGENT_ZERO_REPULSION
4642  };
4643 
4644 #ifdef CPLUSPLUS_ONLY
4645 /*****************************************************************************/
4651  /*l
4652  *b Description:
4653  **
4654  ** This function adds a user callback. Callbacks can be removed
4655  ** with remove_callback() or remove_callback_with_user_data().
4656  **
4657  *b Arguments:
4658  **
4659  *a callback - pointer to function with prototype
4660  *a diguyCharacterCallback (typedefed above)
4661  *a callback_id - integer id of when this callback is to be called
4662  *a callback_params - not currently used; pass NULL
4663  *a callback_user_data - pointer for user's own use; DI-Guy will
4664  *a do nothing to the contents of this pointer
4665  *a beyond passing it back when the callback is
4666  *a invoked
4667  **
4668  *b Returns:
4669  **
4670  ** 0 on success, -1 on failure
4671  */
4672  int add_callback(int callback_id,
4673  diguyCharacterCallback* callback,
4674  void* callback_params = 0,
4675  void* callback_user_data = 0);
4676 
4677  /*l
4678  *b Description:
4679  **
4680  ** This function removes a user callback. All callbacks matching
4681  ** the specified callback_id and callback function will be removed.
4682  **
4683  *b Arguments:
4684  **
4685  *a callback_id - integer id of when this callback is to be called
4686  *a callback - pointer to function with prototype
4687  *a diguyCharacterCallback (typedefed above)
4688  **
4689  *b Returns:
4690  **
4691  ** 0 on success, -1 on failure
4692  */
4693  int remove_callback(int callback_id,
4694  diguyCharacterCallback* callback);
4695 
4696  /*l
4697  *b Description:
4698  **
4699  ** This function removes a user callback. All callbacks matching
4700  ** the specified callback_id and callback_user_data pointer will
4701  ** be removed.
4702  **
4703  *b Arguments:
4704  **
4705  *a callback_id - integer id of when this callback is to be
4706  *a called
4707  *a callback_user_data - pointer for user's own use
4708  **
4709  *b Returns:
4710  **
4711  ** 0 on success, -1 on failure
4712  */
4713  int remove_callback_with_user_data(int callback_id,
4714  void* callback_user_data);
4715 
4716 #endif
4717 /*****************************************************************************/
4723  /*l
4724  *b Description:
4725  **
4726  ** This function adds a user callback script. Callback scripts can
4727  ** be removed with remove_callback_script().
4728  **
4729  *b Arguments:
4730  **
4731  *a callback_id - integer id of the callback
4732  *a callback_script - script text of callback to be added
4733  *a callback_script_type - the type of script contained in
4734  *a callback_script
4735  **
4736  ** If NULL is passed for callback_script_type, a default script type
4737  ** will be derived based on the default script interpreter of the
4738  ** scenario.
4739  **
4740  *i lua specific:
4741  **
4742  ** When the script is called, the object for which it is being called
4743  ** will be in the callback_object global.
4744  **
4745  ** To pass NULL when calling from a lua script, use nil.
4746  **
4747  *b Returns:
4748  **
4749  ** 0 on success, -1 on failure
4750  **
4751  *b Lua Example:
4752  **
4753  *e -------------------------------------------------------------------
4754  *e local pre_fire_weapon_callback = [[
4755  *e
4756  *e local ch_name = callback_object:get_name();
4757  *e bdi_log_print(BDI_LOG_WARN, "Calling pre_fire_weapon_callback for character ".. ch_name .. ".\n");
4758  *e
4759  *e ]]
4760  *e -------------------------------------------------------------------
4761  *e
4762  *e character:add_callback_script(diguyCharacter_CALLBACK_ID_PRE_FIRE_WEAPON,
4763  *e pre_fire_weapon_callback,
4764  *e "lua");
4765  */
4766  int add_callback_script(int callback_id,
4767  const char* callback_script,
4768  const char* callback_script_type = NULL);
4769 
4770  /*l
4771  *b Description:
4772  **
4773  ** This function removes a user callback script previously added with
4774  ** add_callback_script().
4775  **
4776  *b Arguments:
4777  **
4778  *a callback_id - integer id of the callback
4779  *a callback_script - script text of callback previously added
4780  *a callback_script_type - the type of script contained in
4781  *a callback_script
4782  **
4783  ** If NULL is passed for callback_script, all callback
4784  ** scripts whose ids match callback_id and whose types match
4785  ** callback_script_type will be removed.
4786  **
4787  ** If NULL is passed for callback_script_type, a default script type
4788  ** will be derived based on the default script interpreter of the
4789  ** scenario.
4790  **
4791  *i lua specific:
4792  **
4793  ** To pass NULL when calling from a lua script, use nil.
4794  **
4795  *b Returns:
4796  **
4797  ** 0 on success, -1 on failure
4798  **
4799  *b lua Example:
4800  **
4801  *e #
4802  *e # Remove all callback scripts with id
4803  *e # diguyCharacter_CALLBACK_ID_PRE_FIRE_WEAPON
4804  *e #
4805  *e character:remove_callback_script(diguyCharacter_CALLBACK_ID_PRE_FIRE_WEAPON,
4806  *e nil,
4807  *e "lua");
4808  */
4809  int remove_callback_script(int callback_id,
4810  const char* callback_script,
4811  const char* callback_script_type = NULL);
4812 
4813 
4814 /*****************************************************************************/
4824  /*l
4825  *b Description:
4826  **
4827  ** This function maps the event handler with the given name
4828  ** to a callback id. This mapping will be saved in the .dss
4829  ** file and restored when the .dss file is loaded.
4830  **
4831  ** Mappings can also be made via the DI-Guy Scenario UI.
4832  **
4833  ** The event handler is one of the following:
4834  **
4835  *- - a character callback function registered by
4836  *- diguyScenario::register_character_event_handler() or
4837  *- diguyScenario::register_character_event_handler_from_library()
4838  *- - a script registered by
4839  *- diguyScenario::register_character_event_handler_script()
4840  *- - a Script, Decision, or Library Function in the scenario
4841  *- whose "Event Type" is "Character"
4842  **
4843  *b Arguments:
4844  **
4845  *a callback_id - integer id of callback
4846  *a handler_name - name of the event handler to map
4847  **
4848  *b Returns:
4849  **
4850  ** 0 on success, -1 on failure
4851  */
4852  int map_event_handler_to_callback_id(int callback_id,
4853  const char* handler_name);
4854 
4855  /*l
4856  *b Description:
4857  **
4858  ** This function unmaps the event handler with the given name
4859  ** from a callback id.
4860  **
4861  *b Arguments:
4862  **
4863  *a callback_id - integer id of callback
4864  *a handler_name - name of the event handler to unmap
4865  *a unmap_all_matches - pass 0 to unmap only the first match,
4866  *a pass 1 to unmap all matches
4867  **
4868  *b Returns:
4869  **
4870  ** 0 on success, -1 on failure
4871  */
4872  int unmap_event_handler_from_callback_id(int callback_id,
4873  const char* handler_name,
4874  int unmap_all_matches = 0);
4875 
4876  /*l
4877  *b Description:
4878  **
4879  ** This function manually invokes the named character event
4880  ** handler. The callback_id that will be passed to the event
4881  ** handler will be CALLBACK_ID_MANUALLY_INVOKED.
4882  **
4883  ** See diguyCharacter::map_event_handler_to_callback_id() for
4884  ** a description of what comprises a character event handler.
4885  **
4886  ** Note that care should be taken not to end up in an
4887  ** infinite loop of event calls. In general an event handler
4888  ** should not end up directly or indirectly invoking itself.
4889  **
4890  *b Arguments:
4891  **
4892  *a handler_name - name of the event handler to invoke
4893  **
4894  *b Returns:
4895  **
4896  ** DIGUY_CALLBACK_CONTINUE or DIGUY_CALLBACK_STOP
4897  **
4898  *b Available as Decision Bead/Event
4899  */
4900  diguyCallbackReturn manually_invoke_event_handler(const char* handler_name);
4901 
4902 
4903 /*****************************************************************************/
4909  /*l
4910  *b Description:
4911  **
4912  ** This function creates a new path. The created path has no
4913  ** waypoints and no actions. Waypoints can be added using
4914  ** diguyCharacterPath::create_waypoint() or
4915  ** diguyCharacterPath::add_waypoint(). Action beads should be added
4916  ** using diguyCharacterPath::create_action_bead().
4917  **
4918  ** To create a simple path that has a few waypoints and actions, use
4919  ** create_simple_path().
4920  **
4921  ** The waypoints for the path should be created using the function
4922  ** diguyScenario::create_waypoint(). They should be deleted using the
4923  ** function diguyScenario::destroy_waypoint(). Copies of the
4924  ** waypoints are made during the function call, so it is safe to
4925  ** destroy them immediately after this function call returns, or use
4926  ** the waypoints again for another path.
4927  **
4928  ** The returned diguyCharacterPath pointer should be destroyed using
4929  ** destroy_path().
4930  **
4931  *b Arguments:
4932  **
4933  ** The path makes internal copies of all arguments.
4934  **
4935  *a name - name of the new path
4936  **
4937  *b Returns:
4938  **
4939  ** pointer to type diguyCharacterPath
4940  **
4941  */
4942  diguyCharacterPath* create_path(const char* name);
4943 
4944  /*l
4945  *b Description:
4946  **
4947  ** This function creates a new simple path. The path is simple
4948  ** because it has only two waypoints and three specified actions.
4949  **
4950  ** The waypoints for the path should be created using the function
4951  ** diguyScenario::create_waypoint(). They should be deleted using the
4952  ** function diguyScenario::destroy_waypoint(). Copies of the
4953  ** waypoints are made during the function call, so it is safe to
4954  ** destroy them immediately after this function call returns, or use
4955  ** the waypoints again for another path.
4956  **
4957  ** The returned diguyCharacterPath pointer should be destroyed using
4958  ** destroy_path().
4959  **
4960  *b Arguments:
4961  **
4962  ** The path makes internal copies of all arguments.
4963  **
4964  *a name - name of the new path
4965  *a waypoint0 - beginning waypoint
4966  *a waypoint1 - ending waypoint
4967  *a transition_from_action_name - name of the action the character
4968  *a should be transitioning from at the
4969  *a beginning of the path; can be NULL
4970  *a fill_action_name - name of the action that should fill
4971  *a the majority of the path; can be
4972  *a NULL, but see below
4973  *a transition_to_action_name - name of the action the character
4974  *a should transition into at the end of
4975  *a the path
4976  **
4977  ** If transition_from_action_name is NULL, an initial action bead that
4978  ** transitions to the fill action will not be created.
4979  **
4980  ** If fill_action_name is NULL, no action beads will be created for
4981  ** the path, even if transition_from_action_name and/or
4982  ** transition_to_action_name are non-NULL.
4983  **
4984  ** If transition_to_action_name is NULL, a final action bead that
4985  ** transitions from the fill action will not be created.
4986  **
4987  *b Returns:
4988  **
4989  ** pointer to type diguyCharacterPath
4990  */
4991  diguyCharacterPath* create_simple_path(const char* name,
4992  diguyWaypoint* waypoint0,
4993  diguyWaypoint* waypoint1,
4994  const char* transition_from_action_name,
4995  const char* fill_action_name,
4996  const char* transition_to_action_name);
4997 
4998  /*l
4999  *b Description:
5000  **
5001  ** This function is similar to create_simple_path(), but creates its
5002  ** waypoints based on waypoints from the passed path shape.
5003  **
5004  *b Arguments:
5005  **
5006  ** The path makes internal copies of all arguments.
5007  **
5008  *a name - name of the new path
5009  *a source_path_shape - path shape whose waypoints are used
5010  *a to define shape of new path
5011  *a transition_from_action_name - same as for create_simple_path()
5012  *a fill_action_name - same as for create_simple_path()
5013  *a transition_to_action_name - same as for create_simple_path()
5014  **
5015  *b Returns:
5016  **
5017  ** pointer to type diguyCharacterPath
5018  */
5019  diguyCharacterPath* create_path_from_path_shape(const char* name,
5020  diguyPathShape* source_path_shape,
5021  const char* transition_from_action_name,
5022  const char* fill_action_name,
5023  const char* transition_to_action_name);
5024 
5025  /*l
5026  *b Description:
5027  **
5028  ** This function creates a temporary path and immediately forces it as
5029  ** the character's current path. Once it has been traversed it will
5030  ** be automatically deleted.
5031  **
5032  ** The beginning waypoint of this path is at the character's current
5033  ** position; the ending waypoint is at the specified action bead on
5034  ** the specified path (or the first action bead of the specified path
5035  ** if no action bead is specified). The character will use the
5036  ** specified action to move from the beginning waypoint to the ending
5037  ** waypoint.
5038  **
5039  ** This function is useful for getting a free position mode character
5040  ** back onto a path.
5041  **
5042  ** This function will have no effect on a dead character (see
5043  ** die_now() and get_dead()).
5044  **
5045  *b Mode Effects:
5046  **
5047  *- - This function will put the character into path position mode.
5048  *- - This function will put the character into path action mode.
5049  **
5050  *b Arguments:
5051  **
5052  *a destination_path_name - the path the character is trying to
5053  *a reach
5054  *a via_action_name - the action used over the majority of
5055  *a the bridge path
5056  *a destination_path_action_bead_name - the target action bead on the
5057  *a destination path; pass NULL
5058  *a to start at the beginning
5059  *a of the path
5060  **
5061  *b Returns:
5062  **
5063  ** 0 on success, -1 on failure
5064  */
5065  int create_and_force_bridge_path(const char* destination_path_name,
5066  const char* destination_path_action_bead_name,
5067  const char* via_action_name);
5068 
5069  /*l
5070  *b Description:
5071  **
5072  ** This function creates a temporary path and immediately forces it as
5073  ** the character's current path. Once the path has been traversed it
5074  ** will be automatically deleted. The character then begins the local
5075  ** path specified by path_to_push.
5076  **
5077  ** The beginning waypoint of this path is at the character's current
5078  ** position; the ending waypoint is at the specified x, y, z. A
5079  ** path_offset is available to shorten the distance to the end point
5080  ** along the vector to the destination. The character will use the
5081  ** specified action to move from the beginning waypoint to the ending
5082  ** waypoint.
5083  **
5084  ** An optional follow-on path can be specified that the character will
5085  ** move onto once the end position is reached. This must be the name
5086  ** of an existing path for the character. A local path copy of the
5087  ** specified path will be created, and will be pushed to occur after
5088  ** this bridge path completes.
5089  **
5090  ** This function is useful for branching from one location to another
5091  ** in the world.
5092  **
5093  ** This function will have no effect on a dead character (see
5094  ** die_now() and get_dead()).
5095  **
5096  *b Mode Effects:
5097  **
5098  *- - This function will put the character into path position mode.
5099  *- - This function will put the character into path action mode.
5100  **
5101  *b Arguments:
5102  **
5103  *a x, y, z - location in world space the bridge path
5104  *a should aim for
5105  *a path_offset - the amount to shorten the bridge path
5106  *a via_action_name - the action used over the majority of the
5107  *a bridge path
5108  *a next_local_path - local path to push when the character
5109  *a arrives at it's destination; pass NULL
5110  *a to not push a local path
5111  *a orientation - amount to rotate the local path
5112  **
5113  *b Returns:
5114  **
5115  ** 0 on success, -1 on failure
5116  */
5117  int create_and_force_bridge_path_to_point(float x, float y, float z,
5118  float path_offset,
5119  const char* via_action_name,
5120  const char* next_local_path = NULL,
5121  float orientation = 0.0f);
5122 
5123  /*l
5124  *b Description:
5125  **
5126  ** This function destroys a path created by create_path(),
5127  ** create_simple_path(), or a path from a loaded scenario.
5128  **
5129  ** The path the character is currently traveling, as returned by
5130  ** get_current_traveled_path(), cannot be destroyed. Attempting to
5131  ** destroy it will result in an error.
5132  **
5133  *b Arguments:
5134  **
5135  *a path - path to be destroyed
5136  **
5137  *b Returns:
5138  **
5139  ** 0 on success, -1 on failure
5140  */
5141  int destroy_path(diguyCharacterPath* path);
5142 
5143  /*l
5144  *b Returns:
5145  **
5146  ** the number of paths belonging to this character
5147  */
5148  int get_num_paths();
5149 
5150  /*l
5151  *b Returns:
5152  **
5153  ** pointer of type diguyCharacterPath; NULL if no
5154  ** path at the specified index
5155  **
5156  *b Arguments:
5157  **
5158  *a index - index of the path; indices start at 0
5159  */
5160  diguyCharacterPath* get_path_at_index(int index);
5161 
5162  /*l
5163  *b Returns:
5164  **
5165  ** the name of the path at the given index; NULL if no
5166  ** path at the specified index
5167  */
5168  const char* get_path_name_at_index(int index);
5169 
5170  /*l
5171  *b Description:
5172  **
5173  ** This function returns the index of the path the character
5174  ** is currently following. If the character is not following
5175  ** a path the returned index will be -1. (i.e., the character
5176  ** must be in path action mode *and* path position mode.)
5177  **
5178  *b Mode Restrictions:
5179  **
5180  *- - This function will only return a 0 or greater index if the
5181  ** character is in path action mode *and* path position mode.
5182  **
5183  *b Returns:
5184  **
5185  ** the index of the current path; -1 if not on a path
5186  */
5187  int get_current_path_index();
5188 
5189  /*l
5190  *b Description:
5191  **
5192  ** This function returns the path the character is currently
5193  ** traveling.
5194  **
5195  *b Mode Restrictions:
5196  **
5197  *- - This function can only be called in path position mode.
5198  **
5199  *b Returns:
5200  **
5201  ** pointer of type diguyCharacterPath; NULL if no path is currently
5202  ** being traveled
5203  */
5204  diguyCharacterPath* get_current_traveled_path();
5205 
5206  /*l
5207  *b Description:
5208  **
5209  ** This function can be used to see if the current traveled has the
5210  ** passed name. This is primarily useful for decisions and other
5211  ** limited logic applications.
5212  **
5213  *b Returns:
5214  **
5215  ** 1 if currently traveled path has the passed name; 0 if the name
5216  ** doesn't match, or no path is currently being traveled
5217  **
5218  *b Available as Decision Bead/Event
5219  */
5220  int get_current_traveled_path_is(const char* path_name);
5221 
5222  /*l
5223  *b Description:
5224  **
5225  ** This function pushes the path with the specified name
5226  ** onto the queue of paths this character will follow.
5227  **
5228  ** This function will have no effect on a dead character (see
5229  ** die_now() and get_dead()).
5230  **
5231  *b Arguments:
5232  **
5233  *a name - name of the path to be pushed
5234  **
5235  *b Returns:
5236  **
5237  ** 0 on success, -1 on failure
5238  **
5239  *b Available as Decision Bead/Event
5240  */
5241  int push_path(const char* path_name);
5242 
5243  /*l
5244  *b Description:
5245  **
5246  ** This function clears the queue of paths the character will follow
5247  ** and then pushes the path with the specified name.
5248  **
5249  ** This function will have no effect on a dead character (see
5250  ** die_now() and get_dead()).
5251  **
5252  *b Arguments:
5253  **
5254  *a name - name of the path to be pushed
5255  *a max_rampdown_interval - max amount of time spent trying to
5256  *a smooth over any motion seams; set
5257  *a to 0.5 for a smooth transition, set
5258  *a to 0 for a potentially rough transition
5259  **
5260  *b Returns:
5261  **
5262  ** 0 on success, -1 on failure
5263  **
5264  *b Available as Decision Bead/Event
5265  */
5266  int force_path(const char* path_name,
5267  float max_rampdown_interval = 0.5f);
5268 
5269  /*l
5270  *b Description:
5271  **
5272  ** Same as force_path(), but only motions at or after the specified
5273  ** action bead are added.
5274  **
5275  ** This function will have no effect on a dead character (see
5276  ** die_now() and get_dead()).
5277  **
5278  *b Available as Decision Bead/Event
5279  */
5280  int force_partial_path(const char* path_name,
5281  const char* beginning_action_bead_name,
5282  float max_rampdown_interval = 0.5f);
5283 
5284  /*l
5285  *b Description:
5286  **
5287  ** Resumes a path that was interrupted with a call such as
5288  ** set_desired_action() or force_action(). Note that the
5289  ** retain_path_shape argument to these functions must have been 1 for
5290  ** the path to be resumable.
5291  **
5292  ** This function will have no effect on a dead character (see
5293  ** die_now() and get_dead()).
5294  **
5295  *b Mode Restrictions:
5296  **
5297  *- - This function can only be called if the character is in
5298  *- free action mode *and* path position mode.
5299  **
5300  *b Mode Effects:
5301  **
5302  *- - This function will put the character into path position mode.
5303  *- - This function will put the character into path action mode.
5304  **
5305  *b Arguments:
5306  **
5307  *a max_rampdown_interval - max amount of time spent trying to
5308  *a smooth over any motion seams; set
5309  *a to 0.5 for a smooth transition, set
5310  *a to 0 for a potentially rough transition
5311  **
5312  *b Returns:
5313  **
5314  ** 0 on success, -1 on failure
5315  **
5316  *b Available as Decision Bead/Event
5317  */
5318  int resume_interrupted_path(float max_rampdown_interval = 0.5f);
5319 
5320  /*l
5321  *b Description:
5322  **
5323  ** This function creates a temporary path that is a copy of path_name
5324  ** but transformed so that the starting point is the same as where
5325  ** the character currently is. It then forces it as the character's
5326  ** current path.
5327  **
5328  *b Arguments:
5329  **
5330  *a path_name - path to copy
5331  *a use_character_orientation - whether the character's orientation be
5332  *a incorporated into the transform of the
5333  *a path
5334  *a rotation - additional amount to rotate the path,
5335  *a in degrees
5336  *a clamp_path - whether the path be ground clamped
5337  **
5338  *b Returns:
5339  **
5340  ** pointer to type diguyCharacterPath
5341  */
5342  diguyCharacterPath* force_local_path(const char* path_name,
5343  int use_character_orientation,
5344  float rotation = 0.0f,
5345  int clamp_path = 1);
5346 
5347  /*l
5348  *b Description:
5349  **
5350  ** This function sets which path the character will start on when the
5351  ** scenario is reset.
5352  **
5353  *b Arguments:
5354  **
5355  *a name - name of the path that will be the initial path
5356  **
5357  *b Returns:
5358  **
5359  ** 0 on success, -1 on failure
5360  */
5361  int set_initial_path(const char* name);
5362 
5363  /*l
5364  *b Description:
5365  **
5366  ** This function returns the name of the path the character will start
5367  ** on when the scenario is reset.
5368  **
5369  ** See set_initial_path().
5370  **
5371  *b Returns:
5372  **
5373  ** name of initial path; NULL if there is none
5374  */
5375  const char* get_initial_path();
5376 
5377  /*l
5378  *b Description:
5379  **
5380  ** This function translates all of the paths of this character.
5381  **
5382  *b Arguments:
5383  **
5384  *a tx, ty, tz - distance in meters to move all waypoints
5385  *a reclamp_waypoints - pass 1 to reclamp waypoints to ground
5386  */
5387  void translate_all_paths(float tx, float ty, float tz,
5388  int reclamp_waypoints = 1);
5389 
5390  /*l
5391  *b Description:
5392  **
5393  ** This function rotates all of the paths of this character.
5394  ** The rotation will occur about the specified point.
5395  **
5396  ** *Note:* It is currently recommended that only rotations
5397  ** about the Z axis be done. (i.e., only rz should be non-zero.)
5398  **
5399  *b Arguments:
5400  **
5401  *a rz, rx, ry - amount of rotation, in degrees
5402  *a rotation_pt_x, rotation_pt_y, rotation_pt_z - point around
5403  *a which rotation should occur
5404  *a reclamp_waypoints - pass 1 to reclamp waypoints to ground
5405  */
5406  int rotate_all_paths_about_point(float rz, float rx, float ry,
5407  float rotation_pt_x, float rotation_pt_y, float rotation_pt_z,
5408  int reclamp_waypoints = 1);
5409 
5410  /*l
5411  *b Description:
5412  **
5413  ** This function is similar to rotate_all_paths_about_point(),
5414  ** but rotates around the character's current waypoint instead
5415  ** of an explicitly specified point.
5416  **
5417  ** *Note:* It is currently recommended that only rotations
5418  ** about the Z axis be done. (i.e., only rz should be non-zero.)
5419  **
5420  *b Arguments:
5421  **
5422  *a rz, rx, ry - amount of rotation, in degrees
5423  *a reclamp_waypoints - pass 1 to reclamp waypoints to ground
5424  */
5425  int rotate_all_paths_about_current_waypoint(float rz, float rx, float ry,
5426  int reclamp_waypoints = 1);
5427 
5428  /*l
5429  *b Description:
5430  **
5431  ** This function causes the character to jump forward along
5432  ** its current path to the specified action bead. Motions
5433  ** and beads that would have otherwise been played or processed
5434  ** will be skipped.
5435  **
5436  *b Arguments:
5437  **
5438  *a bead_name - name of the bead to jump to
5439  *a max_rampdown_interval - max amount of time spent trying to
5440  *a smooth over any motion seams; set
5441  *a to 0.5 for a smooth transition, set
5442  *a to 0 for a potentially rough transition
5443  **
5444  *b Returns:
5445  **
5446  ** 0 on success, -1 on failure
5447  */
5448  int jump_to_action_bead(const char* bead_name,
5449  float max_rampdown_interval = 0.5f);
5450 
5451  /*l
5452  *b Description:
5453  **
5454  ** This function finds and returns a pointer to the specified path.
5455  **
5456  *b Arguments:
5457  **
5458  *a name - name of the path to be found
5459  **
5460  *b Returns:
5461  **
5462  ** Pointer to object of type diguyCharacterPath;
5463  ** NULL if path not found.
5464  */
5465  diguyCharacterPath* find_path(const char* path_name);
5466 
5467  /*l
5468  *b Description:
5469  **
5470  ** This function causes the effects of the given aim bead to be
5471  ** applied to this character, regardless of whether the
5472  ** bead belongs to the character or whether character is within
5473  ** the bead's time interval.
5474  **
5475  *b Arguments:
5476  **
5477  *a how_far - how far into the bead the call should be; should
5478  *a be between 0 (beginning of bead time interval) and
5479  *a 1 (end of bead time interval)
5480  **
5481  *b Returns:
5482  **
5483  ** 0 on success, -1 on failure
5484  */
5485  int apply_aim_bead(diguyCharacterPathAimBead* bead,
5486  float how_far = 0.0f);
5487 
5488  /*l
5489  *b Description:
5490  **
5491  ** This function causes the effects of the given decision bead to be
5492  ** applied to this character, regardless of whether the
5493  ** bead belongs to the character or whether character is within
5494  ** the bead's time interval.
5495  **
5496  *b Arguments:
5497  **
5498  *a how_far - how far into the bead the call should be; should
5499  *a be between 0 (beginning of bead time interval) and
5500  *a 1 (end of bead time interval)
5501  **
5502  *b Returns:
5503  **
5504  ** 0 on success, -1 on failure
5505  */
5506  int apply_decision_bead(diguyCharacterPathDecisionBead* bead,
5507  float how_far = 0.0f);
5508 
5509  /*l
5510  *b Description:
5511  **
5512  ** This function causes the effects of the given gaze bead to be
5513  ** applied to this character, regardless of whether the
5514  ** bead belongs to the character or whether character is within
5515  ** the bead's time interval.
5516  **
5517  *b Arguments:
5518  **
5519  *a how_far - how far into the bead the call should be; should
5520  *a be between 0 (beginning of bead time interval) and
5521  *a 1 (end of bead time interval)
5522  **
5523  *b Returns:
5524  **
5525  ** 0 on success, -1 on failure
5526  */
5527  int apply_gaze_bead(diguyCharacterPathGazeBead* bead,
5528  float how_far = 0.0f);
5529 
5530  /*l
5531  *b Description:
5532  **
5533  ** This function causes the effects of the given script bead to be
5534  ** applied to this character, regardless of whether the
5535  ** bead belongs to the character or whether character is within
5536  ** the bead's time interval.
5537  **
5538  *b Arguments:
5539  **
5540  *a how_far - how far into the bead the call should be; should
5541  *a be between 0 (beginning of bead time interval) and
5542  *a 1 (end of bead time interval)
5543  **
5544  *b Returns:
5545  **
5546  ** 0 on success, -1 on failure
5547  */
5548  int apply_script_bead(diguyCharacterPathScriptBead* bead,
5549  float how_far = 0.0f);
5550 
5551  /*l
5552  *b Description:
5553  **
5554  ** This function sets how far along the current path shape
5555  ** the character will be.
5556  **
5557  *b Mode Restrictions:
5558  **
5559  *- - This function can only be called if the character is in
5560  *- free action mode *and* path position mode. i.e., the
5561  *- character is following a path shape, and is not on a
5562  *- diguyCharacterPath.
5563  **
5564  *b Arguments:
5565  **
5566  *a distance - distance in meters; 0.0 is the beginning of the
5567  *a path shape
5568  **
5569  *b Returns:
5570  **
5571  ** 0 on success, -1 on failure
5572  */
5573  int set_distance_along_path(float distance);
5574 
5575  /*l
5576  *b Returns:
5577  **
5578  ** the distance in meters along the path shape; see
5579  ** set_distance_along_path()
5580  **
5581  *b Mode Restrictions:
5582  **
5583  *- - This function can only be called in path position mode.
5584  */
5585  float get_distance_along_path();
5586 
5587  /*l
5588  *b Description:
5589  **
5590  ** This function takes the character off of its current path
5591  ** or path shape.
5592  **
5593  *b Mode Restrictions:
5594  **
5595  *- - This function can only be called in path position mode.
5596  **
5597  *b Mode Effects:
5598  **
5599  *- - This function will put the character into free position mode.
5600  *- - This function will put the character into free action mode.
5601  **
5602  *b Returns:
5603  **
5604  ** 0 on success, -1 on failure
5605  */
5606  int leave_path();
5607 
5608  /*l
5609  *b Description:
5610  **
5611  ** This function returns the index of the nearest waypoint in a path,
5612  ** the path argument is looked up in both the character's path list
5613  ** and the scenario's paths.
5614  **
5615  *b Returns:
5616  **
5617  ** waypoint index
5618  */
5619  int get_nearest_waypoint_index_in_path(const char* path_name);
5620 
5621  /*l
5622  *b Returns:
5623  **
5624  ** Distance to action bead or first waypoint, 100000000.0 on failure
5625  */
5626  float get_distance_to_path(const char* path_name,
5627  const char* action_bead_name = NULL);
5628 
5629 
5630 /*****************************************************************************/
5638  /*l
5639  *b Description:
5640  **
5641  ** This function gets the position link of the character skeleton.
5642  ** The rest of the skeleton can then be traversed by recursively
5643  ** calling the diguyGraphicsLink::get_num_child_links() and
5644  ** diguyGraphicsLink::get_child_link_at_index() functions.
5645  **
5646  ** Alternatively, the links of the character can be traversed
5647  ** by calling the get_num_links() and get_link_at_index()
5648  ** functions below.
5649  **
5650  *b Returns:
5651  **
5652  ** pointer of type diguyGraphicsLink; NULL if there is no
5653  ** position link
5654  */
5655  diguyGraphicsLink* get_position_link();
5656 
5657  /*l
5658  *b Returns:
5659  **
5660  ** number of links on this character
5661  */
5662  int get_num_links();
5663 
5664  /*l
5665  *b Returns:
5666  **
5667  ** pointer of type diguyGraphicsLink; NULL if no
5668  ** link at the specified index
5669  **
5670  *b Arguments:
5671  **
5672  *a index - index of the link; indices start at 0
5673  */
5674  diguyGraphicsLink* get_link_at_index(int index);
5675 
5676  /*l
5677  *b Description:
5678  **
5679  ** This function returns a pointer to the specified link.
5680  **
5681  *b Arguments:
5682  **
5683  *a name - name of link to be found
5684  **
5685  *b Returns:
5686  **
5687  ** pointer of type diguyGraphicsLink; NULL if not found
5688  */
5689  diguyGraphicsLink* find_link(const char* name);
5690 
5691  /*l
5692  *b Returns:
5693  **
5694  ** the string identifying the link at the given index
5695  **
5696  *b Arguments:
5697  **
5698  *a link_index - index of the link; indices start at 0
5699  */
5700  const char* get_link_name_at_index(int link_index);
5701 
5702  /*l
5703  *b Returns:
5704  **
5705  ** the number of shapes on the specified link
5706  **
5707  *b Arguments:
5708  **
5709  *a link_name - name of the link
5710  */
5711  int get_num_link_shapes(const char* link_name);
5712 
5713  /*l
5714  *b Returns:
5715  **
5716  ** the name of the shape at the specified index on the link
5717  **
5718  *b Arguments:
5719  **
5720  *a link_name - name of the link
5721  *a shape_index - index of the shape on the link; indices start at 0
5722  */
5723  const char* get_link_shape_name_at_index(const char* link_name,
5724  int shape_index);
5725 
5727  void set_link_visibility(const char* link_or_connection_name, int visible, int shape_index = -1);
5728 
5730  int get_num_connection_points();
5731 
5734  const char * get_connection_point_name_at_index(int index);
5735 
5737  bool get_connection_point_info_at_index(int index, diguyGraphicsLink** link, float* matrix_offset, int transpose);
5738 
5741  int get_num_connection_points_with_type(diguyConnectionPointType type);
5742 
5745  const char * get_connection_point_name_with_type(diguyConnectionPointType type, int index);
5746 
5748  bool find_connection_point(const char* name, diguyGraphicsLink** link, float* matrix_offset, int transpose);
5749 
5751  diguyGraphicsShape* find_shape(const char* shape_name);
5752 
5754  int remove_shape(const char* shape_name);
5755 
5756 /*****************************************************************************/
5765  diguyLinkController * get_link_controller(const char * link_name);
5768 
5771  int set_link_translation_override(const char * link_name, float x, float y, float z, float ramp_time = .25f);
5772 
5775  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);
5776 
5778  int end_link_translation_override(const char * link_name, float ramp_time = .25f);
5779 
5781  int set_link_rotation_override(const char * link_name, float rz, float rx, float ry, float ramp_time = .25f);
5782  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);
5783 
5785  int end_link_rotation_override(const char * link_name, float ramp_time = .25f);
5786 
5787 
5788 /*****************************************************************************/
5797  int get_num_articulated_parts();
5799 
5801  const char * get_articulated_part_link_name(int index);
5802 
5804  int get_articulated_part_id(int index);
5805 
5807  const char * map_articulated_part_id_to_link(int id);
5808 
5809 
5810 /*****************************************************************************/
5832 #ifdef CPLUSPLUS_ONLY
5833 
5834  /*l
5835  *b Description:
5836  **
5837  ** The following prototype should be used for the altitude
5838  ** function:
5839  **
5840  *e float altitude_func(diguyCharacter* character,
5841  *e float x,
5842  *e float y,
5843  *e float old_z);
5844  **
5845  ** When a character needs new altitude info, DI-Guy calls this
5846  ** function with a pointer to the diguyCharacter in question,
5847  ** the character's current (x, y) coordinates, and its previous
5848  ** altitude in old_z.
5849  **
5850  ** The altitude function should then compute and return the new
5851  ** altitude based on this information. This can be done in a
5852  ** number of ways; a typical approach is to do an intersection
5853  ** test with the visual scene. Some users might want to implement
5854  ** fairly complex behavior, such as attempting to make all four
5855  ** wheels of a vehicle touch the terrain, or causing a character
5856  ** to drift slowly towards the ground.
5857  **
5858  ** A default altitude function that should be set for all
5859  ** characters can be set by calling
5860  ** diguyScenario::set_default_character_altitude_function().
5861  **
5862  ** This function is normally called for all characters if the flags
5863  ** for enabling it in free movement or path-following mode are
5864  ** set (see below). Some character systems, such as certain kinds
5865  ** of vehicle control code, will also use the scenario altitude
5866  ** function.
5867  **
5868  *b Callable From:
5869  **
5870  *- - C++
5871  */
5872  int set_altitude_function(diguyAltitudeFunction* altitude_function);
5873 
5874  /*l
5875  *b Returns:
5876  **
5877  ** current altitude function; see set_altitude_function()
5878  **
5879  *b Callable From:
5880  **
5881  *- - C++
5882  */
5883  diguyAltitudeFunction* get_altitude_function();
5884 
5885 #endif
5886 
5887  /*l
5888  *b Description:
5889  **
5890  ** This function sets whether the character's altitude function is
5891  ** enabled in free position mode. Altitude functions are set by the
5892  ** functions set_altitude_function() or
5893  ** diguyScenario::set_default_character_altitude_function().
5894  **
5895  *b Arguments:
5896  **
5897  *a enabled - pass 1 to enable, 0 to disable
5898  **
5899  *b Mode Effects:
5900  **
5901  *- - This function will not change the position mode.
5902  **
5903  *b Mode Restrictions:
5904  **
5905  *- - This function will only affect characters in free position mode.
5906  **
5907  *b Returns:
5908  **
5909  ** 0 on success, -1 on failure
5910  */
5911  int set_altitude_function_enabled_in_free_position_mode(int enabled);
5912 
5913  /*l
5914  *b Returns:
5915  **
5916  ** whether the character's altitude function is enabled in free
5917  ** position mode; see
5918  ** set_altitude_function_enabled_in_free_position_mode()
5919  */
5920  int get_altitude_function_enabled_in_free_position_mode();
5921 
5922  /*l
5923  *b Description:
5924  **
5925  ** This function sets whether the character's altitude function is
5926  ** enabled in path position mode. Altitude functions are set by
5927  ** the functions set_altitude_function() or
5928  ** diguyScenario::set_default_character_altitude_function().
5929  **
5930  *b Arguments:
5931  **
5932  *a enabled - pass 1 to enable, 0 to disable
5933  **
5934  *b Mode Effects:
5935  **
5936  *- - This function will not change the position mode.
5937  **
5938  *b Mode Restrictions:
5939  **
5940  *- - This function will only affect characters in path position mode.
5941  **
5942  *b Returns:
5943  **
5944  ** 0 on success, -1 on failure
5945  */
5946  int set_altitude_function_enabled_in_path_position_mode(int value);
5947 
5948  /*l
5949  *b Returns:
5950  **
5951  ** whether the character's altitude function is enabled in path
5952  ** position mode;
5953  ** see set_altitude_function_enabled_in_path_position_mode()
5954  */
5955  int get_altitude_function_enabled_in_path_position_mode();
5956 
5957  /*l
5958  *b Description
5959  **
5960  ** This function sets the altitude update rate of the character.
5961  **
5962  ** The default value for new characters is 100.
5963  **
5964  ** Note that characters that are load managed (get_is_load_managed()
5965  ** returns 1) have this parameter managed automatically. The
5966  ** corresponding function for load managed characters is
5967  ** diguyLoadManager::set_zone_altitude_update_rate().
5968  **
5969  *b Arguments:
5970  **
5971  *a update_rate - percentage of scenario ticks for which altitude
5972  *a should update; can be between 1 and 100
5973  **
5974  ** Passing 100 means altitude will update every tick.
5975  ** Passing 50 means altitude will update every other tick.
5976  **
5977  *b Returns:
5978  **
5979  ** 0 on success, -1 on failure
5980  */
5981  int set_altitude_update_rate(int update_rate);
5982 
5984  int get_altitude_update_rate();
5985 
5986  /*l
5987  *b Description
5988  **
5989  ** This function sets the altitude interpolation rate of the
5990  ** character. This function only has an effect if the character's
5991  ** altitude function is enabled.
5992  **
5993  ** When the altitude function determines that the character's Z
5994  ** position should be updated to bring it closer to the ground, the
5995  ** altitude interpolation rate determines how quickly the Z height
5996  ** is adjusted.
5997  **
5998  ** The default value is 10.
5999  **
6000  *b Arguments:
6001  **
6002  *a interpolation_rate - how much of the error will be made up
6003  *a each second
6004  **
6005  ** An interpolation_rate of 100 means that all error will be made
6006  ** up each frame.
6007  */
6008  void set_altitude_interpolation_rate(float interpolation_rate);
6009 
6011  float get_altitude_interpolation_rate();
6012 
6013 /*****************************************************************************/
6125  /*l
6126  *b Description:
6127  **
6128  ** Returns the number of variables in this character's pose array.
6129  ** See get_pose_in_radians() for an example of use.
6130  **
6131  *b Returns:
6132  **
6133  ** size of this character's pose array
6134  */
6135  int get_pose_array_size();
6136 
6137 #ifdef CPLUSPLUS_ONLY
6138 
6139  /*l
6140  *b Description:
6141  **
6142  ** Fills an array of floats with the character's current joint angles.
6143  ** Angles are expressed in radians. The size of the float array must
6144  ** be at least as large as that returned by get_pose_array_size().
6145  **
6146  *b Arguments:
6147  **
6148  *a pose_array - an array of floats
6149  **
6150  *b Returns:
6151  **
6152  ** 0 on success, -1 on failure
6153  **
6154  *b Callable From:
6155  **
6156  *- - C++
6157  **
6158  *b C++ Example:
6159  **
6160  *e diguyCharacter* ch = scenario->get_character_at_index(0);
6161  *e float* pose_array;
6162  *e
6163  *e // allocate a float array of the proper size
6164  *e int n = ch->get_pose_array_size();
6165  *e pose_array = new float[n];
6166  *e
6167  *e // get the pose array
6168  *e ch->get_pose_in_radians(pose_array);
6169  */
6170  int get_pose_in_radians(float* pose_array);
6171 
6173  int get_pose_in_quaternions(float* pose_array);
6174 
6175 #endif
6176 
6177  /*l
6178  *b Description:
6179  **
6180  ** Creates and returns a pose override object. The newly created
6181  ** pose override object is added to the character's previously
6182  ** created override objects, if any.
6183  **
6184  ** How the pose override interacts with other effects that affect
6185  ** the pose of the character depends on the override stage. See
6186  ** the section "Pose Override Stages" for a discussion of pose
6187  ** override stages.
6188  **
6189  *b Arguments:
6190  **
6191  *a override_stage - the stage in the DI-Guy motion engine at
6192  *a which the override should be applied
6193  **
6194  *b Returns:
6195  **
6196  ** object of type diguyCharacterPoseOverride
6197  */
6198  diguyCharacterPoseOverride* create_pose_override(int override_stage = 3);
6199 
6200  /*l
6201  *b Description:
6202  **
6203  ** Destroys a pose override object, ending its influence on the
6204  ** character.
6205  **
6206  *b Arguments:
6207  **
6208  *a po - pose override object to be destroyed
6209  **
6210  *b Returns:
6211  **
6212  ** 0 on success, -1 on failure
6213  */
6214  int destroy_pose_override(diguyCharacterPoseOverride* po);
6215 
6216  /*l
6217  *b Returns:
6218  **
6219  ** the number of pose overrides belonging to this character
6220  */
6221  int get_num_pose_overrides();
6222 
6223  /*l
6224  *b Returns:
6225  **
6226  ** pointer of type diguyCharacterPoseOverride; NULL if no
6227  ** pose override at the specified index
6228  **
6229  *b Arguments:
6230  **
6231  *a index - index of the pose override; indices start at 0
6232  */
6233  diguyCharacterPoseOverride* get_pose_override_at_index(int index);
6234 
6235  /*l
6236  *b Description:
6237  **
6238  ** Creates and returns a pose override object that completely
6239  ** overrides all other character pose operations, including motions,
6240  ** aiming, gazing, gestures, other pose overrides, etc. The values
6241  ** set in the complete pose override object will be the values used
6242  ** to animate the character.
6243  **
6244  ** Having only one thing that affects a character's pose allows for
6245  ** much faster updating of the character.
6246  **
6247  ** There can only be one complete pose override object per character.
6248  **
6249  ** To remove the complete pose override, call
6250  ** destroy_complete_pose_override().
6251  **
6252  *b Returns:
6253  **
6254  ** object of type diguyCharacterPoseOverride
6255  */
6256  diguyCharacterPoseOverride* create_complete_pose_override();
6257 
6258  /*l
6259  *b Description:
6260  **
6261  ** Removes and destroys the complete pose override created by
6262  ** create_complete_pose_override().
6263  */
6264  void destroy_complete_pose_override();
6265 
6266 
6267 /*****************************************************************************/
6273  /*l
6274  *b Description:
6275  **
6276  ** This function sets the current azimuth, elevation, and
6277  ** distance of the character's gaze. A fixed point in 3D space
6278  ** is then found using the two angles and the given distance
6279  ** from the DI-Guy coordinate system origin. Angles are
6280  ** given with respect to the DI-Guy coordinate system.
6281  **
6282  ** See set_position() for a description of the coordinate
6283  ** system.
6284  **
6285  ** Gazing will continue until end_gaze() is called.
6286  **
6287  ** This function will have no effect on a dead character (see
6288  ** die_now() and get_dead()).
6289  **
6290  *b Arguments:
6291  **
6292  *a azimuth - rotation in degrees about up (vertical) axis;
6293  *a positive rotates to character's left
6294  *a elevation - rotation in degrees about forward (horizontal) axis;
6295  *a positive rotates down
6296  *a distance - deprecated as of 13.2
6297  *a is_new_gaze - set to 1 if this is a new gaze;
6298  *a set to 0 if this is continuing an already started
6299  *a gaze
6300  **
6301  *b Returns:
6302  **
6303  ** 0 on success, -1 on failure
6304  */
6305  int gaze_at_angle(float azimuth,
6306  float elevation,
6307  float distance,
6308  int is_new_gaze = 1);
6309 
6310  /*l
6311  *b Description:
6312  **
6313  ** This function is identical to gaze_at_angle() except that it uses
6314  ** body local coordinates for the character. The angles
6315  ** are given with respect to the idealized position of the
6316  ** character. Use get_position() to learn the idealized position.
6317  ** The distance is between the idealized position of the character
6318  ** and the fixation point.
6319  **
6320  ** This function will have no effect on a dead character (see
6321  ** die_now() and get_dead()).
6322  ** distance argument - deprecated as of 13.2
6323  */
6324  int gaze_at_angle_local(float azimuth,
6325  float elevation,
6326  float distance = 10000.0f,
6327  int is_new_gaze = 1);
6328 
6329  /*l
6330  *b Description:
6331  **
6332  ** This function sets the current fixation point of the character's
6333  ** gaze. Point coordinates are given in meters in the DI-Guy
6334  ** global coordinate system. The function uses default gaze behavior
6335  ** settings. Gazing will continue until end_gaze() is called.
6336  **
6337  ** This function will have no effect on a dead character (see
6338  ** die_now() and get_dead()).
6339  **
6340  *b Arguments:
6341  **
6342  *a tx, ty, tz - position in meters from the DI-Guy global
6343  *a origin
6344  *a is_new_gaze - set to 1 if this is a new gaze;
6345  *a set to 0 if this is continuing an already started
6346  *a gaze
6347  **
6348  *b Returns:
6349  **
6350  ** 0 on success, -1 on failure
6351  */
6352  int gaze_at_point(float tx,
6353  float ty,
6354  float tz,
6355  int is_new_gaze = 1);
6356 
6357  /*l
6358  *b Description:
6359  **
6360  ** This function is identical to gaze_at_point() except that it uses
6361  ** body local coordinates for the character. Use get_position()
6362  ** to learn the idealized position of the character if necessary.
6363  **
6364  ** This function will have no effect on a dead character (see
6365  ** die_now() and get_dead()).
6366  */
6367  int gaze_at_point_local(float tx,
6368  float ty,
6369  float tz,
6370  int is_new_gaze = 1);
6371 
6372  /*l
6373  *b Description:
6374  **
6375  ** This function effectively does a gaze_at_point() each tick.
6376  ** The point to be gazed at is updated each tick to be the position
6377  ** of the specified link on the specified character.
6378  **
6379  ** This function will have no effect on a dead character (see
6380  ** die_now() and get_dead()).
6381  **
6382  *b Arguments:
6383  **
6384  *a target_character_name - name of the character to be
6385  *a gazed at
6386  *a target_character_link_name - link on the character that should
6387  *a be gazed at; pass NULL to gaze at
6388  *a the position link of the character
6389  *a offset_tx, offset_ty, offset_tz - offset onto the link, in meters
6390  **
6391  *b Returns:
6392  **
6393  ** 0 on success, -1 on failure
6394  **
6395  *b Available as Decision Bead/Event
6396  **
6397  *b C++ Example:
6398  **
6399  *e // gaze at the head of character "soldier-1".
6400  *e ch->gaze_at_character("soldier-1",
6401  *e "cervical",
6402  *e 0.0,
6403  *e 0.0,
6404  *e 0.0);
6405  */
6406  int gaze_at_character(const char* target_character_name,
6407  const char* target_character_link_name = NULL,
6408  float offset_tx = 0.0f,
6409  float offset_ty = 0.0f,
6410  float offset_tz = 0.0f);
6411 
6412  /*l
6413  *b Returns:
6414  **
6415  ** 1 if the character is actively gazing, 0 if not
6416  */
6417  int get_gaze_is_active();
6418 
6419  /*l
6420  *b Returns:
6421  **
6422  ** the current gaze point relative to the DI-Guy
6423  ** global coordinate system
6424  */
6425  int get_gaze_point(float* x, float* y, float* z);
6426 
6427  /*l
6428  *b Description:
6429  **
6430  ** A gaze is acquired if the final link in the gaze link chain
6431  ** has fully oriented toward the gaze target, even if other
6432  ** links in the gaze chain are still moving.
6433  **
6434  ** If the gaze is acquired, but any links in the gaze chain
6435  ** are still moving, the gaze is considered acquired but not
6436  ** steady (see get_gaze_is_steady().) If all links have reached
6437  ** a relatively steady state, the gaze is considered acquired
6438  ** and steady.
6439  **
6440  ** If either the acquired or steady status of a gaze has changed
6441  ** (e.g., was acquired but now is not, or was steady but now
6442  ** a link is moving), the diguyCharacter callback with callback_id
6443  ** CALLBACK_ID_GAZE_STATUS will be called.
6444  **
6445  *b Returns:
6446  **
6447  *- - 1 if the final link in the gaze can and has become oriented
6448  *- toward the gaze target
6449  *- - 0 if not
6450  *- - -1 on error
6451  */
6452  int get_gaze_is_acquired();
6453 
6454  /*l
6455  *b Description:
6456  **
6457  ** A gaze is steady if it is acquired, and if all links involved
6458  ** in the gaze have reached a steady state.
6459  **
6460  ** For example, since the eyes move faster than the neck, which
6461  ** moves faster than the back, it's possible for the gaze to
6462  ** be acquired (see get_gaze_is_acquired()) by the eyes as the
6463  ** neck and back are still moving. As the neck and back move into
6464  ** a more natural position, the eyes will not need to be turned
6465  ** as far to keep the gaze acquired.
6466  **
6467  ** If either the acquired or steady status of a gaze has changed
6468  ** (e.g., was acquired but now is not, or was steady but now
6469  ** a link is moving), the diguyCharacter callback with callback_id
6470  ** CALLBACK_ID_GAZE_STATUS will be called.
6471  **
6472  *b Returns:
6473  **
6474  *- - 1 if all links participating in the gaze have reached a
6475  *- relatively steady state
6476  *- - 0 if not
6477  *- - -1 on error
6478  */
6479  int get_gaze_is_steady();
6480 
6481  /*l
6482  *b Description:
6483  **
6484  ** This function removes the fixation target of an ongoing gaze,
6485  ** allowing the character to return to a non-gaze posture and
6486  ** behavior. This effectively frees the character's posture to
6487  ** other influences.
6488  */
6489  int end_gaze();
6490 
6491  /*l
6492  *b Description:
6493  **
6494  ** This function is similar to gaze_at_angle(), but sets the target
6495  ** of left pointing rather than gaze.
6496  **
6497  ** This function will have no effect on a dead character (see
6498  ** die_now() and get_dead()).
6499  **
6500  *b Arguments:
6501  **
6502  *a azimuth - rotation in degrees about up (vertical) axis;
6503  *a positive rotates to character's left
6504  *a elevation - rotation in degrees about forward (horizontal) axis;
6505  *a positive rotates down
6506  *a distance - distance in meters from the position of the character
6507  *a to the lpoint target; positive values only
6508  *a is_new_lpoint - set to 1 if this is a new lpoint;
6509  *a set to 0 if this is continuing an already started
6510  *a lpoint
6511  *a base_gesture_name - the underlying gesture that should be used for
6512  *a motion of the arm; this is a placeholder
6513  *a argument for future functionality and should
6514  *a be set to NULL
6515  */
6516  int lpoint_at_angle(float azimuth,
6517  float elevation,
6518  float distance,
6519  int is_new_lpoint = 1,
6520  const char* base_gesture_name = 0);
6521 
6522  /*l
6523  *b Description:
6524  **
6525  ** This function is identical to gaze_at_local() except that it uses
6526  ** body local coordinates for the character. Use get_position()
6527  ** to learn the idealized position of the character if necessary.
6528  **
6529  ** This function will have no effect on a dead character (see
6530  ** die_now() and get_dead()).
6531  */
6532  int lpoint_at_angle_local(float azimuth,
6533  float elevation,
6534  float distance = 10000.0f,
6535  int is_new_lpoint = 1,
6536  const char* base_gesture_name = 0);
6537 
6538  /*l
6539  *b Description:
6540  **
6541  ** This function sets the current fixation point for the character's
6542  ** left pointing. Point coordinates are given in meters in the
6543  ** DI-Guy global coordinate system.
6544  **
6545  ** See set_position() for a description of the coordinate
6546  ** system.
6547  **
6548  ** Pointing will continue until end_lpoint() is called.
6549  **
6550  ** This function will have no effect on a dead character (see
6551  ** die_now() and get_dead()).
6552  **
6553  *b Arguments:
6554  **
6555  *a tx, ty, tz - position in meters from the DI-Guy global
6556  *a origin of the lpoint target
6557  *a is_new_gaze - set to 1 if this is a new lpoint;
6558  *a set to 0 if this is continuing an already started
6559  *a lpoint
6560  *a base_gesture_name - the underlying gesture that should be used for
6561  *a motion of the arm; this is a placeholder
6562  *a argument for future functionality and should
6563  *a be set to NULL
6564  **
6565  *b Returns:
6566  **
6567  ** 0 on success, -1 on failure
6568  */
6569  int lpoint_at_point(float tx,
6570  float ty,
6571  float tz,
6572  int is_new_lpoint = 1,
6573  const char* base_gesture_name = 0);
6574 
6575  /*l
6576  *b Description:
6577  **
6578  ** This function is identical to lpoint_at_local() except that it uses
6579  ** body local coordinates for the character. Use get_position()
6580  ** to learn the idealized position of the character if necessary.
6581  **
6582  ** This function will have no effect on a dead character (see
6583  ** die_now() and get_dead()).
6584  */
6585  int lpoint_at_point_local(float tx,
6586  float ty,
6587  float tz,
6588  int is_new_lpoint = 1,
6589  const char* base_gesture_name = 0);
6590 
6591  /*l
6592  *b Description:
6593  **
6594  ** This function is identical to gaze_at_character(), but sets the
6595  ** target of left pointing rather than gaze.
6596  **
6597  ** This function will have no effect on a dead character (see
6598  ** die_now() and get_dead()).
6599  */
6600  int lpoint_at_character(const char* target_character_name,
6601  const char* target_character_link_name = NULL,
6602  float offset_tx = 0.0f,
6603  float offset_ty = 0.0f,
6604  float offset_tz = 0.0f);
6605 
6606  /*l
6607  *b Returns:
6608  **
6609  ** the current lpoint target point relative to the DI-Guy
6610  ** global coordinate system
6611  */
6612  int get_lpoint_point(float* x, float* y, float* z);
6613 
6614  /*l
6615  *b Returns:
6616  **
6617  ** the current base gesture of the lpoint
6618  */
6619  const char* get_lpoint_base_gesture_name();
6620 
6621  /*l
6622  *b Returns:
6623  **
6624  ** 1 if the character is actively lpointing, 0 if not
6625  */
6626  int get_lpoint_is_active();
6627 
6628  /*l
6629  *b Returns:
6630  **
6631  ** 1 if the final link in the lpoint can and has become oriented
6632  ** toward the lpoint target;
6633  ** 0 if not;
6634  ** -1 on error
6635  */
6636  int get_lpoint_is_acquired();
6637 
6638  /*l
6639  *b Returns:
6640  **
6641  ** 1 if all links participating in the lpoint have reached a
6642  ** relatively steady state;
6643  ** 0 if not;
6644  ** -1 on error
6645  */
6646  int get_lpoint_is_steady();
6647 
6648  /*l
6649  *b Description:
6650  **
6651  ** This function removes the fixation target of an ongoing lpoint,
6652  ** allowing the character to return to a non-point posture and
6653  ** behavior. This effectively frees the character's posture to
6654  ** other influences.
6655  */
6656  int end_lpoint();
6657 
6658  /*l
6659  *b Description:
6660  **
6661  ** This function sets all gaze control parameters back to their
6662  ** default settings. This undoes modifications to gaze control
6663  ** parameters made by the following calls:
6664  **
6665  *- - set_gaze_param_desired_locate_time()
6666  *- - set_gaze_link_uses_desired_locate_time()
6667  *- - set_gaze_link_azimuth_limits()
6668  *- - set_gaze_link_elevation_limits()
6669  *- - set_gaze_link_azimuth_tolerance()
6670  *- - set_gaze_link_elevation_tolerance()
6671  *- - set_gaze_link_max_angular_vel()
6672  *- - set_gaze_link_scale_factor()
6673  **
6674  *b Returns:
6675  **
6676  ** 0 on success, -1 on failure
6677  */
6678  int set_gaze_params_to_defaults();
6679 
6680  /*l
6681  *b Description:
6682  **
6683  ** This function sets the desired amount of time in seconds it
6684  ** will take for the gaze or point target to be acquired.
6685  **
6686  ** Having a desired locate time effectively limits how fast links
6687  ** in the gaze chain can turn; they will turn as fast as it
6688  ** takes for them to arrive at their proper values, or as fast
6689  ** as their maximum angular velocity, whichever is longer.
6690  **
6691  ** The use of desired locate time can be turned on and off on a
6692  ** link by link bases using the function
6693  ** set_gaze_link_uses_desired_locate_time().
6694  **
6695  ** This value is only a guideline and may be overridden on a link
6696  ** by link basis during the actual gaze, as links try not to
6697  ** exceed their maximum angular velocities.
6698  **
6699  ** The default locate time is 1.0 seconds.
6700  **
6701  *b Arguments:
6702  **
6703  *a t - lower value results in faster turning rate
6704  **
6705  *b Returns:
6706  **
6707  ** 0 on success, -1 on failure
6708  */
6709  int set_gaze_param_desired_locate_time(float t);
6710 
6711  /*l
6712  *b Returns:
6713  **
6714  ** the most recent setting of set_gaze_param_desired_locate_time()
6715  */
6716  float get_gaze_param_desired_locate_time();
6717 
6718  /*l
6719  *b Description:
6720  **
6721  ** This function sets whether the specified link will pay attention
6722  ** to the desired locate time (as set by
6723  ** set_gaze_param_desired_locate_time()), or whether the link turns
6724  ** as fast as its maximum angular velocity allows (as set by
6725  ** set_gaze_link_max_angular_vel()).
6726  **
6727  ** Note that if this value is set to 1, the link still pays attention
6728  ** to its maximum angular velocity as an upper limit on how fast
6729  ** it can turn.
6730  **
6731  ** Valid link names and defaults:
6732  **
6733  *a orientation - 1
6734  *a back - 1
6735  *a cervical - 1
6736  *a eye_l - 0
6737  *a shoulder_l - 1
6738  *a elbow_l - 1
6739  **
6740  *b Arguments:
6741  **
6742  *a link_name - name of the link
6743  *a uses_desired_locate_time - 1 to use desired locate time, 0
6744  *a to disregard
6745  **
6746  *b Returns:
6747  **
6748  ** 0 on success, -1 on failure
6749  */
6750  int set_gaze_link_uses_desired_locate_time(const char* link_name,
6751  int uses_desired_locate_time);
6752 
6753  /*l
6754  *b Returns:
6755  **
6756  ** the most recent setting of set_gaze_link_uses_desired_locate_time()
6757  */
6758  int get_gaze_link_uses_desired_locate_time(const char* link_name);
6759 
6760  /*l
6761  *b Description:
6762  **
6763  ** This function sets the maximum amount the character can turn
6764  ** the specified link horizontally in pursuit of a gaze or point
6765  ** target.
6766  **
6767  ** Valid link names and defaults:
6768  **
6769  *a back - -45 to 45
6770  *a cervical - -80 to 80
6771  *a eye_l - -50 to 50
6772  *a shoulder_l - -30 to 135
6773  *a elbow_l - -30 to 10
6774  **
6775  *b Arguments:
6776  **
6777  *a link_name - name of the link
6778  *a min - value <= 0; in degrees
6779  *a max - value >= 0; in degrees
6780  **
6781  *b Returns:
6782  **
6783  ** 0 on success, -1 on failure
6784  */
6785  int set_gaze_link_azimuth_limits(const char* link_name, float min, float max);
6786 
6787  /*l
6788  *b Returns:
6789  **
6790  ** the most recent setting of set_gaze_link_azimuth_max()
6791  */
6792  int get_gaze_link_azimuth_limits(const char* link_name,
6793  float* min,
6794  float* max);
6795 
6796  /*l
6797  *b Description:
6798  **
6799  ** This function sets the maximum amount the character can turn
6800  ** the specified link vertically in pursuit of a gaze or point
6801  ** target.
6802  **
6803  ** Valid link names and defaults:
6804  **
6805  *a back - -15 to 45
6806  *a cervical - -80 to 45
6807  *a eye_l - -40 to 40
6808  *a shoulder_l - -80 to 80
6809  *a elbow_l - -170 to 0
6810  **
6811  *b Arguments:
6812  **
6813  *a link_name - name of the link
6814  *a min - value <= 0; in degrees
6815  *a max - value >= 0; in degrees
6816  **
6817  *b Returns:
6818  **
6819  ** 0 on success, -1 on failure
6820  */
6821  int set_gaze_link_elevation_limits(const char* link_name,
6822  float min,
6823  float max);
6824 
6826  int get_gaze_link_elevation_limits(const char* link_name,
6827  float* min,
6828  float* max);
6829 
6830  /*l
6831  *b Description:
6832  **
6833  ** This function sets how much difference there can be between
6834  ** the link's current horizontal orientation and the gaze or point
6835  ** target before the link begins to turn to acquire the gaze or
6836  ** point target.
6837  **
6838  ** The combination of this function and
6839  ** set_gaze_link_scale_factor() determine how close the link will
6840  ** turn toward the gaze or point target.
6841  **
6842  ** With a looser (higher) tolerance the link will not turn as much
6843  ** toward the target. With a tighter (lower) tolerance the link
6844  ** will turn more toward the target.
6845  **
6846  ** Valid link names and defaults:
6847  **
6848  *a orientation - -30 to 30
6849  *a back - -45 to 45
6850  *a cervical - -5 to 5
6851  *a eye_l - -1 to 1
6852  *a shoulder_l - -5 to 5
6853  *a elbow_l - -5 to 5
6854  **
6855  *b Arguments:
6856  **
6857  *a link_name - name of the link
6858  *a min - value <= 0; in degrees
6859  *a max - value >= 0; in degrees
6860  **
6861  *b Returns:
6862  **
6863  ** 0 on success, -1 on failure
6864  */
6865  int set_gaze_link_azimuth_tolerance(const char* link_name,
6866  float min,
6867  float max);
6868 
6870  int get_gaze_link_azimuth_tolerance(const char* link_name,
6871  float* min,
6872  float* max);
6873 
6874  /*l
6875  *b Description:
6876  **
6877  ** The elevation equivalent of set_gaze_link_azimuth_tolerance(),
6878  **
6879  ** Valid link names and defaults:
6880  **
6881  *a orientation - -90 to 90
6882  *a back - -45 to 45
6883  *a cervical - -5 to 5
6884  *a eye_l - -1 to 1
6885  *a shoulder_l - -5 to 5
6886  *a elbow_l - -5 to 5
6887  **
6888  *b Arguments:
6889  **
6890  *a link_name - name of the link
6891  *a min - value <= 0; in degrees
6892  *a max - value >= 0; in degrees
6893  **
6894  *b Returns:
6895  **
6896  ** 0 on success, -1 on failure
6897  */
6898  int set_gaze_link_elevation_tolerance(const char* link_name,
6899  float min,
6900  float max);
6901 
6903  int get_gaze_link_elevation_tolerance(const char* link_name,
6904  float* min,
6905  float* max);
6906 
6907  /*l
6908  *b Description:
6909  **
6910  ** This function sets the maximum angular velocity that the
6911  ** back link angles may attain in pursuit of a gaze or point target.
6912  **
6913  ** Valid link names and defaults:
6914  **
6915  *a back - 30 deg/s
6916  *a cervical - 60 deg/s
6917  *a eye_l - 180 deg/s
6918  *a shoulder_l - 180 deg/s
6919  *a elbow_l - 180 deg/s
6920  **
6921  *b Arguments:
6922  **
6923  *a link_name - name of the link
6924  *a angular_vel - angular velocity in degrees per second
6925  **
6926  *b Returns:
6927  **
6928  ** 0 on success, -1 on failure
6929  */
6930  int set_gaze_link_max_angular_vel(const char* link_name, float angular_vel);
6931 
6933  int get_gaze_link_max_angular_vel(const char* link_name, float* angular_vel);
6934 
6935  /*l
6936  *b Description:
6937  **
6938  ** This function sets how much the link will make up the difference
6939  ** toward the gaze or point target.
6940  **
6941  ** The combination of this function and
6942  ** the tolerances determine how close the
6943  ** link will turn toward the gaze or point target.
6944  **
6945  ** With a smaller scale factor the link will not turn as much toward
6946  ** the target. With a higher scale factor the link will turn more
6947  ** toward the target.
6948  **
6949  ** For example, if the gaze or point target is at 60 degrees yaw in
6950  ** back coordinates and the scale factor is 0.5, the back will turn
6951  ** 30 degrees in pursuit of the target.
6952  **
6953  ** Valid link names and defaults:
6954  **
6955  *a back - 0.75
6956  *a cervical - 0.5
6957  *a eye_l - 1.0
6958  *a shoulder_l - 0.9
6959  *a elbow_l - 1.0
6960  **
6961  *b Arguments:
6962  **
6963  *a link_name - name of the link
6964  *a scale_factor - scale factor between 0 and 1
6965  **
6966  *b Returns:
6967  **
6968  ** 0 on success, -1 on failure
6969  */
6970  int set_gaze_link_scale_factor(const char* link_name, float scale_factor);
6971 
6973  int get_gaze_link_scale_factor(const char* link_name, float* scale_factor);
6974 
6975  /*l
6976  *b Description:
6977  **
6978  ** This function sets whether the character can turn the specified
6979  ** link in pursuit of the gaze target.
6980  **
6981  ** Valid link names and defaults:
6982  **
6983  *a orientation - 0
6984  *a back - 1
6985  *a cervical - 1
6986  *a eye_l - 1 if character has movable eyes, else 0
6987  *a shoulder_l - 0
6988  *a elbow_l - 0
6989  **
6990  *b Arguments:
6991  **
6992  *a link_name - name of the link
6993  *a enabled - 1 to enable, 0 to disable
6994  **
6995  *b Returns:
6996  **
6997  ** 0 on success, -1 on failure
6998  */
6999  int set_link_enabled_for_gaze(const char* link_name, int enabled);
7000 
7002  int get_link_enabled_for_gaze(const char* link_name);
7003 
7004  /*l
7005  *b Description:
7006  **
7007  ** This function sets whether the character can change its current
7008  ** posture in pursuit of the gaze target.
7009  **
7010  ** Gaze can change current posture by default.
7011  **
7012  *b Arguments:
7013  **
7014  *a enabled - 1 to enable, 0 to disable
7015  **
7016  *b Returns:
7017  **
7018  ** 0 on success, -1 on failure
7019  */
7020  int set_gaze_can_change_posture(int enabled);
7021 
7023  int get_gaze_can_change_posture();
7024 
7025  /*l
7026  *b Description:
7027  **
7028  ** This function sets whether the character can change its current
7029  ** variant in pursuit of the gaze target.
7030  **
7031  ** Gaze can change current variant by default.
7032  **
7033  *b Arguments:
7034  **
7035  *a enabled - 1 to enable, 0 to disable
7036  **
7037  *b Returns:
7038  **
7039  ** 0 on success, -1 on failure
7040  */
7041  int set_gaze_can_change_variant(int enabled);
7042 
7044  int get_gaze_can_change_variant();
7045 
7046  /*l
7047  *b Description:
7048  **
7049  ** This function sets whether the character can move the specified
7050  ** link in pursuit of the lpoint target.
7051  **
7052  ** Valid link names and defaults:
7053  **
7054  *a orientation - 0
7055  *a back - 1
7056  *a cervical - 0
7057  *a eye_l - 0
7058  *a shoulder_l - 1
7059  *a elbow_l - 1
7060  **
7061  *b Arguments:
7062  **
7063  *a link_name - name of the link
7064  *a enabled - 1 to enable, 0 to disable
7065  **
7066  *b Returns:
7067  **
7068  ** 0 on success, -1 on failure
7069  */
7070  int set_link_enabled_for_lpoint(const char* link_name, int enabled);
7071 
7073  int get_link_enabled_for_lpoint(const char* link_name);
7074 
7075  /*l
7076  *b Description:
7077  **
7078  ** This function adjusts the current azimuth and elevation offsets
7079  ** of the character's head. If a gaze is ongoing, then the nod will
7080  ** be supplemented to the gazing, and the character will attempt to
7081  ** maintain its gaze.
7082  **
7083  ** This function will have no effect on a dead character (see
7084  ** die_now() and get_dead()).
7085  **
7086  *b Arguments:
7087  **
7088  *a azimuth - rotation offset about z (vertical) axis, in degrees;
7089  *a positive rotates to character's left
7090  *a elevation - rotation offset about y (horizontal) axis, in degrees;
7091  *a positive rotates down
7092  *a duration - how long it should take to attain the new azimuth
7093  *a and elevation
7094  **
7095  *b Returns:
7096  **
7097  ** 0 on success, -1 on failure
7098  */
7099  int set_nod(float azimuth,
7100  float elevation,
7101  float duration = 0.5f);
7102 
7103  /*l
7104  *b Description:
7105  **
7106  ** This function causes the character to nod its head for the
7107  ** specified number of times over the specified duration.
7108  **
7109  ** If nod_count is 0.5, the elevation of the head will move from its
7110  ** current elevation straight to nod_elevation_out. The arguments
7111  ** nod_elevation0 and nod_elevation1 will be ignored.
7112  **
7113  ** If nod_count is 1.0, the elevation of the head will move from
7114  ** its current elevation to nod_elevation0, then to
7115  ** nod_elevation_out. The argument nod_elevation1 will be ignored.
7116  **
7117  ** If nod_count is 1.5 or greater, the nod elevation will begin at
7118  ** its current elevation, move to nod_elevation0, then alternate
7119  ** between nod_elevation0 and nod_elevation1, before finally ending
7120  ** at nod_elevation_out.
7121  **
7122  ** The head will maintain an elevation offset of nod_elevation_out
7123  ** until a new call to nod_head() or set_nod() is made.
7124  **
7125  ** This function overrides any nod settings made by the set_nod()
7126  ** function.
7127  **
7128  ** This function will have no effect on a dead character (see
7129  ** die_now() and get_dead()).
7130  **
7131  *b Arguments:
7132  **
7133  *a duration - for how long the nod should be executed
7134  *a nod_count - how many nods the character should perform;
7135  *a this will be rounded to the nearest multiple
7136  *a of 0.5
7137  *a nod_elevation0 - elevation of initial nod in degrees
7138  *a nod_elevation1 - elevation of return nod in degrees
7139  *a nod_elevation_out - ending elevation when nod is complete
7140  **
7141  *b Returns:
7142  **
7143  ** 0 on success, -1 on failure
7144  **
7145  *b Available as Decision Bead/Event
7146  */
7147  int nod_head(float duration,
7148  float nod_count,
7149  float nod_elevation0 = 15.0f,
7150  float nod_elevation1 = 0.0f,
7151  float nod_elevation_out = 0.0f);
7152 
7153  /*l
7154  *b Description:
7155  **
7156  ** This function is similar to nod_head(), except the direction
7157  ** of head movement is side to side rather than up and down.
7158  ** See the nod_head() function for a detailed description of usage.
7159  **
7160  ** This function will have no effect on a dead character (see
7161  ** die_now() and get_dead()).
7162  **
7163  *b Arguments:
7164  **
7165  *a duration - for how long the shake should be executed
7166  *a shake_count - how shakes the character should perform; this
7167  *a will be rounded to the nearest multiple of
7168  *a 0.5
7169  *a shake_azimuth0 - azimuth of initial shake in degrees
7170  *a shake_azimuth1 - azimuth of return shake in degrees
7171  *a shake_azimuth_out - ending azimuth when shake is complete
7172  **
7173  *b Returns:
7174  **
7175  ** 0 on success, -1 on failure
7176  **
7177  *b Available as Decision Bead/Event
7178  */
7179  int shake_head(float duration,
7180  float shake_count,
7181  float shake_azimuth0 = -20.0f,
7182  float shake_azimuth1 = 20.0f,
7183  float shake_azimuth_out = 0.0f);
7184 
7185  /*l
7186  *b Returns:
7187  **
7188  ** current nod azimuth setting; see set_nod(), nod_head(), and
7189  ** shake_head()
7190  */
7191  float get_nod_azimuth();
7192 
7193  /*l
7194  *b Returns:
7195  **
7196  ** current nod elevation setting; see set_nod(), nod_head(), and
7197  ** shake_head()
7198  */
7199  float get_nod_elevation();
7200 
7201 
7202 /*****************************************************************************/
7223  /*l
7224  *b Description:
7225  **
7226  ** This function sets the current desired azimuth and elevation of
7227  ** the character's aim. The angles are in character-local
7228  ** coordinates. Zero values mean straight ahead and level.
7229  ** Aiming will continue until end_aim() is called.
7230  **
7231  ** This function effectively calls aim_at_angle_local(), with a
7232  ** distance of 10000 meters, and is_new_aim set to 1.
7233  **
7234  ** This function will have no effect on a dead character (see
7235  ** die_now() and get_dead()).
7236  **
7237  *b Arguments:
7238  **
7239  *a azimuth - rotation about z (vertical) axis, in degrees;
7240  *a positive rotates to character's left
7241  *a elevation - rotation about y (horizontal) axis, in degrees;
7242  *a positive rotates down
7243  **
7244  *b Returns:
7245  **
7246  ** 0 on success, -1 on failure
7247  */
7248  int set_aim(float azimuth, float elevation);
7249 
7250  /*l
7251  *b Description:
7252  **
7253  ** This function sets the current azimuth, elevation, and
7254  ** distance of the character's aim. A fixed point in 3D space is
7255  ** then found using the two angles and the given distance from
7256  ** the character's idealized position. Angles are given with
7257  ** respect to the DI-Guy global coordinate system.
7258  **
7259  ** See set_position() for a description of the coordinate
7260  ** system.
7261  **
7262  ** Aiming will continue until end_aim() is called.
7263  **
7264  ** This function will have no effect on a dead character (see
7265  ** die_now() and get_dead()).
7266  **
7267  *b Arguments:
7268  **
7269  *a azimuth - rotation in degrees about up (vertical) axis;
7270  *a begins at 0 at the positive X axis of the DI-Guy
7271  *a coordinate system and proceeds counter-clockwise
7272  *a elevation - rotation in degrees about horizontal axis; positive
7273  *a value rotates down
7274  *a distance - distance in meters from the idealized position of the
7275  *a character to the aim target; positive values only,
7276  *a typically this is a large value (e.g. 10,000 meters)
7277  *a is_new_aim - set to 1 if this is a new aim, for jumping to a
7278  *a new target;
7279  *a set to 0 if this is continuing an already
7280  *a started aim, for tracking an existing target
7281  **
7282  *b Returns:
7283  **
7284  ** 0 on success, -1 on failure
7285  */
7286  int aim_at_angle(float azimuth,
7287  float elevation,
7288  float distance,
7289  int is_new_aim = 1);
7290 
7291  /*l
7292  *b Description:
7293  **
7294  ** This function is identical to aim_at_angle() except that the
7295  ** angles are relative to the character's frame of reference. These
7296  ** relative angles will be maintained even if the character rotates.
7297  **
7298  ** Use get_position() to learn the idealized position. The
7299  ** distance is between the idealized position of the character
7300  ** and the fixation point. Aiming will continue until end_aim()
7301  ** is called.
7302  **
7303  ** This function will have no effect on a dead character (see
7304  ** die_now() and get_dead()).
7305  */
7306  int aim_at_angle_local(float azimuth,
7307  float elevation,
7308  float distance,
7309  int is_new_aim = 1);
7310 
7311  /*l
7312  *b Description:
7313  **
7314  ** This function is identical to aim_at_angle() and aim_at_angle_local(),
7315  ** but includes velocity that will modify the angles every frame.
7316  ** This can be useful in networked simulations where targeting velocity is published.
7317  **
7318  ** This function will have no effect on a dead character (see
7319  ** die_now() and get_dead()).
7320  */
7321  int aim_at_angle_with_velocity(float azimuth, float elevation, float az_vel, float el_vel, int local, int is_new_aim = 1);
7322 
7323  /*l
7324  *b Description:
7325  **
7326  ** This function sets the current fixation point of the
7327  ** character's aim. Point coordinates are given in meters in the
7328  ** DI-Guy global coordinate system.
7329  **
7330  ** The function uses default aim behavior settings. Aiming will
7331  ** continue until end_aim() is called.
7332  **
7333  ** This function will have no effect on a dead character (see
7334  ** die_now() and get_dead()).
7335  **
7336  *b Arguments:
7337  **
7338  *a tx, ty, tz - position in meters from the DI-Guy global
7339  *a origin
7340  *a is_new_aim - set to 1 if this is a new aim;
7341  *a set to 0 if this is continuing an already started aim
7342  **
7343  *b Returns:
7344  **
7345  ** 0 on success, -1 on failure
7346  */
7347  int aim_at_point(float x, float y, float z, int is_new_aim = 1);
7348 
7349  /*l
7350  *b Description:
7351  **
7352  ** This function is identical to aim_at_point() except that the
7353  ** coordinates are relative to the character, in its own coordinate
7354  ** system. Use get_position() to learn the idealized position of the
7355  ** character if necessary.
7356  **
7357  ** This function will have no effect on a dead character (see
7358  ** die_now() and get_dead()).
7359  */
7360  int aim_at_point_local(float x, float y, float z, int is_new_aim = 1);
7361 
7362  /*l
7363  *b Description:
7364  **
7365  ** This function effectively does an aim_at_point() each tick.
7366  ** The point to be aimed at is updated each tick to be the position
7367  ** of the specified link on the specified character.
7368  **
7369  ** This function will have no effect on a dead character (see
7370  ** die_now() and get_dead()).
7371  **
7372  *b Arguments:
7373  **
7374  *a target_character_name - name of the character to be
7375  *a aimed at
7376  *a target_character_link_name - link on the character that should
7377  *a be aimed at; pass NULL or "" to
7378  *a aim at the position link of the
7379  *a character. If NULL is passed,
7380  *a function will make best effort to
7381  *a choose a character-appropriate link
7382  *a to target.
7383  *a offset_tx, offset_ty, offset_tz - offset onto the link, in meters
7384  **
7385  *b Returns:
7386  **
7387  ** 0 on success, -1 on failure
7388  **
7389  *b Available as Decision Bead/Event
7390  **
7391  *b C++ Example:
7392  **
7393  *e // aim at the head of character "soldier-1".
7394  *e ch->aim_at_character("soldier-1",
7395  *e "cervical",
7396  *e 0.0,
7397  *e 0.0,
7398  *e 0.0);
7399  */
7400  int aim_at_character(const char* target_character_name,
7401  const char* target_character_link_name = NULL,
7402  float offset_tx = 0.0f,
7403  float offset_ty = 0.0f,
7404  float offset_tz = 0.0f);
7405 
7406  /*l
7407  *b Description:
7408  **
7409  ** This function terminates aiming started by the set_aim(),
7410  ** aim_at_point(), aim_at_point_local(), aim_at_angle(),
7411  ** aim_at_angle_local(), and aim_at_character() functions.
7412  */
7413  void end_aim();
7414 
7416  const char * get_aim_at_character();
7417 
7419  float get_aim_azimuth();
7420 
7422  float get_aim_elevation();
7423 
7424  /*l
7425  *b Description:
7426  **
7427  ** This function returns values that can be used to compute the
7428  ** character's weapon's trajectory, i.e. the mathematical ray that
7429  ** comes out of the end of the barrel.
7430  **
7431  *b Returns:
7432  **
7433  ** 1 if the character is aiming, 0 if not
7434  **
7435  *b Arguments:
7436  **
7437  *a muzzle_x, muzzle_y, muzzle_z - position of muzzle in meters from
7438  *a the origin
7439  *a far_x, far_y, far_z - position of end target in meters from the
7440  *a origin
7441  **
7442  ** Pass NULL for any values that are not needed.
7443  ** Note: values will be zero if the character isn't currently aiming
7444  */
7445  int get_aim_trajectory(float* muzzle_x, float* muzzle_y, float* muzzle_z,
7446  float* far_x, float* far_y, float* far_z);
7447 
7448  /*l
7449  *b Description:
7450  **
7451  ** Not all actions of a character will be affected by aim
7452  ** commands. This function returns 1 if this character
7453  ** is currently in an aim-able action.
7454  **
7455  *b Returns:
7456  **
7457  ** 1 if current action is aim-able; 0 if not
7458  */
7459  int get_aim_is_possible();
7460 
7461  /*l
7462  *b Returns:
7463  **
7464  ** 1 if the aim is acquired, 0 if not
7465  */
7466  int get_aim_is_acquired();
7467 
7468  /*l
7469  *b Returns:
7470  **
7471  ** 1 if all links participating in the aim have reached a
7472  ** relatively steady state, 0 if not, -1 on error
7473  */
7474  int get_aim_is_steady();
7475 
7476 
7477  /*l
7478  *b Returns:
7479  **
7480  ** 1 if character is currently aiming, 0 if not
7481  */
7482  int get_is_aiming();
7483 
7484 
7485  /******************************************************
7486  **
7487  *3 Aim Algorithm 8 Parameters
7488  **
7489  ** This aim algorithm works by adjusting the aiming character's pose
7490  ** such that the difference between the current aim angles and the
7491  ** desired aim angles is decreased each scenario tick.
7492  **
7493  ** How much of that difference that is made up each frame is
7494  ** determined by the factor parameters. The difference between the
7495  ** desired aim angles and the current aim angles, multiplied by a
7496  ** calculated factor, is added to the current aim angles each frame.
7497  ** This causes the aim to "home in" on the desired aim angles.
7498  **
7499  ** For example, if for each frame the calculated factor is 0.5, half
7500  ** of the difference between the desired and current aim angles is
7501  ** made up.
7502  **
7503  ** Unless otherwise specified, all functions callable from:
7504  **
7505  *- - C++
7506  *- - Script
7507  */
7508 
7509  /*l
7510  *b Description:
7511  **
7512  ** This function sets the steady-state factor that is used once
7513  ** an aim is no longer considered "new".
7514  **
7515  ** See the function set_aim_param_new_aim_duration() for information
7516  ** on when an aim is considered new, and how the effective acquire
7517  ** is calculated from this steady-state acquire factor and the
7518  ** new aim factor.
7519  **
7520  *b Arguments:
7521  **
7522  *a factor - unitless value between 0 and 1; default is 0.6
7523  */
7524  void set_aim_param_acquire_factor(float factor);
7525 
7526  /*l
7527  *b Returns:
7528  **
7529  ** the current aim acquire factor parameter
7530  */
7531  float get_aim_param_acquire_factor();
7532 
7533  /*l
7534  *b Description:
7535  **
7536  ** This function sets the factor that is used when an aim is
7537  ** considered new.
7538  **
7539  ** See the function set_aim_param_new_aim_duration() for information
7540  ** on when an aim is considered new, and how the effective acquire
7541  ** is calculated from this new aim factor and the steady-state acquire
7542  ** factor.
7543  **
7544  *b Arguments:
7545  **
7546  *a factor - unitless value between 0 and 1; default is 0.05
7547  */
7548  void set_aim_param_new_aim_factor(float factor);
7549 
7551  float get_aim_param_new_aim_factor();
7552 
7553  /*l
7554  *b Description:
7555  **
7556  ** This function sets how long an aim is considered "new".
7557  **
7558  ** When an aim is brand-new, the effective acquire factor is equal
7559  ** to the new aim factor as set by set_aim_param_new_aim_factor().
7560  ** When the new aim duration has expired, the effective acquire factor
7561  ** is equal to the steady-state acquire factor as set by
7562  ** set_aim_param_acquire_factor(). In between, the effective acquire
7563  ** factor moves smoothly between the two.
7564  **
7565  ** For example, say that the new aim factor is 0.1, the acquire factor
7566  ** is 0.5, and the new aim duration is 0.2 seconds.
7567  ** If a new aim is started, say by a call to aim_at_angle_local(),
7568  ** the effective acquire factor of the first frame will be 0.1. Over
7569  ** the next 0.2 seconds, the effective acquire factor will smoothly
7570  ** ramp up to 0.5, where it will stay until the aim is acquired.
7571  **
7572  *b Arguments:
7573  **
7574  *a duration - how long, in seconds, a new aim should be considered
7575  *a new; default is 1 second
7576  */
7577  void set_aim_param_new_aim_duration(float duration);
7578 
7580  float get_aim_param_new_aim_duration();
7581 
7582  /*l
7583  *b Description:
7584  **
7585  ** This function sets the maximum factor that can be used for any
7586  ** single frame for aim convergence attempts.
7587  **
7588  ** See set_aim_param_acquire_factor() for a discussion of why setting
7589  ** this too close to 1 is not recommended.
7590  **
7591  *b Arguments:
7592  **
7593  *a factor - unitless value between 0 and 1; default is 0.95
7594  */
7595  void set_aim_param_max_per_frame_adj_factor(float factor);
7596 
7598  float get_aim_param_max_per_frame_adj_factor();
7599 
7600  /*l
7601  *b Description:
7602  **
7603  ** This function sets how close the current aim azimuth must be to
7604  ** the desired aim azimuth in order for the aim to be considered
7605  ** acquired.
7606  **
7607  ** Note that the aim isn't fully acquired until both azimuth and
7608  ** elevation are acquired.
7609  **
7610  ** Setting this value too close to 0 will result in the aim never
7611  ** being acquired.
7612  **
7613  *b Arguments:
7614  **
7615  *a range - how close, in degrees, the azimuth must be for the
7616  *a aim to be acquired; default is 0.5 degrees
7617  */
7618  void set_aim_param_azimuth_acquired_range(float range);
7619 
7621  float get_aim_param_azimuth_acquired_range();
7622 
7623  /*l
7624  *b Description:
7625  **
7626  ** This function sets how close the current aim elevation must be to
7627  ** the desired aim elevation in order for the aim to be considered
7628  ** acquired.
7629  **
7630  ** Note that the aim isn't fully acquired until both azimuth and
7631  ** elevation are acquired.
7632  **
7633  ** Setting this value too close to 0 will result in the aim never
7634  ** being acquired.
7635  **
7636  *b Arguments:
7637  **
7638  *a range - how close, in degrees, the elevation must be for the
7639  *a aim to be acquired; default is 1.0 degrees
7640  */
7641  void set_aim_param_elevation_acquired_range(float range);
7642 
7644  float get_aim_param_elevation_acquired_range();
7645 
7646  /*l
7647  *b Description:
7648  **
7649  ** This function attempts to have the character reach its desired
7650  ** aim angles instantly, every frame.
7651  **
7652  ** Set enabled to 0 to disable instant aim convergence.
7653  **
7654  */
7655  void set_aim_converge_every_frame( int enabled );
7656 
7658  int get_aim_converge_every_frame();
7659 
7662  int set_aim_variable_interpolation_time(float time);
7663  float get_aim_variable_interpolation_time();
7664 
7665 /*****************************************************************************/
7669  const char* get_aim_at_link();
7671 
7673  int get_aim_at_link_offset(float* offset_x, float* offset_y, float* offset_z);
7674 
7676  const char* get_gaze_at_link();
7677 
7679  int get_gaze_at_link_offset(float* offset_x, float* offset_y, float* offset_z);
7680 
7681 /*****************************************************************************/
7691  /*l
7692  *b Description:
7693  **
7694  ** This function causes a character to fire his weapon.
7695  **
7696  ** Different weapons have different "munition types", which specify,
7697  ** among other things, the sound to be played, the network info to be
7698  ** sent, and muzzle flash effect. See
7699  ** get_weapon_muzzle_munition_type() for more information on munition
7700  ** types.
7701  **
7702  ** If the weapon fires live rounds (as set by
7703  ** set_weapon_fires_live_rounds()) this function also computes a
7704  ** bullet trajectory, perhaps hitting and killing another character.
7705  **
7706  ** This function will have no effect on a dead character (see
7707  ** die_now() and get_dead()).
7708  **
7709  *b Returns:
7710  **
7711  ** 0 on success, -1 on failure
7712  **
7713  *b Available as Decision Bead/Event
7714  */
7715  int fire_weapon(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
7716 
7717  /*l
7718  *b Description:
7719  **
7720  ** This function causes a character to fire his weapon the
7721  ** specified number of times. This causes a muzzle flash and
7722  ** the weapon's sound (if any) to be played.
7723  **
7724  ** The sound played will be one of, in order:
7725  **
7726  *- - the passed override_sound_name, or
7727  *- - the sound set by set_weapon_sound_override(), or
7728  *- - the default weapon sound based on the character's appearance
7729  **
7730  ** If the weapon fires live rounds (as set by
7731  ** set_weapon_fires_live_rounds()), this function also computes a
7732  ** trajectory for each round, perhaps hitting and killing
7733  ** another character.
7734  **
7735  ** This function will have no effect on a dead character (see
7736  ** die_now() and get_dead()).
7737  **
7738  *b Arguments:
7739  **
7740  *a count - number of times weapon should be fired
7741  *a override_sound_name - override sound to be played
7742  *a dt - time between firings if count > 1
7743  *a muzzle - muzzle on which flash should appear
7744  **
7745  *b Returns:
7746  **
7747  ** 0 on success, -1 on failure
7748  **
7749  *b Available as Decision Bead/Event
7750  */
7751  int fire_weapon_n_times(int count,
7752  float dt = 0.2f,
7753  const char* override_sound_name = NULL,
7755 
7756  /*l
7757  *b Description:
7758  **
7759  ** Fires a bullet at point (x, y) from the camera, using this
7760  ** character as the attacker.
7761  **
7762  *i Currently OpenGL only.
7763  **
7764  ** This function will have no effect on a dead character (see
7765  ** die_now() and get_dead()).
7766  **
7767  *b Returns:
7768  **
7769  ** number of hits
7770  */
7771  int fire_screen_space_bullet(diguyView* view, float x, float y);
7772 
7773  /*l
7774  *b Returns:
7775  **
7776  ** number of times weapon has been fired from specified muzzle
7777  **
7778  *b Available as Decision Bead/Event
7779  */
7780  int get_weapon_fire_count(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
7781 
7782  /*l
7783  *b Description:
7784  **
7785  ** This function sets the default muzzle that will flash when
7786  ** the character fires its weapon due to a call to fire_weapon()
7787  ** or fire_weapon_n_times().
7788  **
7789  ** The default value is DIGUY_MUZZLE_DEFAULT.
7790  **
7791  *b Arguments:
7792  **
7793  *a muzzle - the muzzle that will flash; muzzle 1 is common
7794  **
7795  *b Returns:
7796  **
7797  ** 0 on success, -1 on failure
7798  */
7799  int set_default_weapon_muzzle(diguyMuzzle muzzle);
7800 
7801  /*l
7802  *b Returns:
7803  **
7804  ** current default weapon muzzle that flashes when the character's
7805  ** weapon is fired; see set_default_weapon_muzzle()
7806  */
7807  diguyMuzzle get_default_weapon_muzzle();
7808 
7809  /*l
7810  *b Description:
7811  **
7812  ** When the character fires its weapon, the results depend on the
7813  ** munition type of the muzzle fired from. Munition types specify,
7814  ** among other things:
7815  **
7816  *- - sound played
7817  *- - muzzle flash effect
7818  *- - network data sent (DIS septet)
7819  *- - detonation effect
7820  *- - detonation radius
7821  *- - etc.
7822  **
7823  ** Default munition types for the each muzzle are set automatically
7824  ** when the character's appearance is set. The munition type of the
7825  ** weapon can be overridden by calling
7826  ** set_weapon_munition_type_override().
7827  **
7828  ** Current munition types include:
7829  **
7830  *- - m16
7831  *- - m4
7832  *- - m60
7833  *- - m240
7834  *- - m249
7835  *- - m9
7836  *- - hand_gun
7837  *- - 50cal
7838  *- - m256
7839  *- - ak47
7840  *- - pk74
7841  *- - dragunov
7842  *- - sa80
7843  *- - rpg
7844  *- - m203
7845  *- - 40mm_hedp
7846  *- - javelin
7847  *- - stinger
7848  *- - at4
7849  *- - sa7
7850  *- - molotov_cocktail
7851  *- - 60mm_mortar
7852  *- - 82mm_mortar
7853  *- - 155mm_artillery
7854  *- - IED_mortar
7855  *- - VBIED
7856  *- - m242
7857  *- - 120mm
7858  *- - 125mm
7859  *- - ced
7860  *- - pepper_spray
7861  **
7862  *b Returns:
7863  **
7864  ** munition type of specified muzzle
7865  */
7866  const char* get_weapon_muzzle_munition_type(diguyMuzzle muzzle);
7867 
7869  const char* get_weapon_supplemental_data_name();
7870 
7872  const char* get_default_muzzle_munition_type();
7873 
7874  /*l
7875  *b Description:
7876  **
7877  ** This function allows the default munition type to be overridden.
7878  ** The default value is NULL (don't override default munition type).
7879  **
7880  *b Arguments:
7881  **
7882  *a munition_type - name of a munition type
7883  **
7884  *b Returns:
7885  **
7886  ** 0 on success, -1 on failure
7887  */
7888  int set_weapon_munition_type_override(const char* munition_type);
7889 
7891  const char* get_weapon_munition_type_override();
7892 
7893  /*l
7894  *b Description:
7895  **
7896  ** This function sets whether the character's weapons fire live
7897  ** rounds. If so, when fire_weapon() and fire_weapon_n_times() are
7898  ** called the trajectory of the bullet will be calculated and checked
7899  ** against characters in the scenario.
7900  **
7901  ** The default value is 1.
7902  **
7903  *b Arguments:
7904  **
7905  *a weapon_fires_live_rounds - set to 1 for live rounds; set to 0
7906  *a for "blanks"
7907  **
7908  *b Returns:
7909  **
7910  ** 0 on success, -1 on failure
7911  **
7912  *b Available as Decision Bead/Event
7913  */
7914  int set_weapon_fires_live_rounds(int weapon_fires_live_rounds);
7915 
7916  /*l
7917  *b Returns:
7918  **
7919  ** current setting of whether weapon fires live rounds or blanks; see
7920  ** set_weapon_fires_live_rounds()
7921  **
7922  *b Available as Decision Bead/Event
7923  */
7924  int get_weapon_fires_live_rounds();
7925 
7926  /*l
7927  *b Description:
7928  **
7929  ** A weapon sound is played when the character fires its weapon
7930  ** due to a call to fire_weapon() or fire_weapon_n_times().
7931  ** The sound that is played is generally derived from the weapon's
7932  ** munition type, which can be different for each muzzle.
7933  **
7934  ** This function overrides the default sound that will be played.
7935  ** Note that this overrides the sound for all muzzles.
7936  **
7937  ** The default value is NULL (don't override default sound).
7938  **
7939  ** To *not* play a sound at all, set the weapon sound gain override
7940  ** to 0.
7941  **
7942  *b Arguments:
7943  **
7944  *a sound - name of a sound defined in the scenario;
7945  *a pass NULL to specify that default should be played
7946  **
7947  *b Returns:
7948  **
7949  ** 0 on success, -1 on failure
7950  */
7951  int set_weapon_sound_override(const char* sound_name);
7952 
7953  /*l
7954  *b Description:
7955  **
7956  ** The function returns the current weapon sound override, if one
7957  ** is set; see set_weapon_sound_override().
7958  **
7959  ** This function will not return NULL. The empty string ("") is
7960  ** returned if a weapon sound override is not set.
7961  **
7962  *b Returns:
7963  **
7964  ** name of weapon sound override
7965  */
7966  const char* get_weapon_sound_override();
7967 
7968  /*l
7969  *b Description:
7970  **
7971  ** This function overrides the default gain on the sound played
7972  ** due to a call to fire_weapon() or fire_weapon_n_times().
7973  **
7974  ** Pass 1.0 to use the sound's default amplitude. Lower numbers
7975  ** decrease volume, higher numbers increase volume.
7976  **
7977  ** Pass 0.0 to completely disable playing of weapon sound.
7978  **
7979  ** The default value is 3.0.
7980  **
7981  ** See set_weapon_sound_override().
7982  **
7983  *b Arguments:
7984  **
7985  *a sound_gain - amount by which to change sound volume
7986  **
7987  *b Returns:
7988  **
7989  ** 0 on success, -1 on failure
7990  */
7991  int set_weapon_sound_gain_override(float gain);
7992 
7994  float get_weapon_sound_gain_override();
7995 
7996  /*l
7997  *b Description:
7998  **
7999  ** This function provides aiming assistance by making it possible for
8000  ** roughly-aimed weapons to hit targets. When spread is nonzero,
8001  ** fire_weapon searches for a target within a conical space centered
8002  ** on the muzzle. Within this cone, the live character within weapon
8003  ** range, and with the smallest angular deviation from the weapon, is
8004  ** chosen, by default, as the target. Other function calls may alter
8005  ** this aiming behavior, making it aim only at enemy targets, for
8006  ** example, or making it prefer close targets to far ones.
8007  **
8008  *b Arguments:
8009  **
8010  *a spread - angular deviation from weapon muzzle within which a
8011  *a target will be found
8012  **
8013  ** Spread values above 145 are suicidal (character can shoot himself).
8014  ** 90 is the highest sensible value, which covers everything ahead
8015  ** of the weapon muzzle. A value of 0 is the default, meaning that
8016  ** only targets in line with the muzzle are hit.
8017  */
8018  void set_weapon_spread(float spread);
8019 
8020  /*l
8021  *b Description:
8022  **
8023  ** This function affects how targets are chosen when
8024  ** the character's weapon_spread is nonzero. Only
8025  ** characters more than near_range meters away from the muzzle
8026  ** will be fired upon. Characters which are closer than
8027  ** near_range meters will not be fired upon.
8028  **
8029  ** This value does not affect weapon behavior when weapon_spread
8030  ** is zero.
8031  **
8032  ** If this function is never called for a character, it is as if
8033  ** the function had been called with a value of zero.
8034  **
8035  *b Arguments:
8036  **
8037  *a near_range - distance closer than which no character will be
8038  *a targeted
8039  */
8040  void set_weapon_near_range(float near_range);
8041  float get_weapon_near_range();
8042 
8043  /*l
8044  *b Description:
8045  **
8046  ** This function sets the range of the character's
8047  ** weapon.
8048  **
8049  ** If this function is never called for a character, it is as if
8050  ** the function had been called with a value of 500.0.
8051  **
8052  *b Arguments:
8053  **
8054  *a far_range - range of the weapon in meters
8055  */
8056  void set_weapon_far_range( float far_range );
8057  float get_weapon_far_range();
8058 
8059  /*l
8060  *b Description:
8061  **
8062  ** This function sets a weapon's ratio of hits to fired rounds. A
8063  ** value of 1.0 (the default) means the weapon will hit everything it
8064  ** is aimed at. Values less than 1.0 cause the weapon to
8065  ** probabilistically miss targets, even when perfectly aimed at them.
8066  ** A value of zero means the weapon doesn't hit anything, even if it
8067  ** is perfectly aimed. A value of 0.5 will hit half of the time.
8068  */
8069  void set_weapon_hit_ratio( float hit_ratio );
8070 
8071  /*l
8072  *b Description:
8073  **
8074  ** This function sets the duration of a weapon's muzzle flash.
8075  ** The duration is specified as the number of frames it will be visible
8076  ** when shown.
8077  */
8078  void set_weapon_flash_duration( int muzzle_flash_duration );
8079 
8080  /*l
8081  *b Description:
8082  **
8083  ** This function sets the number of potential impacts a fired round
8084  ** can have. The default is 1. Specifying more than 1 means the
8085  ** round will completely go through objects, triggering a
8086  ** CALLBACK_ID_IMPACT callback each time, until the maximum number of
8087  ** impacts has been reached.
8088  */
8089  void set_weapon_max_impacts( int val );
8090 
8091  /*l
8092  *b Returns:
8093  **
8094  ** state of accessory1
8095  */
8096  int get_accessory1_state();
8097 
8098  /*l
8099  *b Returns:
8100  **
8101  ** state of the character's rifle
8102  */
8103  int get_rifle_state();
8104 
8105  /*l
8106  *b Description
8107  **
8108  ** This function sets whether the projectiles of certain appearances'
8109  ** weapons (such as rocket launchers and RPGs) are visible. Note that
8110  ** most weapons do not have visible projectiles and this function will
8111  ** therefore have no effect.
8112  **
8113  *b Arguments:
8114  **
8115  *a muzzle - which muzzle's projectile should be shown/hidden
8116  *a is_visible - pass 1 to show, pass 0 to hide
8117  **
8118  *b Returns:
8119  **
8120  ** 0 on success, -1 on failure
8121  */
8122  int set_weapon_projectile_is_visible(diguyMuzzle muzzle, int is_visible);
8123 
8124  /*l
8125  *b Description
8126  **
8127  ** This function returns the most recent setting of
8128  ** set_weapon_projectile_is_visible().
8129  **
8130  *b Arguments:
8131  **
8132  *a muzzle - which muzzle's projectile should be queried
8133  **
8134  *b Returns:
8135  **
8136  ** 1 if visible, 0 if not
8137  */
8138  int get_weapon_projectile_is_visible(diguyMuzzle muzzle);
8139 
8140  /*l
8141  *b Description:
8142  **
8143  ** Retrieves the position and direction of the character's weapon.
8144  **
8145  *b Arguments:
8146  **
8147  *a muzzle_tx, muzzle_ty, muzzle_tz - muzzle position, and beginning
8148  *a of aim vector
8149  *a end_pt_tx, end_pt_ty, end_pt_tz - end point of aim vector
8150  *a muzzle_rz, muzzle_rx, muzzle_ry - orientation of muzzle in degrees
8151  *a muzzle - the muzzle for which the aim vector is needed
8152  *a in_character_local_coordinates - pass 0 for values in world
8153  *a coordinates (the default), 1 for values in character-local
8154  *a coordinates
8155  **
8156  ** The muzzle position and end point are in meters from the origin
8157  ** (if using world coordinates) or in meters from the character's
8158  ** position (if using character-local coordinates).
8159  **
8160  ** The distance of the end point from the muzzle position should
8161  ** be the weapon's far range, set by set_weapon_far_range().
8162  **
8163  ** Pass NULL for any values that are not needed.
8164  **
8165  ** *Note:* The muzzle argument is currently not used, and is present
8166  ** for future implementation.
8167  **
8168  *b Returns:
8169  **
8170  ** 0 on success, -1 on failure
8171  */
8172  int get_weapon_aim_vector(float* muzzle_tx, float* muzzle_ty, float* muzzle_tz,
8173  float* end_pt_tx = NULL, float* end_pt_ty = NULL, float* end_pt_tz = NULL,
8174  float* muzzle_rz = NULL, float* muzzle_rx = NULL, float* muzzle_ry = NULL,
8175  int in_character_local_coordinates = 0,
8177 
8178  /*l
8179  *b Description
8180  **
8181  ** This function returns the link the passed muzzle is associated
8182  ** with. For example, soldier rifle muzzles are attached to the
8183  ** "rifle_joint" link.
8184  **
8185  ** Call get_muzzle_offset() to get the offset of the muzzle on this
8186  ** link.
8187  **
8188  *b Arguments:
8189  **
8190  *a muzzle - muzzle of interest
8191  **
8192  *b Returns:
8193  **
8194  ** name of link, or NULL if the character doesn't have the specified
8195  ** muzzle
8196  */
8197  const char* get_muzzle_link(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
8198 
8199  /*l
8200  *b Description
8201  **
8202  ** This function returns the offset of the muzzle from the link it
8203  ** is attached to as returned by get_muzzle_link().
8204  **
8205  *b Arguments:
8206  **
8207  *a muzzle - muzzle of interest
8208  *a offset_x, offset_y, offset_z - variables in which to return results
8209  **
8210  *b Returns:
8211  **
8212  ** 0 on success, -1 on failure
8213  */
8214  int get_muzzle_offset(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT,
8215  float* offset_x = NULL,
8216  float* offset_y = NULL,
8217  float* offset_z = NULL);
8218 
8219  /*l
8220  *b Description
8221  **
8222  ** This function sets the highest horizontal error possible when the
8223  ** weapon is fired. If non-0, a random horizontal error angle will
8224  ** be computed and added to the weapon's horizontal aim angle.
8225  **
8226  *b Arguments:
8227  **
8228  *a h_error - highest possible horizontal error
8229  **
8230  *b Returns:
8231  **
8232  ** 0 on success, -1 on failure
8233  */
8234  int set_weapon_max_azimuth_error(float h_error);
8235 
8237  float get_weapon_max_azimuth_error();
8238 
8239  /*l
8240  *b Description:
8241  **
8242  ** Similar to set_weapon_max_azimuth_error(), but for vertical aim.
8243  */
8244  int set_weapon_max_elevation_error(float v_error);
8245 
8247  float get_weapon_max_elevation_error();
8248 
8249  /*l
8250  *b Description
8251  **
8252  ** This function sets whether tracer effects will be shown when
8253  ** the weapon is fired. Not all weapons will support this effect.
8254  **
8255  *b Arguments:
8256  **
8257  *a enabled - pass 1 to enable, 0 to disable
8258  **
8259  *b Returns:
8260  **
8261  ** 0 on success, -1 on failure
8262  */
8263  int set_weapon_tracers_enabled(int enabled);
8264 
8266  int get_weapon_tracers_enabled();
8267 
8268  /*l
8269  *b Returns:
8270  **
8271  ** number of rounds until next tracer
8272  */
8273  int get_weapon_rounds_until_tracer(diguyMuzzle muzzle);
8274 
8275 
8276  /*l
8277  *b Description:
8278  **
8279  ** Similar to diguyScenario::trigger_detonation(), but detonation
8280  ** occurs at character's position.
8281  **
8282  *b Arguments:
8283  **
8284  *a munition_name - name of the munition to detonate
8285  *a attacker_name - this MUST be specified if the detonation is being
8286  *a broadcast over the network
8287  *a radius_override - defaults to the data in the munition config file
8288  *a broadcast_on_network - pass 0 to not broadcast detonation on DIS
8289  *a network
8290  **
8291  ** Note: Overriding the detonation radius will NOT work on broadcast
8292  ** detonations since the override value is not transmitted.
8293  */
8294  int trigger_detonation_on_character(const char* munition_name,
8295  const char* attacker_name = NULL,
8296  float radius_override = -1.0f,
8297  int broadcast_on_network = 1);
8298 
8299 
8300 /*****************************************************************************/
8311  /*l
8312  *b Description:
8313  **
8314  ** This function changes the face of the character to reflect the
8315  ** specified user-defined named facial expression.
8316  **
8317  ** Currently affects only "facefx" appearances.
8318  **
8319  *b Arguments:
8320  **
8321  *a facex_name - name of face expression to be applied
8322  *a blend_duration - how long (in seconds) to take to change the face
8323  *a strength - a multiplier between 0 and 1 on the expression
8324  **
8325  ** Face expressions available by default in new scenarios are:
8326  **
8327  *- - Neutral
8328  *- - Smile_cl
8329  *- - Trust
8330  *- - Sad
8331  *- - Mad
8332  *- - Distrust
8333  *- - Conniving
8334  *- - Smile
8335  *- - BrowsDown
8336  *- - BrowsUp
8337  **
8338  ** New face expressions can be added using the
8339  ** diguyScenario::create_face_expression() function.
8340  **
8341  *b Returns:
8342  **
8343  ** 0 on success, -1 on failure
8344  **
8345  *b Available as Decision Bead/Event
8346  **
8347  *b C++ Example:
8348  **
8349  *e diguyCharacter* ch = scenario->get_character_at_index(0);
8350  *e
8351  *e // take one second to get mad
8352  *e ch->set_face_expression("Mad", 1.0);
8353  */
8354  int set_face_expression(const char* facex_name, float blend_duration, float strength = 1.0f);
8355 
8356  /*l
8357  *b Description:
8358  **
8359  ** This function sets the current azimuth and elevation of the
8360  ** character's eyes.
8361  **
8362  ** Currently affects only "facefx" appearances.
8363  **
8364  *b Arguments:
8365  **
8366  *a azimuth - rotation about up (vertical) axis, in degrees;
8367  *a positive rotates to character's left
8368  *a elevation - rotation about forward (horizontal) axis, in degrees;
8369  *a positive rotates down
8370  *a blend_time - how long to take to reach new orientation
8371  **
8372  *b Returns:
8373  **
8374  ** 0 on success, -1 on failure
8375  **
8376  */
8377  int set_orientation_eyes(float azimuth,
8378  float elevation,
8379  float blend_time = 0.0f);
8380 
8381  /*l
8382  *b Description:
8383  **
8384  ** This function gets the current azimuth and elevation of the
8385  ** character's eyes. It currently doesn't take blending into account.
8386  **
8387  ** Currently affects only "facefx" appearances.
8388  **/
8389  int get_orientation_eyes(float* azimuth, float* elevation);
8390 
8391  /*l
8392  *b Description:
8393  **
8394  ** Sets how open the eyes are. The eyes will stay at this level
8395  ** indefinitely. To get automatic blinking behavior, call blink().
8396  **
8397  *b Arguments:
8398  **
8399  *a droop_amount - 1 = eyes closed, 0 = eyes open, 0.5 = half open
8400  **
8401  *b Returns:
8402  **
8403  ** 0 on success, -1 on failure
8404  **
8405  *b Available as Decision Bead/Event
8406  */
8407  int set_eye_droop(float droop_amount, float blend_time = 0.0f);
8408 
8410  float get_eye_droop();
8411 
8412  /*l
8413  *b Description:
8414  **
8415  ** This function blinks the eyes. To have the eyes close to a
8416  ** specific amount and stay there, call set_eye_droop().
8417  **
8418  ** Only characters with expressive face appearances can blink.
8419  **
8420  *b Arguments:
8421  **
8422  *a duration_in - how long in seconds the first part of the blink
8423  *a (typically eyes closing) should take
8424  *a duration_out - how long in seconds the second part of the blink
8425  *a (typically eyes opening) should take
8426  *a target_in - how closed the eyes should be at duration_in
8427  *a target_out - how open the eyes should be at duration_out and
8428  *a thereafter
8429  *a tin - time at which blink should occur; default is now
8430  **
8431  *b Returns:
8432  **
8433  ** 0 on success, -1 on failure
8434  **
8435  *b Available as Decision Bead/Event
8436  */
8437  int blink(float duration_in = 0.1f,
8438  float duration_out = 0.2f,
8439  float target_in = 1.0f,
8440  float target_out = 0.0f,
8441  float tin = DIGUY_DEFAULT_FLOAT);
8442 
8443  /*l
8444  *b Description:
8445  **
8446  ** This function enables automatic eye blinking, so that blinks
8447  ** will happen without further function calls. The various
8448  ** controlling factors of blinks are set by the following functions:
8449  **
8450  *- - set_automatic_blink_duration_in()
8451  *- - set_automatic_blink_duration_out()
8452  *- - set_automatic_blink_target_in()
8453  *- - set_automatic_blink_target_out()
8454  **
8455  ** See blink() for information on what these factors mean.
8456  **
8457  ** Only characters with expressive face appearances can blink.
8458  **
8459  *b Arguments:
8460  **
8461  *a enabled - pass 1 to enable automatic blinks; 0 to disable
8462  *a period - how many seconds between each blink
8463  *a period_variation - variation on how many seconds between
8464  *a each blink
8465  **
8466  ** If blinks are enabled, the first blink will happen immediately.
8467  ** Successive blinks will happen between times (period -
8468  ** period_variation) and (period + period_variation) after the
8469  ** previous blink ends.
8470  **
8471  *b Returns:
8472  **
8473  ** 0 on success, -1 on failure
8474  **
8475  *b Available as Decision Bead/Event
8476  */
8477  int set_automatic_blinks_enabled(int enabled,
8478  float period = 6.0f,
8479  float period_variation = 3.0f);
8480 
8482  int get_automatic_blinks_enabled();
8483 
8484  /*l
8485  *b Description:
8486  **
8487  ** This function sets how long it will take the eye to close during
8488  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8489  ** blink().
8490  **
8491  *b Arguments:
8492  **
8493  *a duration_in - time in seconds for eye droop to go from droop
8494  *a target in to target out
8495  **
8496  *b Available as Decision Bead/Event
8497  */
8498  void set_automatic_blink_duration_in(float duration_in);
8499 
8501  float get_automatic_blink_duration_in();
8502 
8503  /*l
8504  *b Description:
8505  **
8506  ** This function sets how long it will take the eye to open during
8507  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8508  ** blink().
8509  **
8510  *b Arguments:
8511  **
8512  *a duration_out - time in seconds for eye droop to go from droop
8513  *a target out to target in
8514  **
8515  *b Available as Decision Bead/Event
8516  */
8517  void set_automatic_blink_duration_out(float duration_out);
8518 
8520  float get_automatic_blink_duration_out();
8521 
8522  /*l
8523  *b Description:
8524  **
8525  ** This function sets how much the eye will close during
8526  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8527  ** blink().
8528  **
8529  *b Arguments:
8530  **
8531  *a target_in - how far to close eye; 1.0 is all closed, 0.0 is
8532  *a all open
8533  **
8534  *b Available as Decision Bead/Event
8535  */
8536  void set_automatic_blink_target_in(float target_in);
8537 
8539  float get_automatic_blink_target_in();
8540 
8541  /*l
8542  *b Description:
8543  **
8544  ** This function sets how much the eye will open during
8545  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8546  ** blink().
8547  **
8548  *b Arguments:
8549  **
8550  *a target_out - how far to open eye; 1.0 is all closed, 0.0 is
8551  *a all open
8552  **
8553  *b Available as Decision Bead/Event
8554  */
8555  void set_automatic_blink_target_out(float target_out);
8556 
8558  float get_automatic_blink_target_out();
8559 
8560  /*l
8561  *b Returns:
8562  **
8563  ** 1 if the character is speaking, 0 if not. With a FaceFX character
8564  ** this is true if a character is actively playing a FaceFX animation
8565  */
8566  int is_speaking();
8567 
8568  /*l
8569  *b Description:
8570  **
8571  ** FaceFX animations are referred to as a group/animation name.
8572  ** This function allows you to set the current group once.
8573  ** See diguyScenario::facefx_mount_animset() for how to load a new
8574  ** animset on an actor.
8575  */
8576  int set_current_facefx_animation_group(const char* anim_group);
8577 
8578  /*l
8579  *b Returns:
8580  **
8581  ** the current FaceFX animation group set for this character
8582  */
8583  const char* get_current_facefx_animation_group();
8584 
8585  /*l
8586  *b Returns:
8587  **
8588  ** the name of the FaceFX actor that goes with the current head
8589  ** appearance; returns NULL if there's no FaceFX actor
8590  */
8591  const char* get_facefx_actor();
8592 
8593  /*l
8594  *b Description:
8595  **
8596  ** Mounts an animset on the current FaceFX actor. See also
8597  ** diguyScenario::facefx_mount_animset()
8598  */
8599  int facefx_mount_animset(const char* file_name);
8600 
8601  /*l
8602  *b Description:
8603  **
8604  ** Plays a FaceFX animation. This is the main way a facial animation
8605  ** sequence is triggered. The animation can be named
8606  ** "group_name/animation" or just "animation" if the proper group has
8607  ** been set with set_current_facefx_animation_group().
8608  */
8609  int play_facefx_animation(const char* animation,
8610  float magnitude_scale = 1.0f,
8611  float duration_scale = 1.0f,
8612  float blendin_time = 0.1f,
8613  float blendout_time = 0.1f,
8614  int loop = 0);
8615 
8616  /*l
8617  *b Description:
8618  **
8619  ** Stops all active FaceFX animations.
8620  */
8621  int stop_facefx_animations(float blend_time = 0.25f, int stop_sounds = 1);
8622 
8623  /*****************************************************************************/
8628  /*l
8629  *b Returns:
8630  **
8631  ** the number of nodes in the FaceFX actor's face graph
8632  */
8633  int get_num_facefx_nodes();
8634 
8635  /*l
8636  *b Returns:
8637  **
8638  ** the name of the node with index 'index' in the FaceFX actor's face
8639  ** graph
8640  */
8641  const char* get_facefx_node_name(int index);
8642 
8643  /*l
8644  *b Returns:
8645  **
8646  ** the index of the node with name 'node_name'
8647  */
8648  int find_facefx_node_index(const char* node_name);
8649 
8650  /*l
8651  *b Description:
8652  **
8653  ** Allows low level control of individual nodes of the characters face
8654  ** graph. End users can use this function to get finer grained
8655  ** control over eye direction and emotional state.
8656  */
8657  int set_facefx_node_value(int node_index,
8658  float value,
8659  float blend_time = 0.25f);
8660 
8661  /*l
8662  *b Description:
8663  **
8664  ** Retrieves the current final value of a node
8665  **/
8666  float get_facefx_node_value(int node_index);
8667 
8668 /*****************************************************************************/
8712  /*l
8713  *b Description:
8714  **
8715  ** This function creates (but does not begin) the specified gesture.
8716  ** Exact control over the gesture, such as number of repetitions,
8717  ** when the gesture should begin, when it should end, when it
8718  ** should reach specific points within the gestures, etc., is then
8719  ** possible by making calls through the returned
8720  ** diguyCharacterGesture object.
8721  **
8722  ** To begin execution of the gesture, call the begin_now() function
8723  ** of the diguyCharacterGesture object.
8724  **
8725  ** *Do not* call delete on the returned object. It should be
8726  ** destroyed either by calling destroy_gesture(), or by calling
8727  ** set_automatic_destroy_flag(1) on the diguyCharacterGesture
8728  ** object.
8729  **
8730  *b Arguments:
8731  **
8732  *a gesture_name - name of the gesture of create
8733  **
8734  *b Returns:
8735  **
8736  ** pointer to object of type diguyCharacterGesture
8737  */
8738  diguyCharacterGesture* create_gesture(const char* gesture_name);
8739 
8740  /*l
8741  *b Description:
8742  **
8743  ** This function destroys a gesture object created by
8744  ** create_gesture().
8745  **
8746  *b Arguments:
8747  **
8748  *a gesture - gesture to destroy
8749  **
8750  *b Returns:
8751  **
8752  ** 0 on success, -1 on failure
8753  */
8754  int destroy_gesture(diguyCharacterGesture* gesture);
8755 
8756  /*l
8757  *b Description:
8758  **
8759  ** This function executes the specified gesture or motion file on disk.
8760  **
8761  ** The gesture will automatically begin and end. The only control
8762  ** over the executed gesture is whether is should be ended or aborted
8763  ** early. See end_executing_gesture() and abort_executing_gesture().
8764  ** For full control of gesture attributes, use create_gesture()
8765  ** instead.
8766  **
8767  ** A gesture takes over control of a subset of a character's pose
8768  ** variables and can be overlaid on top of most base actions of the
8769  ** character.
8770  **
8771  ** Note that gestures should be preloaded at the beginning of a
8772  ** scenario to avoid a hitch in frame rate. See the function
8773  ** diguyScenario::preload_gesture().
8774  **
8775  ** This function will have no effect on a dead character (see
8776  ** die_now() and get_dead()).
8777  **
8778  *b Arguments:
8779  **
8780  *a gesture_name - name of the gesture to execute, as of diguy 13.2 this can be
8781  *a a bdm file, and a full body gesture will be created on the fly.
8782  *a reps - how many times the gesture should be
8783  *a repeated; default is 1 if no duration
8784  *a is specified, or best fit if there is
8785  *a a duration specified
8786  *a overall_duration - for how long the gesture should be executed;
8787  *a default is such that no time scaling occurs
8788  *a channel_A_weight - the weight given to channel A of the
8789  *a gesture; ignored if the gesture does not
8790  *a have multiple channels
8791  **
8792  ** If the gesture is a multi-stage gesture, the overall duration
8793  ** will be spread proportionately over each stage.
8794  **
8795  *b Returns:
8796  **
8797  ** 0 on success, -1 on failure
8798  **
8799  *b Available as Decision Bead/Event
8800  */
8801  int execute_gesture(const char* gesture_name,
8802  int reps = DIGUY_DEFAULT_INT,
8803  float overall_duration = DIGUY_DEFAULT_FLOAT,
8804  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8805 
8806  /*l
8807  *b Description:
8808  **
8809  ** The gesture will automatically begin and end. The only control
8810  ** over the executed gesture is whether is should be ended or aborted
8811  ** early. See end_executing_gesture() and abort_executing_gesture().
8812  ** For full control of gesture attributes, use create_gesture()
8813  ** instead.
8814  **
8815  ** If the specified gesture is not a 1 stage gesture, no gesture
8816  ** is executed and an error value is returned.
8817  **
8818  ** The specified gesture can be a one or two channel 1 stage gesture,
8819  ** in which case the specified channel weight will be used over the
8820  ** course of the entire gesture.
8821  **
8822  ** A 1 stage gesture is a comprised of a single motion that begins
8823  ** and ends the gesture.
8824  **
8825  ** n repetitions of a 1 stage gesture will repeat the stage 1
8826  ** motion n times.
8827  **
8828  ** This function will have no effect on a dead character (see
8829  ** die_now() and get_dead()).
8830  **
8831  *b Arguments:
8832  **
8833  *a gesture_name - name of the gesture of execute
8834  *a reps - how many times the gesture should be
8835  *a repeated; default is 1 if no duration
8836  *a is specified, or best fit if there is
8837  *a a duration specified
8838  *a stage1_duration - how long stage 1 of the gesture should take;
8839  *a default is such that no time scaling occurs
8840  *a channel_A_weight - the weight given to channel A of the
8841  *a gesture; ignored if the gesture does not
8842  *a have multiple channels
8843  **
8844  *b Returns:
8845  **
8846  ** 0 on success, -1 on failure
8847  */
8848  int execute_1stage_gesture(const char* gesture_name,
8849  int reps = DIGUY_DEFAULT_INT,
8850  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8851  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8852 
8853  /*l
8854  *b Description:
8855  **
8856  ** This function is similar to execute_1stage_gesture().
8857  **
8858  ** Stage 1 of a 2 stage gesture is a motion that begins the gesture
8859  ** and leads to the "peak" of the gesture.
8860  **
8861  ** Stage 2 of a 2 stage gesture is the motion that returns the
8862  ** gesture from the "peak" to the starting position.
8863  **
8864  ** n repetitions of a 2 stage gesture will repeat the stage 1 motion
8865  ** followed by the stage 2 motion n times.
8866  **
8867  ** This function will have no effect on a dead character (see
8868  ** die_now() and get_dead()).
8869  **
8870  *b Arguments:
8871  **
8872  *a gesture_name - name of the gesture of execute
8873  *a reps - how many times the gesture should be
8874  *a repeated; default is 1 if no duration
8875  *a is specified, or best fit if there is
8876  *a a duration specified
8877  *a stage1_duration - how long stage 1 of the gesture should take,
8878  *a i.e., how far into the gesture the "peak"
8879  *a will occur;
8880  *a default is such that no time scaling occurs
8881  *a stage2_duration - how long stage 2 of the gesture should take;
8882  *a default is such that no time scaling occurs
8883  *a channel_A_weight - the weight given to channel A of the
8884  *a gesture; ignored if the gesture does not
8885  *a have multiple channels
8886  **
8887  *b Returns:
8888  **
8889  ** 0 on success, -1 on failure
8890  */
8891  int execute_2stage_gesture(const char* gesture_name,
8892  int reps = DIGUY_DEFAULT_INT,
8893  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8894  float stage2_duration = DIGUY_DEFAULT_FLOAT,
8895  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8896 
8897  /*l
8898  *b Description:
8899  **
8900  ** This function is similar to execute_1stage_gesture().
8901  **
8902  ** Stage 1 of a 3 stage gesture is a motion that begins the gesture
8903  ** and leads to stage 2; e.g., raising the right arm in preparation
8904  ** for waving.
8905  **
8906  ** Stage 2 of a 3 stage gesture is a motion that can loop
8907  ** indefinitely; e.g., waving the right arm back and forth.
8908  **
8909  ** Stage 3 of a 3 stage gesture is the motion that ends the gesture;
8910  ** e.g., returning the right arm to the side of the body to complete
8911  ** the wave.
8912  **
8913  ** n repetitions of a 3 stage gesture will play the stage 1 motion
8914  ** once, followed by n reps of the stage 2 motion, followed by 1
8915  ** stage 3 motion.
8916  **
8917  ** This function will have no effect on a dead character (see
8918  ** die_now() and get_dead()).
8919  **
8920  *b Arguments:
8921  **
8922  *a gesture_name - name of the gesture of execute
8923  *a reps - how many times the gesture should be
8924  *a repeated; default is 1 if no duration
8925  *a is specified, or best fit if there is
8926  *a a duration specified
8927  *a stage1_duration - how long stage 1 of the gesture should take;
8928  *a default is such that no time scaling occurs
8929  *a stage2_duration - how long each repetition of stage 2 of the
8930  *a gesture should take;
8931  *a default is such that no time scaling occurs
8932  *a stage3_duration - how long stage 3 of the gesture should take;
8933  *a default is such that no time scaling occurs
8934  *a channel_A_weight - the weight given to channel A of the
8935  *a gesture; ignored if the gesture does not
8936  *a have multiple channels
8937  **
8938  *b Returns:
8939  **
8940  ** 0 on success, -1 on failure
8941  */
8942  int execute_3stage_gesture(const char* gesture_name,
8943  int reps = DIGUY_DEFAULT_INT,
8944  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8945  float stage2_duration = DIGUY_DEFAULT_FLOAT,
8946  float stage3_duration = DIGUY_DEFAULT_FLOAT,
8947  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8948 
8949  /*l
8950  *b Description:
8951  **
8952  ** The gesture will automatically begin and end. The only control
8953  ** over the executed gesture is whether is should be ended or aborted
8954  ** early. See end_executing_gesture() and abort_executing_gesture().
8955  ** For full control of gesture attributes, use create_gesture()
8956  ** instead.
8957  **
8958  ** This function serves as a quick way of executing a table gesture.
8959  ** There are many capabilities of table gestures that are accessible
8960  ** only through the full diguyCharacterGesture object.
8961  **
8962  ** If the specified gesture is not a table gesture, no gesture is
8963  ** executed and an error value is returned.
8964  **
8965  ** A table stage gesture is a comprised of a table of gesture actions
8966  ** that can be transitioned between without going through a neutral
8967  ** position.
8968  **
8969  ** n repetitions of a table gesture will repeat the loop action
8970  ** n times.
8971  **
8972  ** This function will have no effect on a dead character (see
8973  ** die_now() and get_dead()).
8974  **
8975  *b Arguments:
8976  **
8977  *a gesture_name - name of the gesture of execute
8978  *a reps - how many times the gesture should be repeated;
8979  *a default is 1
8980  *a loop_action - which action in the gesture should be looped;
8981  *a default is action at index 1 of table
8982  *a begin_action - which action the gesture should begin from;
8983  *a default is action at index 0
8984  *a end_action - which action the gesture should end at;
8985  *a default is action at index 0
8986  **
8987  *b Returns:
8988  **
8989  ** 0 on success, -1 on failure
8990  */
8991  int execute_table_gesture(const char* gesture_name,
8992  int reps = DIGUY_DEFAULT_INT,
8993  const char* loop_action = NULL,
8994  const char* begin_action = NULL,
8995  const char* end_action = NULL);
8996 
8997  /*l
8998  *b Description:
8999  **
9000  ** Executes the given gesture and performs the given action as a table action.
9001  **
9002  *b Arguments:
9003  **
9004  *a gesture_name - name of the gesture to execute
9005  *a desired_action - name of table action to perform
9006  **
9007  *b Returns:
9008  **
9009  ** 0 on success, -1 on failure
9010  **
9011  **/
9012  int set_executing_table_gesture_desired_action(const char* gesture_name,
9013  const char* desired_action);
9014 
9015  /*l
9016  *b Description:
9017  **
9018  ** This function alerts the specified gesture that it should end.
9019  ** The gesture will stop repeating and play its "out" motions as
9020  ** soon as possible.
9021  **
9022  ** In order to immediately stop the gesture, use the
9023  ** abort_executing_gesture() function.
9024  **
9025  *b Arguments:
9026  **
9027  *a gesture_name - name of executing gesture to end
9028  **
9029  *b Returns:
9030  **
9031  ** 0 on success, -1 on failure
9032  **
9033  *b See Also:
9034  **
9035  ** abort_executing_gesture()
9036  */
9037  int end_executing_gesture(const char* gesture_name);
9038 
9039  /*l
9040  *b Description:
9041  **
9042  ** This function aborts a gesture previously executed by one of
9043  ** the execute_*_gesture() calls, if it is currently executing.
9044  ** If a gesture with the given name is not executing, this function
9045  ** will have no effect.
9046  **
9047  ** This call won't cause the gesture to switch to its "out" motion;
9048  ** it is a straight-forward blend out of whatever the gesture is
9049  ** currently doing. Use the end_executing_gesture() call to make
9050  ** the gesture play its "out" motion as soon as possible,
9051  ** therefore ending the gesture in a smoother way.
9052  **
9053  *b Arguments:
9054  **
9055  *a gesture_name - name of executing gesture to abort
9056  *a max_rampdown_interval - max amount of time spent trying to
9057  *a smooth over any motion seams; set
9058  *a to 0.5 for a smooth transition, set
9059  *a to 0 for an immediate abort
9060  **
9061  *b Returns:
9062  **
9063  ** 0 on success, -1 on failure
9064  **
9065  *b See Also:
9066  **
9067  ** end_executing_gesture(), abort_all_gestures()
9068  */
9069  int abort_executing_gesture(const char* gesture_name,
9070  float max_rampdown_interval = .5f);
9071 
9072  /*l
9073  *b Description:
9074  **
9075  ** This function alerts all active gestures that they should end.
9076  ** The gestures will stop repeating and play their "out" motions as
9077  ** soon as possible.
9078  **
9079  ** In order to immediately stop all gestures, use the
9080  ** abort_all_gestures() function.
9081  **
9082  *b Returns:
9083  **
9084  ** 0 on success, -1 on failure
9085  **
9086  *b See Also:
9087  **
9088  ** abort_all_gestures(), diguyCharacterGesture::end_gesture()
9089  */
9090  int end_all_gestures();
9091 
9092  /*l
9093  *b Description:
9094  **
9095  ** This function aborts all active gestures. All gestures will
9096  ** immediately begin to lose their effect on the
9097  ** character's pose.
9098  **
9099  ** This won't cause the gestures to switch to their "out" motions;
9100  ** it is a straight-forward blend out of whatever the gesture is
9101  ** currently doing. Use the end_all_gestures() call to make all
9102  ** active gestures play their "out" motions as soon as possible,
9103  ** therefore ending the gestures in a smoother way.
9104  **
9105  *b Arguments:
9106  **
9107  *a max_rampdown_interval - max amount of time spent trying to
9108  *a smooth over any motion seams; set
9109  *a to 0.5 for a smooth transition, set
9110  *a to 0 for an immediate abort
9111  **
9112  *b Returns:
9113  **
9114  ** 0 on success, -1 on failure
9115  **
9116  *b See Also:
9117  **
9118  ** end_all_gestures(), diguyCharacterGesture::abort_now()
9119  */
9120  int abort_all_gestures(float max_rampdown_interval);
9121 
9122 
9123 /*****************************************************************************/
9155  /*l
9156  *b Description:
9157  **
9158  ** This function will play the specified sound. The sound will be
9159  ** "ambient"; i.e., it will be equally audible from everywhere within
9160  ** the world. Use the function play_3d_sound() to play a sound that
9161  ** moves with the character.
9162  **
9163  ** This function will have no effect on a dead character (see
9164  ** die_now() and get_dead()).
9165  **
9166  ** Unless the sound loops, the sound will play to completion and then
9167  ** stop. To stop the sound early or stop a looping sound call
9168  ** diguyCharacter::stop_all_sounds() or diguyCharacter::stop_sound().
9169  **
9170  *b Arguments
9171  **
9172  *a sound_name - name of sound to play
9173  *a sound_gain - by how much sound's amplitude should be multiplied
9174  *a sound_loop - indicates that sound should loop indefinitely
9175  **
9176  ** There must be a diguySound in the scenario with the passed
9177  ** sound_name. See diguyScenario::create_sound().
9178  **
9179  ** See set_current_voice_actor() for information on how a voice actor
9180  ** can change which sound in the scenario is selected.
9181  **
9182  *b Returns:
9183  **
9184  ** 0 on success, -1 on failure
9185  **
9186  *b Available as Decision Bead/Event
9187  */
9188  int play_sound(const char* sound_name,
9189  float sound_gain = 1.0f,
9190  int sound_loops = 0);
9191 
9192  /*l
9193  *b Description:
9194  **
9195  ** This function will play the specified sound at the character's
9196  ** location. As the character moves, the sound will move with it.
9197  ** Use the function play_sound() to play a sound that is ambient and
9198  ** does not move with the character.
9199  **
9200  ** Note that not all sound modules support 3D sounds.
9201  **
9202  ** This function will have no effect on a dead character (see
9203  ** die_now() and get_dead()).
9204  **
9205  ** Unless the sound loops, the sound will play to completion and then
9206  ** stop. To stop the sound early or stop a looping sound call
9207  ** diguyCharacter::stop_all_sounds() or diguyCharacter::stop_sound().
9208  **
9209  *b Arguments
9210  **
9211  *a sound_name - the name of the sound to play
9212  *a sound_gain - by how much the sound's amplitude
9213  *a should be multiplied
9214  *a sound_loop - indicates that the sound should loop
9215  *a indefinitely
9216  **
9217  ** There must be a diguySound in the scenario with the passed
9218  ** sound_name. See diguyScenario::create_sound().
9219  **
9220  ** See set_current_voice_actor() for information on how a voice actor
9221  ** can change which sound in the scenario is selected.
9222  **
9223  *b Returns:
9224  **
9225  ** 0 on success, -1 on failure
9226  **
9227  *b Available as Decision Bead/Event
9228  */
9229  int play_3d_sound(const char* sound_name,
9230  float sound_gain = 1.0f,
9231  int sound_loops = 0);
9232 
9233  /*l
9234  *b Description:
9235  **
9236  ** This function creates (but does not start playing) an instance of
9237  ** the specified sound.
9238  **
9239  ** Exact control over the sound instance is possible by making calls
9240  ** through the returned diguySoundInstance object.
9241  **
9242  ** To begin playing the sound, call diguySoundInstance::begin_now().
9243  **
9244  ** *Do not* call delete on the returned object. It should be
9245  ** destroyed either by calling diguyCharacter::destroy_sound_instance()
9246  ** or by calling diguySoundInstance::set_automatic_destroy_flag(1) on
9247  ** the returned object.
9248  **
9249  *b Arguments:
9250  **
9251  *a sound_name - name of the sound for which to create an instance
9252  **
9253  ** There must be a diguySound in the scenario with the passed
9254  ** sound_name. See diguyScenario::create_sound().
9255  **
9256  *b Returns:
9257  **
9258  ** pointer to object of type diguySoundInstance
9259  */
9260  diguySoundInstance* create_sound_instance(const char* sound_name);
9261 
9262  /*l
9263  *b Description:
9264  **
9265  ** This function destroys a sound instance object created by
9266  ** create_sound_instance().
9267  **
9268  ** Do not destroy a sound for which the
9269  ** diguySoundInstance::set_automatic_destroy_flag(1) has been called.
9270  **
9271  *b Arguments:
9272  **
9273  *a sound_instance - sound instance to destroy
9274  **
9275  *b Returns:
9276  **
9277  ** 0 on success, -1 on failure
9278  */
9279  int destroy_sound_instance(diguySoundInstance* sound_instance);
9280 
9281  /*l
9282  *b Description:
9283  **
9284  ** This function stops all active sound instances from this character.
9285  ** All sounds being played by this character will fade out and stop
9286  ** after rampdown_time, by default fade out is instant.
9287  **
9288  ** Sound instances that are automatically managed will be destroyed.
9289  ** This includes sound started by a call to
9290  ** diguyCharacter::play_sound() or a sound instance whose
9291  ** set_automatic_destroy_flag() function has been called.
9292  **
9293  ** diguySoundInstance pointers returned by a call to
9294  ** diguyCharacter::create_sound_instance(), which have not been set to
9295  ** be automatically destroyed, will still be valid.
9296  **
9297  *b Arguments:
9298  **
9299  *a rampdown_time - how long to fade out the sound
9300  **
9301  *b Returns:
9302  **
9303  ** 0 on success, -1 on failure
9304  **
9305  *b Available as Decision Bead/Event
9306  */
9307  int stop_all_sounds(float rampdown_time = 0.0f);
9308 
9309  /*l
9310  *b Description:
9311  **
9312  ** This function stops a named sound instance from this character.
9313  **
9314  ** Sound instances that are automatically managed will be destroyed.
9315  ** This includes sound started by a call to
9316  ** diguyCharacter::play_sound() or a sound instance whose
9317  ** set_automatic_destroy_flag() function has been called.
9318  **
9319  ** diguySoundInstance pointers returned by a call to
9320  ** diguyCharacter::create_sound_instance(), which have not been set to
9321  ** be automatically destroyed, will still be valid.
9322  **
9323  *b Arguments:
9324  **
9325  *a sound_name - the name of the sound to stop
9326  *a rampdown_time - how long to fade out the sound
9327  **
9328  *b Returns:
9329  **
9330  ** 0 on success, -1 on failure
9331  **
9332  *b Available as Decision Bead/Event
9333  */
9334  int stop_sound(const char* sound_name, float rampdown_time = 0.0f);
9335 
9336  /*l
9337  *b Returns:
9338  **
9339  ** 1 if the character is playing a the sound specified, 0 if not
9340  */
9341  int is_playing_sound(const char* sound_name);
9342 
9343  /*l
9344  *b Description:
9345  **
9346  ** Sets the "voice actor" for the character.
9347  **
9348  ** Having a voice actor can change which sounds from the scenario a
9349  ** character selects when the diguyCharacter::play_sound() or
9350  ** diguyCharacter::play_3d_sound().
9351  **
9352  ** When play_sound() is called the character asks the scenario for
9353  ** the sound with the specified name. If a voice actor has been set
9354  ** the character will first ask the scenario for the sound name
9355  ** prepended with the voice actor and a slash ("/"). If there isn't
9356  ** a sound with that modified name, it will ask the scenario for a
9357  ** sound with the exact specified name.
9358  **
9359  ** For example, if the character has the voice actor "carl" and is
9360  ** told to play the sound "run_away", the character will first look
9361  ** for a sound named "carl/run_away". If that isn't found, it will
9362  ** look for a sound named "run_away". (If that isn't found no sound
9363  ** is played.)
9364  **
9365  *b Lua Example:
9366  **
9367  ** A more specific example: say that various characters in the
9368  ** scenario need to say "hello". Some of the characters are male,
9369  ** some are female. There are two ways this can be set up.
9370  **
9371  ** The first way, not using a voice actor, is to have two sounds
9372  ** specified in the scenario: "male_hello" and "female_hello". These
9373  ** sounds specify the sound files "male_hello.wav" and
9374  ** "female_hello.wav", respectively. A male character would then do
9375  ** the following to say hello:
9376  **
9377  *e male_character:play_sound("male_hello")
9378  **
9379  ** A female character would do:
9380  **
9381  *e female_character:play_sound("female_hello")
9382  **
9383  ** This is fine, except when one script or character mind needs to be
9384  ** shared by a range of characters, some male and some female.
9385  **
9386  ** In this case it's better to use a voice actor. Say that the sounds
9387  ** specified above have the names "male/hello" and "female/hello";
9388  ** they still have the separate sound files specified. If the
9389  ** character has its voice actor specified as "male" and is told to
9390  ** play the sound "hello", it will select the sound "male/hello" as
9391  ** the sound to play. If its voice actor is "female" and is told to
9392  ** play the sound "hello", it will select the sound "female/hello".
9393  **
9394  *e -- called earlier: character:set_voice_actor("male")
9395  *e character:play_sound("hello") -- plays sound "male/hello"
9396  **
9397  *e -- called earlier: character:set_voice_actor("female")
9398  *e character:play_sound("hello") -- plays sound "female/hello"
9399  **
9400  *b Arguments:
9401  **
9402  *a voice_actor - name of voice actor
9403  **
9404  ** voice_actor can be an arbitrary string. It doesn't need to match
9405  ** any character name, but should have matching sounds specified in
9406  ** the scenario.
9407  **
9408  *b Returns:
9409  **
9410  ** 0 on success, -1 on failure
9411  */
9412  int set_current_voice_actor(const char* voice_actor);
9413 
9415  const char* get_current_voice_actor();
9416 
9417 
9418 /*****************************************************************************/
9454  /*l
9455  *b Description:
9456  **
9457  ** This function returns the state of the character in the form
9458  ** required by DIS.
9459  **
9460  ** Note that there is no corresponding set_DIS_lifeform_state()
9461  ** function. The lifeform state is derived from the character's
9462  ** action, posture, and variant information.
9463  **
9464  *b Returns:
9465  **
9466  ** one of the following values defined in diguy_dis_constants.h:
9467  **
9468  *- DIGUY_DIS_LIFEFORM_UNUSED (0)
9469  *- DIGUY_DIS_LIFEFORM_UPRIGHT_STANDING_STILL (1)
9470  *- DIGUY_DIS_LIFEFORM_UPRIGHT_WALKING (2)
9471  *- DIGUY_DIS_LIFEFORM_UPRIGHT_RUNNING (3)
9472  *- DIGUY_DIS_LIFEFORM_KNEELING (4)
9473  *- DIGUY_DIS_LIFEFORM_PRONE (5)
9474  *- DIGUY_DIS_LIFEFORM_CRAWLING (6)
9475  *- DIGUY_DIS_LIFEFORM_SWIMMING (7)
9476  *- DIGUY_DIS_LIFEFORM_PARACHUTING (8)
9477  *- DIGUY_DIS_LIFEFORM_JUMPING (9)
9478  *- DIGUY_DIS_LIFEFORM_SITTING (10)
9479  *- DIGUY_DIS_LIFEFORM_SQUATTING (11)
9480  *- DIGUY_DIS_LIFEFORM_CROUCHING (12)
9481  *- DIGUY_DIS_LIFEFORM_WADING (13)
9482  **
9483  *b Callable For Networked Entities That Are:
9484  **
9485  *- - DIS published and reflected
9486  */
9487  int get_DIS_lifeform_state();
9488 
9489  /*l
9490  *b Description:
9491  **
9492  ** This function returns the position of the character's
9493  ** primary weapon, in the form required by DIS.
9494  **
9495  *b Returns:
9496  **
9497  ** one of the following values defined in diguy_dis_constants.h:
9498  **
9499  *- DIGUY_DIS_PRIMARY_WEAPON_NOT_PRESENT (0)
9500  *- DIGUY_DIS_PRIMARY_WEAPON_STOWED (1)
9501  *- DIGUY_DIS_PRIMARY_WEAPON_DEPLOYED (2)
9502  *- DIGUY_DIS_PRIMARY_WEAPON_IN_FIRING_POSITION (3)
9503  **
9504  *b Callable For Networked Entities That Are:
9505  **
9506  *- - DIS published
9507  */
9508  int get_DIS_primary_weapon_position();
9509 
9510  /*l
9511  *b Description:
9512  **
9513  ** This function returns the position of the character's
9514  ** secondary weapon, in the form required by DIS.
9515  **
9516  *b Returns:
9517  **
9518  ** one of the following values defined in diguy_dis_constants.h:
9519  **
9520  *- DIGUY_DIS_SECONDARY_WEAPON_NOT_PRESENT (0)
9521  *- DIGUY_DIS_SECONDARY_WEAPON_STOWED (1)
9522  *- DIGUY_DIS_SECONDARY_WEAPON_DEPLOYED (2)
9523  *- DIGUY_DIS_SECONDARY_WEAPON_IN_FIRING_POSITION (3)
9524  **
9525  *b Callable For Networked Entities That Are:
9526  **
9527  *- - DIS published
9528  */
9529  int get_DIS_secondary_weapon_position();
9530 
9531  /*l
9532  *b Description:
9533  **
9534  ** This function sets the Marking Text for characters that are
9535  ** published to the network by DI-Guy Networking. The default
9536  ** network marking is the empty string "".
9537  **
9538  ** This function should only be called for published characters.
9539  ** The Marking Text is set internally for reflected characters.
9540  **
9541  *b Returns:
9542  **
9543  ** 0 on success, -1 on failure
9544  **
9545  *b Callable For Networked Entities That Are:
9546  **
9547  *- - DIS published
9548  *- - HLA published
9549  */
9550  int set_network_marking(const char* network_marking);
9551 
9552  /*l
9553  *b Description:
9554  **
9555  ** This function gets the Marking Text for characters.
9556  **
9557  ** For published characters this value will be what was most
9558  ** recently set by set_network_marking().
9559  **
9560  ** For reflected characters this value will be read from the
9561  ** reflected characters' entity state information.
9562  **
9563  *b Returns:
9564  **
9565  ** character's Marking Text; will never be NULL
9566  **
9567  *b Callable For Networked Entities That Are:
9568  **
9569  *- - DIS published and reflected
9570  *- - HLA published and reflected
9571  */
9572  const char* get_network_marking();
9573 
9574  /*l
9575  *b Description:
9576  **
9577  ** This function sets whether this character will be published
9578  ** by DI-Guy Networking. This value is persistent, and does
9579  ** not depend on whether there actually *is* currently a
9580  ** network connection.
9581  **
9582  ** The default is 1, the character is published.
9583  **
9584  ** This function should *not* be called for reflected characters.
9585  ** It affects to both DIS and HLA networking.
9586  **
9587  *b Returns:
9588  **
9589  ** 0 on success, -1 on failure
9590  **
9591  *b Callable For Networked Entities That Are:
9592  **
9593  *- - DIS published
9594  *- - HLA published
9595  */
9596  int set_is_network_published(int is_network_published);
9597 
9598  /*l
9599  *b Description:
9600  **
9601  ** This function returns whether the character is published
9602  ** by DI-Guy Networking. It will always return 0 for reflected
9603  ** characters.
9604  **
9605  ** This function can be called for any character.
9606  **
9607  *b Returns:
9608  **
9609  ** 1 if published, 0 if not
9610  **
9611  *b Available as Decision Bead/Event
9612  **
9613  *b Callable For Networked Entities That Are:
9614  **
9615  *- - DIS published and reflected
9616  *- - HLA published and reflected
9617  */
9618  int get_is_network_published();
9619 
9620  /*l
9621  *b Description:
9622  **
9623  ** Experimental function that returns a vrlink entity state repository,
9624  ** useful for adding additional information to a diguy that we don't usually
9625  ** model.
9626  */
9627  DtEntityStateRepository * get_vrlink_entity_state_repository();
9628 
9629  /*l
9630  *b Description:
9631  **
9632  ** This function returns whether the character is a
9633  ** reflected character created by DI-Guy Networking.
9634  **
9635  ** This function can be called for any character.
9636  **
9637  *b Returns:
9638  **
9639  ** 1 if reflected, 0 if not
9640  **
9641  *b Available as Decision Bead/Event
9642  **
9643  *b Callable For Networked Entities That Are:
9644  **
9645  *- - DIS published and reflected
9646  *- - HLA published and reflected
9647  */
9648  int get_is_network_reflected();
9649 
9650  /*l
9651  *b Description:
9652  **
9653  ** This function returns whether this character is in a
9654  ** "paused" state. This will only be true for reflected
9655  ** characters.
9656  **
9657  ** A reflected character will be paused if the network
9658  ** entity it is representing is paused; i.e., its personal
9659  ** timeline is not advancing. The most common case of this
9660  ** is when this character is reflecting a published character
9661  ** of a DI-Guy Scenario application that is in a paused or
9662  ** stopped state.
9663  **
9664  ** If DI-Guy Scenario, paused characters will remain frozen
9665  ** in their current postures.
9666  **
9667  *b Returns:
9668  **
9669  ** 1 if paused, 0 if not
9670  **
9671  *b Available as Decision Bead/Event
9672  */
9673  int get_is_network_paused();
9674 
9675  /*l
9676  *b Description:
9677  **
9678  ** Overrides built-in logic for network pausing, becomes end user's responsibility
9679  ** to manage
9680  */
9681  int set_is_network_paused(int paused);
9682 
9683  /*l
9684  *b Description:
9685  **
9686  ** This function returns the character's "network entity number".
9687  ** This number is valid and persistent regardless of whether the
9688  ** character is currently published.
9689  **
9690  ** This number is primarily used internally by DI-Guy Networking
9691  ** for creating entity IDs.
9692  **
9693  *b Returns:
9694  **
9695  ** character's network entity number
9696  **
9697  *b Callable For Networked Entities That Are:
9698  **
9699  *- - DIS published and reflected
9700  *- - HLA published and reflected
9701  */
9702  int get_network_entity_number();
9703 
9704  /*l
9705  *b Description:
9706  **
9707  ** This function returns the name of an action for a character,
9708  ** given the DIS damage state, lifeform state, primary weapon
9709  ** state, speed of the character, and direction of travel.
9710  ** Constants are all defined in diguy_dis_constants.h:
9711  **
9712  *b Arguments:
9713  **
9714  *a damage_state - one of the values listed below
9715  *a life_form_state - one of the values listed below
9716  *a primary_weapon_state - one of the values listed below
9717  *a speed - in meters/second
9718  *a forward - whether the action should move
9719  *a forward (pass 1), or backward (pass 0)
9720  **
9721  ** Valid values for damage_state:
9722  **
9723  *- - DIGUY_DIS_DAMAGE_NONE (0)
9724  *- - DIGUY_DIS_DAMAGE_SLIGHT (1)
9725  *- - DIGUY_DIS_DAMAGE_MODERATE (2)
9726  *- - DIGUY_DIS_DAMAGE_DESTROYED (3)
9727  **
9728  ** Valid values for life_form_state:
9729  **
9730  *- - DIGUY_DIS_LIFEFORM_UNUSED (0)
9731  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_STANDING_STILL (1)
9732  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_WALKING (2)
9733  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_RUNNING (3)
9734  *- - DIGUY_DIS_LIFEFORM_KNEELING (4)
9735  *- - DIGUY_DIS_LIFEFORM_PRONE (5)
9736  *- - DIGUY_DIS_LIFEFORM_CRAWLING (6)
9737  *- - DIGUY_DIS_LIFEFORM_SWIMMING (7)
9738  *- - DIGUY_DIS_LIFEFORM_PARACHUTING (8)
9739  *- - DIGUY_DIS_LIFEFORM_JUMPING (9)
9740  *- - DIGUY_DIS_LIFEFORM_SITTING (10)
9741  *- - DIGUY_DIS_LIFEFORM_SQUATTING (11)
9742  *- - DIGUY_DIS_LIFEFORM_CROUCHING (12)
9743  *- - DIGUY_DIS_LIFEFORM_WADING (13)
9744  **
9745  ** Valid values for primary_weapon_state:
9746  **
9747  *- - DIGUY_DIS_PRIMARY_WEAPON_NOT_PRESENT (0)
9748  *- - DIGUY_DIS_PRIMARY_WEAPON_STOWED (1)
9749  *- - DIGUY_DIS_PRIMARY_WEAPON_DEPLOYED (2)
9750  *- - DIGUY_DIS_PRIMARY_WEAPON_IN_FIRING_POSITION (3)
9751  **
9752  ** Note that a backward motion can be requested in a couple of
9753  ** ways: either by passing a negative speed, or by passing
9754  ** 0 for the forward argument, or both.
9755  **
9756  *b Returns:
9757  **
9758  ** name of an action if a match is found, NULL if not
9759  **
9760  *b Callable For Networked Entities That Are:
9761  **
9762  *- - DIS published
9763  */
9764  const char* get_action_from_entity_state(int damage_state,
9765  int life_form_state,
9766  int primary_weapon_state,
9767  float speed,
9768  int forward);
9769 
9770  /*l
9771  *b Description:
9772  **
9773  ** Sets the damage state for the network published character.
9774  ** Depending on the appearance configuration info the character may automatically switch to a new appearance.
9775  **
9776  *b Arguments:
9777  **
9778  *a state - one of the values listed below
9779  **
9780  ** Valid values for state (defined in diguy_dis_constants.h):
9781  **
9782  *- - DIGUY_DIS_DAMAGE_NONE (0)
9783  *- - DIGUY_DIS_DAMAGE_SLIGHT (1)
9784  *- - DIGUY_DIS_DAMAGE_MODERATE (2)
9785  *- - DIGUY_DIS_DAMAGE_DESTROYED (3)
9786  **
9787  *b Callable For Networked Entities That Are:
9788  **
9789  *- - DIS published
9790  */
9791  void set_DIS_damage_state(int state);
9792 
9795  int get_DIS_damage_state();
9796 
9797  /*l
9798  *b Description:
9799  **
9800  ** Returns the name of damage state appearances based on the base appearance of the character.
9801  ** NULL if there is no appearance specified.
9802  */
9803  const char * get_damage_state_appearance_name(int state);
9804 
9805  /*l
9806  *b Description:
9807  **
9808  ** Sets the smoke state for a network published character.
9809  ** Starts or stops the "smoke" and "engine_smoke" appearance
9810  ** effects as appropriate.
9811  **
9812  *b Arguments:
9813  **
9814  *a state - one of the values listed below
9815  **
9816  ** Valid values for state (defined in diguy_dis_constants.h):
9817  **
9818  *- - DIGUY_DIS_SMOKE_NOT_SMOKING (0)
9819  *- - DIGUY_DIS_SMOKE_SMOKE_PLUME (1)
9820  *- - DIGUY_DIS_SMOKE_ENGINE_SMOKE (2)
9821  *- - DIGUY_DIS_SMOKE_ENGINE_SMOKE_AND_SMOKE_PLUME (3)
9822  **
9823  *b Callable For Networked Entities That Are:
9824  **
9825  *- - DIS published
9826  */
9827  void set_DIS_smoke_state(int state);
9828 
9831  int get_DIS_smoke_state();
9832 
9833  /*l
9834  *b Description:
9835  **
9836  ** Sets the flames state for a network published character.
9837  ** Starts or stops the "flames" appearance effect as appropriate.
9838  **
9839  *b Arguments:
9840  **
9841  ** state - one of the values listed below
9842  **
9843  ** Valid values for state (defined in diguy_dis_constants.h):
9844  **
9845  *- - DIGUY_DIS_FLAMES_NONE (0)
9846  *- - DIGUY_DIS_FLAMES_PRESENT (1)
9847  **
9848  *b Callable For Networked Entities That Are:
9849  **
9850  *- - DIS published
9851  */
9852  void set_DIS_flames_state(int state);
9853 
9856  int get_DIS_flames_state();
9857 
9858  /*l
9859  *b Description:
9860  **
9861  ** Sets the power plant state for a network published character.
9862  ** Vehicle power plants default to being on.
9863  **
9864  *b Arguments:
9865  **
9866  ** state - one of the values listed below
9867  **
9868  ** Valid values for state (defined in diguy_dis_constants.h):
9869  **
9870  *- - DIGUY_DIS_POWER_PLANT_OFF (0)
9871  *- - DIGUY_DIS_POWER_PLANT_ON (1)
9872  **
9873  *b Callable For Networked Entities That Are:
9874  **
9875  *- - DIS published
9876  */
9877  void set_DIS_power_plant_state(int state);
9878 
9881  int get_DIS_power_plant_state();
9882 
9885  void set_emissivity(float r, float g, float b, float lerp_time = .25);
9886 
9889  void get_emissivity(float *r, float *g, float *b);
9890 
9891  /*l
9892  *b Description:
9893  **
9894  ** Sets the trailing effect state for a network published character.
9895  **
9896  *b Arguments:
9897  **
9898  ** state - one of the values listed below
9899  **
9900  ** Valid values for state (defined in diguy_dis_constants.h):
9901  **
9902  *- - DIGUY_DIS_TRAILING_EFFECT_NONE (0)
9903  *- - DIGUY_DIS_TRAILING_EFFECT_SMALL (1)
9904  *- - DIGUY_DIS_TRAILING_EFFECT_MEDIUM (2)
9905  *- - DIGUY_DIS_TRAILING_EFFECT_LARGE (3)
9906  **
9907  *b Callable For Networked Entities That Are:
9908  **
9909  *- - DIS published
9910  */
9911  void set_DIS_trailing_effect_state(int state);
9912 
9915  int get_DIS_trailing_effect_state();
9916 
9918  void set_DIS_station_name(int name);
9919  int get_DIS_station_name() const;
9920 
9922  void set_DIS_station_number(int number);
9923  int get_DIS_station_number() const;
9924 
9927  void set_head_lights_state(int state);
9928 
9930  int get_head_lights_state() const;
9931 
9933  void set_tail_lights_state(int state);
9934 
9936  int get_tail_lights_state() const;
9937 
9938 
9939 /*****************************************************************************/
9949  /*l
9950  *b Description:
9951  **
9952  ** This function will create a new active formation with this
9953  ** character as its leader. The formation followers will fall
9954  ** into the formation given by the formation name.
9955  **
9956  ** The formation is broken up, or disbanded, by calling
9957  ** break_formation().
9958  **
9959  *b Arguments:
9960  **
9961  *a formation_name - the name of the formation
9962  *a snap_to_position_flag - if 1, following characters will
9963  *a immediately snap to their assigned
9964  *a positions; otherwise following characters
9965  *a will move toward their assigned
9966  *a positions from their current positions
9967  *a break_existing_formations_flag - if 1, any formations this
9968  *a character is leading with be broken
9969  *a as if the break_formation() call were
9970  *a made
9971  **
9972  *b Returns:
9973  **
9974  ** 0 on success, -1 on failure
9975  **
9976  *b Available as Decision Bead/Event
9977  */
9978  int call_formation(const char* formation_name,
9979  int snap_to_position_flag = 0,
9980  int break_existing_formations_flag = 1);
9981 
9982  /*l
9983  *b Description:
9984  **
9985  ** This function breaks up a formation initiated by call_formation().
9986  **
9987  *b Arguments:
9988  **
9989  *a formation_name - the name of the formation to break;
9990  *a passing NULL or "(all)" will break all formations
9991  *a this character is leading
9992  **
9993  *b Returns:
9994  **
9995  ** 0 on success, -1 on failure
9996  **
9997  *b Available as Decision Bead/Event
9998  */
9999  int break_formation(const char* formation_name = NULL);
10000 
10001 
10002 /*****************************************************************************/
10010  /*l
10011  *b Description:
10012  **
10013  ** This function adds a copy of the specified scenario guide
10014  ** to the character. Any changes that are subsequently made
10015  ** to the added guide -- for example by a call to
10016  ** diguyCharacterGuide::set_algorithm_float_parameter() -- are
10017  ** private to this copy of the guide and will not affect others.
10018  **
10019  ** The guide will be enabled by default. Guides can be disabled
10020  ** by calling diguyCharacterGuide::set_guide_enabled(0), or by
10021  ** passing 1 for the argument automatically_disable_when_acquired.
10022  **
10023  ** Note that disabling a guide is not the same as removing it.
10024  ** Disabled guides are still a part of the character and can
10025  ** later be re-enabled by calling diguyCharacterGuide::set_enabled().
10026  **
10027  *b Arguments:
10028  **
10029  *a guide_name - name of guide to find and copy
10030  *a automatically_disable_when_acquired - set to 1 to have the guide
10031  *a be automatically disabled when it has acquired
10032  *a its target
10033  **
10034  *b Returns:
10035  **
10036  ** object of type diguyCharacterGuide; if a guide with guide_name
10037  ** is not found, returns NULL
10038  */
10039  diguyCharacterGuide* add_guide(const char* guide_name,
10040  int automatically_disable_when_acquired = 0);
10041 
10042  /*l
10043  *b Description:
10044  **
10045  ** This function creates a new guide and adds it to the character.
10046  **
10047  ** The guide will be enabled by default. Guides can be disabled
10048  ** by calling diguyCharacterGuide::set_guide_enabled(), or by
10049  ** passing 1 for the argument automatically_disable_when_acquired.
10050  **
10051  ** Important note: a new guide will always be created, even if one with
10052  ** the same name already exists
10053  **
10054  *b Arguments:
10055  **
10056  *a guide_name - name of guide to find and copy
10057  *a guide_algorithm - name of guide algorithm to be used
10058  *a automatically_disable_when_acquired - set to 1 to have the guide
10059  *a be automatically disabled when it has
10060  *a acquired its target
10061  **
10062  *b Returns:
10063  **
10064  ** object of type diguyCharacterGuide; if a guide with guide_name
10065  ** is not found, returns NULL
10066  */
10067  diguyCharacterGuide* create_guide(const char* guide_name,
10068  const char* guide_algorithm,
10069  int automatically_disable_when_acquired = 0);
10070 
10071  /*l
10072  *b Description:
10073  **
10074  ** Like create_guide(), but returns guide if it already exists
10075  **
10076  *b Arguments:
10077  **
10078  *a guide_name - name of guide to find and copy
10079  *a guide_algorithm - name of guide algorithm to be used
10080  *a automatically_disable_when_acquired - set to 1 to have the guide
10081  *a be automatically disabled when it has
10082  *a acquired its target
10083  **
10084  *b Returns:
10085  **
10086  ** object of type diguyCharacterGuide; if a guide with guide_name
10087  ** is not found, returns NULL
10088  */
10089  diguyCharacterGuide* find_or_create_guide(const char* guide_name,
10090  const char* guide_algorithm,
10091  int automatically_disable_when_acquired = 0);
10092 
10093  /*l
10094  *b Description:
10095  **
10096  ** This function returns a pointer to the specified guide
10097  ** of the character, if is exists.
10098  **
10099  *b Arguments:
10100  **
10101  *a guide_name - name of guide to find
10102  **
10103  *b Returns:
10104  **
10105  ** object of type diguyCharacterGuide; if a guide with guide_name
10106  ** is not found, returns NULL
10107  */
10108  diguyCharacterGuide* find_guide(const char* guide_name);
10109 
10110  /*l
10111  *b Description:
10112  **
10113  ** This function removes the specified guide from the
10114  ** character.
10115  **
10116  *b Arguments:
10117  **
10118  *a guide_name - name of the guide to remove; must match name
10119  *a used by add_guide() or create_guide() call
10120  **
10121  *b Returns:
10122  **
10123  ** 0 on success, -1 on failure
10124  */
10125  int remove_guide_with_name(const char* guide_name);
10126 
10127  /*l
10128  *b Description:
10129  **
10130  ** This function removes the specified guide from the
10131  ** character.
10132  **
10133  *b Arguments:
10134  **
10135  *a guide - object returned by add_guide() call
10136  **
10137  *b Returns:
10138  **
10139  ** 0 on success, -1 on failure
10140  */
10141  int remove_guide(diguyCharacterGuide* guide);
10142 
10143  /*l
10144  *b Description:
10145  **
10146  ** This function removes all guides from the character.
10147  **
10148  *b Returns:
10149  **
10150  ** 0 on success, -1 on failure
10151  */
10152  int remove_all_guides();
10153 
10154  /*l
10155  *b Description:
10156  **
10157  ** This function removes all guides that are disabled.
10158  **
10159  *b Returns:
10160  **
10161  ** 0 on success, -1 on failure
10162  */
10163  int remove_all_disabled_guides();
10164 
10165 
10166 /*****************************************************************************/
10176  /*l
10177  *b Description:
10178  **
10179  ** This function adds a "motion texture" to the character. A
10180  ** motion texture is a relatively long (usually 10 seconds or
10181  ** more) loop that will add natural-looking, low amplitude
10182  ** joint angle adjustments.
10183  **
10184  ** This function will have no effect on a dead character (see
10185  ** die_now() and get_dead()).
10186  **
10187  *b Arguments:
10188  **
10189  *a motex_name - name of the motion texture to add; see below
10190  *a texture_gain - the relative amplitude of the motion texture;
10191  *a higher numbers result in more pronounced
10192  *a movements
10193  *a end_previous_motex - flag denoting whether this motion texture
10194  *a replaces all previously added motion
10195  *a textures; pass 1 to end existing textures
10196  *a rampup_interval - how long, in seconds, to take ramping up
10197  *a into the motion texture
10198  **
10199  ** List of currently available motion textures:
10200  **
10201  *- - "default"
10202  *- - "motex_stand_casual"
10203  **
10204  ** If 1 is passed for the argument end_previous_motex, the
10205  ** rampup_interval argument will be used as the interval for
10206  ** ending existing motion textures.
10207  **
10208  *b Returns:
10209  **
10210  ** 0 on success, -1 on failure
10211  **
10212  */
10213  int add_motion_texture(const char* motex_name = "default",
10214  float texture_gain = 1.0f,
10215  int end_previous_motex = 1,
10216  float rampup_interval = 0.2f);
10217 
10218  /*l
10219  *b Description:
10220  **
10221  ** This function gradually ends any active motion textures added by
10222  ** add_motion_texture().
10223  **
10224  *b Arguments:
10225  **
10226  *a rampdown_interval - how long, in seconds, to take ending the
10227  *a motion texture
10228  **
10229  *b Returns:
10230  **
10231  ** 0 on success, -1 on failure
10232  */
10233  int end_motion_texture(float rampdown_interval = 0.2f);
10234 
10235  /*l
10236  *b Description:
10237  **
10238  ** This function sets an initial motion texture that should be
10239  ** used by the character whenever the character is loaded from
10240  ** a scenario or the character's scenario is reset.
10241  **
10242  ** The gain of the motion texture can be set by calling
10243  ** set_initial_motion_texture_gain(). The initial motion
10244  ** texture gain is 1.0 by default.
10245  **
10246  *b See Also:
10247  **
10248  ** add_motion_texture(), set_initial_motion_texture_gain()
10249  **
10250  *b Arguments:
10251  **
10252  *a motex_name - name of the motion texture
10253  **
10254  *b Returns:
10255  **
10256  ** 0 on success, -1 on failure
10257  */
10258  int set_initial_motion_texture(const char* motex_name);
10259 
10260  /*l
10261  *b Description:
10262  **
10263  ** This function returns the initial motion texture as set
10264  ** by a call to set_initial_motion_texture().
10265  **
10266  *b Returns:
10267  **
10268  ** name of initial motion texture
10269  */
10270  const char* get_initial_motion_texture();
10271 
10272  /*l
10273  *b Description:
10274  **
10275  ** This function sets the gain of the initial motion texture
10276  ** of the character. The initial motion texture can be set
10277  ** by calling set_initial_motion_texture().
10278  **
10279  *b Arguments:
10280  **
10281  *a motex_gain - gain of the motion texture; higher gains
10282  *a result in more pronounced motion
10283  **
10284  *b Returns:
10285  **
10286  ** 0 on success, -1 on failure
10287  */
10288  int set_initial_motion_texture_gain(float motex_gain);
10289 
10290  /*l
10291  *b Description:
10292  **
10293  ** This function returns the initial motion texture gain as set
10294  ** by a call to set_initial_motion_texture_gain().
10295  **
10296  *b Returns:
10297  **
10298  ** gain of initial motion texture
10299  */
10300  float get_initial_motion_texture_gain();
10301 
10302 
10303 /*****************************************************************************/
10313  /*l
10314  *b Description:
10315  **
10316  ** This function sets what type of "history" will be kept for the
10317  ** character.
10318  **
10319  ** If time is run backwards in a scenario, characters
10320  ** with history will replay the motions they performed at that
10321  ** time. Characters without history will stay frozen in place
10322  ** until time advances past the point from which it was run
10323  ** backwards.
10324  **
10325  ** The default is DIGUY_HISTORY_TYPE_NONE for characters created
10326  ** using the diguyScenario::create_character() function.
10327  ** Characters loaded from a .dss file will retain their history
10328  ** settings from the DI-Guy Scenario editing session.
10329  **
10330  *b Arguments:
10331  **
10332  *a history_type - history type to be used for the character
10333  **
10334  ** history_type should be one of the following values:
10335  **
10336  *i DIGUY_HISTORY_TYPE_NONE
10337  **
10338  ** This history type saves no history.
10339  **
10340  *i DIGUY_HISTORY_TYPE_COMPLETE
10341  **
10342  ** This history type saves all of a character's history.
10343  **
10344  ** The initial amount of history to be saved, before memory buffers
10345  ** need to be resized, can be set by the function
10346  ** set_history_size_t(). The size by which memory buffers grow each
10347  ** time they do need to get resized by be set by
10348  ** set_history_size_increment_t().
10349  **
10350  *i DIGUY_HISTORY_TYPE_FIRST
10351  **
10352  ** This history type is no longer supported. Characters from
10353  ** a .dss that have this history type will have their history
10354  ** type set to DIGUY_HISTORY_TYPE_COMPLETE.
10355  **
10356  *i DIGUY_HISTORY_TYPE_LAST
10357  **
10358  ** This history type is no longer supported. Characters from
10359  ** a .dss that have this history type will have their history
10360  ** type set to DIGUY_HISTORY_TYPE_COMPLETE.
10361  **
10362  *b Returns:
10363  **
10364  ** 0 on success, -1 on failure
10365  */
10366  int set_history_type(diguyHistoryType history_type);
10367 
10368  /*l
10369  *b Returns:
10370  **
10371  ** the current history type of the character; see
10372  ** set_history_type()
10373  */
10374  diguyHistoryType get_history_type();
10375 
10376  /*l
10377  *b Description:
10378  **
10379  ** This function sets the size of the character's history
10380  ** buffer, in seconds.
10381  **
10382  *b Arguments:
10383  **
10384  *a t - length of history buffer, in seconds
10385  **
10386  *b Returns:
10387  **
10388  ** 0 on success, -1 on failure
10389  */
10390  int set_history_size_t(float t);
10391 
10392  /*l
10393  *b Description:
10394  **
10395  ** This function returns the current history buffer size.
10396  ** See set_history_size_t().
10397  **
10398  *b Returns:
10399  **
10400  ** current history size
10401  */
10402  float get_history_size_t();
10403 
10404  /*l
10405  *b Description:
10406  **
10407  ** This function sets the size of the character's history
10408  ** buffer increment, in seconds.
10409  **
10410  *b Arguments:
10411  **
10412  *a t - length of history buffer increment, in seconds
10413  **
10414  *b Returns:
10415  **
10416  ** 0 on success, -1 on failure
10417  */
10418  int set_history_size_increment_t(float t);
10419 
10420  /*l
10421  *b Description:
10422  **
10423  ** This function returns the current history buffer size increment.
10424  ** See set_history_size_increment_t().
10425  **
10426  *b Returns:
10427  **
10428  ** current history size increment
10429  */
10430  float get_history_size_increment_t();
10431 
10432 
10433 /*****************************************************************************/
10443  /*l
10444  *b Description:
10445  **
10446  ** This function sets the desired posture of the character. This,
10447  ** along with the desired variant, is used primarily by some guides.
10448  ** Specifically, to help choose which actions are used to reach the
10449  ** desired position and orientation of the character.
10450  **
10451  ** Pass DIGUY_MOTION_POSTURE_ANY for there to be no desired posture.
10452  **
10453  *b Arguments:
10454  **
10455  *a posture - new desired posture
10456  */
10457  void set_desired_posture(diguyMotionPosture desired_posture);
10458 
10459  /*l
10460  *b Returns:
10461  **
10462  ** current desired posture of the character
10463  */
10464  diguyMotionPosture get_desired_posture();
10465 
10466  /*l
10467  *b Description:
10468  **
10469  ** This function sets the desired variant of the character. This,
10470  ** along with the desired posture, is used primarily by some guides.
10471  ** Specifically, to help choose which actions are used to reach the
10472  ** desired position and orientation of the character.
10473  **
10474  ** Pass DIGUY_MOTION_VARIANT_ANY for there to be no desired variant.
10475  **
10476  *b Arguments:
10477  **
10478  *a variant - new desired variant
10479  */
10480  void set_desired_variant(diguyMotionVariant desired_variant);
10481 
10483  diguyMotionVariant get_desired_variant();
10484 
10485  /*l
10486  *b Description:
10487  **
10488  ** This function looks up the character action that most closely
10489  ** matches the given criteria.
10490  **
10491  *b Arguments:
10492  **
10493  *a direction - the direction of travel relative to
10494  *a the character's facing direction
10495  *a posture - overall desired posture; pass
10496  *a DIGUY_MOTION_POSTURE_ANY
10497  *a to specify that any posture will do
10498  *a variant - overall desired variant; pass
10499  *a DIGUY_MOTION_VARIANT_ANY
10500  *a to specify that any variant will do
10501  *a speed - speed in meters per second
10502  *a comparison - how the passed speed should compare
10503  *a to the action's speed
10504  *a comparison_tolerance - tolerance of comparison
10505  *a match_posture_before_variant - pass 1 if posture should be matched
10506  *a before variant if an exact match is
10507  *a not found; pass 0 if variant should
10508  *a be matched before posture
10509  *a posture_alternate1 - if an exact match is not found, use this
10510  *a as the first alternate posture; pass
10511  *a DIGUY_MOTION_POSTURE_UNKNOWN
10512  *a to specify that no alternate should be used
10513  *a posture_alternate2 - if an exact match is not found, use this
10514  *a as the second alternate posture; pass
10515  *a DIGUY_MOTION_POSTURE_UNKNOWN
10516  *a to specify that no alternate should be used
10517  *a variant_alternate1 - if an exact match is not found, use this
10518  *a as the first alternate variant; pass
10519  *a DIGUY_MOTION_VARIANT_UNKNOWN
10520  *a to specify that no alternate should be used
10521  *a variant_alternate2 - if an exact match is not found, use this
10522  *a as the second alternate variant; pass
10523  *a DIGUY_MOTION_VARIANT_UNKNOWN
10524  *a to specify that no alternate should be used
10525  *a return_random_match - (Experimental) if multiple actions match the
10526  *a specified criteria randomly return one of
10527  *a them. Typically only used for still motions
10528  *a and restricted to EQUAL and NEAREST
10529  *a comparisons
10530  **
10531  ** The direction argument should be one of the following:
10532  **
10533  *- - DIGUY_MOTION_DIRECTION_NONE - does not move character
10534  *- - DIGUY_MOTION_DIRECTION_FORWARD - moves character forward
10535  *- - DIGUY_MOTION_DIRECTION_BACKWARD - moves character backward
10536  *- - DIGUY_MOTION_DIRECTION_LEFT - moves character left
10537  *- - DIGUY_MOTION_DIRECTION_RIGHT - moves character right
10538  *- - DIGUY_MOTION_DIRECTION_UP - moves character up
10539  *- - DIGUY_MOTION_DIRECTION_DOWN - moves character down
10540  *- - DIGUY_MOTION_DIRECTION_TURN_LEFT - turns character left
10541  *- - DIGUY_MOTION_DIRECTION_TURN_RIGHT - turns character right
10542  *- - DIGUY_MOTION_DIRECTION_NONLINEAR - moves character in
10543  *- multiple directions
10544  *- - DIGUY_MOTION_DIRECTION_LINEAR_OFFAXIS - moves character in a
10545  *- line, but not on any
10546  *- of the principle axes
10547  **
10548  ** Not every direction is supported by every character. If the
10549  ** character does not have any actions that move in the specified
10550  ** direction, the returned action will be NULL.
10551  **
10552  ** Use the calls diguyScenario::get_character_type_num_directions()
10553  ** and diguyScenario::get_character_type_direction_at_index() to
10554  ** enumerate which directions a character can travel.
10555  **
10556  ** The posture arguments should be one of the following:
10557  **
10558  *- - DIGUY_MOTION_POSTURE_UNKNOWN - unknown posture
10559  *- - DIGUY_MOTION_POSTURE_ANY - any posture; a wildcard
10560  *- - DIGUY_MOTION_POSTURE_UPRIGHT - upright posture; e.g., standing,
10561  *- walking, or running
10562  *- - DIGUY_MOTION_POSTURE_CROUCHED - crouched posture; e.g., kneeling
10563  *- or walking low
10564  *- - DIGUY_MOTION_POSTURE_PRONE - prone posture; e.g., lying prone
10565  *- or crawling
10566  *- - DIGUY_MOTION_POSTURE_SITTING - sitting posture
10567  *- - DIGUY_MOTION_POSTURE_KNEELING - kneeling posture
10568  *- - DIGUY_MOTION_POSTURE_SWIMMING - swimming posture
10569  *- - DIGUY_MOTION_POSTURE_PARACHUTING - parachuting posture
10570  *- - DIGUY_MOTION_POSTURE_JUMPING - jumping posture
10571  *- - DIGUY_MOTION_POSTURE_SQUATTING - jumping posture
10572  *- - DIGUY_MOTION_POSTURE_WADING - wading posture
10573  **
10574  ** The posture arguments specify the overall posture the action
10575  ** should have. Most characters have an upright posture.
10576  ** The other postures a character has is dependent on character type.
10577  ** Passing DIGUY_MOTION_POSTURE_ANY for the arguments posture,
10578  ** posture_alternate1, or posture_alternate2 means that the posture of
10579  ** the action should not be used to determine a match.
10580  **
10581  ** Use the calls diguyScenario::get_character_type_num_postures()
10582  ** and diguyScenario::get_character_type_posture_at_index() to
10583  ** enumerate which postures a specific character type has.
10584  **
10585  ** The variant arguments specify the overall mood the action should
10586  ** convey. Most characters have a "normal" variant. The other
10587  ** variants a character has is dependent on character type. Passing
10588  ** DIGUY_MOTION_VARIANT_ANY for the arguments variant,
10589  ** variant_alternate1, or variant_alternate2 means that the variant of
10590  ** the action should not be used to determine a match.
10591  **
10592  ** Use the calls diguyScenario::get_character_type_num_variants()
10593  ** and diguyScenario::get_character_type_variant_at_index() to
10594  ** enumerate which variants a specific character type has.
10595  **
10596  ** The comparison argument should be one of the following:
10597  **
10598  *- - DIGUY_PARAMETER_COMPARISON_EQUAL - matched action's speed
10599  *- must be within
10600  *- comparison_tolerance of
10601  *- passed speed
10602  *- - DIGUY_PARAMETER_COMPARISON_NEAREST - matched action's speed
10603  *- is closer than any other
10604  *- potential match's, but
10605  *- still within
10606  *- comparison_tolerance
10607  *- - DIGUY_PARAMETER_COMPARISON_GREATER - matched action's speed
10608  *- faster than passed speed,
10609  *- but still within
10610  *- comparison_tolerance
10611  *- - DIGUY_PARAMETER_COMPARISON_LESS - matched action's speed
10612  *- slower than passed speed,
10613  *- but still within
10614  *- comparison_tolerance
10615  *-
10616  ** The difference between DIGUY_PARAMETER_COMPARISON_EQUAL and
10617  ** DIGUY_PARAMETER_COMPARISON_NEAREST is largely in the
10618  ** value used for comparison_tolerance if DIGUY_DEFAULT_FLOAT is
10619  ** passed; the comparison_tolerance argument defaults to 0.001 for
10620  ** DIGUY_PARAMETER_COMPARISON_EQUAL, and 16384.0 for all
10621  ** other comparison types. Otherwise these two comparison types
10622  ** operate the same.
10623  **
10624  *b Returns:
10625  **
10626  ** name of an action if a match is found, NULL if not
10627  **
10628  *b C++ Example:
10629  **
10630  *e diguyCharacter* ch = scenario->get_character_at_index(0);
10631  *e const char* new_action;
10632  *e
10633  *e //
10634  *e // Get an action that moves forward in an upright posture,
10635  *e // whose speed move at least 2.0 meters per second:
10636  *e //
10637  *e new_action = ch->get_action_from_description(
10638  *e DIGUY_MOTION_DIRECTION_FORWARD,
10639  *e DIGUY_MOTION_POSTURE_UPRIGHT,
10640  *e DIGUY_MOTION_VARIANT_ANY,
10641  *e 2.0,
10642  *e DIGUY_PARAMETER_COMPARISON_GREATER, DIGUY_DEFAULT_FLOAT);
10643  *e
10644  *e //
10645  *e // Get an action that is standing still, with the variant
10646  *e // DIGUY_MOTION_VARIANT_READY. If no action has that variant,
10647  *e // try DIGUY_MOTION_VARIANT_AIM as variant_alternate1,
10648  *e // and DIGUY_MOTION_VARIANT_ANY as variant_alternate2:
10649  *e //
10650  *e new_action = ch->get_action_from_description(
10651  *e DIGUY_MOTION_DIRECTION_NONE,
10652  *e DIGUY_MOTION_POSTURE_ANY,
10653  *e DIGUY_MOTION_VARIANT_READY,
10654  *e 0.0,
10655  *e DIGUY_PARAMETER_COMPARISON_NEAREST, DIGUY_DEFAULT_FLOAT,
10656  *e 0,
10657  *e DIGUY_MOTION_POSTURE_UNKNOWN,
10658  *e DIGUY_MOTION_POSTURE_UNKNOWN,
10659  *e DIGUY_MOTION_VARIANT_AIM,
10660  *e DIGUY_MOTION_VARIANT_ANY);
10661  **
10662  */
10663  const char* get_action_from_description(diguyMotionDirection direction,
10664  diguyMotionPosture posture,
10665  diguyMotionVariant variant,
10666  float speed,
10668  float comparison_tolerance = DIGUY_DEFAULT_FLOAT,
10669  int match_posture_before_variant = 1,
10670  diguyMotionPosture posture_alternate1 = DIGUY_MOTION_POSTURE_UNKNOWN,
10671  diguyMotionPosture posture_alternate2 = DIGUY_MOTION_POSTURE_UNKNOWN,
10672  diguyMotionVariant variant_alternate1 = DIGUY_MOTION_VARIANT_UNKNOWN,
10673  diguyMotionVariant variant_alternate2 = DIGUY_MOTION_VARIANT_UNKNOWN,
10674  int return_random_match = 0);
10675 
10676  /*l
10677  *b Description:
10678  **
10679  ** This function is very similar to get_action_from_description(),
10680  ** but substitutes turn amount per action iteration for speed.
10681  **
10682  *b Arguments:
10683  **
10684  *a direction - the direction of travel relative to
10685  *a the character's facing direction
10686  *a posture - overall desired posture; pass
10687  *a DIGUY_MOTION_POSTURE_ANY
10688  *a to specify that any posture will do
10689  *a variant - overall desired variant; pass
10690  *a DIGUY_MOTION_VARIANT_ANY
10691  *a to specify that any variant will do
10692  *a turn_amount - how many degrees each iteration of the
10693  *a action should turn the character
10694  *a comparison - how the passed turn amount should compare
10695  *a to the action's turn amount
10696  *a comparison_tolerance - tolerance of comparison
10697  *a match_posture_before_variant - pass 1 if posture should be matched
10698  *a before variant if an exact match is
10699  *a not found; pass 0 if variant should
10700  *a be matched before posture
10701  *a posture_alternate1 - if an exact match is not found, use this
10702  *a as the first alternate posture; pass
10703  *a DIGUY_MOTION_POSTURE_UNKNOWN
10704  *a to specify that no alternate should be used
10705  *a posture_alternate2 - if an exact match is not found, use this
10706  *a as the second alternate posture; pass
10707  *a DIGUY_MOTION_POSTURE_UNKNOWN
10708  *a to specify that no alternate should be used
10709  *a variant_alternate1 - if an exact match is not found, use this
10710  *a as the first alternate variant; pass
10711  *a DIGUY_MOTION_VARIANT_UNKNOWN
10712  *a to specify that no alternate should be used
10713  *a variant_alternate2 - if an exact match is not found, use this
10714  *a as the second alternate variant; pass
10715  *a DIGUY_MOTION_VARIANT_UNKNOWN
10716  *a to specify that no alternate should be used
10717  **
10718  ** The direction argument should be one of the following:
10719  **
10720  *- - DIGUY_MOTION_DIRECTION_TURN_LEFT - turns character left
10721  *- - DIGUY_MOTION_DIRECTION_TURN_RIGHT - turns character right
10722  **
10723  ** Not every direction is supported by every character. If the
10724  ** character does not have any actions that move in the specified
10725  ** direction, the returned action will be NULL.
10726  **
10727  ** The turn amount argument should be a positive number.
10728  **
10729  ** Refer to get_action_from_description() for more information on
10730  ** other arguments.
10731  **
10732  *b Returns:
10733  **
10734  ** name of an action if a match is found, NULL if not
10735  **
10736  */
10737  const char* get_turning_action_from_description(diguyMotionDirection direction,
10738  diguyMotionPosture posture,
10739  diguyMotionVariant variant,
10740  float turn_amount,
10742  float comparison_tolerance = DIGUY_DEFAULT_FLOAT,
10743  int match_posture_before_variant = 1,
10744  diguyMotionPosture posture_alternate1 = DIGUY_MOTION_POSTURE_UNKNOWN,
10745  diguyMotionPosture posture_alternate2 = DIGUY_MOTION_POSTURE_UNKNOWN,
10746  diguyMotionVariant variant_alternate1 = DIGUY_MOTION_VARIANT_UNKNOWN,
10747  diguyMotionVariant variant_alternate2 = DIGUY_MOTION_VARIANT_UNKNOWN);
10748 
10749 
10750 /*****************************************************************************/
10760  /*l
10761  *b Returns:
10762  **
10763  ** number of variables the character has
10764  */
10765  int get_num_variables();
10766 
10767  /*l
10768  *b Returns:
10769  **
10770  ** pointer of type diguyVariable; NULL if no
10771  ** variable at the specified index
10772  **
10773  *b Arguments:
10774  **
10775  *a index - index of the variable; indices start at 0
10776  */
10777  diguyVariable* get_variable_at_index(int index);
10778 
10779  /*l
10780  *b Description:
10781  **
10782  ** This function returns a pointer to the specified variable.
10783  **
10784  *b Arguments:
10785  **
10786  *a name - name of variable to be found
10787  **
10788  *b Returns:
10789  **
10790  ** pointer of type diguyVariable; NULL if not found
10791  */
10792  diguyVariable* find_variable(const char* name);
10793 
10794  /*l
10795  *b Description:
10796  **
10797  ** This function finds the variable with the given name or
10798  ** creates it if it doesn't exist.
10799  **
10800  *b Arguments:
10801  **
10802  *a name - name of the variable to find or create
10803  **
10804  *b Returns:
10805  **
10806  ** pointer of type diguyVariable; should never be NULL
10807  */
10808  diguyVariable* find_or_create_variable(const char* name);
10809 
10810  /*l
10811  *b Description:
10812  **
10813  ** This function destroys the passed variable.
10814  **
10815  *b Arguments:
10816  **
10817  *a variable - pointer to a diguyVariable
10818  **
10819  *b Returns:
10820  **
10821  ** 0 on success, -1 on failure
10822  */
10823  int destroy_variable(diguyVariable* variable);
10824 
10825  /*l
10826  *b Returns:
10827  **
10828  ** 1 if variable is equal to passed value,
10829  ** 0 if not
10830  **
10831  *b Arguments:
10832  **
10833  *a varname - name of variable to compare
10834  *a value - value to compare against
10835  **
10836  *b Available as Decision Bead/Event
10837  */
10838  int variable_equal_to_int(const char* varname, int value);
10839 
10840  /*l
10841  *b Returns:
10842  **
10843  ** 1 if variable is greater than passed value,
10844  ** 0 if not
10845  **
10846  *b Arguments:
10847  **
10848  *a varname - name of variable to compare
10849  *a value - value to compare against
10850  **
10851  *b Available as Decision Bead/Event
10852  */
10853  int variable_greater_than_int(const char* varname, int value);
10854 
10855  /*l
10856  *b Returns:
10857  **
10858  ** 1 if variable is less than passed value,
10859  ** 0 if not
10860  **
10861  *b Arguments:
10862  **
10863  *a varname - name of variable to compare
10864  *a value - value to compare against
10865  **
10866  *b Available as Decision Bead/Event
10867  */
10868  int variable_less_than_int(const char* varname, int value);
10869 
10870  /*l
10871  *b Returns:
10872  **
10873  ** 1 if variable is equal to passed value,
10874  ** 0 if not
10875  **
10876  *b Arguments:
10877  **
10878  *a varname - name of variable to compare
10879  *a value - value to compare against
10880  **
10881  *b Available as Decision Bead/Event
10882  */
10883  int variable_equal_to_float(const char* varname, float value);
10884 
10885  /*l
10886  *b Returns:
10887  **
10888  ** 1 if variable is greater than passed value,
10889  ** 0 if not
10890  **
10891  *b Arguments:
10892  **
10893  *a varname - name of variable to compare
10894  *a value - value to compare against
10895  **
10896  *b Available as Decision Bead/Event
10897  */
10898  int variable_greater_than_float(const char* varname, float value);
10899 
10900  /*l
10901  *b Returns:
10902  **
10903  ** 1 if variable is less than passed value,
10904  ** 0 if not
10905  **
10906  *b Arguments:
10907  **
10908  *a varname - name of variable to compare
10909  *a value - value to compare against
10910  **
10911  *b Available as Decision Bead/Event
10912  */
10913  int variable_less_than_float(const char* varname, float value);
10914 
10915  /*l
10916  *b Returns:
10917  **
10918  ** 1 if variable is equal than passed value,
10919  ** 0 if not
10920  **
10921  *b Arguments:
10922  **
10923  *a varname - name of variable to compare
10924  *a value - value to compare against
10925  **
10926  *b Available as Decision Bead/Event
10927  */
10928  int variable_equal_to_string(const char* varname, const char* value);
10929 
10930  /*l
10931  *b Returns:
10932  **
10933  ** 1 if variable is greater than passed value (comes
10934  ** later alphabetically), 0 if not
10935  **
10936  *b Arguments:
10937  **
10938  *a varname - name of variable to compare
10939  *a value - value to compare against
10940  **
10941  *b Available as Decision Bead/Event
10942  */
10943  int variable_greater_than_string(const char* varname, const char* value);
10944 
10945  /*l
10946  *b Returns:
10947  **
10948  ** 1 if variable is less than passed value (comes
10949  ** sooner alphabetically), 0 if not
10950  **
10951  *b Arguments:
10952  **
10953  *a varname - name of variable to compare
10954  *a value - value to compare against
10955  **
10956  *b Available as Decision Bead/Event
10957  */
10958  int variable_less_than_string(const char* varname, const char* value);
10959 
10960  /*l
10961  *b Description:
10962  **
10963  ** This function decrements the variable by the passed amount.
10964  **
10965  *b Arguments:
10966  **
10967  *a varname - name of variable to modify
10968  *a value - amount to decrement
10969  **
10970  *b Returns:
10971  **
10972  ** 0 on success, -1 on failure
10973  **
10974  *b Available as Decision Bead/Event
10975  */
10976  int variable_decrement_value_as_int(const char* varname, int value = 1);
10977 
10978  /*l
10979  *b Description:
10980  **
10981  ** This function increments the variable by the passed amount.
10982  **
10983  *b Arguments:
10984  **
10985  *a varname - name of variable to modify
10986  *a value - amount to increment
10987  **
10988  *b Returns:
10989  **
10990  ** 0 on success, -1 on failure
10991  **
10992  *b Available as Decision Bead/Event
10993  */
10994  int variable_increment_value_as_int(const char* varname, int value = 1);
10995 
10996  /*l
10997  *b Description:
10998  **
10999  ** This function is a convenience function for setting the variable
11000  ** to a new integer value without retrieving the diguyVariable
11001  ** object.
11002  **
11003  *b Arguments:
11004  **
11005  *a varname - name of variable to modify
11006  *a value - new value
11007  *a create_if_doesnt_exist - pass 1 to create the variable if it
11008  *a doesn't exist
11009  **
11010  *b Returns:
11011  **
11012  ** 0 on success, -1 on failure
11013  **
11014  *b Available as Decision Bead/Event
11015  */
11016  int variable_set_value_as_int(const char* varname,
11017  int value,
11018  int create_if_doesnt_exist = 1);
11019 
11020  /*l
11021  *b Description:
11022  **
11023  ** Short form of variable_set_value_as_int().
11024  */
11025  int set_ivar(const char* varname,
11026  int value,
11027  int create_if_doesnt_exist = 1);
11028 
11029  /*l
11030  *b Description:
11031  **
11032  ** This function is a convenience function for retrieving the
11033  ** value of a variable without retrieving the diguyVariable
11034  ** object.
11035  **
11036  ** If the variable doesn't exist and create_if_doesnt_exist is
11037  ** 0, the returned value will be 0.
11038  **
11039  *b Arguments:
11040  **
11041  *a varname - name of variable to query
11042  *a create_if_doesnt_exist - pass 1 to create the variable if it
11043  *a doesn't exist
11044  **
11045  *b Returns:
11046  **
11047  ** value of variable as int
11048  */
11049  int get_ivar(const char* varname,
11050  int create_if_doesnt_exist = 1);
11051 
11052  /*l
11053  *b Description:
11054  **
11055  ** Similar to variable_set_value_as_int(), for sets a
11056  ** floating point value instead.
11057  */
11058  int variable_set_value_as_float(const char* varname,
11059  float value,
11060  int create_if_doesnt_exist = 1);
11061 
11062  /*l
11063  *b Description:
11064  **
11065  ** Short form of variable_set_value_as_float().
11066  */
11067  int set_fvar(const char* varname,
11068  float value,
11069  int create_if_doesnt_exist = 1);
11070 
11071  /*l
11072  *b Description:
11073  **
11074  ** Similar to variable_get_value_as_int(), for returns a
11075  ** floating point value instead.
11076  **
11077  ** If the variable doesn't exist and create_if_doesnt_exist is
11078  ** 0, the returned value will be 0.0.
11079  */
11080  float get_fvar(const char* varname,
11081  int create_if_doesnt_exist = 1);
11082 
11083  /*l
11084  *b Description:
11085  **
11086  ** Similar to variable_set_value_as_int(), for sets a
11087  ** string value instead.
11088  */
11089  int variable_set_value_as_string(const char* varname,
11090  const char* value,
11091  int create_if_doesnt_exist = 1);
11092 
11093  /*l
11094  *b Description:
11095  **
11096  ** Short form of variable_set_value_as_string().
11097  */
11098  int set_svar(const char* varname,
11099  const char* value,
11100  int create_if_doesnt_exist = 1);
11101 
11102  /*l
11103  *b Description:
11104  **
11105  ** Similar to variable_get_value_as_int(), for returns a
11106  ** string value instead.
11107  **
11108  ** If the variable doesn't exist and create_if_doesnt_exist is
11109  ** 0, the returned value will be "".
11110  */
11111  const char* get_svar(const char* varname,
11112  int create_if_doesnt_exist = 1);
11113 
11114 
11115 /*****************************************************************************/
11130  /*l
11131  *b Description:
11132  **
11133  ** This function returns a pointer to the label object of
11134  ** the character.
11135  **
11136  ** Currently character labels are only enabled in DI-Guy Scenario.
11137  **
11138  *b Returns:
11139  **
11140  ** pointer to the character's label
11141  */
11142  diguyViewLabel* get_name_label();
11143 
11144  /*l
11145  *b Description:
11146  **
11147  ** This function sets the text of the character's label.
11148  ** By default the label text matches the character's name.
11149  **
11150  ** Currently character labels are only enabled in DI-Guy Scenario.
11151  **
11152  *b Arguments:
11153  **
11154  *a label_text - new text for the label
11155  **
11156  *b Returns:
11157  **
11158  ** 0 on success, -1 on failure
11159  */
11160  int set_label_text(const char* label_text);
11161 
11162  /*l
11163  *b Description:
11164  **
11165  ** This function returns the character's label text.
11166  ** See set_label_text().
11167  **
11168  *b Returns:
11169  **
11170  ** current label text; the returned pointer will never be NULL
11171  */
11172  const char* get_label_text();
11173 
11174  /*l
11175  *b Description:
11176  **
11177  ** This function sets whether the label of this character
11178  ** is visible. This setting will only be taken into account
11179  ** if the visibility flag for Character Labels is set to
11180  ** "Per Object".
11181  **
11182  ** Currently character labels are only enabled in DI-Guy Scenario.
11183  **
11184  *b Arguments:
11185  **
11186  *a is_visible - pass 1 to show, pass 0 to hide
11187  **
11188  *b Returns:
11189  **
11190  ** 0 on success, -1 on failure
11191  */
11192  int set_label_is_visible(int is_visible);
11193 
11194  /*l
11195  *b Description:
11196  **
11197  ** This function returns the most recent setting of
11198  ** set_label_is_visible().
11199  **
11200  *b Returns:
11201  **
11202  ** 1 if visible, 0 if not
11203  */
11204  int get_label_is_visible();
11205 
11206  /*l
11207  *b Description:
11208  **
11209  ** This function sets the text color of the character's label. By
11210  ** default the label text color is opaque white.
11211  **
11212  ** Currently character labels are only enabled in DI-Guy Scenario.
11213  **
11214  *b Arguments:
11215  **
11216  *a r, g, b, a - the red, green, blue, and alpha
11217  *a components of the text color
11218  **
11219  ** An alpha component of 0 makes the text completely transparent.
11220  ** An alpha component of 1 makes the text completely opaque.
11221  ** Values in between result in varying levels of transparency.
11222  **
11223  *b Returns:
11224  **
11225  ** 0 on success, -1 on failure
11226  */
11227  int set_label_text_color(float r, float g, float b, float a);
11228 
11229  /*l
11230  *b Description:
11231  **
11232  ** Alternate version of set_label_text_color().
11233  */
11234  int set_label_text_color_vec4(const diguyVec4f & color);
11235 
11236  /*l
11237  *b Description:
11238  **
11239  ** This function returns, in the passed variable pointers, the
11240  ** most recent setting of set_label_text_color().
11241  **
11242  *b Returns:
11243  **
11244  ** 0 on success, -1 on failure
11245  */
11246  int get_label_text_color(float* r, float* g, float* b, float* a);
11247 
11248  /*l
11249  *b Description:
11250  **
11251  ** Alternate version of get_label_text_color().
11252  */
11253  diguyVec4f get_label_text_color_vec4();
11254 
11255  /*l
11256  *b Description:
11257  **
11258  ** This function sets the text shadow color of the character's label.
11259  ** By default the label text shadow color is gray.
11260  **
11261  ** Currently character labels are only enabled in DI-Guy Scenario.
11262  **
11263  *b Arguments:
11264  **
11265  *a r, g, b, a - the red, green, blue, and alpha
11266  *a components of the text shadow color
11267  **
11268  ** An alpha component of 0 makes the text completely transparent.
11269  ** An alpha component of 1 makes the text completely opaque.
11270  ** Values in between result in varying levels of transparency.
11271  **
11272  *b Returns:
11273  **
11274  ** 0 on success, -1 on failure
11275  */
11276  int set_label_text_shadow_color(float r, float g, float b, float a);
11277 
11278  /*l
11279  *b Description:
11280  **
11281  ** Alternate version of set_label_text_shadow_color().
11282  */
11283  int set_label_text_shadow_color_vec4(const diguyVec4f & color);
11284 
11285  /*l
11286  *b Description:
11287  **
11288  ** This function returns, in the passed variable pointers, the
11289  ** most recent setting of set_label_text_shadow_color().
11290  **
11291  *b Returns:
11292  **
11293  ** 0 on success, -1 on failure
11294  */
11295  int get_label_text_shadow_color(float* r, float* g, float* b, float* a);
11296 
11297  /*l
11298  *b Description:
11299  **
11300  ** Alternate version of get_label_text_shadow_color().
11301  */
11302  diguyVec4f get_label_text_shadow_color_vec4();
11303 
11304  /*l
11305  *b Description:
11306  **
11307  ** This function sets the whether the text shadow is visible.
11308  **
11309  *b Arguments:
11310  **
11311  *a visible - pass 1 to make shadow visible, 0 to make it invisible
11312  **
11313  *b Returns:
11314  **
11315  ** 0 on success, -1 on failure
11316  */
11317  int set_label_text_shadow_is_visible(int is_visible);
11318 
11319  /*l
11320  *b Returns:
11321  **
11322  ** 1 if text shadow is visible, 0 if not
11323  */
11324  int get_label_text_shadow_is_visible();
11325 
11326  /*l
11327  *b Description:
11328  **
11329  ** This function sets the background color of the character's
11330  ** label. By default the label background color is transparent
11331  ** blue.
11332  **
11333  ** Currently character labels are only enabled in DI-Guy Scenario.
11334  **
11335  *b Arguments:
11336  **
11337  *a r, g, b, a - the red, green, blue, and alpha
11338  *a components of the text color
11339  **
11340  ** An alpha component of 0 makes the text completely transparent.
11341  ** An alpha component of 1 makes the text completely opaque.
11342  ** Values in between result in varying levels of transparency.
11343  **
11344  *b Returns:
11345  **
11346  ** 0 on success, -1 on failure
11347  */
11348  int set_label_background_color(float r, float g, float b, float a);
11349 
11350  /*l
11351  *b Description:
11352  **
11353  ** Alternate version of set_label_background_color().
11354  */
11355  int set_label_background_color_vec4(const diguyVec4f & color);
11356 
11357  /*l
11358  *b Description:
11359  **
11360  ** This function returns, in the passed variable pointers, the
11361  ** most recent setting of set_label_background_color().
11362  **
11363  *b Returns:
11364  **
11365  ** 0 on success, -1 on failure
11366  */
11367  int get_label_background_color(float* r, float* g, float* b, float* a);
11368 
11369  /*l
11370  *b Description:
11371  **
11372  ** Alternate version of get_label_background_color().
11373  */
11374  diguyVec4f get_label_background_color_vec4();
11375 
11376  /*l
11377  *b Description:
11378  **
11379  ** This function sets how high the label of the character will float
11380  ** above the character.
11381  **
11382  *b Arguments:
11383  **
11384  *a offset - offset, in meters, of label above character
11385  */
11386  void set_label_link_offset_override(float offset);
11387 
11388  /*l
11389  *b Returns:
11390  **
11391  ** how high the label of the character will float above the character
11392  */
11393  float get_label_link_offset_override();
11394 
11395  /*l
11396  *b Description:
11397  **
11398  ** This function sets whether the label text should show some basic
11399  ** state information about the character instead of its name or
11400  ** the text set by set_label_text().
11401  **
11402  ** The state shown is: Character name, current path, current action.
11403  ** The current path and current action will change as the character
11404  ** moves through paths and actions.
11405  **
11406  *b Arguments:
11407  **
11408  *a show_state - pass 1 to show state, 0 to show original text
11409  */
11410  int set_label_shows_character_state(int show_state);
11411 
11412  /*l
11413  *b Returns:
11414  **
11415  ** whether character state information is shown instead of the
11416  ** character's name or other label text
11417  */
11418  int get_label_shows_character_state();
11419 
11420 
11421 /*****************************************************************************/
11434  /*l
11435  *b Returns:
11436  **
11437  ** pointer of type diguyImpact; NULL if there has been no recent
11438  ** impact recorded; useful for finding out who or what was hit
11439  */
11440  diguyImpact* get_last_impact_record();
11441 
11442  /*l
11443  *b Returns:
11444  **
11445  ** the last impact number
11446  */
11447  int get_last_impact_number();
11448 
11449  /*l
11450  *b Returns:
11451  **
11452  ** the processed flag on the diguyImpact class
11453  */
11454  int get_last_impact_been_processed();
11455 
11456  /*l
11457  *b Description:
11458  **
11459  ** Sets the processed flag on the diguyImpact object.
11460  */
11461  void set_last_impact_been_processed();
11462 
11463  /*l
11464  *b Description:
11465  **
11466  ** Sets the maximum number of unprocessed impacts there can be.
11467  **
11468  ** The unprocessed impact array is a first-in-first-out queue. If an
11469  ** impact occurs that pushes the number of unprocessed impacts past
11470  ** this maximum number, earlier impacts will be dropped from the
11471  ** array.
11472  **
11473  ** The initial value is 10.
11474  */
11475  void set_max_unprocessed_impacts(int max_unprocessed_impacts);
11476 
11477  /*l
11478  *b Returns:
11479  **
11480  ** maximum number of unprocessed impacts
11481  */
11482  int get_max_unprocessed_impacts();
11483 
11484  /*l
11485  *b Returns:
11486  **
11487  ** the last impact link
11488  */
11489  const char* get_last_impact_link();
11490 
11491  /*l
11492  *b Returns:
11493  **
11494  ** 1 if the last impact link is the link named
11495  */
11496  int get_last_impact_link_is(const char* link_name);
11497 
11498  /*l
11499  *b Returns:
11500  **
11501  ** 1 if the last impact resulted from an impact with a vehicle,
11502  ** 0 if not
11503  */
11504  int get_last_impact_is_from_vehicle();
11505 
11506  /*l
11507  *b Returns:
11508  **
11509  ** 1 if the last impact speed is greater than the passed speed,
11510  ** 0 if not
11511  */
11512  int get_last_impact_speed_is_greater_than(float impact_speed);
11513 
11514  /*l
11515  *b Description:
11516  **
11517  ** Sets if impacts are ever processed on this character.
11518  ** Useful for temporary effects and the like.
11519  */
11520  void set_is_immune_to_impacts(int immune);
11521 
11522  /*l
11523  *b Returns:
11524  **
11525  ** 1 if the character is immune to impacts
11526  ** 0 if not
11527  */
11528  int get_is_immune_to_impacts();
11529 
11530 
11531 /*****************************************************************************/
11553  /*l
11554  *b Description:
11555  **
11556  ** This function starts the specified appearance effect on
11557  ** the character.
11558  **
11559  ** The following appearance effects are available:
11560  **
11561  *- - "brake_lights"
11562  *- - "debris"
11563  *- - "debris_dark"
11564  *- - "dust"
11565  *- - "engine_smoke"
11566  *- - "explosion"
11567  *- - "explosion_dark"
11568  *- - "flames"
11569  *- - "flashing_lights"
11570  *- - "ground_dust_burst"
11571  *- - "headlights"
11572  *- - "rotor_wash"
11573  *- - "smoke"
11574  *- - "smoke_dark"
11575  *- - "smoke_trail"
11576  **
11577  *b Arguments:
11578  **
11579  *a effect - name of appearance effect to be started
11580  *a override_link - link to attach to; overrides default
11581  *a override_scale - scale to use for effect; overrides default
11582  *a override_offset_x - x offset to use for effect; overrides default
11583  *a override_offset_y - y offset to use for effect; overrides default
11584  *a override_offset_z - z offset to use for effect; overrides default
11585  *a override_duration - overrides how long the effect should show
11586  *a before automatically ending
11587  **
11588  *b Returns:
11589  **
11590  ** 0 on success, -1 on failure
11591  **
11592  *b Available as Decision Bead/Event
11593  */
11594  int begin_appearance_effect(const char* effect,
11595  const char* override_link = NULL,
11596  float override_scale = DIGUY_DEFAULT_FLOAT,
11597  float override_offset_x = DIGUY_DEFAULT_FLOAT,
11598  float override_offset_y = DIGUY_DEFAULT_FLOAT,
11599  float override_offset_z = DIGUY_DEFAULT_FLOAT,
11600  float override_duration = DIGUY_DEFAULT_FLOAT);
11601 
11602  /*l
11603  *b Description:
11604  **
11605  ** This function ends the specified appearance effect on the
11606  ** character.
11607  **
11608  ** The active particles of the effect will go to completion. Use
11609  ** stop_all_appearance_effects() to immediately stop effects,
11610  ** including their active particles.
11611  **
11612  ** If the effect hasn't been started, nothing happens.
11613  **
11614  *b Arguments:
11615  **
11616  *a effect - name of appearance effect to be ended
11617  *a override_link - optional override link effect is attached to
11618  **
11619  ** Pass "all" for the effect argument to end all of this character's
11620  ** appearance effects.
11621  **
11622  *b Returns:
11623  **
11624  ** 0 on success, -1 on failure
11625  **
11626  *b Available as Decision Bead/Event
11627  */
11628  int end_appearance_effect(const char* effect,
11629  const char* override_link = NULL);
11630 
11631  /*l
11632  *b Description:
11633  **
11634  ** This function stops the specified appearance effect on the
11635  ** character.
11636  **
11637  ** The active particle systems of the effect will immediately be
11638  ** removed. Use end_appearance_effect() to gradually stop effects;
11639  ** that function lets active particles move to completion.
11640  **
11641  ** If the effect hasn't been started, nothing happens.
11642  **
11643  *b Arguments:
11644  **
11645  *a effect - name of appearance effect to be ended
11646  *a override_link - optional override link effect is attached to
11647  **
11648  ** Pass "all" for the effect argument to stop all of this character's
11649  ** appearance effects.
11650  **
11651  *b Returns:
11652  **
11653  ** 0 on success, -1 on failure
11654  **
11655  *b Available as Decision Bead/Event
11656  */
11657  int stop_appearance_effect(const char* effect,
11658  const char* override_link = NULL);
11659 
11660  /*l
11661  *b Description:
11662  **
11663  ** Equivalent to stop_appearance_effect("all");
11664  */
11665  int stop_all_appearance_effects();
11666 
11667  /*l
11668  *b Description:
11669  **
11670  ** This function checks to see if the specified appearance effect
11671  ** has been started with begin_appearance_effect().
11672  **
11673  *b Arguments:
11674  **
11675  *a effect - name of appearance effect to check
11676  *a override_link - optional override link effect is attached to
11677  **
11678  *b Returns:
11679  **
11680  ** 1 if appearance is active, 0 if not
11681  */
11682  int appearance_effect_is_active(const char* effect,
11683  const char* override_link = NULL);
11684 
11685 
11686 /*****************************************************************************/
11699  /*l
11700  *b Description:
11701  **
11702  ** This function returns a pointer to a diguyChainSimulation if the
11703  ** character is a chain_simulation type of character.
11704  **
11705  *b Returns:
11706  **
11707  ** pointer to a diguyChainSimulation
11708  */
11709  diguyChainSimulation* get_chain_simulation();
11710 
11711 
11712 /*****************************************************************************/
11725  /*l
11726  *b Description:
11727  **
11728  ** This function returns a pointer to a diguyVehicleController if the
11729  ** character has one.
11730  **
11731  *b Returns:
11732  **
11733  ** pointer to a diguyVehicleController; may return NULL if character
11734  ** does not have a vehicle controller object
11735  */
11736  diguyVehicleController* get_vehicle_controller();
11737 
11738  /*l
11739  *b Description:
11740  **
11741  ** For most characters playing a travel forward action, the
11742  ** character's facing direction matches the direction of travel. For
11743  ** example, when humans walk forward their pelvis is generally
11744  ** aligned in the direction of travel.
11745  **
11746  ** Some vehicle characters behave differently. For vehicles whose
11747  ** front wheels steer, when turning the vehicle body will pivot around
11748  ** the rear axle. Only gradually will the rear of the vehicle swing
11749  ** in behind the direction of travel. Think of a car making a very
11750  ** sharp turn, and how the rear of the car swings in behind the front
11751  ** as the turn is completed.
11752  **
11753  ** This function will return the orientation of the body of the
11754  ** vehicle; i.e., the orientation of the forward vector along the
11755  ** vehicle's long axis. As mentioned above this may be different
11756  ** than the orientation of the direction of travel.
11757  **
11758  ** This function will return valid results for all characters, though
11759  ** the returned values from this function and that of
11760  ** get_orientation() will be the same for non-vehicle characters.
11761  **
11762  *b Returns:
11763  **
11764  ** 0 on success, -1 on failure
11765  */
11766  int get_vehicle_body_orientation(float* rz, float* rx, float* ry);
11767 
11768 
11769 /*****************************************************************************/
11786  /*l
11787  *b Description:
11788  **
11789  ** This function sets the name of the shader technique that will be
11790  ** used by the character when the scenario is using the specified
11791  ** render mode. See diguyScenario::set_current_render_mode().
11792  **
11793  ** Note that care should be taken when changing the shader of
11794  ** characters with skinned appearances. A shader capable of properly
11795  ** transforming vertices must be used for such characters.
11796  **
11797  ** The shader with the given name should be loaded first. If the
11798  ** shader technique is not one of DI-Guy's stock shaders, a custom
11799  ** shader technique can be loaded explicitly by calling
11800  ** the diguyApp::load_shader_program() function.
11801  **
11802  *b NOTE:
11803  **
11804  ** The specified shader technique may not take effect immediately,
11805  ** if the scenario's current render mode is different than the
11806  ** passed render mode. See
11807  ** diguyScenario::set_current_render_mode().
11808  **
11809  *b Arguments:
11810  **
11811  *a shader_name - shader technique name; can be NULL
11812  *a render_mode - render mode to modify; passing NULL will
11813  *a modify shader "normal" render mode
11814  **
11815  *b Returns:
11816  **
11817  ** 0 on success, -1 on failure
11818  */
11819  int set_render_mode_shader(const char* shader_name,
11820  const char* render_mode = NULL);
11821 
11822  /*l
11823  *b Description:
11824  **
11825  ** This function resets the shader technique for the specified render
11826  ** mode to its default. This will be the shader technique name
11827  ** returned by
11828  ** diguyScenario::get_default_character_shader_program_name().
11829  **
11830  ** If the specified render mode is the current scenario render mode,
11831  ** the current shader will change immediately. If not, the change
11832  ** will not take effect until the specified render mode becomes the
11833  ** current scenario render mode. See
11834  ** diguyScenario::set_current_render_mode().
11835  **
11836  *b Arguments:
11837  **
11838  *a render_mode - render mode to modify; passing NULL will
11839  *a modify shader of "normal" render mode
11840  */
11841  void reset_render_mode_shader_to_default(const char* render_mode = NULL);
11842 
11843  /*l
11844  *b Description:
11845  **
11846  ** This function returns the name of the shader technique that will be used by
11847  ** the character when the scenario is using the specified render
11848  ** mode.
11849  **
11850  *b Arguments:
11851  **
11852  *a render_mode - render mode for which to get technique name;
11853  *a pass NULL for "normal" render mode
11854  **
11855  *b Returns:
11856  **
11857  ** name of shader technique; NULL if none or error
11858  */
11859  const char* get_render_mode_shader(const char* render_mode = NULL);
11860 
11861  /*l
11862  *b Description:
11863  **
11864  ** This function returns the shader program that is in use by the
11865  ** character. Shader programs are shared objects that can be used
11866  ** by multiple characters. This is here for backwards compatibility,
11867  ** and just returns the highest quality shader technique shader.
11868  **
11869  *b Returns:
11870  **
11871  ** object of type diguyGraphicsShaderProgram; NULL if none
11872  */
11873  diguyGraphicsShaderProgram* get_shader_program();
11874 
11875  /*l
11876  *b Description:
11877  **
11878  ** This function returns the shader technique that is in use by the
11879  ** character. Shader techniques own a number of shader objects.
11880  **
11881  *b Returns:
11882  **
11883  ** object of type diguyGraphicsShaderTechnique; NULL if none
11884  */
11885  diguyGraphicsShaderTechnique* get_shader_technique();
11886 
11887  /*l
11888  *b Description:
11889  **
11890  ** This function overrides the current shader with the specified
11891  ** temporary shader. This temporary shader will remain in effect
11892  ** until:
11893  **
11894  *- - the scenario is reset
11895  *- - reset_current_shader_to_default() is called
11896  *- - set_temporary_current_shader() is called with NULL
11897  **
11898  *b Arguments:
11899  **
11900  *a shader_name - shader name; can be NULL
11901  **
11902  ** Passing NULL for the shader name will un-set the temporary shader,
11903  ** resetting the render mode shader to its default.
11904  **
11905  *b Returns:
11906  **
11907  ** 0 on success, -1 on failure
11908  */
11909  int set_temporary_current_shader(const char* shader_name);
11910 
11911  /*l
11912  *b Description:
11913  **
11914  ** This is a convenience function for resetting the current render
11915  ** mode shader to its default.
11916  **
11917  ** It is equivalent to retrieving the current render mode using
11918  ** diguyScenario::get_current_render_mode(), and calling
11919  ** reset_render_mode_shader_to_default() with that render mode.
11920  */
11921  void reset_current_shader_to_default();
11922 
11923  /*l
11924  *b Description:
11925  **
11926  ** This is a convenience function for refreshing the shader
11927  ** of a character. Usually used in conjunction with logic
11928  ** provided by the user with the graphics API.
11929  */
11930  void trigger_shader_refresh();
11931 
11932  /*l
11933  *b Description:
11934  **
11935  ** This function returns the shader instance that is in use by the
11936  ** character. Each character has its own shader instance.
11937  **
11938  ** Note that the shader instance of a character can change over the
11939  ** lifetime of the character. For example, it will change if the
11940  ** appearance of the character changes. Therefore the returned
11941  ** pointer should not be stored, but should be re-read each time
11942  ** it is needed.
11943  **
11944  *b Returns:
11945  **
11946  ** object of type diguyGraphicsShaderInstance; NULL if none
11947  */
11948  diguyGraphicsShaderInstance* get_shader_instance();
11949 
11950  /*l
11951  *b Description:
11952  **
11953  ** This function resets current values of the variables of the shader
11954  ** back to their initial reset values.
11955  */
11956  void reset_shader_instance_variables_to_initial_values();
11957 
11958  /*l
11959  *b Description:
11960  **
11961  ** This function resets the current and initial values of variables
11962  ** of the shader to the built-in DI-Guy configuration defaults.
11963  */
11964  void reset_shader_instance_variables_to_program_defaults();
11965 
11966 
11967 /*****************************************************************************/
11991  /*l
11992  *b Description:
11993  **
11994  ** This function sets the named character as the attack
11995  ** target of this agent. This agent will pursue the
11996  ** target until it is within range, and then will fire its
11997  ** weapon in an attempt to kill the target.
11998  **
11999  ** This function will implicitly put this agent into the
12000  ** attack behavior.
12001  **
12002  ** The current focus character will be set the specified character.
12003  ** Pass NULL or the empty string ("") to not change the focus
12004  ** character, but still change to the pursue behavior.
12005  **
12006  ** The current focus group will be un-set.
12007  **
12008  *b Arguments:
12009  **
12010  *a character_name - character to attack
12011  **
12012  *b Returns:
12013  **
12014  ** 0 on success, -1 on failure
12015  **
12016  *b Available as Decision Bead/Event
12017  */
12018  int agent_attack_character(const char* character_name);
12019 
12020  /*l
12021  *b Description:
12022  **
12023  ** This function is similar to agent_attack_character(), but instead
12024  ** will choose attack targets from the characters in the specified
12025  ** group.
12026  **
12027  ** This function will implicitly put this agent into the attack
12028  ** behavior.
12029  **
12030  ** The current focus group will be set to the specified group. Pass
12031  ** NULL or the empty string ("") to not change the focus group, but
12032  ** still change to the attack behavior.
12033  **
12034  ** The current focus character will be un-set.
12035  **
12036  *b Arguments:
12037  **
12038  *a group_name - name of group from which attack targets should
12039  *a be chosen
12040  **
12041  *b Returns:
12042  **
12043  ** 0 on success, -1 on failure
12044  **
12045  *b Available as Decision Bead/Event
12046  */
12047  int agent_attack_group(const char* group_name);
12048 
12049  /*l
12050  *b Description:
12051  **
12052  ** See diguyAgentParams::set_attack_zone_enabled().
12053  */
12054  int agent_set_attack_zone_enabled(int use_attack_zone);
12055 
12056  /*l
12057  *b Description:
12058  **
12059  ** See diguyAgentParams::get_attack_zone_enabled().
12060  */
12061  int agent_get_attack_zone_enabled();
12062 
12063  /*l
12064  *b Description:
12065  **
12066  ** See diguyAgentParams::set_attack_zone().
12067  */
12068  int agent_set_attack_zone(float x, float y, float z, float radius);
12069 
12070  /*l
12071  *b Description:
12072  **
12073  ** See diguyAgentParams::get_attack_zone().
12074  */
12075  int agent_get_attack_zone(float* x, float* y, float* z, float* radius);
12076 
12083  /*l
12084  *b Description:
12085  **
12086  ** This function adds a flee object to this agent.
12087  ** This agent will attempt to move away from the specified
12088  ** character until it is beyond the specified flee distance.
12089  **
12090  ** Note: Currently there can only be one flee object. This
12091  ** restriction will be lifted in a future version.
12092  **
12093  ** This function will implicitly put this agent into the
12094  ** flee behavior.
12095  **
12096  ** Neither the current focus character nor group will be
12097  ** changed by this function.
12098  **
12099  *b Arguments:
12100  **
12101  *a character_name - character from which to flee
12102  *a distance - minimum distance to move away from character
12103  *a danger_level - how "strong" the flee should be; set from
12104  *a 0 to 100
12105  **
12106  ** The danger_level argument is not currently used, but will be in
12107  ** a future version.
12108  **
12109  *b Returns:
12110  **
12111  ** 0 on success, -1 on failure
12112  **
12113  *b Available as Decision Bead/Event
12114  */
12115  int agent_flee_character(const char* character_name,
12116  float distance,
12117  int danger_level = 50);
12118 
12119  /*l
12120  *b Description:
12121  **
12122  ** This function adds a flee object to this agent. This agent
12123  ** will attempt to move away from the specified group until it is
12124  ** beyond the specified flee distance.
12125  **
12126  ** This function will implicitly put this agent into the flee
12127  ** behavior.
12128  **
12129  ** Neither the current focus character nor group will be changed
12130  ** by this function.
12131  **
12132  *b Arguments:
12133  **
12134  *a group_name - group from which to flee
12135  *a distance - minimum distance to move away from character
12136  *a danger_level - how "strong" the flee should be; set from
12137  *a 0 to 100
12138  **
12139  ** The danger_level argument is not currently used, but will be in
12140  ** a future version.
12141  **
12142  *b Returns:
12143  **
12144  ** 0 on success, -1 on failure
12145  **
12146  *b Available as Decision Bead/Event
12147  */
12148  int agent_flee_group(const char* group_name,
12149  float distance,
12150  int danger_level = 50);
12151 
12152  /*l
12153  *b Description:
12154  **
12155  ** This function is similar to agent_flee_group(), but the
12156  ** agent will instead flee the members of the specified
12157  ** crowd.
12158  */
12159  int agent_flee_crowd(const char* crowd_name,
12160  float distance,
12161  int danger_level = 50);
12162 
12163  /*l
12164  *b Description:
12165  **
12166  ** This function adds a flee object to this agent.
12167  ** This agent will attempt to move away from the specified
12168  ** location until it is beyond the specified flee distance.
12169  **
12170  ** Note: Currently there can only be one flee object. This
12171  ** restriction will be lifted in a future version.
12172  **
12173  ** This function will implicitly put this agent into the
12174  ** flee behavior.
12175  **
12176  ** Neither the current focus character nor group will be
12177  ** changed by this function.
12178  **
12179  *b Arguments:
12180  **
12181  *a x, y, z - location from which to flee
12182  *a distance - minimum distance to move away from character
12183  *a danger_level - how "strong" the flee should be; set from
12184  *a 0 to 100
12185  **
12186  ** The danger_level argument is not currently used, but will be in
12187  ** a future version.
12188  **
12189  *b Returns:
12190  **
12191  ** 0 on success, -1 on failure
12192  */
12193  int agent_flee_location(float x, float y, float z,
12194  float distance,
12195  int danger_level = 50);
12196 
12197  /*l
12198  *b Description:
12199  **
12200  ** This function removes all flee objects.
12201  **
12202  ** This function has no effect on current behavior.
12203  **
12204  *b Returns:
12205  **
12206  ** 0 on success, -1 on failure
12207  **
12208  *b Available as Decision Bead/Event
12209  */
12210  void agent_remove_all_flee_objects();
12211 
12222  /*l
12223  *b Description:
12224  **
12225  ** This function puts this agent into the mingle behavior, in which
12226  ** it will choose semi-random points in the specified region and
12227  ** subregion to move to. The agent will remain at the selected
12228  ** points for some amount of time, and the select a new point.
12229  **
12230  ** If all members of a crowd have this behavior they will tend to get
12231  ** together in small groups.
12232  **
12233  ** Use diguyAgentParams::set_move_on_t_min() and
12234  ** diguyAgentParams::set_move_on_t_max() for setting how long the
12235  ** agent will remain at the selected mingle points.
12236  **
12237  *b Arguments:
12238  **
12239  *a region_name - region in which to mingle
12240  *a subregion_name - subregion in which to mingle
12241  **
12242  ** The behavior region will be set the specified region. Pass NULL
12243  ** or "(current)" to not change the current behavior region.
12244  **
12245  *b Returns:
12246  **
12247  ** 0 on success, -1 on failure
12248  **
12249  *b Available as Decision Bead/Event
12250  */
12251  int agent_mingle_in_region(const char* region_name = "(current)",
12252  const char* subregion_name = "base");
12253 
12264  /*l
12265  *b Description:
12266  **
12267  ** This function is similar to agent_mingle_in_region(), but agents
12268  ** will pick completely random points and not try to clump together
12269  ** in small groups.
12270  **
12271  *b Returns:
12272  **
12273  ** 0 on success, -1 on failure
12274  **
12275  *b Available as Decision Bead/Event
12276  */
12277  int agent_wander_region(const char* region_name = "(current)",
12278  const char* subregion_name = "base");
12279 
12290  /*l
12291  *b Description:
12292  **
12293  ** This function will cause this agent to pursue the specified
12294  ** character. This agent will attempt to move toward the specified
12295  ** character until it is within its still distance as specified in
12296  ** its agent params.
12297  **
12298  ** This function will implicitly put this agent into the pursue
12299  ** behavior.
12300  **
12301  ** The current focus group will be set to the specified group. Pass
12302  ** NULL or the empty string ("") to not change the focus group, but
12303  ** still change to the attack behavior.
12304  **
12305  ** The current focus character will be un-set.
12306  **
12307  *b Arguments:
12308  **
12309  *a character_name - character to pursue
12310  **
12311  *b Returns:
12312  **
12313  ** 0 on success, -1 on failure
12314  **
12315  *b Available as Decision Bead/Event
12316  */
12317  int agent_pursue_character(const char* character_name);
12318 
12319  /*l
12320  *b Description:
12321  **
12322  ** This function is similar to agent_pursue_character(), but the
12323  ** point toward the agent will move will be offset from the pursued
12324  ** character by the passed offset.
12325  */
12326  int agent_pursue_character_with_offset(const char* character_name,
12327  float offset_x,
12328  float offset_y);
12329 
12330  /*l
12331  *b Description:
12332  **
12333  ** This function is similar to agent_pursue_character(), but instead
12334  ** will choose pursue characters from the characters in the specified
12335  ** group.
12336  **
12337  ** This function will implicitly put this agent into the pursue
12338  ** behavior.
12339  **
12340  ** The current focus group will be set to the specified group. Pass
12341  ** NULL or the empty string ("") to not change the focus group, but
12342  ** still change to the pursue behavior.
12343  **
12344  ** The current focus character will be un-set.
12345  **
12346  *b Arguments:
12347  **
12348  *a group_name - name of group from which pursue characters should
12349  *a be chosen
12350  **
12351  *b Returns:
12352  **
12353  ** 0 on success, -1 on failure
12354  **
12355  *b Available as Decision Bead/Event
12356  */
12357  int agent_pursue_group(const char* group_name);
12358 
12359  /*l
12360  *b Description:
12361  **
12362  ** Calls a formation with this character as a leader, oriented towards
12363  ** (target_x, target_y).
12364  **
12365  *b Returns:
12366  **
12367  ** 0 on success, -1 on failure
12368  */
12369  int agent_call_formation(const char* formation_name,
12370  float target_x,
12371  float target_y);
12372 
12383  /*l
12384  *b Description:
12385  **
12386  ** This function has the character travel along its behavior path
12387  ** shape, typically to the end and then back to the beginning. It
12388  ** will put the agent into the travel behavior.
12389  **
12390  *b Arguments:
12391  **
12392  *a direction - should be either "forward" or "backward"; pass NULL
12393  *a for default forward
12394  *a at_end - what to do when end of path reached
12395  *a waypoint_index - index of waypoint to start at; -1 for nearest,
12396  *a -2 for random
12397  *a offset_y - sideways offset from behavior path
12398  **
12399  ** Valid values for at_end are:
12400  **
12401  *- - "reverse"
12402  *- - "loop"
12403  *- - "stop"
12404  *- - "teleport"
12405  **
12406  ** See the documentation for diguyNavPathAtEnd for information on
12407  ** what each value means.
12408  */
12409  int agent_travel_behavior_path(const char* direction = NULL,
12410  const char* at_end = NULL,
12411  int waypoint_index = -1,
12412  float offset_y = 0.5f);
12413 
12414  /*l
12415  *b Description:
12416  **
12417  ** Similar to agent_travel_behavior_path(), but specific path can be
12418  ** set rather than using behavior path.
12419  */
12420  int agent_travel_path_shape(const char* path_shape_name,
12421  const char* direction = NULL,
12422  const char* at_end = NULL,
12423  int waypoint_index = -1,
12424  float offset_y = 0.5f);
12425 
12426  /*l
12427  *b Description:
12428  **
12429  ** The agent will create a travel path around the border of the
12430  ** region specified. A CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED
12431  ** callback will be triggered every time a character completes a loop
12432  ** around the border.
12433  **
12434  *b Arguments:
12435  **
12436  *a region_name - the name of the region to patrol; leaving blank or
12437  *a passing NULL will use the agent's current region
12438  *a subregion - name of the subregion to use; defaults to the base
12439  *a subregion
12440  **
12441  *b Returns:
12442  **
12443  ** 0 on success, -1 on failure
12444  */
12445  int agent_travel_region_border(const char* region_name = NULL,
12446  const char* subregion_name = "base");
12447 
12448  /*l
12449  *b Description:
12450  **
12451  ** Agent will attempt to create a navigation path on the via_region
12452  ** and then travel it. An A* path planning algorithm is used to find
12453  ** the path, cost preferences from the character's current
12454  ** diguyAgentParams are used in the search.
12455  **
12456  *b Note: as of DI-Guy 12 there is a version of this function
12457  ** agent_move_to_point_bg() that uses a multi-threaded infrastructure.
12458  ** We strongly recommend using it for future developments.
12459  **
12460  *b Arguments:
12461  **
12462  *a x, y, z - the target location
12463  *a via_region - the name of the region to run A* on (pass in "*"
12464  *a to have the code attempt to find the nearest
12465  *a region automatically.)
12466  *a subregion_name - the name of the subregion to restrict search to
12467  **
12468  *b Returns:
12469  **
12470  ** 0 on success, -1 on failure
12471  */
12472  int agent_move_to_point(float x, float y, float z,
12473  const char* via_region = NULL,
12474  const char* subregion_name = "base");
12475 
12476  /*l
12477  *b Description:
12478  **
12479  ** A multi-threaded version of agent_move_to_point(). See that
12480  ** function for more information.
12481  **
12482  ** We recommend switching to using this over the single threaded
12483  ** version. When the path result has been computed a callback with id
12484  ** CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED is triggered and the result is
12485  ** stored in get_path_planning_result(). You can also poll for
12486  ** completion via get_is_path_planning().
12487  **
12488  *b Returns:
12489  **
12490  ** diguyNavPathSearchResults enum value
12491  **
12492  ** The return value is typically DIGUY_NAV_PATH_ERROR_NONE (0) on
12493  ** success, DIGUY_NAV_PATH_ERROR_SEARCH_QUEUED if this has been queued
12494  ** for multi-threading, or a negative value on failure.
12495  */
12496  int agent_move_to_point_bg(float x, float y, float z,
12497  const char* via_region = NULL,
12498  const char* subregion_name = "base");
12499 
12500  /*l
12501  *b Description:
12502  **
12503  ** Agent will attempt to create a navigation path on the region
12504  ** via_region and then travel it. An A* path planning algorithm is
12505  ** used to find the path.
12506  **
12507  ** The subregion masks are used to specify which subregions to use or
12508  ** avoid. Cost bias values can be used to make tweak how strong the
12509  ** repulsion values are.
12510  **
12511  *b Note:
12512  **
12513  ** As of DI-Guy 12 there is a version of this function
12514  ** agent_move_to_point_via_subregions_bg that uses a multi-threaded
12515  ** infrastructure. We strongly recommend using it for future
12516  ** developments.
12517  **
12518  ** This function will fail and return -1 if a path cannot be found.
12519  **
12520  *b Arguments:
12521  **
12522  *a x, y, z - the target location
12523  *a via_region - the name of the region to run A* on (pass in "*"
12524  *a to have the code attempt to find the nearest
12525  *a region automatically)
12526  *a preferred_subregions_mask - diguySubregionMask value of regions
12527  *a preferred for travel
12528  *a cost_bias_for_preferred_regions - how much cheaper it will be
12529  *a to cross spaces that are part of desired subregion;
12530  *a should be < 1.0
12531  *a cost_bias_for_neutral_regions - how much more expensive it will be
12532  *a to cross spaces that are not part of desired subregion; see
12533  *a below for more information
12534  *a repulsed_regions_mask - diguySubregionMask value of regions *not*
12535  *a preferred for travel
12536  *a cost_bias_for_repulsed_regions - how much more expensive it will be
12537  *a to cross regions that are marked as repulsive; pass
12538  *a DIGUY_DEFAULT_FLOAT to avoid completely
12539  **
12540  ** Pass DIGUY_DEFAULT_FLOAT for cost_bias_for_neutral_regions and
12541  ** cost_bias_for_repulsed_regions to specify that they should be
12542  ** avoided completely.
12543  **
12544  ** The preferred_subregions_mask and repulsed_regions_mask use
12545  ** DI-Guy subregion mask values combined together. For example,
12546  ** DIGUY_SUBREGION_MASK_SIDEWALK | DIGUY_SUBREGION_MASK_CROSSWALK.
12547  **
12548  ** For cost_bias_for_neutral_regions, specifying a non-zero value for
12549  ** this lowers the likelihood that searches fail on disjointed
12550  ** subregions. A value < 1 will cause the planner to run faster but
12551  ** explore fewer points, possibly missing preferred regions. Values
12552  ** greater then 1 will explore more points but will be slower.
12553  **
12554  *b NOTE:
12555  **
12556  *b THIS API has changed for DI-GUY 11.
12557  **
12558  ** cost_bias_for_preferred_regions has been added and the neutral and
12559  ** repulsed default values have changed.
12560  **
12561  *b Returns:
12562  **
12563  ** 0 on success, -1 on failure
12564  */
12565  int agent_move_to_point_via_subregions(float x, float y, float z,
12566  const char* via_region = NULL,
12567  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12568  float cost_bias_for_preferred_regions = 0.25f,
12569  float cost_bias_for_neutral_regions = 1.1f,
12570  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12571  float cost_bias_for_repulsed_regions = 10.0f,
12572  int cost_rule = 0);
12573 
12574  /*l
12575  *b Description:
12576  **
12577  ** A multi-threaded version of agent_move_to_point_via_subregions().
12578  ** We recommend switching to using this over the single threaded
12579  ** version. When the result is found a
12580  ** CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED is triggered and the result is
12581  ** stored in get_path_planning_result(), you can also poll for
12582  ** completion via get_is_path_planning().
12583  **
12584  *b Returns:
12585  **
12586  ** diguyNavPathSearchResults enum value
12587  **
12588  ** The return value is typically DIGUY_NAV_PATH_ERROR_NONE (0) on
12589  ** success, DIGUY_NAV_PATH_ERROR_SEARCH_QUEUED if this has been queued
12590  ** for multi-threading, or a negative value on failure.
12591  */
12592  int agent_move_to_point_via_subregions_bg(float x, float y, float z,
12593  const char* via_region = NULL,
12594  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12595  float cost_bias_for_preferred_regions = 0.25f,
12596  float cost_bias_for_neutral_regions = 1.1f,
12597  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12598  float cost_bias_for_repulsed_regions = 10.0f,
12599  int cost_rule = 0);
12600 
12601  /*l
12602  *b Returns:
12603  **
12604  ** diguyNavPathSearchResults value after agent_move_to_point_bg()
12605  ** or agent_move_to_point_via_subregions_bg() has been called when
12606  ** the multi-threaded path planner has completed.
12607  */
12608  int get_path_planning_result();
12609 
12610  /*l
12611  *b Returns:
12612  **
12613  ** 1 if character is currently waiting for a result from the
12614  ** multi-threaded path planner, else 0
12615  */
12616  int get_is_path_planning();
12617 
12618  /*l
12619  *b Description:
12620  **
12621  ** Agent will attempt to create a navigation path on the via_region
12622  ** to a point in the target region, and then travel it. An A* path
12623  ** planning algorithm is used to find the path. Cost preferences from
12624  ** the character's current diguyAgentParams are used in the search.
12625  **
12626  *b Arguments:
12627  **
12628  *a region - target region
12629  *a subregion_name - target subregion
12630  *a via_region - name of the region travel in
12631  **
12632  *b Returns:
12633  **
12634  ** 0 on success, -1 on failure
12635  **
12636  *b Available as Decision Bead/Event
12637  */
12638  int agent_move_to_region(const char* region,
12639  const char* subregion_name = "base",
12640  const char* via_region = NULL);
12641 
12642  /*l
12643  *b Description:
12644  **
12645  ** Similar to agent_move_to_point_via_subregions(), but for moving to
12646  ** another region.
12647  **
12648  *b NOTE:
12649  **
12650  *b THIS API has changed for DI-GUY 11.
12651  **
12652  ** cost_bias_for_preferred_regions has been added and the neutral and
12653  ** repulsed default values have changed.
12654  **
12655  *b See Also:
12656  **
12657  ** diguyScenario::set_max_distance_planning_multiplier();
12658  ** diguyScenario::get_time_spent_path_planning_this_frame();
12659  **
12660  *b Returns:
12661  **
12662  ** 0 on success, -1 on failure
12663  */
12664  int agent_move_to_region_via_subregions(const char* region_name,
12665  const char* subregion_name = "base",
12666  const char* via_region = NULL,
12667  float cost_bias_for_preferred_regions = 0.25f,
12668  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12669  float cost_bias_for_neutral_regions = 1.1f,
12670  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12671  float cost_bias_for_repulsed_regions = 10.0f);
12672 
12683  /*l
12684  *b Description:
12685  **
12686  ** The agent will begin following the specified path, using the path
12687  ** follow behavior (DIGUY_AGENT_BEHAVIOR_PATH_FOLLOW).
12688  **
12689  ** The path follow behavior allows an agent to approximately follow a
12690  ** diguyCharacterPath without being in path position mode. The agent
12691  ** can respond to external stimuli (e.g., run away from gunfire), and
12692  ** later return to and resume the path.
12693  **
12694  ** Currently the path must be a path previously defined for the
12695  ** character, through either DI-Guy Scenario or via path API calls.
12696  **
12697  *b Arguments:
12698  **
12699  *a path_name - name of a path of this character
12700  **
12701  *b Returns:
12702  **
12703  ** 0 on success, -1 on failure
12704  **
12705  *b Available as Decision Bead/Event
12706  */
12707  int agent_path_follow(const char* path_name);
12708 
12709  /*l
12710  *b Description:
12711  **
12712  ** The agent will resume following the path specified by a previous
12713  ** call to agent_path_follow(). This will put the agent back into
12714  ** the path follow behavior.
12715  **
12716  *b Returns:
12717  **
12718  ** 0 on success, -1 on failure
12719  **
12720  *b Available as Decision Bead/Event
12721  */
12722  int agent_resume_path_follow();
12723 
12724  /*l
12725  *b Returns:
12726  **
12727  ** the path being followed in path behavior mode
12728  */
12729  diguyCharacterPath* agent_get_path_follow_path();
12730 
12731  /*l
12732  *b Description:
12733  **
12734  ** In path follow behavior the agent moves along the path specified
12735  ** in agent_path_follow(). How far along the agent is on the path is
12736  ** specified in seconds. This function returns that time.
12737  **
12738  ** Note that advancing along the path may be paused for some reason,
12739  ** typically because the agent is resuming path follow behavior
12740  ** after being in a different behavior, or the agent is too far away
12741  ** from the current desired position on the path. In this case the
12742  ** returned time may not advance for awhile until the agent is close
12743  ** enough to the path to resume advancing along it.
12744  **
12745  ** Call diguyAgentParams::set_path_follow_pause_t_when_off_path()
12746  ** to set whether time will be paused when off of the path.
12747  **
12748  ** Call diguyAgentParams::set_path_follow_unpause_t_at_radius() to
12749  ** set how close the agent must be to the last point on the path
12750  ** before time will resume.
12751  **
12752  *b Returns:
12753  **
12754  ** how far, in seconds, the agent is along its path follow path
12755  */
12756  float agent_get_path_follow_path_t();
12757 
12758  /*l
12759  *b Returns:
12760  **
12761  ** 1 if time along the path is not advancing, else 0
12762  */
12763  int agent_get_path_follow_path_t_paused();
12764 
12775  /*l
12776  *b Returns:
12777  **
12778  ** the crowd this agent is a part of, if any; returns NULL if not in
12779  ** a crowd
12780  */
12781  diguyCrowd* agent_get_crowd();
12782 
12783  /*l
12784  *b Description:
12785  **
12786  ** This function allows the end user to directly change an agent's
12787  ** current behavior. This function currently the only way to start
12788  ** an agent "idling".
12789  */
12790  int agent_begin_behavior(const char* behavior_name);
12791 
12792  /*l
12793  *b Description:
12794  **
12795  ** This function sets the behavior of the agent to "none".
12796  */
12797  int agent_stop_behavior();
12798 
12799  /*l
12800  *b Description:
12801  **
12802  ** This function is a convenience function that changes the focus
12803  ** character of this agent's current crowd params.
12804  **
12805  ** This can also be done by getting the character's current params
12806  ** using get_agent_current_params(), and then calling
12807  ** set_focus_character() on that object. This function
12808  ** call, however, is available in decisions.
12809  **
12810  ** The agent currently need not be part of a crowd for this function
12811  ** to work.
12812  **
12813  *b Arguments:
12814  **
12815  *a character_name - name of character to become new focus
12816  *a character; pass NULL or "" to un-set
12817  *a the focus character
12818  **
12819  *b Returns:
12820  **
12821  ** 0 on success, -1 on failure
12822  **
12823  *b Available as Decision Bead/Event
12824  */
12825  int agent_set_current_focus_character(const char* character_name);
12826 
12827  /*l
12828  *b Description:
12829  **
12830  ** This function returns the current character this agent
12831  ** is focused on. This will either be the character named
12832  ** by the focus character, or the character chosen from the
12833  ** focus group to be the current focus character.
12834  **
12835  ** The agent currently need not be part of a crowd for this function
12836  ** to work.
12837  **
12838  *b Returns:
12839  **
12840  *a pointer to type diguyCharacter
12841  */
12842  diguyCharacter* agent_get_current_focus_character();
12843 
12844  /*l
12845  *b Description:
12846  **
12847  ** Similar to set_current_focus_character(), but sets
12848  ** the current focus group instead of character.
12849  **
12850  ** The agent currently need not be part of a crowd for this function
12851  ** to work.
12852  **
12853  *b Arguments:
12854  **
12855  *a group_name - name of group to become new focus
12856  *a group; pass NULL or "" to un-set
12857  *a the focus group
12858  **
12859  *b Returns:
12860  **
12861  ** 0 on success, -1 on failure
12862  **
12863  *b Available as Decision Bead/Event
12864  */
12865  int agent_set_current_focus_group(const char* group_name);
12866 
12867  /*l
12868  *b Description:
12869  **
12870  ** This function returns the initial agent parameters of
12871  ** this agent. The initial parameters of this agent
12872  ** can then be edited through this object.
12873  **
12874  ** Changes to the initial parameters will have no effect until
12875  ** the scenario is reset.
12876  **
12877  ** The current agent parameters will be set to these
12878  ** initial parameters whenever the scenario is reset.
12879  **
12880  ** The agent currently need not be part of a crowd for this function
12881  ** to work.
12882  **
12883  *b Returns:
12884  **
12885  *a pointer to type diguyAgentParams
12886  */
12887  diguyAgentParams* agent_get_initial_params();
12888 
12889  /*l
12890  *b Description:
12891  **
12892  ** This function returns the current agent parameters of
12893  ** this agent. The current parameters of this agent
12894  ** can then be edited through this object.
12895  **
12896  ** Changes to the current parameters should take effect immediately.
12897  **
12898  ** The current agent parameters will be reset to the
12899  ** initial parameters whenever the scenario is reset.
12900  **
12901  ** The agent currently need not be part of a crowd for this function
12902  ** to work.
12903  **
12904  *b Returns:
12905  **
12906  *a pointer to type diguyAgentParams
12907  */
12908  diguyAgentParams* agent_get_current_params();
12909 
12910  /*l
12911  *b Description:
12912  **
12913  ** This function gets the name of the agent's current profile.
12914  **
12915  *b Returns:
12916  **
12917  ** the name of the agent's current profile
12918  */
12919  const char* agent_get_current_params_profile_name();
12920 
12921  /*l
12922  *b Description:
12923  **
12924  ** This function sets this agent's current agent parameters from the
12925  ** specified crowd profile.
12926  **
12927  ** The agent currently need not be part of a crowd for this function
12928  ** to work.
12929  **
12930  *b Arguments:
12931  **
12932  *a profile_name - name of existing crowd profile
12933  *a retain_focus_objects - pass 1 to not change focus object from
12934  *a current focus
12935  *a retain_navigation_values - pass 1 to not change current navigation
12936  *a parameters
12937  *a retain_behavior - pass 1 to not change current behavior
12938  **
12939  ** Navigation values are things like:
12940  **
12941  *- - behavior path
12942  *- - behavior region and subregion
12943  *- - region masks
12944  *- - cost biases
12945  *- - path planner settings
12946  **
12947  *b Returns:
12948  **
12949  ** 0 on success, -1 on failure
12950  **
12951  *b Available as Decision Bead/Event
12952  */
12953  int agent_set_current_params_from_profile(const char* profile_name,
12954  int retain_focus_objects = 1,
12955  int retain_navigation_values = 1,
12956  int retain_behavior = 0);
12957 
12958  /*l
12959  *b Description:
12960  **
12961  ** Similar to agent_set_current_params_from_profile(), but initial
12962  ** parameters are changed.
12963  */
12964  int agent_set_initial_params_from_profile(const char* profile_name);
12965 
12966  /*l
12967  *b Description:
12968  **
12969  ** This function sets the current parameters from the agent's
12970  ** initial parameters.
12971  */
12972  void agent_set_current_params_from_initial_params();
12973 
12974  /*l
12975  *b Description:
12976  **
12977  ** This function sets whether the borders of the current behavior
12978  ** region of the agent is solid.
12979  **
12980  ** If they are, the agent will treat the walls as if they are
12981  ** solid walls in the environment. If not, the agent is free to
12982  ** walk through them.
12983  **
12984  ** The agent currently need not be part of a crowd for this function
12985  ** to work.
12986  **
12987  *b Arguments:
12988  **
12989  *a is_solid - 1 if region border should be solid, 0 if not
12990  **
12991  *b Available as Decision Bead/Event
12992  */
12993  void agent_set_current_behavior_region_border_is_solid(int is_solid);
12994 
12995  /*l
12996  *b Description:
12997  **
12998  ** If the agent is in a behavior that stays in one place before moving
12999  ** to another, such as wander or mingle, this function will request
13000  ** that the agent move on to the next location.
13001  **
13002  *b Available as Decision Bead/Event
13003  */
13004  void agent_move_on();
13005 
13006 
13007  /*l
13008  *b Description:
13009  **
13010  ** This function controls if the AI will attempt to automatically change variants
13011  ** depending on the behavior. This should only change how still motions are performed
13012  ** when the default variant is Normal. Characters in wander and idle will automatically
13013  ** shift to ambient still motions, mingle will alternate between socialize and ambient
13014  ** motions. Attack should automatically switch from aiming to ambient.
13015  ** defaults to being on.
13016  */
13017  int agent_set_auto_variant_selection(int selection_enabled);
13018 
13019  /*l
13020  *b Description:
13021  **
13022  ** Returns if automatic variant selection is enabled, defaults to being on.
13023  */
13024  int agent_get_auto_variant_selection();
13025 
13026  /*l
13027  *b Description:
13028  **
13029  ** Returns current travel path or nav path.
13030  */
13031  diguyPathShape * agent_get_current_traveled_path();
13032 
13033  /*l
13034  *b Description:
13035  **
13036  ** Allows agent to determine speed zone based on distance to endpoint of current
13037  ** path. With this off, speed zones are determined by "desired position", which
13038  ** when following a path is not the endpoint, but a point on the path a short
13039  ** distance ahead of the current position.
13040  **
13041  ** The default value is false.
13042  **
13043  ** Enable this if you want the character to automatically run when following a
13044  ** long path.
13045  */
13046  void agent_set_use_speed_zones_on_paths(int enabled);
13047 
13048  /*l
13049  *b Description:
13050  **
13051  ** Returns the current value set by agent_set_use_speed_zones_on_paths().
13052  */
13053  int agent_get_use_speed_zones_on_paths();
13054 
13055 #ifdef CPLUSPLUS_ONLY
13056 
13112  /*l
13113  *b Description:
13114  **
13115  ** This function sets a feeler function that will be used by this
13116  ** character for environment collision detection. The feeler will
13117  ** replace any existing feeler function (including the default
13118  ** function used in DI-Guy Scenario).
13119  **
13120  ** See the "User-Defined Feelers" information for more information.
13121  **
13122  *b Arguments:
13123  **
13124  *a feeler_function - pointer to user-defined feeler function
13125  **
13126  *b Returns:
13127  **
13128  ** 0 on success, -1 on failure
13129  **
13130  *b Callable From:
13131  **
13132  *- - C++
13133  */
13134  int agent_set_feeler_function(diguyFeelerFunction* feeler_function);
13135 
13136  /*l
13137  *b Returns:
13138  **
13139  ** current feeler function; see set_feeler_function()
13140  **
13141  *b Callable From:
13142  **
13143  *- - C++
13144  */
13145  diguyFeelerFunction* agent_get_feeler_function();
13146 
13147 #endif
13148 
13149 
13150 /*****************************************************************************/
13156  /*l
13157  *b Description:
13158  **
13159  ** Creates a Lua mind object based off of the contents of base_class.
13160  **
13161  *b Arguments:
13162  **
13163  *a base_class - the class to use as the basis for the character's
13164  *a mind
13165  *a init_arg1-2 - experimental optional arguments passed to the init
13166  *a function; your lua init function will need to take
13167  *a arguments
13168  **
13169  */
13170  int create_lua_mind(const char* base_class, const char* init_arg1 = NULL,
13171  const char* init_arg2 = NULL);
13172 
13173  /*l
13174  *b Description:
13175  **
13176  ** Returns the name of the mind, e.g. "luaPedestrian". This is, in other
13177  ** words, the mind's base class
13178  */
13179  const char *get_mind_name();
13180 
13181  /*l
13182  *b Description:
13183  **
13184  ** Agent characters with minds will typically have the mind be in
13185  ** some state, such as "patrolling", "fleeing", "mobbing", etc. This
13186  ** function returns the name of that state.
13187  **
13188  ** Currently this is only applicable to characters with Lua minds.
13189  **
13190  *b Returns:
13191  **
13192  ** the name of the agent's current mind state
13193  */
13194  const char* get_mind_current_state_name();
13195 
13196  /*l
13197  *b Description:
13198  **
13199  ** This function causes callback functions with the callback id
13200  ** CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED to be called.
13201  ** It's intended use is for mind implementations that need to
13202  ** signal that the mind's current state has changed.
13203  **
13204  ** Currently this is only applicable to characters with Lua minds.
13205  */
13206  void do_mind_current_state_changed_callback();
13207 
13208  /*l
13209  *b Description:
13210  **
13211  ** How long until the character's main coroutine thread should be
13212  ** resumed. This function is typically used by various luaCharacter
13213  ** sleep functions.
13214  **
13215  *b Arguments:
13216  **
13217  *a sleep_length - how long relative to the current time the character
13218  *a should sleep
13219  */
13220  int set_sleep_timer(float sleep_length);
13221 
13222  /*l
13223  *b Returns:
13224  **
13225  ** How long until the character's main coroutine thread resumes,
13226  ** relative to the current time.
13227  */
13228  float get_sleep_timer();
13229 
13230  /*l
13231  *b Description:
13232  **
13233  ** The frequency at which the luaCharacter's heartbeat function
13234  ** should run. This defaults to once per second. The character
13235  ** must have a Lua function named heartbeat.
13236  **
13237  *b Arguments:
13238  **
13239  *a heartbeat_dt - frequency of heartbeat
13240  */
13241  int set_heartbeat_dt(float heartbeat_dt);
13242 
13243  /*l
13244  *b Description:
13245  **
13246  ** This function allows the addition of additional heartbeat
13247  ** functions.
13248  **
13249  *b Arguments:
13250  **
13251  *a function_name - the name of the Lua function to treat as a
13252  *a heartbeat; the function_name should not include
13253  *a the name of the character object
13254  *a heartbeat_dt - frequency of heartbeat
13255  **
13256  *b Returns:
13257  **
13258  ** 0 on success, -1 on failure
13259  */
13260  int add_secondary_heartbeat(const char* function_name,
13261  float heartbeat_dt);
13262 
13263  /*l
13264  *b Description:
13265  **
13266  ** This function removes an added heartbeat function.
13267  **
13268  *b Arguments:
13269  **
13270  *a function_name - the name of the Lua function to treat as a
13271  *a heartbeat; the function_name should not include
13272  *a the name of the character object
13273  **
13274  *b Returns:
13275  **
13276  ** 0 on success, -1 on failure
13277  */
13278  int remove_secondary_heartbeat(const char* function_name);
13279 
13280  /*l
13281  *b Description:
13282  **
13283  ** The frequency at which a luaCharacter's secondary heartbeat
13284  ** function should run. The character must have a Lua function named
13285  ** function_name.
13286  **
13287  *b Arguments:
13288  **
13289  *a function_name - heartbeat function to adjust
13290  *a heartbeat_dt - frequency of heartbeat
13291  **
13292  *b Returns:
13293  **
13294  ** 0 on success, -1 on failure
13295  */
13296  int set_secondary_heartbeat_dt(const char* function_name, float heartbeat_dt);
13297 
13298  /*l
13299  *b Description:
13300  **
13301  ** This function creates a request that whenever the specified
13302  ** callback is triggered, the character is woken up with a message.
13303  ** The message will be of the form:
13304  *>
13305  *- - message_type = "callback"
13306  *- - message = the string representation of the callback
13307  *<
13308  ** A good example of the use for this is a flexible "move to"
13309  ** command:
13310  **
13311  *b Lua Example:
13312  **
13313  *e self.character:add_wakeup_callback(diguyCharacter_CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED);
13314  *e -- begin to move to a location
13315  *e self.character:agent_move_to_region_via_subregions("navmesh", "green", "navmesh",
13316  *e DIGUY_SUBREGION_MASK_BASE, 12);
13317  *e -- sleep till arrived
13318  *e self:sleep(100);
13319  *e self.character:remove_wakeup_callback(diguyCharacter_CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED);
13320  **
13321  ** Effectively the character will wake up either after 100 seconds or
13322  ** when they arrive at their desired destination.
13323  **
13324  *b Arguments:
13325  **
13326  *a callback - the callback id that should wake up the character
13327  **
13328  *b Returns:
13329  **
13330  ** 0 on success, -1 on failure
13331  */
13332  int add_wakeup_callback(int callback);
13333 
13334  /*l
13335  *b Description:
13336  **
13337  ** This function removes a request to trigger a message when a
13338  ** callback is triggered.
13339  **
13340  *b Arguments:
13341  **
13342  *a callback - callback id that should no longer wake up the
13343  *a character
13344  **
13345  *b Returns:
13346  **
13347  ** 0 on success, -1 on failure
13348  */
13349  int remove_wakeup_callback(int callback);
13350 
13351  /*l
13352  *b Description:
13353  **
13354  ** This function removes all requests to trigger a message when
13355  ** callbacks are triggered.
13356  **
13357  *b Returns:
13358  **
13359  ** 0 on success, -1 on failure
13360  */
13361  int remove_all_wakeup_callbacks();
13362 
13363  /*l
13364  *b Description:
13365  **
13366  ** This function check for a requests to trigger a message when
13367  ** a given callback is triggered.
13368  **
13369  *b Returns:
13370  **
13371  ** 0 on false, 1 on true
13372  */
13373  int has_wakeup_callback(int callback);
13374 
13375  /*l
13376  *b Description:
13377  **
13378  ** This function wakes up a character and sends them a message.
13379  ** Currently this is only applicable to characters with Lua minds.
13380  **
13381  *b Arguments:
13382  **
13383  *a sender - who is sending the message
13384  *a message_type - what type of message is being sent
13385  *a message - the message string
13386  *a message_params - optional parameter string
13387  **
13388  *b Returns:
13389  **
13390  ** number of times message was successfully parsed
13391  */
13392  int agent_accept_message(const char* sender,
13393  const char* message_type,
13394  const char* message,
13395  const char* message_params = NULL);
13396 
13397  /*l
13398  **
13399  *b Description:
13400  **
13401  ** This function wakes up nearby characters and sends them a message.
13402  ** The sender of the message is implicitly set to the individual
13403  ** calling the broadcast function
13404  **
13405  ** Currently this is only applicable to characters with Lua minds.
13406  **
13407  *b Arguments:
13408  **
13409  *a radius - how far to broadcast the message
13410  *a message_type - what type of message is being sent
13411  *a message - the message string
13412  *a message_params - optional parameter string
13413  **
13414  *b Returns:
13415  **
13416  ** number of times message was successfully parsed
13417  */
13418  int agent_broadcast_message(float radius,
13419  const char* message_type,
13420  const char* message,
13421  const char* message_params = NULL);
13422 
13423  /*l
13424  *b Description:
13425  **
13426  ** This function wakes up nearby characters in the group specified
13427  ** and sends them a message. The sender of the message is implicitly
13428  ** set to the individual calling the broadcast function.
13429  **
13430  ** Currently this is only applicable to characters with Lua minds.
13431  **
13432  *b Arguments:
13433  **
13434  *a group_name - group to broadcast message to
13435  *a radius - how far to broadcast the message
13436  *a message_type - what type of message is being sent
13437  *a message - the message string
13438  *a message_params - optional parameter string
13439  **
13440  **
13441  *b Returns:
13442  **
13443  ** number of times message was successfully parsed,
13444  ** -1 on failure
13445  */
13446  int agent_broadcast_message_to_group(const char* group_name,
13447  float radius,
13448  const char* message_type,
13449  const char* message,
13450  const char* message_params = NULL);
13451 
13452  /*l
13453  **
13454  *b Returns:
13455  **
13456  ** name of character's lua mind object; typically this is the
13457  ** character's name with '-' replaced by '_'
13458  */
13459  const char* get_lua_object_name();
13460 
13461  /*l
13462  *b Description:
13463  **
13464  ** Sets the specified field of the mind to the string field_value.
13465  */
13466  void set_mind_field_as_string(const char* field_name,
13467  const char* field_value);
13468 
13469  /*l
13470  *b Description:
13471  **
13472  ** Queries the luaCharacter object for a specific field, and attempts
13473  ** to convert it into a string. This works for strings and
13474  ** numbers.
13475  **
13476  ** This returned pointer will stay valid until the next time this
13477  ** function is called, so if the results need to be saved they must
13478  ** be copied.
13479  **
13480  *b Returns:
13481  **
13482  ** field_name as string
13483  */
13484  const char* get_mind_field_as_string(const char* field_name,
13485  int warn_if_no_field = 1);
13486 
13487  /*l
13488  *b Description:
13489  **
13490  ** Sets the specified field of the mind to the floating point
13491  ** number field_value.
13492  */
13493  void set_mind_field_as_float(const char* field_name, float field_value);
13494 
13495  /*l
13496  *b Description:
13497  **
13498  ** Similar to get_mind_field_as_string(), but returns field as
13499  ** a float.
13500  **
13501  *b Returns:
13502  **
13503  ** field_name as double
13504  */
13505  float get_mind_field_as_float(const char* field_name,
13506  int warn_if_no_field = 1,
13507  int* found_field = NULL);
13508 
13509  /*l
13510  *b Description:
13511  **
13512  ** Sets the specified field of the mind to the integer number
13513  ** field_value.
13514  */
13515  void set_mind_field_as_int(const char* field_name, int field_value);
13516 
13517  /*l
13518  *b Description:
13519  **
13520  ** Similar to get_mind_field_as_int(), but returns field as
13521  ** an integer.
13522  **
13523  *b Returns:
13524  **
13525  ** field_name as int
13526  */
13527  int get_mind_field_as_int(const char* field_name,
13528  int warn_if_no_field = 1,
13529  int* found_field = NULL);
13530 
13531  /*l
13532  *b Description:
13533  **
13534  ** Attempts to run a luaCharacter member function, and can optionally
13535  ** return the function's result. Lua return values can be converted
13536  ** to strings and numbers -- other data types will cause an error.
13537  **
13538  ** This returned pointer will stay valid until the next time this
13539  ** function is called, so if the results need to be saved they must
13540  ** be copied.
13541  **
13542  *b *Note:* This function should be considered experimental, as the
13543  *b API may change.
13544  **
13545  *b Arguments:
13546  **
13547  *a function_name - luaCharacter function field to invoke
13548  *a argument - optional string argument to the function
13549  *a has_return_string - 0 or 1; determines if lua interface should
13550  *a attempt to retrieve a string value
13551  **
13552  *b Returns:
13553  **
13554  ** Lua function return value
13555  */
13556  const char* evaluate_mind_function(const char* function_name,
13557  const char* argument = NULL,
13558  int has_return_string = 0);
13559 
13560  /*l
13561  *b Description:
13562  **
13563  ** This function produces a string with a long list of character
13564  ** information, including: current path, crowd, behavior, lua state,
13565  ** lua call stack, wakeup callbacks and lua object fields. It is
13566  ** meant to help with debugging agents.
13567  **
13568  ** This returned pointer will stay valid until the next time this
13569  ** function is called, so if the results need to be saved they must
13570  ** be copied.
13571  **
13572  *b Arguments:
13573  **
13574  *a include_stack - pass 1 to include callstack info, 0 to not
13575  *a include_locals - pass 1 to include local variable info, 0 to not
13576  **
13577  *b Returns:
13578  **
13579  ** string containing character information
13580  */
13581  const char* get_ai_state_string(int include_stack = 1, int include_locals = 1);
13582 
13583 
13584 /*****************************************************************************/
13594 /*
13595  *3 Visibility Tests
13596  */
13597 
13598  /*l
13599  *b Description:
13600  **
13601  ** This function tests whether this character can see the passed
13602  ** character. Currently this tests if the cervical link of this
13603  ** character has a clear line of sight to either the cervical or the
13604  ** position links of the target. Currently the orientation of this
13605  ** character isn't factored in.
13606  **
13607  ** This function does not fail if other characters are between the
13608  ** two characters in question.
13609  **
13610  ** Checking visibility is only an option if an octtree is generated
13611  ** from scene objects; typically only DI-Guy Scenario does this.
13612  ** Outside of DI-Guy Scenario set_character_los_function() should be
13613  ** used if no octtree is present.
13614  **
13615  *b Arguments:
13616  **
13617  *a character - character to check
13618  *a los_check_type - currently unused but passed to callback function
13619  *a if end users wish to pass an additional parameter
13620  **
13621  *b Returns:
13622  **
13623  ** 1 if character is visible, 0 if not
13624  */
13625  int check_character_visibility(diguyCharacter* character,
13626  int los_check_type = 0);
13627 
13628  /*l
13629  *b Description:
13630  **
13631  ** This function tests whether this character can see the x, y, z
13632  ** location specified. Currently this tests if the cervical link of
13633  ** this character has a clear line of sight to the x, y, z location.
13634  ** Currently the orientation of this character isn't factored in.
13635  **
13636  ** This function does not fail if other characters are between the
13637  ** character and the location in question.
13638  **
13639  ** Checking visibility is only an option if an octtree is generated
13640  ** from scene objects; typically only DI-Guy Scenario does this.
13641  **
13642  *b Arguments:
13643  **
13644  *a x, y, z - location to check
13645  **
13646  *b Returns:
13647  **
13648  ** 1 if location is visible, 0 if not
13649  */
13650  int check_point_visibility(float x, float y, float z);
13651 
13652 
13653 
13654 /*****************************************************************************/
13671 #ifdef CPLUSPLUS_ONLY
13672 
13673  /*l
13674  *b Description:
13675  **
13676  ** When a character needs to check if it can see a location, DI-Guy
13677  ** calls this function with a pointer to the diguyCharacter in
13678  ** question, and the coordinates of the point that is being looked
13679  ** at. This currently happens when an agent is told to move to a new
13680  ** region.
13681  **
13682  ** The following prototype should be used for the point line-of-sight
13683  ** function:
13684  **
13685  *e int diguyPointLOSFunction(diguyCharacter* character,
13686  *e float x,
13687  *e float y,
13688  *e float z);
13689  **
13690  ** The function should then check if the desired location is visible.
13691  ** This can be done in a number of ways; a typical approach is to do
13692  ** an intersection test with the static scene.
13693  **
13694  ** The function should return 1 if the path to the target is clear, 0
13695  ** if there is an obstruction.
13696  **
13697  ** A default point line-of-sight function can be set for all
13698  ** subsequently created characters by calling
13699  ** diguyScenario::set_default_point_los_function().
13700  **
13701  *b Callable From:
13702  **
13703  *- - C++
13704  */
13705  int set_point_los_function(diguyPointLOSFunction* point_los_function);
13706 
13707  /*l
13708  *b Returns:
13709  **
13710  ** current point line-of-sight function; see set_point_los_function()
13711  **
13712  *b Callable From:
13713  **
13714  *- - C++
13715  */
13716  diguyPointLOSFunction* get_point_los_function();
13717 
13718  /*l
13719  *b Description:
13720  **
13721  ** When a character needs to check if it can see another character,
13722  ** DI-Guy calls this function with a pointer to the diguyCharacter in
13723  ** question. This can happen when check_character_visibility() is
13724  ** invoked or when AI attack code assesses if it should take a shot.
13725  **
13726  ** The following prototype should be used for the character
13727  ** line-of-sight function:
13728  **
13729  *e int diguyCharacterLOSFunction(diguyCharacter* character,
13730  *e diguyCharacter* target_character,
13731  *e int los_test_type) // (currently unused)
13732  **
13733  ** Currently the los_test_type argument defaults to 0 and is not used
13734  ** internally. It is, however, available in
13735  ** check_character_visibility() and will be passed to the callback.
13736  ** This can be useful if the end user wants to write scripting code
13737  ** that has alternative Line of Sight tests depending on agent
13738  ** conditions. (e.g. a test that factors in the character's field of
13739  ** view.)
13740  **
13741  ** The function then checks if the target character is visible. This
13742  ** can be done in a number of ways; a typical approach is to do an
13743  ** intersection test with the static scene. The default
13744  ** implementation tests the path from the characters head to the
13745  ** target's head and then to the target's feet.
13746  **
13747  ** The function should return 1 if the path to the target is clear,
13748  ** and 0 if there is an obstruction.
13749  **
13750  ** A default character line-of-sight function can be set for all
13751  ** subsequently created characters by calling
13752  ** diguyScenario::set_default_character_los_function().
13753  **
13754  *b Callable From:
13755  **
13756  *- - C++
13757  */
13758  int set_character_los_function(diguyCharacterLOSFunction* character_los_function);
13759 
13760  /*l
13761  *b Returns:
13762  **
13763  ** current character line-of-sight function; see
13764  ** set_character_los_function()
13765  **
13766  *b Callable From:
13767  **
13768  *- - C++
13769  */
13770  diguyCharacterLOSFunction* get_character_los_function();
13771 
13772 #endif
13773 
13774 
13775 /*****************************************************************************/
13792  int get_num_ik_chains();
13794 
13796  const char * get_ik_chain_name_at_index(int index);
13797 
13798  /*b Description:
13799  ** Moves the end effector for the specified ik chain to a location in the world.
13800  **
13801  *b Arguments:
13802  *a ik_chain_target - index of ik chain
13803  *a x,y,z - world location of where to move the IK end effector to.
13804  *a ramp_time - how long to take blending in solution
13805  **
13806  *b Returns:
13807  ** -1 on failure, 0 on success
13808  */
13809  int set_ik_target_world(int ik_chain_target, float x, float y, float z, float ramp_time = .25f);
13810 
13811  /*b Description:
13812  ** Moves the end effector for the specified ik chain to a location relative to the character.
13813  **
13814  *b Arguments:
13815  *a ik_chain_target - index of ik chain
13816  *a x,y,z - local location of where to move the IK end effector to.
13817  *a ramp_time - how long to take blending in solution
13818  **
13819  *b Returns:
13820  ** -1 on failure, 0 on success
13821  */
13822  int set_ik_target_local(int ik_chain_target, float x, float y, float z, float ramp_time = .25f);
13823 
13824  /*b Description:
13825  ** Moves the end effector for the specified ik chain to location on another character.
13826  **
13827  *b Arguments:
13828  *a ik_chain_target - index of ik chain
13829  *a target - target character.
13830  *a link_name - target joint
13831  *a ramp_time - how long to take blending in solution
13832  **
13833  *b Returns:
13834  ** -1 on failure, 0 on success
13835  */
13836  int set_ik_target_character(int ik_chain_target, diguyCharacter * target, const char * link_name, float ramp_time = .25f);
13837 
13838 
13839  /*b Description:
13840  ** Resets the end effector to be solely driven by the animation system */
13841  int disable_ik_target(int ik_chain_target, float ramp_time = .25f);
13842 
13843  /*b Description:
13844  ** Sets the distance to the primary camera, this should be automatically set in OpenGL
13845  ** or if you set the camera position, in retained mode renderers you will need to set this
13846  ** manually. Currently only used by IK system for performance culling.
13847  */
13848  void set_distance_to_primary_camera(float camera_dist);
13849 
13851  float get_distance_to_primary_camera();
13852 
13853 /*****************************************************************************/
13869  /*l
13870  *b Description:
13871  **
13872  ** This function sets the initial character simulator this character
13873  ** will use. The current simulator will be set to this value on
13874  ** scenario reset.
13875  **
13876  ** The current simulator can be set by calling
13877  ** set_current_character_simulator().
13878  **
13879  ** The default simulator is
13880  ** DIGUY_CHARACTER_SIMULATOR_DIGUY_MOTION_ENGINE.
13881  **
13882  ** Requires active physics module if character simulator is set to
13883  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13884  **
13885  *b Arguments:
13886  **
13887  *a character_simulator - which simulator to use at reset
13888  **
13889  *b Returns:
13890  **
13891  ** 0 on success, -1 on failure
13892  */
13893  int set_initial_character_simulator(diguyCharacterSimulator character_simulator);
13894 
13895  /*l
13896  *b Returns:
13897  **
13898  ** initial character simulator
13899  */
13900  diguyCharacterSimulator get_initial_character_simulator();
13901 
13902  /*l
13903  *b Description:
13904  **
13905  ** This function sets the current character simulator this character
13906  ** will use. The current simulator will be reset to the initial
13907  ** character simulator on scenario reset.
13908  **
13909  ** The initial simulator can be set by calling
13910  ** set_initial_character_simulator().
13911  **
13912  *b Arguments:
13913  **
13914  *a character_simulator - new current character simulator
13915  **
13916  *b Returns:
13917  **
13918  ** 0 on success, -1 on failure
13919  */
13920  int set_current_character_simulator(diguyCharacterSimulator character_simulator);
13921 
13922  /*l
13923  *b Returns:
13924  **
13925  ** current character simulator
13926  */
13927  diguyCharacterSimulator get_current_character_simulator();
13928 
13929  /*l
13930  *b Description:
13931  **
13932  ** This function sets the initial physics simulation mode this
13933  ** character will use. The current simulation mode will be set to
13934  ** this value on scenario reset.
13935  **
13936  ** The current simulation mode can be set by calling
13937  ** set_current_physics_simulation_mode().
13938  **
13939  ** The default simulation mode is
13940  ** DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER.
13941  **
13942  ** The physics simulation mode will have no effect unless the current
13943  ** character simulator is
13944  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13945  **
13946  *b Arguments:
13947  **
13948  *a physics_simulation_mode - which simulation mode to use at reset
13949  **
13950  *b Returns:
13951  **
13952  ** 0 on success, -1 on failure
13953  */
13954  int set_initial_physics_simulation_mode(diguyPhysicsSimulationMode physics_simulation_mode);
13955 
13956  /*l
13957  *b Returns:
13958  **
13959  ** initial physics simulation mode
13960  */
13961  diguyPhysicsSimulationMode get_initial_physics_simulation_mode();
13962 
13963  /*l
13964  *b Description:
13965  **
13966  ** This function sets the current physics simulation mode this
13967  ** character will use. The current simulation mode will be reset to
13968  ** the initial physics simulator mode on scenario reset.
13969  **
13970  ** The initial simulation mode can be set by calling
13971  ** set_initial_physics_simulation_mode().
13972  **
13973  ** The physics simulation mode will have no effect unless the current
13974  ** character simulator is
13975  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13976  **
13977  *b Arguments:
13978  **
13979  *a physics_simulation_mode - new current physics simulation mode
13980  **
13981  *b Returns:
13982  **
13983  ** 0 on success, -1 on failure
13984  */
13985  int set_current_physics_simulation_mode(diguyPhysicsSimulationMode physics_simulation_mode);
13986 
13987  /*l
13988  *b Returns:
13989  **
13990  ** initial physics simulation mode
13991  */
13992  diguyPhysicsSimulationMode get_current_physics_simulation_mode();
13993 
13994  /*l
13995  *b Description:
13996  **
13997  ** This function sets the physics collision group this character will
13998  ** be in when being simulated. For improved performance, collision
13999  ** detection between various characters and scene objects will not
14000  ** be performed, based on which collision groups the objects are in.
14001  **
14002  ** By default:
14003  **
14004  *- - characters in character group n collide against props in prop
14005  *- group n and scene objects in scene object group n
14006  *- in group n
14007  *- - characters in group ghost don't collide against any other
14008  *- characters, but do against scene objects and props
14009  *- - characters in group everything collide against all characters,
14010  *- props, and scene objects
14011  *- - all props collide against all other props and scene objects
14012  **
14013  ** Collision group relationships can be modified using
14014  ** diguyApp::set_collision_group_detection_flag().
14015  **
14016  *b Arguments:
14017  **
14018  *a physics_simulation_mode - new current physics simulation mode
14019  **
14020  *b Returns:
14021  **
14022  ** 0 on success, -1 on failure
14023  */
14024  int set_physics_collision_group(diguyPhysicsCollisionGroup collision_group);
14025 
14026  /*l
14027  *b Returns:
14028  **
14029  ** physics collision group
14030  */
14031  diguyPhysicsCollisionGroup get_physics_collision_group();
14032 
14033  /*l
14034  *b Description:
14035  **
14036  ** This function sets a time at which active simulation of a physics
14037  ** controlled character will stop. This is useful for:
14038  **
14039  *- - reducing simulation processing overhead
14040  *- - freezing a simulation that is mostly in steady state, but some
14041  *- small part remains oscillating
14042  **
14043  ** The physics controlled character will remain frozen in the last
14044  ** computed simulated pose.
14045  **
14046  *b Arguments:
14047  **
14048  *a t - scenario t at which simulation will freeze
14049  **
14050  ** t should be large enough for the simulation to reach a reasonably
14051  ** steady state, such as a human lying on the ground. A value that
14052  ** is usually reasonable is around 5 seconds.
14053  */
14054  void set_stop_physics_sim_at_t(float t);
14055 
14056  /*l
14057  *b Description:
14058  **
14059  ** Similar to set_stop_physics_sim_at_t(), but the passed time will
14060  ** be relative to the current simulation time as returned by
14061  ** diguyScenario::get_t().
14062  */
14063  void set_stop_physics_sim_in_t_seconds(float relative_t);
14064 
14065  /*l
14066  *b Returns:
14067  **
14068  ** time at which physics simulation will freeze
14069  */
14070  float get_stop_physics_sim_at_t();
14071 
14072  /*l
14073  *b Description:
14074  **
14075  ** This function applied an impulse force to the character. An
14076  ** impulse is a force that is applied all at one time, such as an
14077  ** explosion shock wave.
14078  **
14079  *b Arguments:
14080  **
14081  *a link - link to which impulse should be applied
14082  *a impulse_magnitude_[xyz] - magnitude of impulse in x direction
14083  *a link_offset_[xyz] - offset on link at which to apply impulse
14084  *a set_simulation_drives_character - pass 1 to automatically change
14085  *a the character's current simulation mode
14086  *a to DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER
14087  */
14088  void apply_impulse_to_physics_sim(const char* link,
14089  float impulse_magnitude_x,
14090  float impulse_magnitude_y,
14091  float impulse_magnitude_z,
14092  float link_offset_x = 0.0f,
14093  float link_offset_y = 0.0f,
14094  float link_offset_z = 0.0f,
14095  int set_simulation_drives_character = 1);
14096 
14097  /*l
14098  *b Description:
14099  **
14100  ** Similar to apply_impulse_to_physics_sim(), but impulse can be
14101  ** calculated relative to a world position. This is useful if, for
14102  ** example, a character should react to a nearby explosion.
14103  **
14104  *b Arguments:
14105  **
14106  *a link - link to which impulse should be applied
14107  *a impulse_magnitude_[xyz] - magnitude of impulse
14108  *a impulse_generator_position_[xyz] - world coordinates of impulse
14109  *a generating object
14110  *a max_distance - maximum distance from above position at
14111  *a which the impulse can affect this
14112  *a character
14113  *a impulse_rolloff - how much the impulse magnitude should
14114  *a decrease as distance from impulse source
14115  *a increases
14116  *a link_offset_[xyz] - offset on link at which to apply impulse
14117  *a set_simulation_drives_character - pass 1 to automatically change
14118  *a the character's current simulation mode
14119  *a to DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER
14120  */
14121  void apply_impulse_to_physics_sim_from_world_position(const char* link,
14122  float impulse_magnitude_x,
14123  float impulse_magnitude_y,
14124  float impulse_magnitude_z,
14125  float impulse_generator_position_x,
14126  float impulse_generator_position_y,
14127  float impulse_generator_position_z,
14128  float max_distance = 20.0f,
14129  float impulse_rolloff = 0.0f,
14130  float link_offset_x = 0.0f,
14131  float link_offset_y = 0.0f,
14132  float link_offset_z = 0.0f,
14133  int set_simulation_drives_character = 1);
14134 
14135 /*****************************************************************************/
14139  /*l
14140  *b Description:
14141  **
14142  ** Sets texture load behavior to DIGUY_LOAD_INSTANTLY, DIGUY_LOAD_PRIORITY_ASYNC, or
14143  ** DIGUY_LOAD_ASYNC
14144  */
14145  static int set_texture_load_behavior(diguyGraphicsTextureLoadingBehavior mode);
14146 
14147  /*l
14148  *b Returns current behavior, as set in set_texture_load_behavior()
14149  */
14150  static diguyGraphicsTextureLoadingBehavior get_texture_load_behavior();
14151 
14152  /*l
14153  *b Description:
14154  **
14155  ** Sets maximum quality of shader to use (actual quality varies
14156  ** by distance from camera). See diguyGraphicsShaderQualityLevel for
14157  ** possible values.
14158  **
14159  *b Arguments:
14160  **
14161  *a quality_level - a value between DIGUY_GRAPHICS_SHADER_QUALITY_UNLIT
14162  *- and DIGUY_GRAPHICS_SHADER_QUALITY_MAX
14163  */
14164  static int set_max_shader_quality_level(int quality_level);
14165 
14167  static int get_max_shader_quality_level();
14168 
14169 
14170 /****************************************************************************/
14177 /****************************************************************************/
14178 
14179  /*l
14180  ** Sets if this character will play back animation events that have been
14181  ** added to motion inits in the action table.
14182  */
14183  int set_animation_events_enabled(int enable);
14184  int get_animation_events_enabled();
14185 
14186 
14187  /*l
14188  *b Description:
14189  **
14190  ** This function returns how many channels the specified action has.
14191  ** If an action has more than one channel, the relative weights of
14192  ** its channels can be set using the set_action_channel_weight()
14193  ** function.
14194  **
14195  *b Arguments:
14196  **
14197  *a action_name - name of action to be queried
14198  **
14199  *b Returns:
14200  **
14201  ** number of channels in specified action
14202  */
14203  int get_action_num_channels(const char* action_name);
14204 
14205  /*l
14206  *b Description:
14207  **
14208  ** This function sets the weight one channel of a multi-channel
14209  ** action.
14210  **
14211  ** The passed weight should be between 0 and 1. The weights of
14212  ** the other channels in the action will be adjusted so that the
14213  ** total weight of all channels is 1.
14214  **
14215  *b Arguments:
14216  **
14217  *a action_name - name of action to be affected
14218  *a channel - which channel's weight to set
14219  *a weight - weight of the channel, between 0 and 1
14220  **
14221  *b Returns:
14222  **
14223  ** 0 on success, -1 on failure
14224  */
14225  int set_action_channel_weight(const char* action_name,
14226  char channel,
14227  float weight);
14228 
14229  /*l
14230  *b Description:
14231  **
14232  ** This function returns the weight of one channel of a multi-channel
14233  ** action.
14234  **
14235  *b Arguments:
14236  **
14237  *a action_name - name of action to be queried
14238  *a channel - which channel's weight to return
14239  **
14240  *b Returns:
14241  **
14242  ** weight of a channel
14243  */
14244  float get_action_channel_weight(const char* action_name,
14245  char channel);
14246 
14247  /*l
14248  *b Description:
14249  **
14250  ** This function returns the number of seconds before the transition
14251  ** to the desired action begins. If the character is already
14252  ** performing the desired action the function returns 0.
14253  **
14254  *b THIS FUNCTION DOES NOT YET RETURN VALID RESULTS.
14255  **
14256  *b Returns:
14257  **
14258  ** time to reach desired action, in seconds
14259  */
14260  float get_time_to_reach_desired_action();
14261 
14262  /*l
14263  *b Description:
14264  **
14265  ** Maps a character type map field to its value. See diguyCharacterTypeMap.
14266  **
14267  ** Returns:
14268  **
14269  ** The value, as a string.
14270  */
14271  const char* get_type_map_field(diguyCharacterTypeMapField field);
14272 
14273  /*l
14274  *b Description:
14275  **
14276  ** Maps a character type map field to its value, using a string version (e.g.
14277  ** "age") of the field name. See diguyCharacterTypeMap.
14278  **
14279  ** Returns:
14280  **
14281  ** The value, as a string.
14282  */
14283  const char* get_type_map_field_using_string(const char* field);
14284 
14287  float get_normalized_age() const;
14288 
14289  /*l
14290  *b Description:
14291  **
14292  ** This function performs a "micro merge", allowing a diguyCharacter
14293  ** to have objects added to it by parsing a .dss file fragment in the
14294  ** form of a string.
14295  **
14296  ** This function can be used, for example, to add paths to
14297  ** dynamically created agents. A Lua Package can contain a number of
14298  ** text strings representing local paths for agents. On character
14299  ** creation these strings can be merged in and turned into
14300  ** per-character objects.
14301  **
14302  ** The DI-Guy Scenario path page has a "Display Asset" button for
14303  ** generating merge_object() compatible strings.
14304  **
14305  ** There is also a diguyScenario::merge_object() function that allows
14306  ** the merging of text blocks that represent sounds and particle
14307  ** systems.
14308  **
14309  ** Note: the parser is very sensitive to tabs and formatting!
14310  */
14311  int merge_object(const char* object);
14312 
14313  /*l
14314  *b Description:
14315  **
14316  ** Returns 1 if any active character in the named group is visible,
14317  ** otherwise 0.
14318  **
14319  *b Arguments:
14320  **
14321  *a group_name
14322  *a max_distance_to_check
14323  */
14324  int is_active_character_in_group_visible(const char* group_name,
14325  float max_distance_to_check = 100000.0f);
14326 
14327  /*l
14328  *b Description:
14329  **
14330  ** Gets local space bounding box, this function is currently expensive
14331  ** and should be used with care.
14332  **
14333  *b Arguments:
14334  **
14335  *a x1,y1,z1,x2,y2,z2 - output parameters
14336  **
14337  *b Returns:
14338  **
14339  ** 0 on success, -1 on failure
14340  ** (float * arguments converted to return values in Lua)
14341  */
14342  int get_local_space_bounding_box(float* x1, float* y1, float* z1,
14343  float* x2, float* y2, float* z2);
14344 
14345  /*l
14346  *b Description:
14347  **
14348  ** This causes a character's mind to get an update call even if time
14349  ** isn't passing in the scenario. This is occasionally useful for
14350  ** characters that are managing the UI.
14351  **
14352  ** Note that there is now a luaUIStateMachine that might be a better
14353  ** solution.
14354  */
14355  void set_mind_always_updates(int force_update);
14356 
14358  int get_mind_always_updates();
14359 
14360  /*l
14361  ** Returns angle in degrees from character's "forward facing" vector
14362  ** to the specified action bead, on the specified path
14363  */
14364  float get_angle_to_path(const char* path_name,
14365  const char* action_bead_name = NULL);
14366 
14367 
14370  void set_scene_graph_mask(unsigned int mask);
14371 
14373  unsigned int get_scene_graph_mask();
14374 
14375 
14380  diguyMotionEngineSnapshot get_motion_engine_snapshot();
14381 
14383  int apply_motion_engine_snapshot( const diguyMotionEngineSnapshot& action_info );
14384 
14385 
14390  int set_local_to_world_orientation_matrix( float rz, float rx, float ry);
14392  int set_local_to_world_orientation_matrix(
14393  float a0, float a1, float a2,
14394  float b0, float b1, float b2,
14395  float c0, float c1, float c2, int transpose = 0);
14396 
14397 #ifdef CPLUSPLUS_ONLY
14398  const float * get_local_to_world_orientation_matrix();
14400 #endif
14401  int set_current_IK_world_conversion_matrix(
14402  float a0, float a1, float a2,
14403  float b0, float b1, float b2,
14404  float c0, float c1, float c2, int transpose = 0);
14405  // HACK fix me with generalized system
14406  void set_IK_use_vrv_swizzle(bool);
14407 
14408 
14411  int set_always_update_regardless_of_dt(int val);
14413  int get_always_update_regardless_of_dt();
14414 
14415  void set_shader_matrixes_out_of_date();
14416 
14417  void draw_debugging_visuals();
14418 
14419 /****************************************************************************/
14420 /****************************************************************************/
14431 /****************************************************************************/
14432 /****************************************************************************/
14433 /****************************************************************************/
14434 
14435  // Deprecated as of 13.0;
14437  int aim_converge(int max_iterations = 30);
14438 
14440  void set_aim_algorithm(int aim_algorithm);
14441 
14443  int get_aim_algorithm();
14444 
14445 
14446  // Deprecated as of 9.1.3; use diguyCharacter::get_position_link() instead.
14447  // diguyGraphicsLink* get_base_link();
14448 
14449  // Deprecated as of 9.0.1; use set_apply_actor_scale_to_action_bead_travel() instead.
14450  // void set_apply_actor_scale_to_action_bead_xy_travel(int apply_scale_flag);
14451 
14452  // Deprecated as of 9.0.1; use get_apply_actor_scale_to_action_bead_travel() instead.
14453  // int get_apply_actor_scale_to_action_bead_xy_travel();
14454 
14455  /*l
14456  ** Deprecated as of 9.1.4. In general setting the weapon sound
14457  ** should no longer be necessary, as weapon sounds are now specified
14458  ** by the weapon's munition type. If this function is called, it
14459  ** will have the same effect as calling
14460  ** diguyCharacter::set_weapon_sound_override().
14461  */
14462  // int set_default_weapon_sound(const char* sound_name);
14463 
14464  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14465  //const char* get_default_weapon_sound();
14466 
14467  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14468  // int set_default_weapon_sound_gain(float gain);
14469 
14470  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14471  // float get_default_weapon_sound_gain();
14472 
14473  // Deprecated as of 9.1.4. Call set_weapon_munition_type_override() instead.
14474  // int set_weapon_munition_type(const char* munition_type);
14475 
14476  // Deprecated as of 9.1.4. Call get_weapon_munition_type_override() instead.
14477  // const char* get_weapon_munition_type();
14478 
14479  // Deprecated as of 10.5.2. Call set_weapon_max_azimuth_error() instead.
14480  // int set_weapon_horizontal_error(float h_error);
14481 
14482  // Deprecated as of 10.5.2. Call get_weapon_max_azimuth_error() instead.
14483  // float get_weapon_horizontal_error();
14484 
14485  // Deprecated as of 10.5.2. Call set_weapon_max_elevation_error() instead.
14486  // int set_weapon_vertical_error(float v_error);
14487 
14488  // Deprecated as of 10.5.2. Call get_weapon_max_elevation_error() instead.
14489  // float get_weapon_vertical_error();
14490 
14491  // Added as of 10.1.6. Invokes the old implementation of
14492  // begin_appearance_effect().
14493  //int begin_legacy_appearance_effect(const char* effect,
14494  // const char* override_link = "",
14495  // float override_scale = DIGUY_DEFAULT_FLOAT,
14496  // float override_offset_x = DIGUY_DEFAULT_FLOAT,
14497  // float override_offset_y = DIGUY_DEFAULT_FLOAT,
14498  // float override_offset_z = DIGUY_DEFAULT_FLOAT);
14499 
14500 
14501  // Added as of 10.1.6. Invokes the old implementation of
14502  // end_appearance_effect().
14503  //
14504  //int end_legacy_appearance_effect(const char* effect);
14505 
14506  // Added as of 10.1.6. Invokes the old implementation of
14507  // appearance_effect_is_active().
14508  //int legacy_appearance_effect_is_active(const char* effect);
14509 
14510  // Deprecated as of 10.1.8. Use set_render_mode_shader() instead.
14511  //int set_shader_program(const char* shader_name);
14512 
14513  // Deprecated as of 10.5.2. Use get_render_mode_shader() instead.
14514  //const char* get_recommended_appearance_shader_program_name();
14515 
14516  // Deprecated as of 10.5.1. Use merge_object() instead.
14517  //int merge_asset(const char* asset);
14518 
14519  // Deprecated as of 10.5.2. Use get_DIS_trailing_effect_state() instead.
14520  // void set_DIS_smoke_trail_state(int state);
14521 
14522  // Deprecated as of 10.5.2. Use get_DIS_trailing_effect_state() instead.
14523  // int get_DIS_smoke_trail_state();
14524 
14525  // Deprecated as of 12.0.0. Not supported in FaceFX.
14526  //int speak(const char* string);
14527 
14528 
14529  // Deprecated as of 12.0.0. Not supported in FaceFX.
14530  //int set_viseme(const char* viseme_name, float weight);
14531 
14532  // Deprecated as of 12.0.0. Not supported in FaceFX.
14533  //float get_viseme(const char* viseme_name);
14534 
14535 
14536  // Deprecated as of 12.0.0. Not supported in FaceFX.
14537  //int set_orientation_eye_left(float azimuth, float elevation);
14538 
14539  // Deprecated as of 12.0.0. Not supported in FaceFX.
14540  //int set_orientation_eye_right(float azimuth, float elevation);
14541 
14542  // Deprecated as of 12.0.0. Not supported in FaceFX.
14543  //float get_azimuth_eye_left();
14544 
14545  // Deprecated as of 12.0.0. Not supported in FaceFX.
14546  //float get_elevation_eye_left();
14547 
14548  // Deprecated as of 12.0.0. Not supported in FaceFX.
14549  //float get_azimuth_eye_right();
14550 
14551  // Deprecated as of 12.0.0. Not supported in FaceFX.
14552  //float get_elevation_eye_right();
14553 
14554  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14555  //int set_weapon_shell_eject_enabled(int enabled);
14556 
14557  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14558  //int get_weapon_shell_eject_enabled();
14559 
14560  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14561  //int set_weapon_smoke_enabled(int enabled);
14562 
14563  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14564  //int get_weapon_smoke_enabled();
14565 
14566  // Deprecated as of 13.5
14567  // int set_shape_switches_disabled(int disabled_flag);
14568  // int get_shape_switches_disabled();
14569 
14570 /****************************************************************************/
14571 /****************************************************************************/
14572 
14577 #ifdef CPLUSPLUS_ONLY
14578 
14579  bdiScenarioCharacter* get_scripted_object();
14580 private:
14581 
14582  /*l
14583  ** A private constructor.
14584  */
14585  diguyCharacter(bdiScenarioCharacter* character);
14586 
14587  /*l
14588  ** A private destructor.
14589  */
14590  ~diguyCharacter();
14591 
14592  /*l
14593  ** A pointer to internal data.
14594  */
14595  bdiScenarioCharacter* m_scripted_object;
14596 
14597  friend class bdiPublishedCharacter;
14598  friend class bdiScenarioCharacter;
14599  friend class diguySensorRegion;
14600  friend class diguyScenario;
14601 
14602 #endif
14603 
14604 };
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:38
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:39
A bead that sits on a character's spline path and triggers a new gaze.
Definition: diguyCharacterPathGazeBead.h:34
Definition: diguyMotionPosture.h:40
diguyConnectionPointType
Definition: diguyConnectionPointType.h: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:12
float diguyAltitudeFunction(diguyCharacter *character, float x, float y, float old_z, int *valid)
Definition: diguy_typedefs.h:57
int diguyCharacterLOSFunction(diguyCharacter *character, diguyCharacter *target_character, int visibility_type)
Definition: diguy_typedefs.h:106
Represents the scenario currently being portrayed.
Definition: diguyScenario.h:99
Contains the diguyMotionVariant enumeration and utility function declarations.
A group of DI-Guy characters, useful for organizing your scenarios.
Definition: diguyCharacterGroup.h:38
The class that represents a DI-Guy Entity in the world.
Definition: diguyCharacter.h:81
Represents a scriptable api wrapping a 3D point on a path.
Definition: diguyWaypoint.h:35
Definition: diguySensorRegion.h:41
int diguyPointLOSFunction(diguyCharacter *character, float x, float y, float z)
Definition: diguy_typedefs.h:111
int diguyFeelerFunction(diguyCharacter *character, float origin_x, float origin_y, float origin_z, float dir_x, float dir_y, float dir_z, float max_distance_to_test, float *intersection_x, float *intersection_y, float *intersection_z, float *normal_x, float *normal_y, float *normal_z)
Definition: diguy_typedefs.h:64
Contains the diguyMotionPosture enumeration and utility function declarations.
static double t
Definition: simple_playback_ogl.cpp:58
Definition: diguy_constants.h:1569
Definition: diguyMotionVariant.h:62
diguyParameterComparison
This is an enumeration of the different parameter comparison options that can be specified to various...
Definition: diguy_constants.h:212
A class that allows end users to override a character's animation on a joint level.
Definition: diguyCharacterPoseOverride.h:35
diguyCallbackReturn
DI-Guy callbacks return a value of type diguyCallbackReturn, which will be DIGUY_CALLBACK_STOP or DIG...
Definition: diguy_constants.h:94
diguyMotionVariant
Definition: diguyMotionVariant.h:28
diguyCharacterMode
This is an enumeration of the different modes a DI-Guy character can be in.
Definition: diguy_constants.h:197
A class that represents the unique per-character non-shared mesh object. DI-Guy encapsulates its text...
Definition: diguyGraphicsShape.h:49
A class representing a overlaid performance on a character's base animation.
Definition: diguyCharacterGesture.h:42
A bead that sits on a character's spline path and triggers a new script evaluation.
Definition: diguyCharacterPathScriptBead.h:34
Definition: diguySoundInstance.h:27
The diguyVariable class allows you to add per character named parameters. This can be handy for track...
Definition: diguyVariable.h: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:48
Represents algorithm for steering and maneuvering a character towards a goal point.
Definition: diguyCharacterGuide.h:561
diguyMotionPosture
Definition: diguyMotionPosture.h:28
A bead that sits on a character's spline path and triggers a new aim event.
Definition: diguyCharacterPathAimBead.h:34