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