DI-Guy SDK Documentation  13.2
diguyCharacter.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2018 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
6 /*********************************************************************
7  **
8  *t diguyCharacter
9  **
10  *b Link against: libdiguy
11  */
12 
13 #ifndef __diguyCharacter_H
14 #define __diguyCharacter_H
15 
16 #ifdef SWIG
17 %module diguyCharacter
18 #else
19 #define CPLUSPLUS_ONLY
20 #endif
21 
22 #ifdef CPLUSPLUS_ONLY
23 #include <declspec_diguy.h>
24 #include <diguy_constants.h>
25 #include <diguy_typedefs.h>
26 #include <diguy_vector_classes.h>
29 #include <diguyCharacterTypeMap.h>
30 #include <diguyMotionDirection.h>
31 #include <diguyMotionPosture.h>
32 #include <diguyMotionVariant.h>
33 
34 class bdiScenarioCharacter;
35 class diguyAgentParams;
37 class diguyCharacter;
41 class diguyCharacterPath;
46 class diguyCrowd;
47 class diguyGraphicsLink;
50 class diguyImpact;
52 class diguyPathShape;
53 class diguyScenario;
54 class diguySoundInstance;
55 class diguyVariable;
57 class diguyView;
58 class diguyViewLabel;
59 class diguyWaypoint;
60 
62 
64 
65 class DtEntityStateRepository;
66 
67 #endif
68 
69 
82 class BDI_DECLSPEC_diguy diguyCharacter
83 {
84 
85 public:
86 
87 /*****************************************************************************/
97  /*l
98  *b Description:
99  **
100  ** Returns the name of the object. This pointer will never be NULL.
101  */
102  const char* get_name();
103 
104  /*l
105  *b Description:
106  **
107  ** This function sets the name of this object.
108  **
109  *b Returns:
110  **
111  ** 0 on success, -1 on failure
112  */
113  int set_name(const char* name);
114 
115  /*l
116  *b Description:
117  **
118  ** Returns the type name of the object, should be 'character'. This pointer will never be
119  ** NULL.
120  */
121  const char* get_type_name();
122 
123  /*l
124  *b Description:
125  **
126  ** All characters are assigned a unique identifier, or uid. This
127  ** function returns this character's uid.
128  **
129  ** *Note*: unique identifiers will change between DI-Guy runs!
130  **
131  */
132  long get_uid();
133 
134  /*l
135  *b Description:
136  **
137  ** Returns the index of the object. This index may change if
138  ** characters are created or destroyed, so it should not be considered
139  ** a unique identifier for the character. See get_uid().
140  */
141  int get_index();
142 
143  /*l
144  *b Description:
145  **
146  ** This function updates the character. The character's position and
147  ** pose will be set to be what it will be (or was) at the specified t.
148  **
149  ** If the scenario has control of t (return value of
150  ** get_t_controlled_by_scenario_t() is 0), then this function's
151  ** effects will be overridden the next time diguyScenario::update() is
152  ** called with a new t.
153  **
154  ** Note: diguyScenario::update() must be called as or more frequently
155  ** than diguyCharacter::update() for proper DI-Guy operation.
156  ** diguyCharacter::update() is intended for load management use, where
157  ** the user intends to update far away or out-of-frustum characters
158  ** less frequently than the overall scenario. This is done in con-
159  ** junction with set_t_controlled_by_scenario_t(0) for the character.
160  ** diguyCharacter::update() is not intended as a replacement for
161  ** diguyScenario::update().
162  **
163  *b Returns:
164  **
165  ** 0 on success, -1 on failure
166  **
167  *b Arguments:
168  **
169  *a t - new time for the character
170  *a full_update - set to 1 to cause full update of character
171  */
172  int update(float t, int full_update = 1);
173 
174  /*l
175  *b Description:
176  **
177  ** This function sets the current type of this character.
178  **
179  *b Arguments:
180  **
181  *a type - name of the new desired type
182  **
183  *b See Also:
184  **
185  ** get_character_type_string()
186  */
187  void set_character_type(const char* type);
188 
189  /*l
190  *b Description:
191  **
192  ** Returns the type of the character (never NULL).
193  **
194  ** Character types specify the types of motions the character will be
195  ** able to perform. Some characters can move like soldiers, others
196  ** can move like civilians, still others can move like specific
197  ** animals.
198  **
199  ** The character type is explicitly specified in the call to
200  ** diguyScenario::create_character().
201  **
202  ** Examples of character types are:
203  *>
204  *- - soldier
205  *- - male_pedestrian
206  *- - horse
207  *- - prop
208  *<
209  */
210  const char* get_character_type_string();
211 
212  /*l
213  *b Description:
214  **
215  ** Returns the class of the character (never NULL).
216  **
217  ** Character classes are a higher level description than character
218  ** types, and allow for more generalized logic. For example, instead
219  ** of having something happen when one of a large set of specific
220  ** character types enters a region, something can happen when any
221  ** human enters the region.
222  **
223  ** Character classes are not specified directly, but are instead
224  ** derived from the character type. (In DI-Guy, all soldiers are
225  ** humans, for example.)
226  **
227  ** Examples of character classes are:
228  *>
229  *- - human
230  *- - vehicle
231  *- - object
232  *- - animal
233  *<
234  */
235  const char* get_character_class();
236 
238  diguyCharacterClass get_character_class_type();
239 
240  /*l
241  *b Description:
242  **
243  ** Returns the scenario that this character is a part of.
244  */
245  diguyScenario* get_scenario();
246 
247  /*l
248  *b Description:
249  **
250  ** This is the top-level on/off switch for the character. A character
251  ** that is not enabled has very little processing overhead: it is
252  ** neither updated during an update() call, nor is it drawn during a
253  ** draw() call. A disabled character will remain disabled until
254  ** set_enabled(1) is called on it; nothing else implicitly re-enables
255  ** the character.
256  **
257  ** There are several other diguyCharacter functions that have somewhat
258  ** similar effects that may be more appropriate at times:
259  **
260  *- - set_current_tin() and set_current_tout(): These functions
261  *- show and animate the character starting at time tin ("T In"),
262  *- and ending at time tout ("T Out")
263  *- - set_invisible_flag(): This function disables drawing of
264  *- the character, but the character still updates and changes
265  *- position.
266  **
267  ** Refer to the documentation of these functions for more information.
268  **
269  *b Returns:
270  **
271  ** always return 0
272  */
273  int set_enabled(int enabled);
274 
275  /*l
276  *b Description:
277  **
278  ** Returns whether the character is enabled, as set by the
279  ** set_enabled() call. New characters are enabled by default.
280  **
281  *b Returns:
282  **
283  ** 1 if the character is enabled, 0 if not
284  */
285  int get_enabled();
286 
287  /*l
288  *b Description:
289  **
290  ** Sets whether this character is drawn automatically by the scenario.
291  **
292  ** Note depending on the rendering environment if this flag is set to 0,
293  ** it is up to the user to call the character draw_pass1() and draw_pass2()
294  ** calls at the appropriate time.
295  **
296  *b Arguments:
297  **
298  *a flag - pass 1 for character drawing to automatically be
299  *a handled by scenario (this is the default);
300  *a 0 for it not to be
301  **
302  *b Returns:
303  **
304  ** 0 on success, -1 on failure
305  */
306  int set_drawn_by_scenario_flag(int flag);
307 
308  /*l
309  *b Description:
310  **
311  ** Returns whether character drawing is done automatically by the
312  ** scenario.
313  **
314  *b Returns:
315  **
316  ** 1 if character drawing is done by the scenario;
317  ** 0 if not
318  **
319  *b See Also:
320  **
321  ** set_drawn_by_scenario_flag()
322  */
323  int get_drawn_by_scenario_flag();
324 
325  /*l
326  *b Description:
327  **
328  ** This function makes the character invisible; i.e., draw() calls
329  ** for the character will have no effect. Note that the character
330  ** will still update its position and pose during update() calls. To
331  ** more thoroughly disable a character, consider the functions
332  ** set_enabled() and set_current_tout().
333  **
334  *b Arguments:
335  **
336  *a invisible_flag - pass 1 to make character invisible, 0 to
337  *a make it visible
338  **
339  *b Available as Decision Bead/Event
340  */
341  void set_invisible_flag(int invisible_flag);
342 
344  int get_invisible_flag();
345 
346  /*l
347  *b Description:
348  **
349  ** Returns whether the character is active. A character is
350  ** active if:
351  **
352  *- - it is enabled as per the set_enabled() call
353  *- - it is within its tin/tout interval as set by the
354  *- set_current_tin() and set_current_tout() calls
355  *- - it is not "network paused" (get_is_network_paused()
356  *- returns 0)
357  **
358  *b Returns:
359  **
360  ** 1 if the character is active, 0 if not
361  **
362  *b Available as Decision Bead
363  */
364  int get_is_active();
365 
366  /*l
367  *b Description:
368  **
369  ** Returns whether the character will be drawn during scenario and
370  ** character draw() calls. A character will be drawn if:
371  **
372  *- - it is enabled as per the set_enabled() call
373  *- - it is within its tin/tout interval as set by the
374  *- set_current_tin() and set_current_tout() calls
375  *- - its invisible flag is 0, as set by the
376  *- set_invisible_flag() call
377  **
378  ** There is no corresponding set_is_drawn() function; use
379  ** set_invisible_flag() to explicitly make a character not be drawn.
380  **
381  *b Returns:
382  **
383  ** 1 if the character will be drawn, 0 if not
384  */
385  int get_is_drawn();
386 
390  int get_was_drawn_last_frame();
391 
393  int set_was_drawn_last_frame(int drawn);
394 
396  int get_is_culled();
397 
403  int set_is_culled(int culled);
404 
405  /*l
406  *b Returns:
407  **
408  ** 1 if the character is temporary (created by diguyScenario::create_temporary_character()
409  ** call; 0 if not
410  */
411  int get_is_temporary();
412 
413  /*l
414  *b Description:
415  **
416  ** This function returns 1 if the character has been recycled from the
417  ** character recycle bin, 0 if not.
418  **
419  ** See diguyScenario::send_character_to_recycle_bin()
420  ** and diguyScenario::retrieve_character_from_recycle_bin().
421  */
422  int get_is_recycled();
423 
424  /*l
425  *b Description:
426  **
427  ** This function sets how the character's t (time) is controlled. If
428  ** 1, the character's t will be set by the scenario on each call to
429  ** diguyScenario::update(). If 0, the character should be updated by
430  ** calls to update().
431  **
432  *b Arguments:
433  **
434  *a t_controlled_by_scenario_t - 1 for controlled by scenario, 0 for
435  *a manual update
436  **
437  *b Returns:
438  **
439  ** 0 on success, -1 on failure
440  */
441  int set_t_controlled_by_scenario_t(int t_controlled_by_scenario_t);
442 
443  /*l
444  *b Returns:
445  **
446  ** whether character's t is controlled by the scenario;
447  ** see set_t_controlled_by_scenario_t()
448  */
449  int get_t_controlled_by_scenario_t();
450 
451  /*l
452  *b Description:
453  **
454  ** This function sets the initial tin ("T In") time of the character.
455  ** See set_current_tin() for a discussion of how tin and tout times
456  ** affect the character.
457  **
458  ** When the scenario is reset or loaded from a .dss file, the current
459  ** tin value will be set to this initial tin value.
460  **
461  ** Note that if the scenario is running (diguyScenario::get_t() returns > 0),
462  ** tin can be set only if override_time_warning is set.
463  **
464  ** Note that both tin and tout times are scenario-relative times, not
465  ** character-relative.
466  **
467  ** This call makes an implicit call to set_current_tin() with the
468  ** same value.
469  **
470  *b Arguments:
471  **
472  *a tin - new value of initial tin in seconds
473  *a override_time_warning - if set, initial_tin can be set at any time
474  **
475  *b Returns:
476  **
477  ** 0 on success, -1 on failure
478  */
479  int set_initial_tin(float tin, int override_time_warning = 0);
480 
481  /*l
482  *b Description:
483  **
484  ** This function sets the initial tout ("T Out") time of the
485  ** character. See set_current_tin() for a discussion of how tin and
486  ** tout times affect the character.
487  **
488  ** When the scenario is reset or loaded from a .dss file, the current
489  ** tout value will be set to this initial tout value.
490  **
491  ** Note that this function cannot be called once the scenario has
492  ** begun running (diguyScenario::get_t() returns > 0).
493  **
494  ** Note that both tin and tout times are scenario-relative times, not
495  ** character-relative.
496  **
497  ** This call makes an implicit call to set_current_tout() with the
498  ** same value.
499  **
500  *b Arguments:
501  **
502  *a tout - new value of initial tout in seconds
503  **
504  *b Returns:
505  **
506  ** 0 on success, -1 on failure
507  */
508  int set_initial_tout(float tout);
509 
510  /*l
511  *b Description:
512  **
513  ** This function sets the current tin ("T In") time of the character.
514  ** The character will not be visible nor will it start moving or
515  ** animating until the scenario reaches this time.
516  **
517  ** There are two ways the tin and tout times of the character can be
518  ** used:
519  **
520  ** The first is to set them to their desired values when the scenario
521  ** begins. If, for example, it is known that this character should
522  ** only be visible and active from 60 seconds to 80 seconds, the tin
523  ** and tout times can be set to 60 and 80, respectively. The
524  ** scenario will then spend very little time for character updates
525  ** and draws outside of these limits.
526  **
527  ** The second is to use them to quickly "trigger" a character to
528  ** become visible and start moving. This is done by setting the
529  ** initial values of tin and tout to very high values, and then
530  ** changing them to lower values when the character should become
531  ** active. Consider the following example: This character is
532  ** waiting just inside a doorway, and should emerge when another
533  ** character comes close. If the tin time of the character is very
534  ** high, very little time will be taken for this character's updates
535  ** and draws. When the other character does come close, this
536  ** character's tin time can be set to "now" (the scenario's current
537  ** t, as returned by diguyScenario::get_t()). This character will
538  ** then become visible and start moving out of the doorway.
539  **
540  ** The default current tin time is the current time of the scenario
541  ** when the character is created.
542  **
543  ** Note that both tin and tout times are scenario-relative times, not
544  ** character-relative.
545  **
546  *b Arguments:
547  **
548  *a tin - new value of current tin in seconds
549  **
550  *b Returns:
551  **
552  ** 0 on success, -1 on failure
553  */
554  int set_current_tin(float tin);
555 
556  /*l
557  *b Description:
558  **
559  ** Same as set_current_tin(), but time is set to current scenario time.
560  **
561  *b Returns:
562  **
563  ** 0 on success, -1 on failure
564  **
565  *b Available as Decision Bead/Event
566  */
567  int set_current_tin_to_now();
568 
569  /*l
570  *b Description:
571  **
572  ** This function returns the current tin time of the character. See
573  ** set_current_tin().
574  **
575  *b Returns:
576  **
577  ** Current tin time in seconds.
578  */
579  float get_current_tin();
580 
581  /*l
582  *b Description:
583  **
584  ** This function sets the current tout ("T Out") time of the
585  ** character. If tout is enabled the character will become invisible
586  ** and will stop moving and animating when the scenario reaches this
587  ** time.
588  **
589  ** Note that both tin and tout times are scenario-relative times, not
590  ** character-relative.
591  **
592  ** Default tout time is 60000 seconds.
593  **
594  *b Arguments:
595  **
596  *a tout - new value of current tout in seconds
597  *a disable_character_at_tout - this argument is present to keep
598  *a the function prototype will remain
599  *a backward compatible; it has no effect
600  */
601  int set_current_tout(float tout,
602  int disable_character_at_tout = 0);
603 
604  /*l
605  *b Description:
606  **
607  ** Same as set_current_tout(), but time is set to current scenario
608  ** time.
609  **
610  *b Returns:
611  **
612  ** 0 on success, -1 on failure
613  **
614  *b Available as Decision Bead
615  */
616  int set_current_tout_to_now();
617 
618  /*l
619  *b Description:
620  **
621  ** This function returns the current tout ("T Out") time of the
622  ** character in seconds. See set_current_tout().
623  */
624  float get_current_tout();
625 
626  /*l
627  *b Description:
628  **
629  ** This function sets what will happen when the character reaches its
630  ** tout time. If set to 0, the character will ignore the tout time
631  ** and continue indefinitely.
632  */
633  void set_tout_enabled(int tout_enabled);
634 
635  /*l
636  *b Description:
637  **
638  ** This function returns the whether tout is enabled.
639  **
640  ** See set_tout_enabled().
641  **
642  *b Returns:
643  **
644  ** 1 if tout enabled, 0 if not
645  */
646  int get_tout_enabled();
647 
649  float get_char_time();
650 
651  /*l
652  *b Description:
653  **
654  ** When the motion data of a character is interpolated a quick
655  ** interpolation method can be used which may yield incorrect results,
656  ** or an expensive interpolation method can be used which will yield
657  ** correct results at the expense of time. The threshold at which
658  ** the interpolation method changes is specified by this function.
659  **
660  *b Arguments:
661  **
662  *a threshold - float between 0 (careful never) and 1 (careful always);
663  ** default is 0.7
664  **
665  ** DI-Guy compares the careful interpolation threshold to the cosine
666  ** of an angle. Both the threshold and the cosine are dimensionless
667  ** and thus have no units.
668  **
669  *b Returns:
670  **
671  ** 0 on success, -1 on failure
672  */
673  int set_careful_interpolation_threshold(float threshold);
674 
675  /*l
676  *b Returns:
677  **
678  ** most recent setting of the careful interpolation threshold;
679  ** see set_careful_interpolation_threshold()
680  */
681  float get_careful_interpolation_threshold();
682 
683  /*l
684  *b Description:
685  **
686  ** Sets whether the motion data of the character is interpolated.
687  ** Interpolation is disabled by default for better performance. For
688  ** applications achieving high frame rates, smoother motion may be
689  ** achieved by turning interpolation on.
690  **
691  *b Arguments:
692  **
693  *a flag - 0 by default
694  **
695  *b Returns:
696  **
697  ** 0 on success, -1 on failure
698  */
699  int set_motion_interpolation_flag(int flag);
700 
701  /*l
702  *b Returns:
703  **
704  ** most recent setting of the motion interpolation flag; see
705  ** set_motion_interpolation_flag()
706  */
707  int get_motion_interpolation_flag();
708 
709  /*l
710  *b Description:
711  **
712  ** Sets the scale of the character on each of the three major axes.
713  **
714  *b Arguments:
715  **
716  *a scale_x, scale_y, scale_z - the factor by which to scale along
717  *a the given axis
718  **
719  *b Returns:
720  **
721  ** 0 on success, -1 on failure
722  */
723  int set_scale(float scale_x, float scale_y, float scale_z);
724 
725  /*l
726  *b Description:
727  **
728  ** Returns the scale of the character.
729  **
730  *b Arguments:
731  **
732  *a sx, sy, sz - scale of the character along each axis
733  **
734  ** Pass NULL for any values that are not needed.
735  **
736  *b Returns:
737  **
738  ** 0 on success, -1 on failure
739  */
740  int get_scale(float* scale_x, float* scale_y, float* scale_z);
741 
742  /*l
743  *b Description:
744  **
745  ** Sets the parent of this character to be the passed character.
746  ** This means that the coordinate system of this character will be
747  ** local to the parent character rather than the world coordinate
748  ** system.
749  **
750  *b Arguments:
751  **
752  *a parent_name - character to which this character should
753  *a be attached; pass NULL to have no parent
754  *a and be attached to the world
755  *a parent_link_name - name of the link or connection point to which this character's
756  *a position link should attach; pass "" to attach
757  *a to the parent's position link
758  **
759  *b Returns:
760  **
761  ** 0 on success, -1 on failure
762  **
763  *b Available as Decision Bead/Event
764  */
765  int set_parent(const char* parent_name, const char* parent_link_name = "");
766 
767  /*l
768  *b Description:
769  **
770  ** Gets the parent of this character.
771  **
772  *b Returns:
773  **
774  ** pointer to type diguyCharacter; NULL if no parent
775  **
776  *b Available as Decision Bead/Event
777  */
778  diguyCharacter* get_parent();
779 
780  /*l
781  *b Description:
782  **
783  ** Gets the link name that the character is parented to, if any.
784  **
785  *b Returns:
786  **
787  ** name of link, NULL if no parent
788  */
789  const char* get_parent_link_name();
790 
791  /*l
792  *b Description:
793  **
794  ** Detaches a character from its parent and reattaches it to the
795  ** world. This is equivalent to diguyCharacter::set_parent(NULL).
796  **
797  *b Returns:
798  **
799  ** 0 on success, -1 on failure
800  **
801  *b Available as Decision Bead/Event
802  */
803  int unset_parent();
804 
805  /*l
806  *b Description:
807  **
808  ** Gets the number of children the character has.
809  */
810  int get_num_children();
811 
812  /*l
813  *b Description:
814  **
815  ** This function returns a pointer to the nth child of the character.
816  **
817  *b Returns:
818  **
819  ** pointer of type diguyCharacter; NULL if no
820  ** child at the specified index
821  **
822  *b Arguments:
823  **
824  *a index - index of the child; indices start at 0
825  */
826  diguyCharacter* get_child_at_index(int index);
827 
828  /*l
829  *b Description:
830  **
831  ** Gets if a character is a static object, by default any blitzed .
832  ** in props are.
833  **
834  *b Returns:
835  **
836  ** 1 if true, 0 if false
837  */
838  int get_is_scene_object();
839 
840  /*l
841  *b Description:
842  **
843  ** Sets if a character is a static object. By default any blitzed
844  ** in props are.
845  **
846  *b Arguments:
847  **
848  *a is_scene_object - pass 1 to make the object a scene object,
849  *a 0 to not
850  **
851  *b Returns:
852  **
853  ** 0 on success, -1 on failure
854  */
855  int set_is_scene_object(int is_scene_object);
856 
857  /*l
858  *b Description:
859  **
860  ** Gets the bounding radius currently used for this character
861  ** for purposes of culling it from the draw operation.
862  **
863  *b Returns:
864  **
865  ** The current draw-culling bounding radius for the character, in
866  ** meters.
867  */
868  float get_bounding_radius();
869 
870  /*l
871  *b Description:
872  **
873  ** Gets the default draw-culling bounding radius for this
874  ** character, as specified in its actor cfg file. See
875  ** actor_vehicle.cfg for an example.
876  **
877  *b Returns:
878  **
879  ** The default draw-culling bounding radius for the character.
880  */
881  float get_default_bounding_radius();
882 
883  /*l
884  *b Description:
885  **
886  ** Sets the current draw-culling bounding radius to be used for
887  ** this character.
888  */
889  void set_bounding_radius(float f);
890 
891  /*l
892  *b Description:
893  **
894  ** This function returns the number of seconds before the blend
895  ** into the next motion begins. If the character is already
896  ** in a blend between motions the function returns 0.
897  **
898  ** Note that this function is of limited practical use; in most
899  ** cases get_time_to_reach_desired_action() returns
900  ** information that is more useful.
901  **
902  *b Returns:
903  **
904  ** time to next blend, in seconds
905  **
906  *b Mode Restrictions:
907  **
908  *- - This function can only be called in free action mode.
909  */
910  float get_time_to_transition();
911 
913  float get_character_local_time();
914 
915  /*l
916  *b Returns:
917  **
918  ** the action mode of the character
919  */
920  diguyCharacterMode get_action_mode();
921 
922  /*l
923  *b Returns:
924  **
925  ** the position mode of the character
926  */
927  diguyCharacterMode get_position_mode();
928 
929  /*l
930  *b Description:
931  **
932  ** This function speeds up or slows down the character. Setting
933  ** this value greater than 1 will cause character actions to
934  ** be played back at a slower pace, setting to less that 1 will
935  ** cause character actions to be played at a faster pace.
936  **
937  ** This will override other factors that may scale the time
938  ** scale factor of a character. (For example, smaller scale
939  ** characters will generally move faster.)
940  **
941  ** Call unset_t_scale_factor() to allow other factors such
942  ** as scale or desired speed to determine the time scale factor.
943  **
944  *b Mode Restrictions:
945  **
946  *- - This function can only be called in free action mode.
947  **
948  *b Arguments:
949  **
950  *a t_scale_factor - time scale factor
951  **
952  *b Returns:
953  **
954  ** 0 on success, -1 on failure
955  */
956  int set_t_scale_factor(float t_scale_factor);
957 
958  /*l
959  *b Description:
960  **
961  ** This function removes the manual setting of the time
962  ** scale factor as set by set_t_scale_factor().
963  **
964  *b Mode Restrictions:
965  **
966  *- - This function can only be called in free action mode.
967  **
968  *b Returns:
969  **
970  ** 0 on success, -1 on failure
971  */
972  int unset_t_scale_factor();
973 
974  /*l
975  *b Description:
976  **
977  ** This function determines whether this character is within the
978  ** specified distance of another.
979  **
980  *b Arguments:
981  **
982  *a character - character to be checked
983  *a distance - distance to character in meters
984  **
985  *b Returns:
986  **
987  ** 1 if within distance; 0 if not
988  */
989  int is_within_distance_n_of_character(const char* character_name,
990  float distance);
991 
992  /*l
993  *b Description:
994  **
995  ** This function determines whether this character is within the
996  ** specified distance of any members of the specified group.
997  **
998  *b Arguments:
999  **
1000  *a group_name - name of group to be checked
1001  *a distance - distance in meters
1002  **
1003  *b Returns:
1004  **
1005  ** 1 if member of group is within distance; 0 if not
1006  */
1007  int is_within_distance_n_of_member_of_group(const char* group_name,
1008  float distance);
1009 
1010  /*l
1011  *b Description:
1012  **
1013  ** This function determines whether a character is a member of
1014  ** a particular group.
1015  **
1016  ** Also see diguyCharacterGroup::is_member().
1017  **
1018  *b Arguments:
1019  **
1020  *a group_name - name of group to be checked
1021  **
1022  *b Returns:
1023  **
1024  ** 1 if character is in group, 0 if not
1025  */
1026  int is_group_member(const char* group_name);
1027 
1028  /*l
1029  *b Description:
1030  **
1031  ** This function returns the number of groups that a character is a
1032  ** member of.
1033  **
1034  ** Also see diguyCharacterGroup::is_member().
1035  */
1036  int get_num_group_memberships();
1037 
1038  /*l
1039  *b Description:
1040  **
1041  ** This function returns a pointer to the nth group that this
1042  ** character is a member of.
1043  **
1044  ** Also see diguyCharacterGroup::is_member().
1045  **
1046  *b Returns:
1047  **
1048  ** pointer of type diguyCharacterGroup; NULL if no
1049  ** group at the specified index
1050  **
1051  *b Arguments:
1052  **
1053  *a index - index of the group; indices start at 0
1054  */
1055  diguyCharacterGroup* get_group_membership_at_index(int index);
1056 
1057  /*l
1058  *b Description:
1059  **
1060  ** This function will check all characters in the scenario and return
1061  ** the nearest character that is both alive and enabled. An optional
1062  ** argument specifies whether to skip characters that are invisible
1063  ** to the caller because a scene object is in the way. Checking
1064  ** visibility is only an option if an octtree is generated from scene
1065  ** objects. Typically only DI-Guy Scenario does this.
1066  **
1067  *b Arguments:
1068  **
1069  *a check_visibility - whether to check that characters are
1070  *a visible to calling character; pass 1
1071  *a to check, 0 to not check
1072  *a xy_distance - whether to include the z component
1073  *a in distance calculations; pass 1 to
1074  *a check only XY distance, 0 to check
1075  *a XYZ distance
1076  **
1077  *b Returns:
1078  **
1079  ** pointer of type diguyCharacter; may be NULL
1080  */
1081  diguyCharacter* get_nearest_active_character(int check_visibility,
1082  int xy_distance = 0,
1083  float max_distance_to_check = 100000);
1084 
1085  /*l
1086  *b Description:
1087  **
1088  ** This function will check all characters in a group and return the
1089  ** nearest character that is both alive and enabled. An optional
1090  ** argument specifies whether to skip characters that are invisible
1091  ** to the caller because a scene object is in the way. Checking
1092  ** visibility is only an option if an octtree is generated from scene
1093  ** objects. Typically only DI-Guy Scenario does this.
1094  **
1095  *b Arguments:
1096  **
1097  *a group_name - name of group to check
1098  *a check_visibility - whether to check that characters are
1099  *a visible to calling character; pass 1
1100  *a to check, 0 to not check
1101  *a xy_distance - whether to include the z component
1102  *a in distance calculations; pass 1 to
1103  *a check only XY distance, 0 to check
1104  *a XYZ distance
1105  **
1106  *b Returns:
1107  **
1108  ** pointer of type diguyCharacter; may be NULL
1109  */
1110  diguyCharacter* get_nearest_active_character_in_group(const char* group_name,
1111  int check_visibility = 1,
1112  int xy_distance = 0,
1113  float max_distance_to_check = 100000);
1114 
1115  /*l
1116  *b Description:
1117  **
1118  ** This function will check all characters in the scenario and return
1119  ** a random character within max_distance that is both alive and
1120  ** enabled. An optional argument specifies whether to skip characters
1121  ** that are invisible to the caller because a scene object is in the
1122  ** way. Checking visibility is only an option if an octtree is
1123  ** generated from scene objects. Typically only DI-Guy Scenario does
1124  ** this.
1125  **
1126  *b Arguments:
1127  **
1128  *a check_visibility - whether to check that characters are
1129  *a visible to calling character; pass 1
1130  *a to check, 0 to not check
1131  *a max_distance - how far away the search cut off should be pass
1132  *a in -1.0f to use all characters
1133  *a xy_distance - whether to include the z component
1134  *a in distance calculations; pass 1 to
1135  *a check only XY distance, 0 to check
1136  *a XYZ distance
1137  **
1138  *b Returns:
1139  **
1140  ** pointer of type diguyCharacter; may be NULL
1141  */
1142  diguyCharacter* get_random_active_character(float max_distance = 10.0f,
1143  int check_visibility = 1,
1144  int xy_distance = 0);
1145 
1146  /*l
1147  *b Description:
1148  **
1149  ** This function will check all characters in a group and return a
1150  ** random character within max_distance that is both alive and
1151  ** enabled. An optional argument specifies whether to skip characters
1152  ** that are invisible to the caller because a scene object is in the
1153  ** way. Checking visibility is only an option if an octtree is
1154  ** generated from scene objects. Typically only DI-Guy Scenario does
1155  ** this.
1156  **
1157  *b Arguments:
1158  **
1159  *a group_name - name of group to check
1160  *a max_distance - how far away the search cut off should be, pass
1161  *a in -1.0f to use all characters
1162  *a check_visibility - whether to check that characters are
1163  *a visible to calling character; pass 1
1164  *a to check, 0 to not check
1165  *a xy_distance - whether to include the z component
1166  *a in distance calculations; pass 1 to
1167  *a check only XY distance, 0 to check
1168  *a XYZ distance
1169  **
1170  *b Returns:
1171  **
1172  ** pointer of type diguyCharacter; may be NULL
1173  */
1174  diguyCharacter* get_random_active_character_in_group(const char* group_name,
1175  float max_distance = 10,
1176  int check_visibility = 1,
1177  int xy_distance = 0);
1178 
1179  /*l
1180  *b Description:
1181  **
1182  ** This function returns the 3D distance from this character to the
1183  ** specified character, in meters. The distance is calculated from
1184  ** the characters' idealized positions.
1185  */
1186  float get_distance_to_character(diguyCharacter* character);
1187 
1188  /*l
1189  *b Description:
1190  **
1191  ** This function returns the 2D distance in X and Y coordinates only
1192  ** from this character to the specified character, in meters. The
1193  ** distance is calculated from the characters' idealized positions.
1194  */
1195  float get_distance_xy_to_character(diguyCharacter* character);
1196 
1197  /*l
1198  *b Description:
1199  **
1200  ** This function returns the 3D distance from this character to the
1201  ** specified impact, in meters. The distance is calculated from the
1202  ** characters' idealized positions.
1203  */
1204  float get_distance_to_impact(diguyImpact* impact);
1205 
1206  /*l
1207  *b Description:
1208  **
1209  ** Each character has a "random factor" between 0 and 1. This value
1210  ** is persistent with the character; i.e., the random factor will
1211  ** stay constant for the entire lifetime of the character.
1212  **
1213  ** This random factor can be used to add some variability between
1214  ** different characters.
1215  **
1216  ** Though each character has a random factor that has a very good
1217  ** chance of being different from all other characters' in the
1218  ** scenario, this is not guaranteed and so should not be used as a
1219  ** unique identifier.
1220  **
1221  ** An example of use: Instead of all characters beginning an action
1222  ** or behavior at the same time, have each one begin (random_factor *
1223  ** 2.0) seconds from the current time. This will result in more
1224  ** natural looking behavior as characters one by one begin the new
1225  ** behavior in the next two seconds, rather than all beginning at
1226  ** once.
1227  **
1228  *b Returns:
1229  **
1230  ** the character's random factor, a value between 0 and 1
1231  */
1232  float get_random_factor();
1233 
1234 
1235 /*****************************************************************************/
1240  /*l
1241  *b Description:
1242  **
1243  ** This function draws this character in immediate mode graphics
1244  ** environments (see below). This is the equivalent of calling
1245  ** draw_pass1() immediately followed by draw_pass2().
1246  **
1247  *b Returns:
1248  **
1249  ** 0 on success, -1 on failure
1250  **
1251  *i OpenGL Version:
1252  **
1253  ** This function immediately draws this character. Either this
1254  ** function or draw_pass1() and draw_pass2() should be called once per
1255  ** frame.
1256  */
1257  int draw();
1258 
1259  /*l
1260  *b Description:
1261  **
1262  ** This function, along with draw_pass2(), allows the drawing of
1263  ** opaque and transparent polygons to be separated. This function
1264  ** draws all opaque polygons of this character.
1265  **
1266  *b Returns:
1267  **
1268  ** 0 on success, -1 on failure
1269  **
1270  *i OpenGL Version:
1271  **
1272  ** This function immediately draws the opaque character parts. Either
1273  ** this function or draw() should be called once per frame.
1274  */
1275  int draw_pass1();
1276 
1277  /*l
1278  *b Description:
1279  **
1280  ** Same as draw_pass1(), but draws transparent character parts.
1281  */
1282  int draw_pass2();
1283 
1284 #ifdef CPLUSPLUS_ONLY
1285 
1286  /*l
1287  *b Returns:
1288  **
1289  ** A pointer to the character's graphics.
1290  **
1291  *i Vega Prime Version:
1292  **
1293  ** The return pointer may be cast to point to a vpDiguyCharacter,
1294  ** which is derived from vpObject.
1295  **
1296  *i OpenGL Version:
1297  **
1298  ** This function returns NULL.
1299  **
1300  *i DI-Guy Graphics API:
1301  **
1302  ** This function returns the pointer set from the most recent
1303  ** set_graphics_ptr() call.
1304  */
1305  void* get_graphics_ptr();
1306 
1307  /*l
1308  *b Description:
1309  **
1310  ** Sets a graphics environment-specific pointer to graphics data.
1311  ** The pointer can be retrieved using get_graphics_ptr().
1312  **
1313  *b Arguments:
1314  **
1315  *a graphics_ptr - pointer to graphics data
1316  **
1317  *b Returns:
1318  **
1319  ** 0 on success, -1 on failure
1320  **
1321  *i OpenGL Version:
1322  **
1323  *b This function should not be called for these environments.
1324  **
1325  *i DI-Guy Graphics API Version:
1326  **
1327  ** This function allows graphics environment-specific data to be
1328  ** stored for later retrieval by get_graphics_ptr(). DI-Guy does
1329  ** not directly use the pointer, beyond returning it using the
1330  ** get_graphics_ptr() function.
1331  */
1332  int set_graphics_ptr(void* graphics_ptr);
1333 
1334  /*l
1335  *b Description:
1336  **
1337  ** This function sets a generic node pointer that can later be
1338  ** retrieved by the get_graphics_api_node_ptr() call. The pointer is
1339  ** otherwise not used.
1340  **
1341  *i Callback Info:
1342  **
1343  ** This function can be safely be called in the
1344  ** CALLBACK_ID_SET_GRAPHICS_API_NODE_PTR callback.
1345  **
1346  *b Arguments:
1347  **
1348  *a node_ptr - generic void* pointer
1349  */
1350  void set_graphics_api_node_ptr(void* node_ptr);
1351 
1352  /*l
1353  *b Returns:
1354  **
1355  ** pointer set by most recent call to set_graphics_api_node_ptr
1356  */
1357  void* get_graphics_api_node_ptr();
1358 
1359  /*l
1360  *b Description:
1361  **
1362  ** This function stores a pointer to user data.
1363  **
1364  *b Arguments:
1365  **
1366  *a user_data - pointer for user's own use; DI-Guy will
1367  *a do nothing to the contents of this pointer
1368  *a beyond passing it back when requested
1369  *a by get_user_data()
1370  **
1371  *b Returns:
1372  **
1373  ** 0 on success, -1 on failure
1374  */
1375  int set_user_data(void* user_data);
1376 
1377  /*l
1378  *b Returns:
1379  **
1380  ** The user data pointer set by set_user_data()
1381  */
1382  void* get_user_data();
1383 
1384 #endif
1385 
1386 /*****************************************************************************/
1396  /*l
1397  *b Description:
1398  **
1399  ** This function sets the desired action of the character.
1400  **
1401  ** This function will put the character into free action mode. If
1402  ** the character was in path action mode, actions will no longer be
1403  ** set by action beads on the path.
1404  **
1405  ** If the character is in path position mode and 1 is passed for
1406  ** retain_path_shape, the character will stay in path position mode.
1407  ** If 0 is passed for retain_path_shape, the character will be put
1408  ** into free position mode.
1409  **
1410  ** If the character is in free position mode the retain_path_shape
1411  ** argument will have no effect.
1412  **
1413  ** If this call is interrupting a character in path action mode
1414  ** and path position mode, the character will not be able to resume
1415  ** the interrupted path unless retain_path_shape is set to 1.
1416  ** See resume_interrupted_path().
1417  **
1418  ** This function will have no effect on a dead character (see
1419  ** die_now() and get_dead()).
1420  **
1421  *b Mode Effects:
1422  **
1423  *- - This function will put the character into free action mode.
1424  *- - This function may change the position mode; see Description.
1425  **
1426  *b Arguments:
1427  **
1428  *a action_name - name of the desired action to be performed by
1429  *a the character
1430  *a speed - the speed at which the character should travel
1431  *a while performing the action; pass
1432  *a DIGUY_DEFAULT_FLOAT for the optimal speed to
1433  *a be used
1434  *a retain_path_shape - pass 1 to remain in path position mode; pass
1435  *a 0 to change to free position mode
1436  **
1437  *b Returns:
1438  **
1439  ** 0 on success, -1 on failure
1440  */
1441  int set_desired_action(const char* action_name,
1442  float speed = DIGUY_DEFAULT_FLOAT,
1443  int retain_path_shape = 0);
1444 
1449  const char* get_desired_action();
1450 
1452  int get_desired_action_index();
1453 
1455  const char* get_current_action();
1456 
1458  int get_current_action_index();
1459 
1461  diguyMotionDirection get_desired_action_direction();
1462 
1464  diguyMotionDirection get_current_action_direction();
1465 
1466  /*l
1467  *b Description:
1468  **
1469  ** This function returns the transition state of the action
1470  ** of a character. When commanding an action, DI-Guy may
1471  ** transition the character through one or more intermediate
1472  ** actions to reach the final action. For example, a character
1473  ** with the action "walk" that is commanded to "prone" would
1474  ** transition through the intermediate action "stand".
1475  **
1476  *b Returns:
1477  **
1478  ** 1 if the character is transitioning between actions
1479  ** 0 otherwise
1480  */
1481  int get_is_in_action_transition();
1482 
1483  /*l
1484  *b Description:
1485  **
1486  ** This function forces the current action of the character to be the
1487  ** action identified by action_name.
1488  **
1489  ** See set_desired_action() for a discussion of the effects on
1490  ** position mode.
1491  **
1492  ** This function will have no effect on a dead character (see
1493  ** die_now() and get_dead()).
1494  **
1495  ** By passing a value greater than 0 for t_offset_into_new_action,
1496  ** the character can be made to begin the action partway in. This is
1497  ** useful when forcing actions for a lot of characters at the same
1498  ** time; without the offset, the characters would move in lockstep.
1499  **
1500  ** The most recent forced action, the time at which it was forced,
1501  ** and any time offset can be queried using the functions
1502  ** get_most_recent_forced_action(),
1503  ** get_most_recent_forced_action_t(), and
1504  ** get_most_recent_forced_action_t_offset().
1505  **
1506  *b Mode Effects:
1507  **
1508  *- - This function will put the character into free action mode.
1509  *- - This function may change the position mode; see Description.
1510  **
1511  *b Arguments:
1512  **
1513  *a action_name - name of the action to be performed by
1514  *a the character
1515  *a speed - the speed at which the character should
1516  *a travel while performing the action; pass
1517  *a DIGUY_DEFAULT_FLOAT for the optimal speed
1518  *a to be used
1519  *a include_transition_arc - flag for whether the transition
1520  *a motion from the current action to
1521  *a the new action is included;
1522  *a pass 1 for best chance of good looking
1523  *a transition;
1524  *a pass 0 for fastest response
1525  *a max_rampdown_interval - max amount of time spent trying to
1526  *a smooth over any motion seams; set
1527  *a to 0.5 for a smooth transition, set
1528  *a to 0 for a potentially rough transition
1529  *a retain_path_shape - pass 1 to remain in path position mode;
1530  *a pass 0 to change to free position mode
1531  *a t_offset_into_new_action - how much to shift time forward into
1532  *a new action; must be >= 0; see comment
1533  *a above for more info
1534  **
1535  *b Returns:
1536  **
1537  ** 0 on success, -1 on failure
1538  */
1539  int force_action(const char* action_name,
1540  float speed = DIGUY_DEFAULT_FLOAT,
1541  int include_transition_arc = 1,
1542  float max_rampdown_interval = 0.5f,
1543  int retain_path_shape = 0,
1544  float t_offset_into_new_action = 0.0f);
1545 
1546  /*l
1547  *b Description:
1548  **
1549  ** This function is similar to force_action(), but allows the
1550  ** specification of how long the interruption should last.
1551  **
1552  ** This function will have no effect on a dead character (see
1553  ** die_now() and get_dead()).
1554  **
1555  *b Mode Restrictions:
1556  **
1557  *- - This function can only be called if the character is in
1558  *- path action mode *and* path position mode.
1559  **
1560  *b Mode Effects:
1561  **
1562  *- - This function will put the character into free action mode.
1563  *- - This function will not change the position mode.
1564  **
1565  *b Arguments:
1566  **
1567  *a duration - how long the action should be performed before
1568  *a an automatic resume_interrupted_path() call is
1569  *a made
1570  **
1571  *b Returns:
1572  **
1573  ** 0 on success, -1 on failure
1574  */
1575  int force_action_with_duration(const char* action_name,
1576  float duration,
1577  int include_transition_arc = 1,
1578  float max_rampdown_interval = 0.5f);
1579 
1580  /*l
1581  *b Description:
1582  **
1583  ** This function is similar to force_action(), but allows the
1584  ** specification of an offset to apply to the character's position.
1585  **
1586  *b Mode Effects:
1587  **
1588  *- - This function will put the character into free action mode.
1589  *- - This function may change the position mode; see Description.
1590  **
1591  *b Arguments:
1592  **
1593  *a x, y, z - Offset to apply to character's position when transitioning
1594  *a to given action.
1595  **
1596  *b Returns:
1597  **
1598  ** 0 on success, -1 on failure
1599  **
1600  */
1601  int force_action_with_offset( const char* action_name,
1602  float speed = DIGUY_DEFAULT_FLOAT,
1603  int include_transition_arc = 1,
1604  float max_rampdown_interval = 0.5f,
1605  int retain_path_shape = 0,
1606  float t_offset_into_new_action = 0.0f,
1607  float x = 0, float y = 0, float z = 0 );
1608 
1609  /*l
1610  *b Description:
1611  **
1612  ** This function forces the current action of the character to be the
1613  ** action identified by action_name, to be executed along the path
1614  ** shape specified by path_shape_name.
1615  **
1616  ** This function will have no effect on a dead character (see
1617  ** die_now() and get_dead()).
1618  **
1619  *b Mode Effects:
1620  **
1621  *- - This function will put the character into free action mode.
1622  *- - This function will put the character into path position mode.
1623  **
1624  *b Arguments:
1625  **
1626  *a action_name - name of the action to be performed by
1627  *a the character
1628  *a path_shape_name - name of the path shape on which action
1629  *a should be performed
1630  *a waypoint_name - name of waypoint on path shape to begin at;
1631  *a default of NULL will start at first waypoint
1632  *a distance_into_path - distance into path shape to start at, if
1633  *a waypoint_name isn't specified
1634  **
1635  *b Returns:
1636  **
1637  ** 0 on success, -1 on failure
1638  */
1639  int force_action_and_path_shape(const char* action_name,
1640  const char* path_shape_name,
1641  const char* waypoint_name = NULL,
1642  float distance_into_path = 0.0f);
1643 
1644  /*l
1645  *b Description:
1646  **
1647  ** This function returns the most recently forced action as set by
1648  ** by force_action(), force_action_with_duration(), or
1649  ** force_action_and_path_shape().
1650  **
1651  *b Returns:
1652  **
1653  ** the name of the most recent forced action, or NULL if no action
1654  ** has been forced
1655  */
1656  const char* get_most_recent_forced_action();
1657 
1658  /*l
1659  *b Description:
1660  **
1661  ** This function returns the time at which the most recently forced
1662  ** action occurred.
1663  **
1664  *b Returns:
1665  **
1666  ** time at which force action occurred; -1.0 if no action has been
1667  ** forced
1668  */
1669  float get_most_recent_forced_action_t();
1670 
1671  /*l
1672  *b Description:
1673  **
1674  ** This function returns the action time offset of the most recently
1675  ** forced action. This is typically value of the
1676  ** t_offset_into_new_action argument of the force_action() call.
1677  **
1678  *b Returns:
1679  **
1680  ** time at which force action occurred; -1.0 if no action has been
1681  ** forced
1682  */
1683  float get_most_recent_forced_action_t_offset();
1684 
1685 
1686  /*l
1687  *b Description:
1688  **
1689  ** This function adds a "pending action" to the character. This is
1690  ** essentially a delayed set_desired_action() call. The desired
1691  ** action will be set at the passed scenario t, just as if
1692  ** set_desired_action() is called at that time.
1693  **
1694  ** *Note:* Any call to set_desired_action() or force_action(), or
1695  ** their related variants, will clear any pending actions.
1696  **
1697  *b Arguments:
1698  **
1699  *a action - name of pending desired action
1700  *a scenario_t - time at which to set desired action
1701  *a remove_existing_pending_actions - pass 1 to remove any previously
1702  *a added pending actions, 0 to leave them
1703  *a speed - as passed to set_desired_action()
1704  *a retain_path_shape - as passed to set_desired_action()
1705  **
1706  *b Returns:
1707  **
1708  ** 0 on success, -1 on failure
1709  */
1710  int add_pending_desired_action(const char* action,
1711  float scenario_t,
1712  int remove_existing_pending_actions = 0,
1713  float speed = DIGUY_DEFAULT_FLOAT,
1714  int retain_path_shape = 1);
1715 
1716  /*l
1717  *b Description:
1718  **
1719  ** Similar to add_pending_desired_action(), but will do a
1720  ** force_action() at the passed scenario_t instead of a
1721  ** set_desired_action().
1722  **
1723  ** *Note:* Any call to set_desired_action() or force_action(), or
1724  ** their related variants, will clear any pending actions.
1725  **
1726  *b Returns:
1727  **
1728  ** 0 on success, -1 on failure
1729  */
1730  int add_pending_force_action(const char* action,
1731  float scenario_t,
1732  int remove_existing_pending_actions = 0,
1733  float speed = DIGUY_DEFAULT_FLOAT,
1734  int include_transition_arc = 1,
1735  float max_rampdown_interval = 0.5f,
1736  int retain_path_shape = 1,
1737  float first_arc_time_shift = 0.0f);
1738 
1739  /*l
1740  *b Returns:
1741  **
1742  ** 1 if the passed action name is an action available to this
1743  ** character, 0 if not
1744  */
1745  int is_valid_action(const char* action);
1746 
1747  /*l
1748  *b Description:
1749  **
1750  ** This function sends this character a signal to die as soon as
1751  ** possible. The character will transition to a dead action.
1752  **
1753  ** The following side-effects will also happen:
1754  *>
1755  *- - all aiming is ended
1756  *- - all gazing is ended
1757  *- - all pointing is ended
1758  *- - head nodding and shaking are stopped
1759  *- - all gestures are aborted
1760  *- - all sounds originated by the character are stopped
1761  *- - Destroyed appearance might be switched to.
1762  *<
1763  ** Many function calls will have no effect on dead characters;
1764  ** see individual function descriptions for limitations.
1765  **
1766  ** Use the get_dead() call to retrieve the dead state of a
1767  ** character.
1768  **
1769  *b Mode Effects:
1770  **
1771  *- - This function will put the character into free action mode.
1772  *- - This function will not change the position mode.
1773  **
1774  *b Returns:
1775  **
1776  ** 0 on success, -1 on failure
1777  **
1778  *b Available as Decision Bead/Event
1779  */
1780  int die_now(const char* preferred_dead_action_name = "(default)");
1781 
1782  /*l
1783  *b Description:
1784  **
1785  ** This function revives a dead character. The limitations of dead
1786  ** characters will be lifted from the revived character; e.g., the
1787  ** character will be able to gaze, execute gestures, etc.
1788  **
1789  *b Returns:
1790  **
1791  ** 0 on success, -1 on failure
1792  **
1793  *b Available as Decision Bead/Event
1794  */
1795  int revive_now(const char* preferred_revive_action_name = "(default)");
1796 
1797  /*l
1798  *b Description:
1799  **
1800  ** This function returns whether or not the character is dead.
1801  ** Characters can be killed by die_now() function calls, as well as
1802  ** by being hit by weapon fire.
1803  **
1804  *b Returns:
1805  **
1806  ** 1 if character is dead (die_now() function has been called),
1807  ** 0 if not.
1808  */
1809  int get_dead();
1810 
1811  /*l
1812  *b Description:
1813  **
1814  ** Sets the speed the character should attempt to move, in meters per
1815  ** second.
1816  **
1817  ** This setting takes effect immediately. To set a desired action
1818  ** and a desired speed at the same time, use the speed argument of
1819  ** the set_desired_action() call.
1820  **
1821  ** This desired speed setting can be undone in a couple of ways:
1822  **
1823  *- 1. by calling set_speed() with an argument of
1824  *- DIGUY_DEFAULT_FLOAT, or
1825  *- 2. by calling set_desired_action(), or
1826  *- 3. by calling one of the force_action() functions
1827  **
1828  *b Arguments:
1829  **
1830  *a speed - desired speed in meters per second
1831  **
1832  *b Returns:
1833  **
1834  ** 0 on success, -1 on failure
1835  */
1836  int set_speed(float speed);
1837 
1838  /*l
1839  *b Returns:
1840  **
1841  ** the approximate speed at which the character is moving, in meters
1842  ** per second
1843  */
1844  float get_speed();
1845 
1846  /*l
1847  *b Returns:
1848  **
1849  ** The desired speed of the character, in meters per second. Calls to
1850  ** set_speed(), set_desired_action(), or force_action() assign
1851  ** the character a desired speed, to which it transitions over some
1852  ** amount of time. If the speed-setting was instantaneous, the current
1853  ** speed will be returned.
1854  */
1855  float get_desired_speed();
1856 
1857 /*****************************************************************************/
1874  /*l
1875  *b Description:
1876  **
1877  ** Sets a generic parameter that can be mapped to a blend tree driver.
1878  ** Useful for creating animations that can play back at different vertical angles.
1879  */
1880  int set_animation_target_el(float elevation, float ramp_time = .25f);
1881 
1883  float get_animation_target_el();
1884 
1885  /*l
1886  *b Description:
1887  **
1888  ** Sets a generic parameter that can be mapped to a blend tree driver.
1889  ** Useful for creating animations that can play back at different horizontal angles.
1890  */
1891  int set_animation_target_az(float azimuth, float ramp_time = .25f);
1892 
1894  float get_animation_target_az();
1895 
1896  /*l
1897  *b Description:
1898  **
1899  ** Sets a generic parameter in world space that can be mapped to a blend tree driver.
1900  ** The locomotion actions are driven by these values allowing one action to go
1901  ** many different direction.
1902  ** Internally this is mapped to local space.
1903  **
1904  ** In practical terms, this means that a character with the appropriate animation blend
1905  ** tree can be made to move at an arbitrary speed in an arbitrary direction, provided
1906  ** that the blend tree supports these motions. One example would be a soldier who can
1907  ** "strafe" from side to side while pointing his weapon in a certain direction. Another
1908  ** example would be a car that can travel forwards or backwards at a speed within a
1909  ** continuous range.
1910  **
1911  ** Users can see a demonstration of this feature in the character view by selecting an
1912  ** appropriate character type (e.g. vehicle_09), appearance (e.g. taxi_2013), and
1913  ** action ("movement"). The exercise blend tree widget will allow adjustments.
1914  **
1915  */
1916  void set_animation_velocity(float vel_x, float vel_y, float vel_z, float ramp_time = .25f);
1917 
1919  void get_animation_velocity(float *vel_x, float *vel_y, float *vel_z);
1920 
1921  /*l
1922  *b Description:
1923  **
1924  ** Sets a generic parameter in local space that can be mapped to a blend tree driver.
1925  ** The locomotion actions are driven by these values allowing one action to go
1926  ** many different directions.
1927  **
1928  ** Similar to set_animation_velocity() in terms of overall practical details.
1929  ** Note that the local velocity setting will affect the character's world velocity.
1930  */
1931  void set_animation_local_velocity(float vel_x, float vel_y, float vel_z, float ramp_time = .25f);
1932 
1934  void get_animation_local_velocity(float *vel_x, float *vel_y, float *vel_z);
1935 
1936  /*l
1937  *b Description:
1938  **
1939  ** Sets a generic parameter in that can be mapped to a blend tree driver.
1940  ** The locomotion actions are driven by these values allowing one action to turn
1941  */
1942  void set_animation_angular_velocity(float vel_rz, float ramp_time = .25f);
1943 
1945  float get_animation_angular_velocity();
1946 
1947 
1948 /*****************************************************************************/
1958  /*l
1959  *b Description:
1960  **
1961  ** Sets the position of the character relative to the origin of the
1962  ** DI-Guy global coordinate system.
1963  **
1964  ** The new settings will take effect immediately, possibly causing
1965  ** the character to "teleport" if the new values are significantly
1966  ** different than the old.
1967  **
1968  ** The DI-Guy global coordinate system is right-handed, with
1969  ** X forward, Z up, and Y to the left. Rotation directions follow
1970  ** standard right-handed coordinate system conventions:
1971  **
1972  *- - positive rotations about X cause a counter-clockwise roll
1973  *- - position rotations about Y cause a forward pitch
1974  *- - positive rotations about Z cause a yaw to the left
1975  **
1976  ** Note that if the character has an altitude function (see
1977  ** set_altitude_function()), the tz argument will effectively be
1978  ** ignored as the altitude function will override it.
1979  **
1980  ** If the magnitude of the numbers is large (say 32000 or higher),
1981  ** the function set_position_double() should be used instead.
1982  **
1983  *b Mode Effects:
1984  **
1985  *- - This function will put the character into free position mode.
1986  *- - This function will put the character into free action mode.
1987  **
1988  *b Arguments:
1989  **
1990  *a tx, ty, tz - position in meters from the origin
1991  **
1992  *b Returns:
1993  **
1994  ** 0 on success, -1 on failure
1995  */
1996  int set_position(float tx, float ty, float tz);
1997 
1998  /*l
1999  *b Description:
2000  **
2001  ** Similar to set_position(), but using double-precision rather than
2002  ** single-precision numbers. If the magnitude of the numbers is large
2003  ** (say 32000 or higher), this function should be used.
2004  **
2005  *b Mode Effects:
2006  **
2007  *- - This function will put the character into free position mode.
2008  *- - This function will put the character into free action mode.
2009  **
2010  *b Arguments:
2011  **
2012  *a tx, ty, tz - position in meters from the origin
2013  **
2014  *b Returns:
2015  **
2016  ** 0 on success, -1 on failure
2017  */
2018  int set_position_double(double tx, double ty, double tz);
2019 
2020  /*l
2021  *b Description:
2022  **
2023  ** Retrieves the position of the character in the DI-Guy
2024  ** global coordinate system.
2025  **
2026  ** See set_position() for a description of the coordinate system.
2027  **
2028  *b Arguments:
2029  **
2030  *a tx, ty, tz - position in meters from the origin
2031  **
2032  ** Pass NULL for any values that are not needed.
2033  **
2034  *b Returns:
2035  **
2036  ** 0 on success, -1 on failure
2037  */
2038  int get_position(float* tx, float* ty, float* tz);
2039 
2040  /*l
2041  *b Description:
2042  **
2043  ** Retrieves the position of the character in the DI-Guy
2044  ** global coordinate system.
2045  **
2046  ** See set_position() for a description of the coordinate system.
2047  **
2048  ** Unlike get_position(), this function returns higher-precision
2049  ** values for the position, which is important when the character is
2050  ** far from the coordinate system origin.
2051  **
2052  *b Arguments:
2053  **
2054  *a tx, ty, tz - position in meters from the origin
2055  **
2056  ** Pass NULL for any values that are not needed.
2057  **
2058  *b Returns:
2059  **
2060  ** 0 on success, -1 on failure
2061  */
2062  int get_position_double(double* tx, double* ty, double* tz);
2063 
2064  /*l
2065  *b Description:
2066  **
2067  ** Sets the position of the character relative to its parent or the
2068  ** origin of the DI-Guy global coordinate system if this
2069  ** character is not parented.
2070  **
2071  ** See set_position() for a description of the coordinate system.
2072  **
2073  ** The new settings will take effect immediately, possibly causing the
2074  ** character to "teleport" if the new values are significantly
2075  ** different than the old.
2076  **
2077  *b Mode Effects:
2078  **
2079  *- - This function will put the character into free position mode.
2080  *- - This function will put the character into free action mode.
2081  **
2082  *b Arguments:
2083  **
2084  *a tx, ty, tz - position in meters from the origin
2085  **
2086  *b Returns:
2087  **
2088  ** 0 on success, -1 on failure
2089  */
2090  int set_position_relative_to_parent(float tx, float ty, float tz);
2091 
2092  /*l
2093  *b Description:
2094  **
2095  ** Retrieves the position of the character relative to its parent, or
2096  ** relative to the origin of the DI-Guy global coordinate
2097  ** system if this character is not parented.
2098  **
2099  ** See set_position() for a description of the coordinate system.
2100  **
2101  *b Arguments:
2102  **
2103  *a tx, ty, tz - position in meters from the origin
2104  **
2105  ** Pass NULL for any values that are not needed.
2106  **
2107  *b Returns:
2108  **
2109  ** 0 on success, -1 on failure
2110  */
2111  int get_position_relative_to_parent(float* tx, float* ty, float* tz);
2112 
2113  /*l
2114  *b Description:
2115  **
2116  ** Similar to set_position_relative_to_parent(), but the position is
2117  ** either from the other character's overall position (if
2118  ** other_link_name is NULL), or the position of the other character's
2119  ** link (if other_link_name specifies a link on the other character).
2120  **
2121  ** The position that is set is relative to this character's parent.
2122  **
2123  *b Mode Effects:
2124  **
2125  *- - This function will put the character into free position mode.
2126  *- - This function will put the character into free action mode.
2127  **
2128  *b Arguments:
2129  **
2130  *a other_character_name - other character from which to read
2131  *a position
2132  *a other_link_name - optional link on other character; if
2133  *a NULL, other character's base position is
2134  *a used
2135  *a offset_x, offset_y, offset_z - offset to apply to position
2136  *a read from other character
2137  *a also_set_orientation - pass 1 to also set this character's
2138  *a orientation from the other character's
2139  *a orientation
2140  **
2141  *b Returns:
2142  **
2143  ** 0 on success, -1 on failure
2144  */
2145  int set_position_to_other_character_position(const char* other_character_name,
2146  const char* other_link_name = NULL,
2147  float offset_x = 0.0f, float offset_y = 0.0f, float offset_z = 0.0f,
2148  int also_set_orientation = 1);
2149 
2150  /*l
2151  *b Description:
2152  **
2153  ** Sets the desired position of the character. How the character
2154  ** moves toward the desired position is determined by its current
2155  ** guides; see add_guide() and create_guide().
2156  **
2157  *b Mode Effects:
2158  **
2159  *- - This function will put the character into free position mode.
2160  *- - This function will put the character into free action mode.
2161  **
2162  *b Arguments:
2163  **
2164  *a tx, ty, tz - desired position in meters from the origin
2165  *a force_guide_unacquired - this optional argument will set any guides
2166  *a the character has to be unacquired
2167  *b Returns:
2168  **
2169  ** 0 on success, -1 on failure
2170  */
2171  int set_desired_position(float tx, float ty, float tz,
2172  int force_guide_unacquired = 0);
2173 
2174  int set_desired_position_double(double tx, double ty, double tz,
2175  int force_guide_unacquired = 0);
2176  /*l
2177  *b Description:
2178  **
2179  ** Like set_desired_position(), but uses the character's current
2180  ** position as the desired position.
2181  **
2182  *b Mode Effects:
2183  **
2184  *- - This function will put the character into free position mode.
2185  *- - This function will put the character into free action mode.
2186  **
2187  *b Arguments:
2188  **
2189  *a also_set_orientation - pass 1 to also set this character's
2190  *a orientation to its current orientation
2191  **
2192  *b Returns:
2193  **
2194  ** 0 on success, -1 on failure
2195  */
2196  int set_desired_position_to_current_position(int also_set_orientation = 1);
2197 
2198  /*l
2199  *b Description:
2200  **
2201  ** Like set_desired_position(), but sets the character's desired
2202  ** position to passed waypoint's position.
2203  **
2204  ** The passed waypoint can be one created by
2205  ** diguyScenario::create_waypoint, a waypoint from a character's
2206  ** diguyCharacterPath, or waypoint from a diguyPathShape.
2207  **
2208  *b Mode Effects:
2209  **
2210  *- - This function will put the character into free position mode.
2211  *- - This function will put the character into free action mode.
2212  **
2213  *b Arguments:
2214  **
2215  *a waypoint - pointer to diguyWaypoint object
2216  *a offset_x, offset_y, offset_z - offset to apply to waypoint
2217  *a position
2218  *a offset_in_world_coords - 1 if offset is to be in world
2219  *a coordinates, 0 if it is to be
2220  *a in waypoint-local coordinates
2221  **
2222  *b Returns:
2223  **
2224  ** 0 on success, -1 on failure
2225  */
2226  int set_desired_position_to_waypoint(diguyWaypoint* waypoint,
2227  float offset_x = 0.0f, float offset_y = 0.0f, float offset_z = 0.0f,
2228  int offset_in_world_coords = 0);
2229 
2230  /*l
2231  *b Description:
2232  **
2233  ** Like set_desired_position(), but finds the specified waypoint on
2234  ** the specified path and sets the character's desired position to the
2235  ** waypoint's position.
2236  **
2237  *b Mode Effects:
2238  **
2239  *- - This function will put the character into free position mode.
2240  *- - This function will put the character into free action mode.
2241  **
2242  *b Arguments:
2243  **
2244  *a path_name - name of path on which to find waypoint
2245  *a waypoint_name - name of waypoint
2246  **
2247  *b Returns:
2248  **
2249  ** 0 on success, -1 on failure
2250  */
2251  int set_desired_position_to_path_waypoint(const char* path_name,
2252  const char* waypoint_name);
2253 
2254  /*l
2255  *b Description:
2256  **
2257  ** Like set_desired_position(), but finds the specified waypoint on
2258  ** the specified path shape and sets the character's desired position
2259  ** to the waypoint's position.
2260  **
2261  *b Mode Effects:
2262  **
2263  *- - This function will put the character into free position mode.
2264  *- - This function will put the character into free action mode.
2265  **
2266  *b Arguments:
2267  **
2268  *a path_shape_name - name of path shape on which to find waypoint
2269  *a waypoint_name - name of waypoint
2270  **
2271  *b Returns:
2272  **
2273  ** 0 on success, -1 on failure
2274  */
2275  int set_desired_position_to_path_shape_waypoint(const char* path_shape_name,
2276  const char* waypoint_name);
2277 
2278  /*l
2279  *b Description:
2280  **
2281  ** Retrieves the desired position of the character.
2282  **
2283  *b Mode Restrictions:
2284  **
2285  *- - This function can only be called in free position mode.
2286  **
2287  *b Arguments:
2288  **
2289  *a tx, ty, tz - desired position in meters from the origin
2290  **
2291  ** Pass NULL for any values that are not needed.
2292  **
2293  *b Returns:
2294  **
2295  ** 0 on success, -1 on failure
2296  */
2297  int get_desired_position(float* tx, float* ty, float* tz);
2298  int get_desired_position_double(double* tx, double* ty, double* tz);
2299 
2300  /*l
2301  *b Description:
2302  **
2303  ** Retrieves the delta vector from current position to desired one.
2304  **
2305  *b Mode Restrictions:
2306  **
2307  *- - This function can only be called in free position mode.
2308  **
2309  *b Arguments:
2310  **
2311  *a tx, ty, tz - delta in meters
2312  **
2313  ** Pass NULL for any values that are not needed.
2314  **
2315  *b Returns:
2316  **
2317  ** 0 on success, -1 on failure
2318  */
2319  int get_delta_to_desired_position(float* tx, float* ty, float* tz);
2320 
2321  /*l
2322  *b Description:
2323  **
2324  ** Sets the initial position the character should move to on a call to
2325  ** diguyScenario::reset().
2326  **
2327  ** If the character has an initial path, that path, not this function
2328  ** call, will determine its initial position.
2329  **
2330  *b Arguments:
2331  **
2332  *a tx, ty, tz - initial position in meters from the origin
2333  **
2334  *b Returns:
2335  **
2336  ** 0 on success, -1 on failure
2337  */
2338  int set_initial_position(float tx, float ty, float tz);
2339 
2340  /*l
2341  *b Description:
2342  **
2343  ** Retrieves the initial position of the character.
2344  **
2345  ** If the character is in free position mode or has no initial path,
2346  ** this will be the position set by set_initial_position().
2347  **
2348  ** Otherwise this will be the position of the first waypoint of the
2349  ** initial path.
2350  **
2351  *b Arguments:
2352  **
2353  *a tx, ty, tz - initial position in meters from the origin
2354  **
2355  ** Pass NULL for any values that are not needed.
2356  **
2357  *b Returns:
2358  **
2359  ** 0 on success, -1 on failure
2360  */
2361  int get_initial_position(float* tx, float* ty, float* tz);
2362 
2363  /*l
2364  *b Description:
2365  **
2366  ** Sets the orientation of the character relative to the origin of the
2367  ** DI-Guy global coordinate system.
2368  **
2369  ** See set_position() for a description of the coordinate system.
2370  **
2371  ** The new settings will take effect immediately, possibly causing the
2372  ** character to "teleport" if the new values are significantly
2373  ** different than the old.
2374  **
2375  ** Note that if the character has an up vector type of 'z' or 'n' or even
2376  ** sometimes 'd' (as set by the set_up_vector_type() call) the rx and ry
2377  ** values will not have any effect. To be able to set rx and ry
2378  ** values, set the up vector type of the character to 'c', for "custom".
2379  **
2380  *b Mode Effects:
2381  **
2382  *- - This function will put the character into free position mode.
2383  *- - This function will put the character into free action mode.
2384  **
2385  *b Arguments:
2386  **
2387  *a rz, rx, ry - orientations in degrees
2388  **
2389  *b Returns:
2390  **
2391  ** 0 on success, -1 on failure
2392  */
2393  int set_orientation(float rz, float rx, float ry);
2394 
2395  /*l
2396  *b Description:
2397  **
2398  ** Retrieves the orientation of the character in the DI-Guy
2399  ** global coordinate system. See set_position() for a description of
2400  ** the coordinate system.
2401  **
2402  *i Note:
2403  **
2404  ** For vehicles, you may want to use the function
2405  ** get_vehicle_body_orientation(). See that function for more
2406  ** information.
2407  **
2408  *b Arguments:
2409  **
2410  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2411  *a positive X axis
2412  **
2413  ** Pass NULL for any values that are not needed.
2414  **
2415  *b Returns:
2416  **
2417  ** 0 on success, -1 on failure
2418  */
2419  int get_orientation(float* rz, float* rx, float* ry);
2420 
2421  /*l
2422  *b Description:
2423  **
2424  ** Sets the orientation of the character relative to its parent or the
2425  ** origin of the DI-Guy global coordinate system if this
2426  ** character is not parented.
2427  **
2428  ** See set_position() for a description of the coordinate system.
2429  **
2430  ** The new settings will take effect immediately, possibly causing the
2431  ** character to "teleport" if the new values are significantly
2432  ** different than the old.
2433  **
2434  *b Mode Effects:
2435  **
2436  *- - This function will put the character into free position mode.
2437  *- - This function will put the character into free action mode.
2438  **
2439  *b Arguments:
2440  **
2441  *a rz, rx, ry - orientations in degrees
2442  **
2443  *b Returns:
2444  **
2445  ** 0 on success, -1 on failure
2446  */
2447  int set_orientation_relative_to_parent(float rz, float rx, float ry);
2448 
2449  /*l
2450  *b Description:
2451  **
2452  ** Retrieves the orientation of the character relative to its parent,
2453  ** or the origin of the DI-Guy global coordinate system if
2454  ** this character does not have a parent.
2455  **
2456  ** See set_position() for a description of the coordinate system.
2457  **
2458  *b Arguments:
2459  **
2460  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2461  *a positive X axis
2462  **
2463  ** Pass NULL for any values that are not needed.
2464  **
2465  *b Returns:
2466  **
2467  ** 0 on success, -1 on failure
2468  */
2469  int get_orientation_relative_to_parent(float* rz, float* rx, float* ry);
2470 
2471  /*l
2472  *b Description:
2473  **
2474  ** This function sets how the character should be oriented relative
2475  ** to its surroundings.
2476  **
2477  ** This function changes the current up vector type, and the up vector type
2478  ** that will be set when the character is reset. To change only the
2479  ** current up vector type (a temporary change that goes away on reset),
2480  ** call set_up_vector_type()).
2481  **
2482  *b Arguments:
2483  **
2484  *a axis - the up vector type the character should use; legal
2485  *a values shown below:
2486  **
2487  *- - 'd' - use default settings; character will change
2488  *- up vector type depending on current action and
2489  *- path shape parameters
2490  *- - 'z' - Z axis is up; character will be oriented
2491  *- so that positive Z in character coordinates is
2492  *- always oriented along the positive world Z axis
2493  *- - 'n' - normal to path; character will be oriented
2494  *- so that positive Z in character coordinates is
2495  *- normal to the path shape the character is on
2496  *- - 'g' - ground-clamped; the vehicle will attempt to cling
2497  *- to the terrain, in an approximation of real rigid
2498  *- body physics
2499  *- - 'c' - custom; character's rx and ry orientation values
2500  *- will not be modified
2501  **
2502  ** Having an up vector type of 'z' effectively zeroes out the rx and ry
2503  ** values of the character's orientation.
2504  **
2505  ** Having an up vector type of 'n' may override rx and ry values of the
2506  ** character's orientation with values derived from the character's
2507  ** path shape.
2508  **
2509  ** Having an up vector type of 'c' allows the pitch and roll of the
2510  ** character to be changed without taking it off the path it in on by
2511  ** calling set_custom_orientation_rx_and_ry(). Calling
2512  ** set_orientation() has the side-effect of putting the character
2513  ** into free position mode, taking it off of any path it's on.
2514  **
2515  *b Returns:
2516  **
2517  ** 0 on success, -1 on failure
2518  */
2519  int set_initial_up_vector_type(char axis);
2520 
2521  /*l
2522  *b Description:
2523  **
2524  ** This function is being deprecated, but remains for backwards compatibility.
2525  ** It does the same thing as set_initial_up_vector_type()
2526  **
2527  */
2528  int set_initial_up_vector(char axis);
2529 
2530  /*l
2531  *b Returns:
2532  **
2533  ** current up vector type; see set_initial_up_vector_type()
2534  */
2535  char get_initial_up_vector_type();
2536 
2537  /*l
2538  *b Description:
2539  **
2540  ** This function is being deprecated, but remains for backwards compatibility.
2541  ** It does the same thing as get_initial_up_vector_type()
2542  **
2543  */
2544  char get_initial_up_vector();
2545 
2546  /*l
2547  *b Description:
2548  **
2549  ** This function sets how the character should be oriented relative
2550  ** to its surroundings.
2551  **
2552  ** This function changes only the current up vector type. To change the
2553  ** up vector type that will be used when the character is reset, call
2554  ** set_initial_up_vector_type().
2555  **
2556  *b Arguments:
2557  **
2558  *a axis - the up vector type the character should use; see
2559  *a set_initial_up_vector_type() for description
2560  **
2561  *b Returns:
2562  **
2563  ** 0 on success, -1 on failure
2564  **
2565  *b Available as Decision Bead/Event
2566  */
2567  int set_up_vector_type(char axis);
2568 
2569  /*l
2570  *b Description:
2571  **
2572  ** This function is being deprecated, but remains for backwards compatibility.
2573  ** It does the same thing as set_up_vector_type()
2574  **
2575  */
2576  int set_up_vector(char axis);
2577 
2578  /*l
2579  *b Returns:
2580  **
2581  ** current up vector type; see set_up_vector_type()
2582  */
2583  char get_up_vector_type();
2584 
2585  /*l
2586  *b Description:
2587  **
2588  ** This function is being deprecated, but remains for backwards compatibility.
2589  ** It does the same thing as get_up_vector_type()
2590  **
2591  */
2592  char get_up_vector();
2593 
2594  /*l
2595  *b Description:
2596  **
2597  ** This function sets the rx and ry components of the character's
2598  ** orientation. Unlike set_orientation(), this function does not
2599  ** put the character into free position mode if it is currently in
2600  ** path position mode.
2601  **
2602  ** Note that if the character has an up vector type of 'z' or 'n' or even
2603  ** sometimes 'd' (as set by the set_up_vector_type() call) this function
2604  ** will not have any effect. To be able to set rx and ry values,
2605  ** set the up vector type of the character to 'c', for "custom".
2606  **
2607  ** The passed rx and ry values are in character-local coordinates,
2608  ** not parent coordinates if the character has a parent.
2609  **
2610  *b Mode Effects:
2611  **
2612  *- - None.
2613  **
2614  *b Arguments:
2615  **
2616  *a rx, ry - orientations in degrees
2617  **
2618  *b Returns:
2619  **
2620  ** 0 on success, -1 on failure
2621  */
2622  int set_custom_orientation_rx_and_ry(float rx,
2623  float ry);
2624 
2625  /*l
2626  *b Description:
2627  **
2628  ** Sets the desired orientation of the character. See
2629  ** set_desired_position().
2630  **
2631  *b Mode Effects:
2632  **
2633  *- - This function will put the character into free position mode.
2634  *- - This function will put the character into free action mode.
2635  **
2636  *b Arguments:
2637  **
2638  *a rz, rx, ry - orientations in degrees counter-clockwise from
2639  *a the positive X axis
2640  **
2641  *b Returns:
2642  **
2643  ** 0 on success, -1 on failure
2644  */
2645  int set_desired_orientation(float rz, float rx, float ry,
2646  int force_guide_unacquired = 0);
2647 
2648  /*l
2649  *b Description:
2650  **
2651  ** Retrieves the desired orientation of the character.
2652  **
2653  *b Mode Restrictions:
2654  **
2655  *- - This function can only be called in free position mode.
2656  **
2657  *b Arguments:
2658  **
2659  *a rz, rx, ry - orientations in degrees counter-clockwise from
2660  *a the positive X axis
2661  **
2662  ** Pass NULL for any values that are not needed.
2663  **
2664  *b Returns:
2665  **
2666  ** 0 on success, -1 on failure
2667  */
2668  int get_desired_orientation(float* rz, float* rx, float* ry);
2669 
2670  /*l
2671  *b Description:
2672  **
2673  ** Retrieves the delta from current orientation of the character
2674  ** to the desired one.
2675  **
2676  *b Mode Restrictions:
2677  **
2678  *- - This function can only be called in free position mode.
2679  **
2680  *b Arguments:
2681  **
2682  *a rz, rx, ry - orientation deltas in degrees counter-clockwise from
2683  *a the positive X axis
2684  **
2685  ** Pass NULL for any values that are not needed.
2686  **
2687  *b Returns:
2688  **
2689  ** 0 on success, -1 on failure
2690  */
2691  int get_delta_to_desired_orientation(float* rz, float* rx, float* ry);
2692 
2693  /*l
2694  *b Description:
2695  **
2696  ** Like set_desired_orientation(), but uses the character's current
2697  ** orientation as the desired orientation.
2698  **
2699  *b Mode Effects:
2700  **
2701  *- - This function will put the character into free position mode.
2702  *- - This function will put the character into free action mode.
2703  **
2704  *b Returns:
2705  **
2706  ** 0 on success, -1 on failure
2707  */
2708  int set_desired_orientation_to_current_orientation();
2709 
2710  /*l
2711  *b Description:
2712  **
2713  ** Like set_desired_orientation(), but orients the character towards
2714  ** the position specified.
2715  **
2716  *b Mode Effects:
2717  **
2718  *- - This function will put the character into free position mode.
2719  *- - This function will put the character into free action mode.
2720  **
2721  *b Returns:
2722  **
2723  ** 0 on success, -1 on failure
2724  */
2725  int set_desired_orientation_towards_position(float x, float y, float z,
2726  int force_guide_unacquired = 0);
2727 
2728  /*l
2729  *b Description:
2730  **
2731  ** Sets the initial orientation the character should move
2732  ** to on a call to diguyScenario::reset().
2733  **
2734  ** If the character is on a path the path, not this function
2735  ** call, will determine its initial orientation.
2736  **
2737  *b Arguments:
2738  **
2739  *a rz, rx, ry - orientations in degrees counter-clockwise from
2740  *a the positive X axis
2741  **
2742  *b Returns:
2743  **
2744  ** 0 on success, -1 on failure
2745  */
2746  int set_initial_orientation(float rz, float rx, float ry);
2747 
2748  /*l
2749  *b Description:
2750  **
2751  ** Retrieves the initial orientation of the character.
2752  **
2753  ** If the character is in free position mode or has no
2754  ** initial path, this will be the orientation set by
2755  ** set_initial_orientation().
2756  **
2757  ** Otherwise this will be the orientation of the first
2758  ** waypoint of the initial path.
2759  **
2760  *b Arguments:
2761  **
2762  *a rz, rx, ry - orientations in degrees counter-clockwise from
2763  *a the positive X axis
2764  **
2765  ** Pass NULL for any values that are not needed.
2766  **
2767  *b Returns:
2768  **
2769  ** 0 on success, -1 on failure
2770  */
2771  int get_initial_orientation(float* rz, float* rx, float* ry);
2772 
2773  /*l
2774  *b Description:
2775  **
2776  ** Returns the location and orientation of a specific link of the
2777  ** character.
2778  **
2779  *b Arguments:
2780  **
2781  *a link_name - name of the link or connection point; links are named after their inbound
2782  *a joint name
2783  *a tx, ty, tz - position in meters from the origin of the world
2784  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2785  *a positive X axis
2786  **
2787  ** Pass NULL for any values that are not needed.
2788  **
2789  *b Returns:
2790  **
2791  ** 0 on success, -1 on failure
2792  */
2793  int get_link_position(const char* link_name,
2794  float* tx, float* ty, float* tz,
2795  float* rz, float* rx, float* ry);
2796 
2797  /*l
2798  *b Description:
2799  **
2800  ** Returns the location and orientation of a specific link
2801  ** of the character.
2802  **
2803  *b Arguments:
2804  **
2805  *a link_name - name of the link or connection point; links are named after their inbound
2806  *a joint name
2807  *a tx, ty, tz - position in meters from the origin of the world
2808  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2809  *a positive X axis
2810  **
2811  ** Pass NULL for any values that are not needed.
2812  **
2813  *b Returns:
2814  **
2815  ** 0 on success, -1 on failure
2816  */
2817  int get_link_position_double(const char* link_name,
2818  double* tx, double* ty, double* tz,
2819  double* rz, double* rx, double* ry);
2820 
2821  /*l
2822  *b Description:
2823  **
2824  ** Similar to get_link_position(), but allows specification
2825  ** of offset into ending link.
2826  **
2827  *b Arguments:
2828  **
2829  *a link_name - name of the link or connection point
2830  *a offset_tx, offset_ty, offset_tz - offset in link
2831  *a tx, ty, tz - position in meters from the origin
2832  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2833  *a positive X axis
2834  **
2835  ** Pass NULL for any values that are not needed.
2836  **
2837  *b Returns:
2838  **
2839  ** 0 on success, -1 on failure
2840  */
2841  int get_link_position_with_offset(const char* link_name,
2842  float offset_tx, float offset_ty, float offset_tz,
2843  float* tx, float* ty, float* tz,
2844  float* rz, float* rx, float* ry);
2845 
2846  /*l
2847  *b Description:
2848  **
2849  ** Similar to get_link_position(), but allows specification
2850  ** of offset into ending link.
2851  **
2852  *b Arguments:
2853  **
2854  *a link_name - name of the link or connection point
2855  *a offset_tx, offset_ty, offset_tz - offset in link
2856  *a tx, ty, tz - position in meters from the origin
2857  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2858  *a positive X axis
2859  **
2860  ** Pass NULL for any values that are not needed.
2861  **
2862  *b Returns:
2863  **
2864  ** 0 on success, -1 on failure
2865  */
2866  int get_link_position_with_offset_double(const char* link_name,
2867  double offset_tx, double offset_ty, double offset_tz,
2868  double* tx, double* ty, double* tz,
2869  double* rz, double* rx, double* ry);
2870 
2871  /*l
2872  *b Description:
2873  **
2874  ** Returns the location and orientation of a specific link
2875  ** of the character relative to the position of another link.
2876  **
2877  *b Arguments:
2878  **
2879  *a beginning_link_name - name of the first link; send NULL to
2880  *a to specify the position link
2881  *a ending_link_name - name of the last link; send NULL to
2882  *a to specify the position link
2883  *a tx, ty, tz - position in meters from the origin
2884  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2885  *a positive X axis
2886  **
2887  ** Pass NULL for any values that are not needed.
2888  **
2889  *b Returns:
2890  **
2891  ** 0 on success, -1 on failure
2892  */
2893  int get_link_relative_position(const char* beginning_link_name,
2894  const char* ending_link_name,
2895  float* tx, float* ty, float* tz,
2896  float* rz, float* rx, float* ry);
2897 
2898  /*l
2899  *b Description:
2900  **
2901  ** Similar to get_link_relative_position(), but allows specification
2902  ** of offset into ending link.
2903  **
2904  *b Arguments:
2905  **
2906  *a beginning_link_name - name of the first link; send NULL to
2907  *a to specify the position link
2908  *a ending_link_name - name of the last link; send NULL to
2909  *a to specify the position link
2910  *a offset_tx, offset_ty, offset_tz - offset in ending link
2911  *a tx, ty, tz - position in meters from the origin
2912  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2913  *a positive X axis
2914  **
2915  ** Pass NULL for any values that are not needed.
2916  **
2917  *b Returns:
2918  **
2919  ** 0 on success, -1 on failure
2920  */
2921  int get_link_relative_position_with_offset(const char* beginning_link_name,
2922  const char* ending_link_name,
2923  float offset_tx, float offset_ty, float offset_tz,
2924  float* tx, float* ty, float* tz,
2925  float* rz, float* rx, float* ry);
2926 
2927  /*l
2928  *b Description:
2929  **
2930  ** By default characters on a path will scale their movement speed
2931  ** and velocity based on the scale of the actor the character is
2932  ** based on. For example, if a tall character and short character
2933  ** are both playing the exact same walk motion, the tall character
2934  ** will move further per motion repetition than the short character.
2935  **
2936  ** Scaling the travel in this way leads to more realistic looking
2937  ** motion, but can cause different characters using the same actions
2938  ** and underlying motions to move at different speeds. At times it
2939  ** is convenient to not scale the travel.
2940  **
2941  ** If actor scaling is disabled, characters of different sizes will
2942  ** all move the same distance, and at the same speed, if they have
2943  ** the same path shapes and action beads. Note that in cases of
2944  ** extreme differences between the actor the motion is based on
2945  ** and the actor the character's current appearance is based on,
2946  ** the characters feet may slip on the ground more than normal.
2947  **
2948  *b Arguments:
2949  **
2950  *a apply_scale_flag - pass 1 to apply actor scale to travel;
2951  *a 0 to not
2952  */
2953  void set_apply_actor_scale_to_action_bead_travel(int apply_scale_flag);
2954 
2955  /*l
2956  *b Returns:
2957  **
2958  ** 1 if actor scale is being applied to travel, 0 if not
2959  */
2960  int get_apply_actor_scale_to_action_bead_travel();
2961 
2962  /*l
2963  *b Description:
2964  **
2965  ** This function transforms a point that is in the local space of the
2966  ** character into a location in the world. Useful for things like
2967  ** navigating AIs to a location near a prop. Or moving to a spot
2968  ** in front of someone else.
2969  **
2970  ** This code presumes up_axis is 'z' and that there is only rotation
2971  ** about that axis.
2972  */
2973  int local_to_global(float x, float y, float z,
2974  float* res_x, float* res_y, float* res_z);
2975 
2976  /*l
2977  *b Description:
2978  **
2979  ** This function transforms a point that is in world space into the
2980  ** local space of a character. Useful for figuring out if something
2981  ** was seen.
2982  **
2983  ** This code presumes up_axis is 'z' and that there is only rotation
2984  ** about that axis.
2985  **
2986  */
2987  int global_to_local(float x, float y, float z,
2988  float* res_x, float* res_y, float* res_z);
2989 
2990  /*l
2991  *b Description:
2992  **
2993  ** Retrieves the current estimated velocity of the character. Note
2994  ** this value may not be valid in environments where characters are
2995  ** transformed independent of DI-Guy function calls. Teleporting
2996  ** characters can also temporarily make this calculation incorrect.
2997  **
2998  *b Arguments:
2999  **
3000  *a vel_x, vel_y, vel_z - meters/sec
3001  **
3002  ** Pass NULL for any values that are not needed.
3003  **
3004  */
3005  void get_velocity(float* vel_x, float* vel_y, float* vel_z);
3006 
3009  void get_acceleration(float* accel_x, float* accel_y, float* accel_z);
3010 
3011  /*l
3012  *b Description:
3013  **
3014  ** Used by the Drift and Adaptive guide
3015  **
3016  *b Arguments:
3017  **
3018  *a vel_x, vel_y, vel_z - meters/sec
3019  */
3020  void set_desired_velocity(float vel_x, float vel_y, float vel_z, float ramp_time = 0.0);
3021  void get_desired_velocity(float *vel_x, float *vel_y, float *vel_z);
3022 
3023  /*l
3024  *b Description:
3025  **
3026  ** Retrieves the current estimated angular velocity of the character.
3027  ** As above, changes made to characters independent of DI-Guy
3028  ** function calls will temporarily make this value incorrect.
3029  **
3030  ** Currently only the angular velocity in yaw is measured.
3031  **
3032  *b Arguments:
3033  **
3034  *a vel_rz - degrees/sec
3035  **
3036  */
3037  void get_angular_velocity(float* vel_rz);
3038 
3039  /*l
3040  ** Used by the Drift and Adaptive guide -- see diguyCharacterGuide.
3041  **
3042  ** The guide attempts to rotate the character at the desired angular
3043  ** velocity.
3044  */
3045  void set_desired_angular_velocity(float vel_rz);
3046  void get_desired_angular_velocity(float* vel_rz);
3047 
3048 /*****************************************************************************/
3054  /*l
3055  *b Description:
3056  **
3057  ** Returns the base appearance of the character, as passed to
3058  ** the function diguyScenario::create_character(). This pointer will
3059  ** never be NULL.
3060  **
3061  ** Note that the current appearance (as returned by
3062  ** get_current_appearance()) may be different than the base
3063  ** appearance. This base appearance is the starting appearance
3064  ** of the character before any calls to set_current_appearance()
3065  ** have been made.
3066  **
3067  *b Returns:
3068  **
3069  ** name of base appearance of the character
3070  */
3071  const char* get_appearance();
3072 
3073  /*l
3074  *b Description:
3075  **
3076  ** This function sets the base appearance of the character.
3077  ** The base appearance is the appearance the character will take
3078  ** if the scenario is reset, undoing any appearance changes made
3079  ** by calls to set_current_appearance().
3080  **
3081  ** Calling this function also makes an implicit call to
3082  ** set_current_appearance().
3083  **
3084  *b Arguments:
3085  **
3086  *a appearance - name of new base appearance
3087  **
3088  *b Returns:
3089  **
3090  ** 0 on success, -1 on failure
3091  */
3092  int set_appearance(const char* appearance);
3093 
3094  /*l
3095  *b Description:
3096  **
3097  ** This function sets the current appearance of this character.
3098  **
3099  ** Note that different appearances may be based on different actors.
3100  ** Different actors represent people of different sizes, so
3101  ** changing to an appearance that has a different actor can
3102  ** cause a pronounced change in character size.
3103  **
3104  ** Also, changing actors can take some time, as more internal
3105  ** character state needs to be updated to support the new size
3106  ** of the character.
3107  **
3108  *b Arguments:
3109  **
3110  *a appearance - name of new desired appearance
3111  *a allow_actor_change - pass 1 to allow the appearance change
3112  *a even if the actor changes, 0 to not
3113  **
3114  *b See Also:
3115  **
3116  ** get_current_appearance(), set_current_head_appearance()
3117  **
3118  *b Returns:
3119  **
3120  ** 0 on success, -1 on failure
3121  **
3122  *b Available as Decision Bead/Event
3123  */
3124  int set_current_appearance(const char* appearance,
3125  int allow_actor_change = 1);
3126 
3128  const char* get_current_appearance();
3129 
3130  /*l
3131  *b Description:
3132  **
3133  ** This function can be used to see if the current appearance
3134  ** has the passed name. This is primarily useful for decisions
3135  ** and other limited logic applications.
3136  **
3137  *b Returns:
3138  **
3139  ** 1 if current appearance has passed name; 0 if not
3140  **
3141  *b Available as Decision Bead/Event
3142  */
3143  int get_current_appearance_is(const char* appearance);
3144 
3145  /*l
3146  *b Description:
3147  **
3148  ** This function sets the head appearance of this character.
3149  ** This will persist past reseting the scenario, see set_appearance()
3150  ** for conceptual similarities.
3151  **
3152  *b Arguments:
3153  **
3154  *a head_appearance - name of the new desired head appearance
3155  **
3156  *b Returns:
3157  **
3158  ** 0 on success, -1 on failure
3159  */
3160  int set_head_appearance(const char* head_appearance);
3161 
3162  /*l
3163  *b Description:
3164  **
3165  ** This function sets the current head appearance of this character.
3166  ** On failure head appearance will be set to "default". see set_head_appearance()
3167  ** for more details
3168  **
3169  *b Available as Decision Bead/Event
3170  */
3171  int set_current_head_appearance(const char* head_appearance);
3172 
3174  const char* get_current_head_appearance();
3175 
3176  /*l
3177  *b Description:
3178  **
3179  ** Similar to get_current_appearance_is(), but for head appearance.
3180  **
3181  *b Returns:
3182  **
3183  ** 1 if current head appearance has passed name; 0 if not
3184  **
3185  *b Available as Decision Bead/Event
3186  */
3187  int get_current_head_appearance_is(const char* head_appearance);
3188 
3189 
3190  /*b Description:
3191  **
3192  ** This function sets the both base and current hand item appearance
3193  ** of this character. The base hand item is the one it will have upon
3194  ** reset.
3195  **
3196  *b Arguments:
3197  **
3198  *a hand_item_appearance -- name of the desired hand item or "default"
3199  **
3200  *b Returns:
3201  **
3202  ** 0 on success, -1 on failure
3203  **
3204  *b Available as Decision Bead/Event
3205  */
3206  int set_hand_item(const char* hand_item_appearance);
3207 
3208  /*l
3209  *b Returns:
3210  **
3211  ** Hand item appearance; see set_hand_item()
3212  **
3213  ** Might return "default"
3214  */
3215  const char* get_hand_item();
3216 
3217  /*b Description:
3218  **
3219  ** This function sets the current hand item appearance of this character.
3220  ** The base hand item will remain unaffected.
3221  **
3222  *b Arguments:
3223  **
3224  *a hand_item_appearance -- name of the desired hand item or "default"
3225  **
3226  *b Returns:
3227  **
3228  ** 0 on success, -1 on failure
3229  **
3230  *b Available as Decision Bead/Event
3231  */
3232  int set_current_hand_item(const char* hand_item_appearance);
3233 
3234  /*l
3235  *b Returns:
3236  **
3237  ** Current hand item appearance. Will be the actual appearance
3238  ** displayed, not "default"
3239  */
3240  const char* get_current_hand_item();
3241 
3242 
3243  /*l
3244  *b Description:
3245  **
3246  ** Turns on texture modulation system that tries to make all characters look
3247  ** unique. Only supported by some appearances. See diguyGraphicsShape Texture Variation API
3248  ** for fine grained control of this feature
3249  */
3250  int set_use_texture_variations(int value);
3251 
3252  /*l
3253  *b Returns:
3254  ** If texture variations have been enabled for this character. Note: only some
3255  ** appearances support this feature
3256  */
3257  int get_use_texture_variations();
3258 
3260  int get_supports_texture_variations();
3261 
3264  int get_supports_weight_variations();
3265 
3269  void set_weight_scale(float weight);
3270 
3272  float get_weight_scale();
3273 
3274  /*l
3275  *b Arguments:
3276  **
3277  *a appearance_type - a value indicating the type of supplementary appearance of concern,
3278  ** ie DIGUY_APPEARANCE_BODY, DIGUY_APPEARANCE_HEAD, DIGUY_APPEARANCE_EXPRESSIVE_HEAD,
3279  ** DIGUY_APPEARANCE_HAND_ITEM
3280  *b Returns:
3281  **
3282  ** The number of available supplementary appearances of given type
3283  */
3284  int get_num_appearances_of_type(diguyCharacterAppearanceTypes appearance_type);
3285 
3286  /*l
3287  *b Returns:
3288  **
3289  ** The name of the supplementary appearance (body, head, expressive head, hand item) or NULL
3290  **
3291  *b Arguments:
3292  **
3293  *a appearance_type - a value indicating the type of appearance of concern
3294  *a index - a value indicating the type of supplementary appearance of concern
3295  **
3296  */
3297  const char* get_appearance_name_at_index(diguyCharacterAppearanceTypes appearance_type, int index);
3298 
3299  /*****************************************************************************/
3322  /*l
3323  *b Description:
3324  **
3325  ** Sets the graphics level of detail (LOD) ranges for this character.
3326  ** Compare with diguyScenario::set_default_lod_ranges(), which sets
3327  ** the LOD ranges for newly created characters of a particular type.
3328  ** In both cases, ranges must be a static array of 8 floats,
3329  ** each larger than the one before.
3330  **
3331  ** This function sets graphics LOD ranges only. Motion levels of
3332  ** detail can be set by calling set_motion_lod().
3333  **
3334  *b Arguments:
3335  **
3336  *a lod_ranges - new lod ranges for this character;
3337  **
3338  ** See diguyScenario::set_default_lod_ranges() for a description
3339  ** of what to pass in lod_ranges.
3340  **
3341  *b Returns:
3342  **
3343  ** 0 on success, -1 on failure
3344  **
3345  *b Callable From:
3346  **
3347  *- - C++
3348  */
3349  int set_lod_ranges(float* lod_ranges);
3350 
3351 #ifdef CPLUSPLUS_ONLY
3352  float* get_lod_ranges();
3354 
3355 #endif
3356 
3358  int get_num_lods();
3359 
3360  /*l
3361  *b Description:
3362  **
3363  ** Set the desired graphics level of detail (LOD) for this character.
3364  ** This may be overridden if this character uses automatic LOD
3365  ** switching. See diguyScenario::set_automatic_graphics_lod_switching().
3366  **
3367  ** DI-Guy graphics LODs are numbered 1 (most detail) through 7 (least detail).
3368  **
3369  *b Arguments:
3370  **
3371  *a lod - an integer between 1 and 7
3372  **
3373  *b Returns:
3374  **
3375  ** 0 on success, -1 on failure
3376  */
3377  int set_graphics_lod(int lod);
3378 
3380  int get_graphics_lod();
3381 
3382 
3385  int set_allow_instancing(int value);
3386 
3388  int get_allow_instancing() const;
3389 
3392  int get_is_instanced() const;
3393 
3394  // informs the internals that this character wasn't instanced, can cause an update if set_is_culled(0) is called
3395  void set_is_instanced(int val);
3396 
3398  int can_lod_be_instanced(int lod);
3399 
3400  /*l
3401  *b Description:
3402  **
3403  ** For scene graph renderers it can be necessary to patch the texture buffer object after
3404  ** the scene graph finishes updating various post processes (ground clamping for instance),
3405  ** or modifying the TBO with a local space camera.
3406  **
3407  ** This function allows the end user to pre-multiply the matrix in the TBO for each shape
3408  ** the character has. It requires diguyScenario::set_use_user_position_matrices() is called
3409  ** so that DI-Guy knows to keep track of TBO shape index data.
3410  */
3411  int set_final_tbo_position_matrix(int include_local_to_global_transform,
3412  float a0, float a1, float a2, float a3,
3413  float b0, float b1, float b2, float b3,
3414  float c0, float c1, float c2, float c3);
3415 
3416  /*l
3417  *b Description:
3418  **
3419  ** Set the desired shader level of detail (LOD) for this character.
3420  ** By default this is -1 and the shader is automatically picked by distance.
3421  **
3422  ** DI-Guy shaders LODs are numbered 1 (most quality) through the number of shaders in the
3423  ** current technique.
3424  **
3425  *b Arguments:
3426  **
3427  *a lod - an integer between 1 and the number of shaders in the current technique
3428  **
3429  *b Returns:
3430  **
3431  ** 0 on success, -1 on failure
3432  */
3433  int set_shader_lod(int lod);
3434 
3436  int get_shader_lod();
3437 
3440  int get_has_bump_maps();
3441 
3442  /*l
3443  *b Description:
3444  **
3445  *b Note: As of DI-Guy 12.5 we strongly recommend using the
3446  ** multi-threaded pipeline for increasing performance.
3447  **
3448  ** Sets the motion level of detail (LOD) for this character.
3449  ** LOD 1 animates all joints of a character. Higher LODs
3450  ** animate fewer joints.
3451  **
3452  ** For LOD 6, *nothing* in the pose is updated. The character's
3453  ** pose will remain whatever it was the last time pose data
3454  ** was changed.
3455  **
3456  *a LOD - Effect
3457  *a 1 - animate all joints
3458  *a 2 - stop animating wrists and ankles
3459  *a 3 - stop animating elbows and knees
3460  *a 4 - stop animating everything but pelvis and position
3461  *a 5 - stop animating everything but position
3462  *a 6 - stop animating everything but position
3463  **
3464  ** Note that characters that are load managed
3465  ** (get_is_load_managed() returns 1) have this parameter managed
3466  ** automatically. The corresponding function for load managed
3467  ** characters is diguyLoadManager::set_zone_motion_lod().
3468  **
3469  *b Arguments:
3470  **
3471  *a motion_lod - an integer between 1 and 6
3472  **
3473  *b Returns:
3474  **
3475  ** 0 on success, -1 on failure
3476  */
3477  int set_motion_lod(int motion_lod);
3478 
3480  int get_motion_lod();
3481 
3483  int get_current_motion_lod();
3484 
3485  /*l
3486  *b Description:
3487  **
3488  *b Note: As of DI-Guy 12.5 we strongly recommend using the
3489  ** multi-threaded pipeline for increasing performance.
3490  **
3491  ** This function sets the minimum CPL (character performance
3492  ** level) of the character.
3493  **
3494  ** A higher CPL will limit the types of operations that the character
3495  ** can perform, but will allow for more optimized update() calls.
3496  **
3497  ** The following CPL limitations are cumulative:
3498  **
3499  *- - CPL 1: all character function calls are available
3500  *- - CPL 2: the character cannot save history
3501  *- - CPL 3: no advanced pose operations that alter the basic pose
3502  *- of the character, including:
3503  *>
3504  *- - gazing
3505  *- - pointing
3506  *- - aiming
3507  *- - gestures
3508  *- - head nodding and shaking
3509  *- - pose overrides
3510  *- - features relying on link matrices
3511  *- - wheel rolling and turning on vehicles
3512  **
3513  ** Since link matrices are not computed, the DI-Guy Graphics API
3514  ** function diguyGraphicsLink::get_transformation_matrix() will
3515  ** not return valid results.
3516  *<
3517  *- - CPL 4: no blends between motions
3518  *- - CPL 5: (not currently implemented)
3519  **
3520  ** Note that characters that are load managed (get_is_load_managed()
3521  ** returns 1) have this parameter managed automatically. The
3522  ** corresponding function for load managed characters is
3523  ** diguyLoadManager::set_zone_minimum_cpl().
3524  **
3525  ** The passed minimum_cpl may not be achievable if the character
3526  ** is already in the process of doing something not allowed by the
3527  ** new CPL. For example, if the character is already gazing, trying
3528  ** to set the minimum CPL to 3 will fail, as CPL 3 would disable
3529  ** gazing. In this case the minimum CPL will be set to the current
3530  ** highest possible CPL based on what the character is already doing.
3531  ** In this example the minimum CPL would be set to 2, as gazing is
3532  ** allowed at that CPL.
3533  **
3534  ** Conversely, if the minimum CPL has been successfully been set to
3535  ** 3 or higher, any gaze calls such as diguyCharacter::gaze_at_point()
3536  ** will fail.
3537  **
3538  *b Arguments:
3539  **
3540  *a cpl - minimum CPL allowed for this character
3541  **
3542  *b Returns:
3543  **
3544  ** 0 on success, -1 on failure
3545  */
3546  int set_minimum_cpl(int minimum_cpl);
3547 
3549  int get_minimum_cpl();
3550 
3551  /*l
3552  *b Description:
3553  **
3554  ** This function returns that maximum possible CPL the character
3555  ** can attain based on what it is currently doing. Advanced pose
3556  ** operations like gazing and pose overrides will limit the maximum
3557  ** CPL that can be achieved.
3558  **
3559  ** See diguyCharacter::set_minimum_cpl() for a description of
3560  ** what is possible under the different CPL levels.
3561  **
3562  *b Returns:
3563  **
3564  ** maximum possible current CPL
3565  */
3566  int get_maximum_possible_current_cpl();
3567 
3568  /*l
3569  *b Description:
3570  **
3571  ** This function puts the character into the maximum possible CPL
3572  ** that can be achieved based on what the character is currently
3573  ** doing.
3574  **
3575  ** This current CPL does not prevent the character from starting
3576  ** operations that will potentially lower the CPL. e.g., if the
3577  ** character starts gazing, the CPL will potentially go down.
3578  ** Use set_minimum_cpl() to prevent that character from starting
3579  ** such operations.
3580  **
3581  ** See diguyCharacter::set_minimum_cpl() for a description of
3582  ** what is possible under the different CPL levels.
3583  **
3584  *b Returns:
3585  **
3586  ** 0 on success, -1 on failure
3587  */
3588  int maximize_current_cpl();
3589 
3590  /*l
3591  *b Description:
3592  **
3593  ** This function sets a flag that determines whether the character
3594  ** should raise and lower its CPL automatically. If automatic
3595  ** CPL switching is enabled then any time a potential CPL-changing
3596  ** operation is performed, the character will check the maximum
3597  ** possible current CPL (as per a call to maximize_current_cpl())
3598  ** and set its current CPL to the maximum possible.
3599  **
3600  *b Arguments:
3601  **
3602  *a enabled - pass 1 to enable automatic CPL switching, 0 to
3603  *a disable it
3604  **
3605  *b Returns:
3606  **
3607  ** 0 on success, -1 on failure
3608  */
3609  int set_automatic_cpl_switching_enabled(int enabled);
3610 
3612  int get_automatic_cpl_switching_enabled();
3613 
3614  /*l
3615  *b Description:
3616  **
3617  ** This function sets the current CPL of the character. Trying
3618  ** to set the CPL lower than the minimum (as set by
3619  ** set_minimum_cpl()) of higher than the maximum (as returned by
3620  ** get_maximum_possible_current_cpl()) will fail.
3621  **
3622  ** Note that characters that have automatic CPL switching enabled
3623  ** (get_automatic_cpl_switching_enabled() returns 1) will override
3624  ** this value.
3625  **
3626  ** See diguyCharacter::set_minimum_cpl() for a description of
3627  ** what is possible under the different CPL levels.
3628  **
3629  *b Arguments:
3630  **
3631  *a cpl - new current CPL
3632  **
3633  *b Returns:
3634  **
3635  ** 0 on success, -1 on failure
3636  */
3637  int set_current_cpl(int current_cpl);
3638 
3640  int get_current_cpl();
3641 
3642  /*l
3643  *b Description:
3644  **
3645  ** This function sets the position update rate of the character. If
3646  ** the character's position is not updated on a particular update
3647  ** tick, its position will not change for that tick. This can
3648  ** result is a modest performance increase.
3649  **
3650  ** The default value for new characters is 100.
3651  **
3652  ** This value may be overridden by the minimum full update period, as
3653  ** set by set_minimum_full_update_period().
3654  **
3655  ** Note that if the character's pose is updated, (see
3656  ** diguyCharacter::set_pose_update_rate()) its position will be
3657  ** updated as well.
3658  **
3659  ** Note that characters that are load managed
3660  ** (get_is_load_managed() returns 1) have this parameter managed
3661  ** automatically. The corresponding function for load managed
3662  ** characters is diguyLoadManager::set_zone_position_update_rate().
3663  **
3664  *b Arguments:
3665  **
3666  *a update_rate - percentage of scenario ticks for which
3667  *a position should update; can be between
3668  *a 1 and 100
3669  **
3670  ** Passing 100 means position will update every tick.
3671  ** Passing 50 means position will update every other tick.
3672  **
3673  *b Returns:
3674  **
3675  ** 0 on success, -1 on failure
3676  */
3677  int set_position_update_rate(int update_rate);
3678 
3680  int get_position_update_rate();
3681 
3682  /*l
3683  *b Description:
3684  **
3685  ** This function is very similar to set_position_update_rate(), but
3686  ** sets the percentage of ticks for which the character's pose is
3687  ** updated.
3688  **
3689  ** The default value for new characters is 100.
3690  **
3691  ** This value may be overridden by the minimum full update period,
3692  ** as set by set_minimum_full_update_period().
3693  **
3694  ** Note that if the character's pose is updated, its position will
3695  ** be updated as well.
3696  **
3697  ** Note that characters that are load managed (get_is_load_managed()
3698  ** returns 1) have this parameter managed automatically. The
3699  ** corresponding function for load managed characters is
3700  ** diguyLoadManager::set_zone_pose_update_rate().
3701  **
3702  *b Arguments:
3703  **
3704  *a update_rate - percentage of scenario ticks for which
3705  *a pose should update; can be between
3706  *a 1 and 100
3707  **
3708  ** Passing 100 means pose will update every tick.
3709  ** Passing 50 means pose will update every other tick.
3710  **
3711  *b Returns:
3712  **
3713  ** 0 on success, -1 on failure
3714  */
3715  int set_pose_update_rate(int update_rate);
3716 
3718  int get_pose_update_rate();
3719 
3720  /*l
3721  *b Description:
3722  **
3723  ** This function sets the minimum period for position or pose
3724  ** updates. If the passed amount of time passes with no position or
3725  ** pose update (see set_position_update_rate() and
3726  ** set_pose_update_rate()), the character's position and potentially
3727  ** pose will be updated.
3728  **
3729  ** Note that characters that are load managed (get_is_load_managed()
3730  ** returns 1) have this parameter managed automatically. The
3731  ** corresponding function for load managed characters is
3732  ** diguyLoadManager::set_minimum_full_update_period().
3733  **
3734  ** The default for new characters is 1.0 seconds.
3735  **
3736  *b Arguments:
3737  **
3738  *a min_period - in seconds
3739  **
3740  *b Returns:
3741  **
3742  ** 0 on success, -1 on failure
3743  */
3744  int set_minimum_full_update_period(float min_period);
3745 
3747  float get_minimum_full_update_period();
3748 
3749  /*l
3750  *b Description:
3751  **
3752  ** This function disables position accumulation due to played
3753  ** actions. The character will stay in whatever position has most
3754  ** recently been set by set_position(), regardless of action.
3755  ** Because of this the character will, for example, walk in place.
3756  ** It is up to the user application to correctly set and update the
3757  ** character's position.
3758  **
3759  ** This function can be used when a host application provides
3760  ** absolute control over character positions.
3761  **
3762  ** Disabling position accumulation will result in a modest
3763  ** performance increase.
3764  **
3765  *b Arguments:
3766  **
3767  *a disabled_flag - pass 1 to disable position accumulation, 0
3768  *a to enable it
3769  **
3770  *b Returns:
3771  **
3772  ** 0 on success, -1 on failure
3773  */
3774  int set_position_accumulation_disabled(int disabled_flag);
3775 
3777  int get_position_accumulation_disabled();
3778 
3779  /*l
3780  *b Description:
3781  **
3782  ** This function disables all blends between motions of the
3783  ** character. This will speed up performance at the expense of
3784  ** visual quality of the motions. If the character is far from the
3785  ** current camera position, however, the lack of blends may be
3786  ** visually acceptable.
3787  **
3788  ** Note that characters that are load managed (get_is_load_managed()
3789  ** returns 1) have this parameter managed automatically.
3790  **
3791  *b Arguments:
3792  **
3793  *a disabled_flag - pass 1 to disable all blends, 0
3794  *a to enable them
3795  **
3796  *b Returns:
3797  **
3798  ** 0 on success, -1 on failure
3799  */
3800  int set_all_blends_disabled(int disabled_flag);
3801 
3803  int get_all_blends_disabled();
3804 
3805  /*l
3806  *b Description:
3807  **
3808  *b Note: This function is not recommended. There is minimal perf gain.
3809  ** This function disables all update calls for shape switches.
3810  **
3811  ** Switches currently control:
3812  **
3813  *- - muzzle flashes
3814  *- - hand switching for selected characters
3815  **
3816  ** For DI-Guy Graphics API users this means that most calls to
3817  ** diguyGraphicsShape::show() and diguyGraphicsShape::hide() will not
3818  ** be made.
3819  **
3820  ** Note that characters that are load managed (get_is_load_managed()
3821  ** returns 1) have this parameter managed automatically.
3822  **
3823  *b Arguments:
3824  **
3825  *a disabled_flag - pass 1 to disable shape switches, 0
3826  *a to enable them
3827  **
3828  *b Returns:
3829  **
3830  ** 0 on success, -1 on failure
3831  */
3832  int set_shape_switches_disabled(int disabled_flag);
3833 
3835  int get_shape_switches_disabled();
3836 
3837  /*l
3838  *b Description:
3839  **
3840  *b Note: This function is not recommended. There is minimal perf gain.
3841  ** This function disables all shape callbacks. Shape callbacks are
3842  ** used internally for updating some advanced visual effects.
3843  **
3844  ** Shape callbacks currently control:
3845  **
3846  *- - expressive faces
3847  *- - particle systems
3848  **
3849  ** Disabling shape callbacks will make these visual effects work
3850  ** incorrectly but will result in a performance increase for
3851  ** characters that do not use them.
3852  **
3853  ** Note that characters that are load managed (get_is_load_managed()
3854  ** returns 1) have this parameter managed automatically.
3855  **
3856  *b Arguments:
3857  **
3858  *a disabled_flag - pass 1 to disable shape callbacks, 0
3859  *a to enable them
3860  **
3861  *b Returns:
3862  **
3863  ** 0 on success, -1 on failure
3864  */
3865  int set_shape_callbacks_disabled(int disabled_flag);
3866 
3868  int get_shape_callbacks_disabled();
3869 
3870  /*l
3871  *b Description:
3872  **
3873  *b Note: This function is not recommend. There is minimal perf gain.
3874  ** This function disables all calls to the virtual diguyGraphicsShape::update()
3875  ** function.
3876  **
3877  ** Note that characters that are load managed (get_is_load_managed()
3878  ** returns 1) have this parameter managed automatically.
3879  **
3880  *b Arguments:
3881  **
3882  *a disabled_flag - pass 1 to disable update calls, 0
3883  *a to enable them
3884  **
3885  *b Returns:
3886  **
3887  ** 0 on success, -1 on failure
3888  */
3889  int set_graphics_api_shape_update_disabled(int disabled_flag);
3890 
3892  int get_graphics_api_shape_update_disabled();
3893 
3894  /*l
3895  *b Description:
3896  **
3897  ** This function is a stripped-down version of the normal update()
3898  ** function. This function is for high performance applications that
3899  ** are willing to sacrifice advanced character functionality in
3900  ** exchange for faster performance.
3901  **
3902  ** Characters using optimized_update() must not do any of the
3903  ** following:
3904  **
3905  *- - change character types (e.g., set_character_type())
3906  *- - play sounds (e.g., play_sound())
3907  *- - use history (e.g., set_history_type())
3908  *- - use paths (e.g., push_path())
3909  *- - weapon firing (e.g., fire_weapon())
3910  *- - advanced pose operations (as per CPL 3)
3911  *- - be a DI-Guy Network Module character
3912  *- - need to use character callbacks
3913  *- - use advanced visual effects, such as expressive faces and particle systems
3914  **
3915  ** Like update(), the scenario must not call the character's update()
3916  ** function (return value of get_t_controlled_by_scenario_t() is 0)
3917  ** for this function to work properly.
3918  **
3919  ** In some cases the regular update() call can be used for a time in
3920  ** place of optimized_update() if one of the above operations is
3921  ** desired.
3922  **
3923  *b Arguments:
3924  **
3925  *a t - new time for the character
3926  **
3927  *b Returns:
3928  **
3929  ** 0 on success, -1 on failure
3930  */
3931  int optimized_update(float t);
3932 
3933  /*l
3934  *b Description:
3935  **
3936  ** This function sets whether many of the performance tuning
3937  ** functions above are automatically managed by a diguyLoadManager
3938  ** object, which can be obtained by calling
3939  ** diguyApp::create_load_manager().
3940  **
3941  ** Note that this function will have no effect if a load manager has
3942  ** not been enabled.
3943  **
3944  ** The default for new characters is to be load managed if the load
3945  ** manager has been enabled.
3946  **
3947  *b Arguments:
3948  **
3949  *a is_load_managed - pass 1 to have character automatically
3950  *a load managed, 0 for manual management
3951  **
3952  *b Returns:
3953  **
3954  ** 0 on success, -1 on failure
3955  */
3956  int set_is_load_managed(int is_load_managed);
3957 
3959  int get_is_load_managed();
3960 
3961 
3962 /*****************************************************************************/
3968  /*l
3969  *b Description:
3970  **
3971  ** This is an enumeration of the different callbacks that can be
3972  ** registered with add_callback() and add_callback_script().
3973  **
3974  ** Callbacks return a value of type diguyCallbackReturn, which will
3975  ** be DIGUY_CALLBACK_STOP or DIGUY_CALLBACK_CONTINUE. If the
3976  ** callback returns DIGUY_CALLBACK_STOP, in some cases the default
3977  ** handler of the function will not be called; the callback is
3978  ** asserting that it has done everything necessary for the function
3979  ** call. If the callback returns DIGUY_CALLBACK_CONTINUE, the default
3980  ** handler for the function will be called after the callback.
3981  **
3982  *b Usable From:
3983  **
3984  *- - C++
3985  *- - Script
3986  **
3987  *************************************************************************
3988  *4 Callback Enums:
3989  **
3990  *i CALLBACK_ID_CREATE
3991  **
3992  ** This callback will be called when a new character is created,
3993  ** *after* the character is fully initialized.
3994  **
3995  ** Note that this callback can only be added by calling
3996  ** diguyScenario::add_default_character_callback(); adding it with
3997  ** diguyCharacter::add_callback() will have no effect, as by that
3998  ** time the character has already been created.
3999  **
4000  *i CALLBACK_ID_DESTROY
4001  **
4002  ** This callback will be called when a character is
4003  ** destroyed.
4004  **
4005  *i CALLBACK_ID_PRE_CREATE
4006  **
4007  ** Like CALLBACK_ID_CREATE, this callback will be called when a
4008  ** new character is created; however, it is called *before* the
4009  ** character is fully initialized.
4010  **
4011  *b NOTE: Care must be taken when using this callback!
4012  ** As mentioned above, the character is not fully initialized,
4013  ** meaning that most member functions of the diguyCharacter object
4014  ** should not be called. Those member functions that are safe
4015  ** to call will be mentioned in the documentation for the function;
4016  ** e.g., set_graphics_api_node_ptr().
4017  **
4018  ** Note that this callback can only be added by calling
4019  ** diguyScenario::add_default_character_callback(); adding it
4020  ** with diguyCharacter::add_callback() will have no effect, as
4021  ** by that time the character has already been created.
4022  **
4023  *i CALLBACK_ID_CURRENT_APPEARANCE_CHANGED
4024  **
4025  ** This callback will be called when a character's current
4026  ** appearance is changed.
4027  **
4028  *i CALLBACK_ID_CURRENT_HEAD_APPEARANCE_CHANGED
4029  **
4030  ** This callback will be called when a character's current head
4031  ** appearance is changed.
4032  **
4033  *i CALLBACK_ID_PRE_UPDATE
4034  **
4035  ** This callback will be called before the character is updated as
4036  ** a result of the diguyScenario::update() function.
4037  **
4038  *i CALLBACK_ID_POST_UPDATE
4039  **
4040  ** This callback will be called after the character is updated as a
4041  ** result of the diguyScenario::update() function.
4042  **
4043  *i CALLBACK_ID_DONE_SPEAKING
4044  **
4045  ** This callback will be called when the character has finished
4046  ** speaking the contents of a speak() function call.
4047  **
4048  *i CALLBACK_ID_GAZE_STATUS
4049  **
4050  ** This callback will be called after the character's gaze has
4051  ** experienced a status change.
4052  **
4053  *i CALLBACK_ID_LPOINT_STATUS
4054  **
4055  ** This callback will be called after the character's lpoint (left
4056  ** arm pointing) has experienced a status change.
4057  **
4058  *i CALLBACK_ID_SHOW
4059  **
4060  ** This callback will be called when the character is being shown
4061  ** for any reason.
4062  **
4063  *i CALLBACK_ID_HIDE
4064  **
4065  ** This callback will be called when the character is being hidden
4066  ** for any reason.
4067  **
4068  *i CALLBACK_ID_PRE_DIE
4069  **
4070  ** This callback will be called when the character has been told to
4071  ** die, before a die action has been selected and initiated.
4072  **
4073  ** If the returned diguyCallbackReturn value is
4074  ** DIGUY_CALLBACK_STOP, the character will not die.
4075  **
4076  *i CALLBACK_ID_POST_DIE
4077  **
4078  ** This callback will be called when the character has been told to
4079  ** die, after a die action has been selected and initiated.
4080  **
4081  *i CALLBACK_ID_PRE_FIRE_WEAPON
4082  **
4083  ** This callback will be called when the character has been told to
4084  ** fire its weapon, before a final decision has been made to fire.
4085  **
4086  ** If the returned diguyCallbackReturn value is
4087  ** DIGUY_CALLBACK_STOP, the character will not fire.
4088  **
4089  *i CALLBACK_ID_IMPACT
4090  **
4091  ** This callback will be called when the character has been hit.
4092  ** diguyCharacter::get_last_impact_record() contains a pointer to
4093  ** the impact information. If a character has this callback the
4094  ** standard behavior (killing the character) is skipped and the
4095  ** system assumes the end user has handled the impact.
4096  **
4097  ** Similar behavior results if
4098  ** diguyCrowd::CALLBACK_ID_CROWD_MEMBER_IMPACT is registered.
4099  **
4100  *i CALLBACK_ID_POST_FIRE_WEAPON
4101  **
4102  ** This callback will be called when the character has been told to
4103  ** fire its weapon, after a final decision has been made to fire.
4104  **
4105  *i CALLBACK_ID_CURRENT_ARC_CHANGED
4106  **
4107  ** This callback will be called whenever the character's current
4108  ** motion arc changes, typically after a call to set_desired_action()
4109  ** or force_action(), or when transitioning to the next motion arc.
4110  **
4111  *i CALLBACK_ID_CURRENT_ACTION_CHANGED
4112  **
4113  ** This callback will be called whenever the character's current
4114  ** action changes, typically after a call to set_desired_action()
4115  ** or force_action().
4116  **
4117  *i CALLBACK_ID_DESIRED_ACTION_CHANGED
4118  **
4119  ** This callback will be called whenever the character's desired
4120  ** action changes, typically after a call to set_desired_action().
4121  **
4122  *i CALLBACK_ID_DESIRED_ACTION_REACHED
4123  **
4124  ** This callback will be called when the character reaches its
4125  ** desired action as set by a call to set_desired_action().
4126  **
4127  *i CALLBACK_ID_MANUALLY_INVOKED
4128  **
4129  ** This callback id will be supplied to event handlers invoked by a
4130  ** call to manually_invoke_event_handler().
4131  **
4132  *i CALLBACK_ID_USER_SELECTED
4133  **
4134  ** This callback will be called when the character is selected in DI-Guy Scenario.
4135  **
4136  *i CALLBACK_ID_USER_UNSELECTED
4137  **
4138  ** This callback will be called on a currently selected character when a different
4139  ** character is selected in DI-Guy Scenario.
4140  **
4141  *i CALLBACK_ID_IGUY_INTERACT
4142  **
4143  ** This callback will be called when the character has been clicked
4144  ** on while DI-Guy Scenario is in I-Guy Input Mode. Note that this
4145  ** is called on the character clicked, not the I-Guy character.
4146  **
4147  *i CALLBACK_ID_IGUY_INTERACT_WITH_SUBJECT
4148  **
4149  ** This callback will be called when the character, as the I-Guy
4150  ** character, has clicked another character in I-Guy Input Mode.
4151  ** Note that this is called for the I-Guy character, not the
4152  ** clicked character.
4153  **
4154  *i CALLBACK_ID_GUIDE_POSITION_ACQUIRED
4155  **
4156  ** This callback will be called when the character has reached its
4157  ** desired position as set by set_desired_position(). The
4158  ** diguyCharacterGuide is responsible for moving the character towards
4159  ** this position.
4160  **
4161  *i CALLBACK_ID_GUIDE_POSITION_UNACQUIRED
4162  **
4163  ** This callback will be called if the character moves too far away
4164  ** from its desired position after it has been previously reached.
4165  **
4166  *i CALLBACK_ID_GUIDE_ORIENTATION_ACQUIRED
4167  **
4168  ** This callback will be called when the character has reached its
4169  ** desired orientation as set by set_desired_orientation(). The
4170  ** diguyCharacterGuide is responsible for moving the character towards
4171  ** this orientation.
4172  **
4173  *i CALLBACK_ID_GUIDE_ORIENTATION_UNACQUIRED
4174  **
4175  ** This callback will be called if the character turns too far away
4176  ** from its desired orientation after it has been previously
4177  ** reached.
4178  **
4179  *i CALLBACK_ID_GUIDE_ALTITUDE_ACQUIRED
4180  **
4181  ** This callback will be called when the character has reached its
4182  ** desired altitude as set by set_desired_orientation() or other functions.
4183  ** The callback is most meaningful for vehicles that need to achieve
4184  ** some sort "cruising altitude" while moving to a destination.
4185  **
4186  *i CALLBACK_ID_GUIDE_ALTITUDE_UNACQUIRED
4187  **
4188  ** This callback will be called if the character turns too far away
4189  ** from its desired orientation after it has been previously
4190  ** reached.
4191  **
4192  *i CALLBACK_ID_GUIDE_TARGET_LOST
4193  **
4194  ** This callback will be called when the character guide has determined
4195  ** that the character can't reach its desired position/orientation. An
4196  ** example would be a missile that has flown past its target
4197  **
4198  *i CALLBACK_ID_CURRENT_TOUT_REACHED
4199  **
4200  ** This callback will be called when scenario time reaches this
4201  ** character's tout time as set by set_current_tout().
4202  **
4203  *i CALLBACK_ID_POST_CREATE_GEOMETRY
4204  **
4205  ** This callback will be called just after the character's geometry
4206  ** has been created.
4207  **
4208  *i CALLBACK_ID_PRE_DESTROY_GEOMETRY
4209  **
4210  ** This callback will be called just before the character's
4211  ** geometry is broken down and destroyed.
4212  **
4213  *i CALLBACK_ID_END_OF_PATH_REACHED
4214  **
4215  ** This callback will be called when a character reaches the end of
4216  ** their current path. Note the path must finish, forcing to other
4217  ** paths will not trigger this callback.
4218  **
4219  **
4220  *************************************************************************
4221  *4 DI-Guy Scenario UI Callback enums:
4222  **
4223  *i CALLBACK_ID_UI_PRE_TRANSLATION
4224  **
4225  ** This callback will be called when the user interface starts
4226  ** moving a character.
4227  **
4228  *i CALLBACK_ID_UI_POST_TRANSLATION
4229  **
4230  ** This callback will be called when the user interface finishes
4231  ** moving a character.
4232  **
4233  *i CALLBACK_ID_UI_MOUSE_DOWN
4234  **
4235  ** This callback will be called when the user interface gets a
4236  ** mouse click in the DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT input
4237  ** mode.
4238  **
4239  *i CALLBACK_ID_UI_MOUSE_UP
4240  **
4241  ** This callback will be called when the user interface gets a
4242  ** mouse release in the DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT
4243  ** input mode.
4244  **
4245  *************************************************************************
4246  *4 DI-Guy AI Agent Callback enums:
4247  **
4248  *i CALLBACK_ID_AGENT_NEW_BEHAVIOR
4249  **
4250  ** This callback will be called when an agent changes its current
4251  ** behavior.
4252  **
4253  *i CALLBACK_ID_AGENT_NEW_FOCUS_CHARACTER
4254  **
4255  ** This callback will be called when an agent changes its current
4256  ** focus character; this happens most frequently when it is focused
4257  ** on a group.
4258  **
4259  *i CALLBACK_ID_AGENT_ATTACK_OUT_OF_TARGETS
4260  **
4261  ** This callback will be called when an agent in attack behavior
4262  ** evaluates the group it's focused on and cannot find an
4263  ** appropriate target. This can happen if all group members are
4264  ** dead.
4265  **
4266  *i CALLBACK_ID_AGENT_ATTACK_NO_VISIBLE_TARGETS
4267  **
4268  ** This callback will be called when an agent in attack behavior
4269  ** can't see any potential members of the group it's focused on.
4270  **
4271  *i CALLBACK_ID_AGENT_PURSUE_TARGET_REACHED
4272  **
4273  ** This callback will be called when an agent in pursue behavior
4274  ** has come within the pursuit distance of its pursuit target.
4275  **
4276  *i CALLBACK_ID_AGENT_PURSUE_TARGET_LOST
4277  **
4278  ** This callback will be called when an agent in pursue behavior
4279  ** is no longer within the pursuit distance of its pursuit target.
4280  **
4281  *i CALLBACK_ID_AGENT_MINGLE_TARGET_REACHED
4282  **
4283  ** This callback will be called when an agent in mingle behavior
4284  ** has reached its mingle target.
4285  **
4286  *i CALLBACK_ID_AGENT_MINGLE_TARGET_LOST
4287  **
4288  ** This callback will be called when an agent in mingle behavior
4289  ** is no longer is range of its mingle target.
4290  **
4291  *i CALLBACK_ID_AGENT_WANDER_TARGET_REACHED
4292  **
4293  ** This callback will be called when an agent in wander behavior
4294  ** has reached its wander target.
4295  **
4296  *i CALLBACK_ID_AGENT_WANDER_TARGET_LOST
4297  **
4298  ** This callback will be called when an agent in wander behavior
4299  ** is no longer is range of its wander target.
4300  **
4301  *i CALLBACK_ID_AGENT_FLEE_AREA_LEFT
4302  **
4303  ** This callback will be called when an agent in flee behavior has
4304  ** successfully moved out range of all fled characters or
4305  ** locations. This will only be called when the agent is
4306  ** transitioning from inside the flee area to outside of it.
4307  **
4308  *i CALLBACK_ID_AGENT_FLEE_AREA_ENTERED
4309  **
4310  ** This callback will be called when an agent in flee behavior has
4311  ** moved inside of the range of any fled characters or locations.
4312  ** This will only be called when the agent is transitioning from
4313  ** outside the flee area to inside of it.
4314  **
4315  *i CALLBACK_ID_AGENT_TRAVEL_WAYPOINT_REACHED
4316  **
4317  ** This callback will be called when an agent in travel behavior
4318  ** has reached in intermediate waypoint and is about to move
4319  ** on to the next.
4320  **
4321  *i CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED
4322  **
4323  ** This callback will be called when an agent in travel behavior
4324  ** has reached the end of its travel path when moving forward
4325  ** along the path.
4326  **
4327  *i CALLBACK_ID_AGENT_TRAVEL_BACKWARD_DEST_REACHED
4328  **
4329  ** This callback will be called when an agent in travel behavior
4330  ** has reached the beginning of its travel path when moving
4331  ** backward along the path.
4332  **
4333  *i CALLBACK_ID_AGENT_TRAVEL_NEAR_FORWARD_DEST
4334  **
4335  ** This callback will be called when an agent gets within a specified
4336  ** distance of the end of the travel path
4337  **
4338  *i CALLBACK_ID_AGENT_CROWD_MEMBER_KILLED
4339  **
4340  ** This callback will be called when fellow member of the crowd is
4341  ** killed.
4342  **
4343  *- - This is the character version of
4344  *- diguyCrowd::CALLBACK_ID_CROWD_MEMBER_KILLED
4345  *- - The crowd's callback character is the crowd member that was
4346  *- killed.
4347  *- - The crowd's callback impact contains the impact information.
4348  **
4349  *i CALLBACK_ID_AGENT_CROWD_MEMBER_IMPACT
4350  **
4351  ** This callback will be called when a fellow member of the crowd
4352  ** is hit by a detonation. This callback does not replace
4353  ** diguyCharacter::CALLBACK_ID_IMPACT, which still needs to be
4354  ** handled to implement damage models.
4355  **
4356  *- - The crowd's callback character is the crowd member that was
4357  *- hit.
4358  *- - The crowd's callback impact contains the impact information.
4359  **
4360  *i CALLBACK_ID_AGENT_NEARBY_SCENE_OBJECT_IMPACT
4361  **
4362  ** This callback will be called when a detonation occurs within the
4363  ** awareness radius (as set by set_awareness_radius()) of the
4364  ** crowd's current bounds.
4365  **
4366  *- - This is the character version of
4367  *- diguyCrowd::CALLBACK_ID_NEARBY_SCENE_OBJECT_IMPACT
4368  *- - The crowd's callback character is the character that caused
4369  *- the detonation.
4370  *- - The crowd's callback impact contains the impact information.
4371  **
4372  *i CALLBACK_ID_AGENT_NEARBY_WEAPON_FIRED
4373  **
4374  ** This callback will be called when a weapon is fired within the
4375  ** awareness radius (as set by set_awareness_radius()) of the
4376  ** crowd's current bounds.
4377  **
4378  *- - The crowd's callback character is the character that fired the
4379  *- weapon.
4380  **
4381  *i CALLBACK_ID_AGENT_VEHICLE_COLLISION
4382  **
4383  ** This callback will be called on a vehicle agent when it hits a
4384  ** member of a companion crowd.
4385  **
4386  *i CALLBACK_ID_AGENT_VEHICLE_NEAR_COLLISION
4387  **
4388  ** This callback will be called on a vehicle agent when it
4389  ** approaches another vehicle.
4390  **
4391  *i CALLBACK_ID_AGENT_NON_ZERO_REPULSION
4392  **
4393  ** This callback will be called when an agent character's repulsion
4394  ** forces become non-zero.
4395  **
4396  *i CALLBACK_ID_AGENT_ZERO_REPULSION
4397  **
4398  ** This callback will be called when an agent character's repulsion
4399  ** forces become zero.
4400  **
4401  *i CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED
4402  **
4403  ** This callback will be called when a character who's requested a
4404  ** path plan via the background path planner
4405  ** (agent_move_to_point_bg) gets a path result. Call
4406  ** diguyCharacter::get_path_planning_result() to get the status of
4407  ** the result.
4408  **
4409  *i CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED
4410  **
4411  ** This callback will be called when the current state the agent's
4412  ** mind, if it has one, has changed. Call
4413  ** diguyCharacter::get_mind_current_state_name() to get the new
4414  ** state name.
4415  */
4416  enum {
4417  CALLBACK_ID_CREATE = 1,
4418  CALLBACK_ID_DESTROY,
4419  CALLBACK_ID_PRE_CREATE,
4420  CALLBACK_ID_CURRENT_APPEARANCE_CHANGED,
4421  CALLBACK_ID_CURRENT_HEAD_APPEARANCE_CHANGED,
4422  CALLBACK_ID_CURRENT_HAND_ITEM_APPEARANCE_CHANGED,
4423  CALLBACK_ID_SHAPE_VISIBILITY_CHANGED,
4424  CALLBACK_ID_PRE_UPDATE,
4425  CALLBACK_ID_POST_UPDATE,
4426  CALLBACK_ID_DONE_SPEAKING,
4427  CALLBACK_ID_GAZE_STATUS,
4428  CALLBACK_ID_LPOINT_STATUS,
4429  CALLBACK_ID_SHOW,
4430  CALLBACK_ID_HIDE,
4431  CALLBACK_ID_PRE_DIE,
4432  CALLBACK_ID_POST_DIE,
4433  CALLBACK_ID_PRE_FIRE_WEAPON,
4434  CALLBACK_ID_POST_FIRE_WEAPON,
4435  CALLBACK_ID_IMPACT,
4436  CALLBACK_ID_FIRE_WEAPON_SUCCESS,
4437  CALLBACK_ID_CURRENT_ARC_CHANGED,
4438  CALLBACK_ID_CURRENT_ACTION_CHANGED,
4439  CALLBACK_ID_DESIRED_ACTION_CHANGED,
4440  CALLBACK_ID_DESIRED_ACTION_REACHED,
4441  CALLBACK_ID_MANUALLY_INVOKED,
4442  CALLBACK_ID_USER_SELECTED,
4443  CALLBACK_ID_USER_UNSELECTED,
4444  CALLBACK_ID_IGUY_INTERACT,
4445  CALLBACK_ID_IGUY_INTERACT_WITH_SUBJECT,
4446  CALLBACK_ID_GUIDE_POSITION_ACQUIRED,
4447  CALLBACK_ID_GUIDE_POSITION_UNACQUIRED,
4448  CALLBACK_ID_GUIDE_ORIENTATION_ACQUIRED,
4449  CALLBACK_ID_GUIDE_ORIENTATION_UNACQUIRED,
4450  CALLBACK_ID_GUIDE_ALTITUDE_ACQUIRED,
4451  CALLBACK_ID_GUIDE_ALTITUDE_UNACQUIRED,
4452  CALLBACK_ID_GUIDE_TARGET_LOST,
4453  CALLBACK_ID_CURRENT_TOUT_REACHED,
4454  CALLBACK_ID_POST_CREATE_GEOMETRY,
4455  CALLBACK_ID_PRE_DESTROY_GEOMETRY,
4456  CALLBACK_ID_END_OF_PATH_REACHED,
4457  CALLBACK_ID_CHARACTER_CLICKED,
4458 
4459  // DI-Guy Scenario UI callbacks:
4460  CALLBACK_ID_UI_PRE_TRANSLATION,
4461  CALLBACK_ID_UI_POST_TRANSLATION,
4462  CALLBACK_ID_UI_MOUSE_DOWN,
4463  CALLBACK_ID_UI_MOUSE_UP,
4464  CALLBACK_ID_UI_RIGHT_MOUSE_DOWN,
4465  CALLBACK_ID_UI_RIGHT_MOUSE_UP,
4466  CALLBACK_ID_UI_LEFT_CLICK,
4467  CALLBACK_ID_UI_RIGHT_CLICK,
4468  CALLBACK_ID_UI_DOUBLE_CLICK,
4469  CALLBACK_ID_UI_MIDDLE_CLICK,
4470  CALLBACK_ID_UI_SCROLL_UP,
4471  CALLBACK_ID_UI_SCROLL_DOWN,
4472  //CALLBACK_ID_UI_DRAG,
4473 
4474  // DI-Guy AI agent callbacks:
4475  CALLBACK_ID_AGENT_NEW_BEHAVIOR,
4476  CALLBACK_ID_AGENT_NEW_PATH_SHAPE,
4477  CALLBACK_ID_AGENT_NEW_FOCUS_CHARACTER,
4478  CALLBACK_ID_AGENT_ATTACK_OUT_OF_TARGETS,
4479  CALLBACK_ID_AGENT_ATTACK_NO_VISIBLE_TARGETS,
4480  CALLBACK_ID_AGENT_PURSUE_TARGET_REACHED,
4481  CALLBACK_ID_AGENT_PURSUE_TARGET_LOST,
4482  CALLBACK_ID_AGENT_MINGLE_TARGET_REACHED,
4483  CALLBACK_ID_AGENT_MINGLE_TARGET_LOST,
4484  CALLBACK_ID_AGENT_WANDER_TARGET_REACHED,
4485  CALLBACK_ID_AGENT_WANDER_TARGET_LOST,
4486  CALLBACK_ID_AGENT_FLEE_AREA_LEFT,
4487  CALLBACK_ID_AGENT_FLEE_AREA_ENTERED,
4488  CALLBACK_ID_AGENT_TRAVEL_WAYPOINT_REACHED,
4489  CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED,
4490  CALLBACK_ID_AGENT_TRAVEL_BACKWARD_DEST_REACHED,
4491  CALLBACK_ID_AGENT_TRAVEL_NEAR_FORWARD_DEST,
4492  CALLBACK_ID_AGENT_CROWD_MEMBER_KILLED,
4493  CALLBACK_ID_AGENT_CROWD_MEMBER_IMPACT,
4494  CALLBACK_ID_AGENT_NEARBY_SCENE_OBJECT_IMPACT,
4495  CALLBACK_ID_AGENT_NEARBY_WEAPON_FIRED,
4496  CALLBACK_ID_AGENT_VEHICLE_COLLISION,
4497  CALLBACK_ID_AGENT_VEHICLE_NEAR_COLLISION,
4498  CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED,
4499  CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED,
4500  CALLBACK_ID_AGENT_NON_ZERO_REPULSION,
4501  CALLBACK_ID_AGENT_ZERO_REPULSION
4502  };
4503 
4504 #ifdef CPLUSPLUS_ONLY
4505 /*****************************************************************************/
4511  /*l
4512  *b Description:
4513  **
4514  ** This function adds a user callback. Callbacks can be removed
4515  ** with remove_callback() or remove_callback_with_user_data().
4516  **
4517  *b Arguments:
4518  **
4519  *a callback - pointer to function with prototype
4520  *a diguyCharacterCallback (typedefed above)
4521  *a callback_id - integer id of when this callback is to be called
4522  *a callback_params - not currently used; pass NULL
4523  *a callback_user_data - pointer for user's own use; DI-Guy will
4524  *a do nothing to the contents of this pointer
4525  *a beyond passing it back when the callback is
4526  *a invoked
4527  **
4528  *b Returns:
4529  **
4530  ** 0 on success, -1 on failure
4531  */
4532  int add_callback(int callback_id,
4533  diguyCharacterCallback* callback,
4534  void* callback_params = 0,
4535  void* callback_user_data = 0);
4536 
4537  /*l
4538  *b Description:
4539  **
4540  ** This function removes a user callback. All callbacks matching
4541  ** the specified callback_id and callback function will be removed.
4542  **
4543  *b Arguments:
4544  **
4545  *a callback_id - integer id of when this callback is to be called
4546  *a callback - pointer to function with prototype
4547  *a diguyCharacterCallback (typedefed above)
4548  **
4549  *b Returns:
4550  **
4551  ** 0 on success, -1 on failure
4552  */
4553  int remove_callback(int callback_id,
4554  diguyCharacterCallback* callback);
4555 
4556  /*l
4557  *b Description:
4558  **
4559  ** This function removes a user callback. All callbacks matching
4560  ** the specified callback_id and callback_user_data pointer will
4561  ** be removed.
4562  **
4563  *b Arguments:
4564  **
4565  *a callback_id - integer id of when this callback is to be
4566  *a called
4567  *a callback_user_data - pointer for user's own use
4568  **
4569  *b Returns:
4570  **
4571  ** 0 on success, -1 on failure
4572  */
4573  int remove_callback_with_user_data(int callback_id,
4574  void* callback_user_data);
4575 
4576 #endif
4577 /*****************************************************************************/
4583  /*l
4584  *b Description:
4585  **
4586  ** This function adds a user callback script. Callback scripts can
4587  ** be removed with remove_callback_script().
4588  **
4589  *b Arguments:
4590  **
4591  *a callback_id - integer id of the callback
4592  *a callback_script - script text of callback to be added
4593  *a callback_script_type - the type of script contained in
4594  *a callback_script
4595  **
4596  ** If NULL is passed for callback_script_type, a default script type
4597  ** will be derived based on the default script interpreter of the
4598  ** scenario.
4599  **
4600  *i lua specific:
4601  **
4602  ** When the script is called, the object for which it is being called
4603  ** will be in the callback_object global.
4604  **
4605  ** To pass NULL when calling from a lua script, use nil.
4606  **
4607  *b Returns:
4608  **
4609  ** 0 on success, -1 on failure
4610  **
4611  *b Lua Example:
4612  **
4613  *e -------------------------------------------------------------------
4614  *e local pre_fire_weapon_callback = [[
4615  *e
4616  *e local ch_name = callback_object:get_name();
4617  *e bdi_log_print(BDI_LOG_WARN, "Calling pre_fire_weapon_callback for character ".. ch_name .. ".\n");
4618  *e
4619  *e ]]
4620  *e -------------------------------------------------------------------
4621  *e
4622  *e character:add_callback_script(diguyCharacter_CALLBACK_ID_PRE_FIRE_WEAPON,
4623  *e pre_fire_weapon_callback,
4624  *e "lua");
4625  */
4626  int add_callback_script(int callback_id,
4627  const char* callback_script,
4628  const char* callback_script_type = NULL);
4629 
4630  /*l
4631  *b Description:
4632  **
4633  ** This function removes a user callback script previously added with
4634  ** add_callback_script().
4635  **
4636  *b Arguments:
4637  **
4638  *a callback_id - integer id of the callback
4639  *a callback_script - script text of callback previously added
4640  *a callback_script_type - the type of script contained in
4641  *a callback_script
4642  **
4643  ** If NULL is passed for callback_script, all callback
4644  ** scripts whose ids match callback_id and whose types match
4645  ** callback_script_type will be removed.
4646  **
4647  ** If NULL is passed for callback_script_type, a default script type
4648  ** will be derived based on the default script interpreter of the
4649  ** scenario.
4650  **
4651  *i lua specific:
4652  **
4653  ** To pass NULL when calling from a lua script, use nil.
4654  **
4655  *b Returns:
4656  **
4657  ** 0 on success, -1 on failure
4658  **
4659  *b lua Example:
4660  **
4661  *e #
4662  *e # Remove all callback scripts with id
4663  *e # diguyCharacter_CALLBACK_ID_PRE_FIRE_WEAPON
4664  *e #
4665  *e character:remove_callback_script(diguyCharacter_CALLBACK_ID_PRE_FIRE_WEAPON,
4666  *e nil,
4667  *e "lua");
4668  */
4669  int remove_callback_script(int callback_id,
4670  const char* callback_script,
4671  const char* callback_script_type = NULL);
4672 
4673 
4674 /*****************************************************************************/
4684  /*l
4685  *b Description:
4686  **
4687  ** This function maps the event handler with the given name
4688  ** to a callback id. This mapping will be saved in the .dss
4689  ** file and restored when the .dss file is loaded.
4690  **
4691  ** Mappings can also be made via the DI-Guy Scenario UI.
4692  **
4693  ** The event handler is one of the following:
4694  **
4695  *- - a character callback function registered by
4696  *- diguyScenario::register_character_event_handler() or
4697  *- diguyScenario::register_character_event_handler_from_library()
4698  *- - a script registered by
4699  *- diguyScenario::register_character_event_handler_script()
4700  *- - a Script, Decision, or Library Function in the scenario
4701  *- whose "Event Type" is "Character"
4702  **
4703  *b Arguments:
4704  **
4705  *a callback_id - integer id of callback
4706  *a handler_name - name of the event handler to map
4707  **
4708  *b Returns:
4709  **
4710  ** 0 on success, -1 on failure
4711  */
4712  int map_event_handler_to_callback_id(int callback_id,
4713  const char* handler_name);
4714 
4715  /*l
4716  *b Description:
4717  **
4718  ** This function unmaps the event handler with the given name
4719  ** from a callback id.
4720  **
4721  *b Arguments:
4722  **
4723  *a callback_id - integer id of callback
4724  *a handler_name - name of the event handler to unmap
4725  *a unmap_all_matches - pass 0 to unmap only the first match,
4726  *a pass 1 to unmap all matches
4727  **
4728  *b Returns:
4729  **
4730  ** 0 on success, -1 on failure
4731  */
4732  int unmap_event_handler_from_callback_id(int callback_id,
4733  const char* handler_name,
4734  int unmap_all_matches = 0);
4735 
4736  /*l
4737  *b Description:
4738  **
4739  ** This function manually invokes the named character event
4740  ** handler. The callback_id that will be passed to the event
4741  ** handler will be CALLBACK_ID_MANUALLY_INVOKED.
4742  **
4743  ** See diguyCharacter::map_event_handler_to_callback_id() for
4744  ** a description of what comprises a character event handler.
4745  **
4746  ** Note that care should be taken not to end up in an
4747  ** infinite loop of event calls. In general an event handler
4748  ** should not end up directly or indirectly invoking itself.
4749  **
4750  *b Arguments:
4751  **
4752  *a handler_name - name of the event handler to invoke
4753  **
4754  *b Returns:
4755  **
4756  ** DIGUY_CALLBACK_CONTINUE or DIGUY_CALLBACK_STOP
4757  **
4758  *b Available as Decision Bead/Event
4759  */
4760  diguyCallbackReturn manually_invoke_event_handler(const char* handler_name);
4761 
4762 
4763 /*****************************************************************************/
4769  /*l
4770  *b Description:
4771  **
4772  ** This function creates a new path. The created path has no
4773  ** waypoints and no actions. Waypoints can be added using
4774  ** diguyCharacterPath::create_waypoint() or
4775  ** diguyCharacterPath::add_waypoint(). Action beads should be added
4776  ** using diguyCharacterPath::create_action_bead().
4777  **
4778  ** To create a simple path that has a few waypoints and actions, use
4779  ** create_simple_path().
4780  **
4781  ** The waypoints for the path should be created using the function
4782  ** diguyScenario::create_waypoint(). They should be deleted using the
4783  ** function diguyScenario::destroy_waypoint(). Copies of the
4784  ** waypoints are made during the function call, so it is safe to
4785  ** destroy them immediately after this function call returns, or use
4786  ** the waypoints again for another path.
4787  **
4788  ** The returned diguyCharacterPath pointer should be destroyed using
4789  ** destroy_path().
4790  **
4791  *b Arguments:
4792  **
4793  ** The path makes internal copies of all arguments.
4794  **
4795  *a name - name of the new path
4796  **
4797  *b Returns:
4798  **
4799  ** pointer to type diguyCharacterPath
4800  **
4801  */
4802  diguyCharacterPath* create_path(const char* name);
4803 
4804  /*l
4805  *b Description:
4806  **
4807  ** This function creates a new simple path. The path is simple
4808  ** because it has only two waypoints and three specified actions.
4809  **
4810  ** The waypoints for the path should be created using the function
4811  ** diguyScenario::create_waypoint(). They should be deleted using the
4812  ** function diguyScenario::destroy_waypoint(). Copies of the
4813  ** waypoints are made during the function call, so it is safe to
4814  ** destroy them immediately after this function call returns, or use
4815  ** the waypoints again for another path.
4816  **
4817  ** The returned diguyCharacterPath pointer should be destroyed using
4818  ** destroy_path().
4819  **
4820  *b Arguments:
4821  **
4822  ** The path makes internal copies of all arguments.
4823  **
4824  *a name - name of the new path
4825  *a waypoint0 - beginning waypoint
4826  *a waypoint1 - ending waypoint
4827  *a transition_from_action_name - name of the action the character
4828  *a should be transitioning from at the
4829  *a beginning of the path; can be NULL
4830  *a fill_action_name - name of the action that should fill
4831  *a the majority of the path; can be
4832  *a NULL, but see below
4833  *a transition_to_action_name - name of the action the character
4834  *a should transition into at the end of
4835  *a the path
4836  **
4837  ** If transition_from_action_name is NULL, an initial action bead that
4838  ** transitions to the fill action will not be created.
4839  **
4840  ** If fill_action_name is NULL, no action beads will be created for
4841  ** the path, even if transition_from_action_name and/or
4842  ** transition_to_action_name are non-NULL.
4843  **
4844  ** If transition_to_action_name is NULL, a final action bead that
4845  ** transitions from the fill action will not be created.
4846  **
4847  *b Returns:
4848  **
4849  ** pointer to type diguyCharacterPath
4850  */
4851  diguyCharacterPath* create_simple_path(const char* name,
4852  diguyWaypoint* waypoint0,
4853  diguyWaypoint* waypoint1,
4854  const char* transition_from_action_name,
4855  const char* fill_action_name,
4856  const char* transition_to_action_name);
4857 
4858  /*l
4859  *b Description:
4860  **
4861  ** This function is similar to create_simple_path(), but creates its
4862  ** waypoints based on waypoints from the passed path shape.
4863  **
4864  *b Arguments:
4865  **
4866  ** The path makes internal copies of all arguments.
4867  **
4868  *a name - name of the new path
4869  *a source_path_shape - path shape whose waypoints are used
4870  *a to define shape of new path
4871  *a transition_from_action_name - same as for create_simple_path()
4872  *a fill_action_name - same as for create_simple_path()
4873  *a transition_to_action_name - same as for create_simple_path()
4874  **
4875  *b Returns:
4876  **
4877  ** pointer to type diguyCharacterPath
4878  */
4879  diguyCharacterPath* create_path_from_path_shape(const char* name,
4880  diguyPathShape* source_path_shape,
4881  const char* transition_from_action_name,
4882  const char* fill_action_name,
4883  const char* transition_to_action_name);
4884 
4885  /*l
4886  *b Description:
4887  **
4888  ** This function creates a temporary path and immediately forces it as
4889  ** the character's current path. Once it has been traversed it will
4890  ** be automatically deleted.
4891  **
4892  ** The beginning waypoint of this path is at the character's current
4893  ** position; the ending waypoint is at the specified action bead on
4894  ** the specified path (or the first action bead of the specified path
4895  ** if no action bead is specified). The character will use the
4896  ** specified action to move from the beginning waypoint to the ending
4897  ** waypoint.
4898  **
4899  ** This function is useful for getting a free position mode character
4900  ** back onto a path.
4901  **
4902  ** This function will have no effect on a dead character (see
4903  ** die_now() and get_dead()).
4904  **
4905  *b Mode Effects:
4906  **
4907  *- - This function will put the character into path position mode.
4908  *- - This function will put the character into path action mode.
4909  **
4910  *b Arguments:
4911  **
4912  *a destination_path_name - the path the character is trying to
4913  *a reach
4914  *a via_action_name - the action used over the majority of
4915  *a the bridge path
4916  *a destination_path_action_bead_name - the target action bead on the
4917  *a destination path; pass NULL
4918  *a to start at the beginning
4919  *a of the path
4920  **
4921  *b Returns:
4922  **
4923  ** 0 on success, -1 on failure
4924  */
4925  int create_and_force_bridge_path(const char* destination_path_name,
4926  const char* destination_path_action_bead_name,
4927  const char* via_action_name);
4928 
4929  /*l
4930  *b Description:
4931  **
4932  ** This function creates a temporary path and immediately forces it as
4933  ** the character's current path. Once the path has been traversed it
4934  ** will be automatically deleted. The character then begins the local
4935  ** path specified by path_to_push.
4936  **
4937  ** The beginning waypoint of this path is at the character's current
4938  ** position; the ending waypoint is at the specified x, y, z. A
4939  ** path_offset is available to shorten the distance to the end point
4940  ** along the vector to the destination. The character will use the
4941  ** specified action to move from the beginning waypoint to the ending
4942  ** waypoint.
4943  **
4944  ** An optional follow-on path can be specified that the character will
4945  ** move onto once the end position is reached. This must be the name
4946  ** of an existing path for the character. A local path copy of the
4947  ** specified path will be created, and will be pushed to occur after
4948  ** this bridge path completes.
4949  **
4950  ** This function is useful for branching from one location to another
4951  ** in the world.
4952  **
4953  ** This function will have no effect on a dead character (see
4954  ** die_now() and get_dead()).
4955  **
4956  *b Mode Effects:
4957  **
4958  *- - This function will put the character into path position mode.
4959  *- - This function will put the character into path action mode.
4960  **
4961  *b Arguments:
4962  **
4963  *a x, y, z - location in world space the bridge path
4964  *a should aim for
4965  *a path_offset - the amount to shorten the bridge path
4966  *a via_action_name - the action used over the majority of the
4967  *a bridge path
4968  *a next_local_path - local path to push when the character
4969  *a arrives at it's destination; pass NULL
4970  *a to not push a local path
4971  *a orientation - amount to rotate the local path
4972  **
4973  *b Returns:
4974  **
4975  ** 0 on success, -1 on failure
4976  */
4977  int create_and_force_bridge_path_to_point(float x, float y, float z,
4978  float path_offset,
4979  const char* via_action_name,
4980  const char* next_local_path = NULL,
4981  float orientation = 0.0f);
4982 
4983  /*l
4984  *b Description:
4985  **
4986  ** This function destroys a path created by create_path(),
4987  ** create_simple_path(), or a path from a loaded scenario.
4988  **
4989  ** The path the character is currently traveling, as returned by
4990  ** get_current_traveled_path(), cannot be destroyed. Attempting to
4991  ** destroy it will result in an error.
4992  **
4993  *b Arguments:
4994  **
4995  *a path - path to be destroyed
4996  **
4997  *b Returns:
4998  **
4999  ** 0 on success, -1 on failure
5000  */
5001  int destroy_path(diguyCharacterPath* path);
5002 
5003  /*l
5004  *b Returns:
5005  **
5006  ** the number of paths belonging to this character
5007  */
5008  int get_num_paths();
5009 
5010  /*l
5011  *b Returns:
5012  **
5013  ** pointer of type diguyCharacterPath; NULL if no
5014  ** path at the specified index
5015  **
5016  *b Arguments:
5017  **
5018  *a index - index of the path; indices start at 0
5019  */
5020  diguyCharacterPath* get_path_at_index(int index);
5021 
5022  /*l
5023  *b Returns:
5024  **
5025  ** the name of the path at the given index; NULL if no
5026  ** path at the specified index
5027  */
5028  const char* get_path_name_at_index(int index);
5029 
5030  /*l
5031  *b Description:
5032  **
5033  ** This function returns the index of the path the character
5034  ** is currently following. If the character is not following
5035  ** a path the returned index will be -1. (i.e., the character
5036  ** must be in path action mode *and* path position mode.)
5037  **
5038  *b Mode Restrictions:
5039  **
5040  *- - This function will only return a 0 or greater index if the
5041  ** character is in path action mode *and* path position mode.
5042  **
5043  *b Returns:
5044  **
5045  ** the index of the current path; -1 if not on a path
5046  */
5047  int get_current_path_index();
5048 
5049  /*l
5050  *b Description:
5051  **
5052  ** This function returns the path the character is currently
5053  ** traveling.
5054  **
5055  *b Mode Restrictions:
5056  **
5057  *- - This function can only be called in path position mode.
5058  **
5059  *b Returns:
5060  **
5061  ** pointer of type diguyCharacterPath; NULL if no path is currently
5062  ** being traveled
5063  */
5064  diguyCharacterPath* get_current_traveled_path();
5065 
5066  /*l
5067  *b Description:
5068  **
5069  ** This function can be used to see if the current traveled has the
5070  ** passed name. This is primarily useful for decisions and other
5071  ** limited logic applications.
5072  **
5073  *b Returns:
5074  **
5075  ** 1 if currently traveled path has the passed name; 0 if the name
5076  ** doesn't match, or no path is currently being traveled
5077  **
5078  *b Available as Decision Bead/Event
5079  */
5080  int get_current_traveled_path_is(const char* path_name);
5081 
5082  /*l
5083  *b Description:
5084  **
5085  ** This function pushes the path with the specified name
5086  ** onto the queue of paths this character will follow.
5087  **
5088  ** This function will have no effect on a dead character (see
5089  ** die_now() and get_dead()).
5090  **
5091  *b Arguments:
5092  **
5093  *a name - name of the path to be pushed
5094  **
5095  *b Returns:
5096  **
5097  ** 0 on success, -1 on failure
5098  **
5099  *b Available as Decision Bead/Event
5100  */
5101  int push_path(const char* path_name);
5102 
5103  /*l
5104  *b Description:
5105  **
5106  ** This function clears the queue of paths the character will follow
5107  ** and then pushes the path with the specified name.
5108  **
5109  ** This function will have no effect on a dead character (see
5110  ** die_now() and get_dead()).
5111  **
5112  *b Arguments:
5113  **
5114  *a name - name of the path to be pushed
5115  *a max_rampdown_interval - max amount of time spent trying to
5116  *a smooth over any motion seams; set
5117  *a to 0.5 for a smooth transition, set
5118  *a to 0 for a potentially rough transition
5119  **
5120  *b Returns:
5121  **
5122  ** 0 on success, -1 on failure
5123  **
5124  *b Available as Decision Bead/Event
5125  */
5126  int force_path(const char* path_name,
5127  float max_rampdown_interval = 0.5f);
5128 
5129  /*l
5130  *b Description:
5131  **
5132  ** Same as force_path(), but only motions at or after the specified
5133  ** action bead are added.
5134  **
5135  ** This function will have no effect on a dead character (see
5136  ** die_now() and get_dead()).
5137  **
5138  *b Available as Decision Bead/Event
5139  */
5140  int force_partial_path(const char* path_name,
5141  const char* beginning_action_bead_name,
5142  float max_rampdown_interval = 0.5f);
5143 
5144  /*l
5145  *b Description:
5146  **
5147  ** Resumes a path that was interrupted with a call such as
5148  ** set_desired_action() or force_action(). Note that the
5149  ** retain_path_shape argument to these functions must have been 1 for
5150  ** the path to be resumable.
5151  **
5152  ** This function will have no effect on a dead character (see
5153  ** die_now() and get_dead()).
5154  **
5155  *b Mode Restrictions:
5156  **
5157  *- - This function can only be called if the character is in
5158  *- free action mode *and* path position mode.
5159  **
5160  *b Mode Effects:
5161  **
5162  *- - This function will put the character into path position mode.
5163  *- - This function will put the character into path action mode.
5164  **
5165  *b Arguments:
5166  **
5167  *a max_rampdown_interval - max amount of time spent trying to
5168  *a smooth over any motion seams; set
5169  *a to 0.5 for a smooth transition, set
5170  *a to 0 for a potentially rough transition
5171  **
5172  *b Returns:
5173  **
5174  ** 0 on success, -1 on failure
5175  **
5176  *b Available as Decision Bead/Event
5177  */
5178  int resume_interrupted_path(float max_rampdown_interval = 0.5f);
5179 
5180  /*l
5181  *b Description:
5182  **
5183  ** This function creates a temporary path that is a copy of path_name
5184  ** but transformed so that the starting point is the same as where
5185  ** the character currently is. It then forces it as the character's
5186  ** current path.
5187  **
5188  *b Arguments:
5189  **
5190  *a path_name - path to copy
5191  *a use_character_orientation - whether the character's orientation be
5192  *a incorporated into the transform of the
5193  *a path
5194  *a rotation - additional amount to rotate the path,
5195  *a in degrees
5196  *a clamp_path - whether the path be ground clamped
5197  **
5198  *b Returns:
5199  **
5200  ** pointer to type diguyCharacterPath
5201  */
5202  diguyCharacterPath* force_local_path(const char* path_name,
5203  int use_character_orientation,
5204  float rotation = 0.0f,
5205  int clamp_path = 1);
5206 
5207  /*l
5208  *b Description:
5209  **
5210  ** This function sets which path the character will start on when the
5211  ** scenario is reset.
5212  **
5213  *b Arguments:
5214  **
5215  *a name - name of the path that will be the initial path
5216  **
5217  *b Returns:
5218  **
5219  ** 0 on success, -1 on failure
5220  */
5221  int set_initial_path(const char* name);
5222 
5223  /*l
5224  *b Description:
5225  **
5226  ** This function returns the name of the path the character will start
5227  ** on when the scenario is reset.
5228  **
5229  ** See set_initial_path().
5230  **
5231  *b Returns:
5232  **
5233  ** name of initial path; NULL if there is none
5234  */
5235  const char* get_initial_path();
5236 
5237  /*l
5238  *b Description:
5239  **
5240  ** This function translates all of the paths of this character.
5241  **
5242  *b Arguments:
5243  **
5244  *a tx, ty, tz - distance in meters to move all waypoints
5245  *a reclamp_waypoints - pass 1 to reclamp waypoints to ground
5246  */
5247  void translate_all_paths(float tx, float ty, float tz,
5248  int reclamp_waypoints = 1);
5249 
5250  /*l
5251  *b Description:
5252  **
5253  ** This function rotates all of the paths of this character.
5254  ** The rotation will occur about the specified point.
5255  **
5256  ** *Note:* It is currently recommended that only rotations
5257  ** about the Z axis be done. (i.e., only rz should be non-zero.)
5258  **
5259  *b Arguments:
5260  **
5261  *a rz, rx, ry - amount of rotation, in degrees
5262  *a rotation_pt_x, rotation_pt_y, rotation_pt_z - point around
5263  *a which rotation should occur
5264  *a reclamp_waypoints - pass 1 to reclamp waypoints to ground
5265  */
5266  int rotate_all_paths_about_point(float rz, float rx, float ry,
5267  float rotation_pt_x, float rotation_pt_y, float rotation_pt_z,
5268  int reclamp_waypoints = 1);
5269 
5270  /*l
5271  *b Description:
5272  **
5273  ** This function is similar to rotate_all_paths_about_point(),
5274  ** but rotates around the character's current waypoint instead
5275  ** of an explicitly specified point.
5276  **
5277  ** *Note:* It is currently recommended that only rotations
5278  ** about the Z axis be done. (i.e., only rz should be non-zero.)
5279  **
5280  *b Arguments:
5281  **
5282  *a rz, rx, ry - amount of rotation, in degrees
5283  *a reclamp_waypoints - pass 1 to reclamp waypoints to ground
5284  */
5285  int rotate_all_paths_about_current_waypoint(float rz, float rx, float ry,
5286  int reclamp_waypoints = 1);
5287 
5288  /*l
5289  *b Description:
5290  **
5291  ** This function causes the character to jump forward along
5292  ** its current path to the specified action bead. Motions
5293  ** and beads that would have otherwise been played or processed
5294  ** will be skipped.
5295  **
5296  *b Arguments:
5297  **
5298  *a bead_name - name of the bead to jump to
5299  *a max_rampdown_interval - max amount of time spent trying to
5300  *a smooth over any motion seams; set
5301  *a to 0.5 for a smooth transition, set
5302  *a to 0 for a potentially rough transition
5303  **
5304  *b Returns:
5305  **
5306  ** 0 on success, -1 on failure
5307  */
5308  int jump_to_action_bead(const char* bead_name,
5309  float max_rampdown_interval = 0.5f);
5310 
5311  /*l
5312  *b Description:
5313  **
5314  ** This function finds and returns a pointer to the specified path.
5315  **
5316  *b Arguments:
5317  **
5318  *a name - name of the path to be found
5319  **
5320  *b Returns:
5321  **
5322  ** Pointer to object of type diguyCharacterPath;
5323  ** NULL if path not found.
5324  */
5325  diguyCharacterPath* find_path(const char* path_name);
5326 
5327  /*l
5328  *b Description:
5329  **
5330  ** This function causes the effects of the given aim bead to be
5331  ** applied to this character, regardless of whether the
5332  ** bead belongs to the character or whether character is within
5333  ** the bead's time interval.
5334  **
5335  *b Arguments:
5336  **
5337  *a how_far - how far into the bead the call should be; should
5338  *a be between 0 (beginning of bead time interval) and
5339  *a 1 (end of bead time interval)
5340  **
5341  *b Returns:
5342  **
5343  ** 0 on success, -1 on failure
5344  */
5345  int apply_aim_bead(diguyCharacterPathAimBead* bead,
5346  float how_far = 0.0f);
5347 
5348  /*l
5349  *b Description:
5350  **
5351  ** This function causes the effects of the given decision bead to be
5352  ** applied to this character, regardless of whether the
5353  ** bead belongs to the character or whether character is within
5354  ** the bead's time interval.
5355  **
5356  *b Arguments:
5357  **
5358  *a how_far - how far into the bead the call should be; should
5359  *a be between 0 (beginning of bead time interval) and
5360  *a 1 (end of bead time interval)
5361  **
5362  *b Returns:
5363  **
5364  ** 0 on success, -1 on failure
5365  */
5366  int apply_decision_bead(diguyCharacterPathDecisionBead* bead,
5367  float how_far = 0.0f);
5368 
5369  /*l
5370  *b Description:
5371  **
5372  ** This function causes the effects of the given gaze bead to be
5373  ** applied to this character, regardless of whether the
5374  ** bead belongs to the character or whether character is within
5375  ** the bead's time interval.
5376  **
5377  *b Arguments:
5378  **
5379  *a how_far - how far into the bead the call should be; should
5380  *a be between 0 (beginning of bead time interval) and
5381  *a 1 (end of bead time interval)
5382  **
5383  *b Returns:
5384  **
5385  ** 0 on success, -1 on failure
5386  */
5387  int apply_gaze_bead(diguyCharacterPathGazeBead* bead,
5388  float how_far = 0.0f);
5389 
5390  /*l
5391  *b Description:
5392  **
5393  ** This function causes the effects of the given script bead to be
5394  ** applied to this character, regardless of whether the
5395  ** bead belongs to the character or whether character is within
5396  ** the bead's time interval.
5397  **
5398  *b Arguments:
5399  **
5400  *a how_far - how far into the bead the call should be; should
5401  *a be between 0 (beginning of bead time interval) and
5402  *a 1 (end of bead time interval)
5403  **
5404  *b Returns:
5405  **
5406  ** 0 on success, -1 on failure
5407  */
5408  int apply_script_bead(diguyCharacterPathScriptBead* bead,
5409  float how_far = 0.0f);
5410 
5411  /*l
5412  *b Description:
5413  **
5414  ** This function sets how far along the current path shape
5415  ** the character will be.
5416  **
5417  *b Mode Restrictions:
5418  **
5419  *- - This function can only be called if the character is in
5420  *- free action mode *and* path position mode. i.e., the
5421  *- character is following a path shape, and is not on a
5422  *- diguyCharacterPath.
5423  **
5424  *b Arguments:
5425  **
5426  *a distance - distance in meters; 0.0 is the beginning of the
5427  *a path shape
5428  **
5429  *b Returns:
5430  **
5431  ** 0 on success, -1 on failure
5432  */
5433  int set_distance_along_path(float distance);
5434 
5435  /*l
5436  *b Returns:
5437  **
5438  ** the distance in meters along the path shape; see
5439  ** set_distance_along_path()
5440  **
5441  *b Mode Restrictions:
5442  **
5443  *- - This function can only be called in path position mode.
5444  */
5445  float get_distance_along_path();
5446 
5447  /*l
5448  *b Description:
5449  **
5450  ** This function takes the character off of its current path
5451  ** or path shape.
5452  **
5453  *b Mode Restrictions:
5454  **
5455  *- - This function can only be called in path position mode.
5456  **
5457  *b Mode Effects:
5458  **
5459  *- - This function will put the character into free position mode.
5460  *- - This function will put the character into free action mode.
5461  **
5462  *b Returns:
5463  **
5464  ** 0 on success, -1 on failure
5465  */
5466  int leave_path();
5467 
5468  /*l
5469  *b Description:
5470  **
5471  ** This function returns the index of the nearest waypoint in a path,
5472  ** the path argument is looked up in both the character's path list
5473  ** and the scenario's paths.
5474  **
5475  *b Returns:
5476  **
5477  ** waypoint index
5478  */
5479  int get_nearest_waypoint_index_in_path(const char* path_name);
5480 
5481  /*l
5482  *b Returns:
5483  **
5484  ** Distance to action bead or first waypoint, 100000000.0 on failure
5485  */
5486  float get_distance_to_path(const char* path_name,
5487  const char* action_bead_name = NULL);
5488 
5489 
5490 /*****************************************************************************/
5498  /*l
5499  *b Description:
5500  **
5501  ** This function gets the position link of the character skeleton.
5502  ** The rest of the skeleton can then be traversed by recursively
5503  ** calling the diguyGraphicsLink::get_num_child_links() and
5504  ** diguyGraphicsLink::get_child_link_at_index() functions.
5505  **
5506  ** Alternatively, the links of the character can be traversed
5507  ** by calling the get_num_links() and get_link_at_index()
5508  ** functions below.
5509  **
5510  *b Returns:
5511  **
5512  ** pointer of type diguyGraphicsLink; NULL if there is no
5513  ** position link
5514  */
5515  diguyGraphicsLink* get_position_link();
5516 
5517  /*l
5518  *b Returns:
5519  **
5520  ** number of links on this character
5521  */
5522  int get_num_links();
5523 
5524  /*l
5525  *b Returns:
5526  **
5527  ** pointer of type diguyGraphicsLink; NULL if no
5528  ** link at the specified index
5529  **
5530  *b Arguments:
5531  **
5532  *a index - index of the link; indices start at 0
5533  */
5534  diguyGraphicsLink* get_link_at_index(int index);
5535 
5536  /*l
5537  *b Description:
5538  **
5539  ** This function returns a pointer to the specified link.
5540  **
5541  *b Arguments:
5542  **
5543  *a name - name of link to be found
5544  **
5545  *b Returns:
5546  **
5547  ** pointer of type diguyGraphicsLink; NULL if not found
5548  */
5549  diguyGraphicsLink* find_link(const char* name);
5550 
5551  /*l
5552  *b Returns:
5553  **
5554  ** the string identifying the link at the given index
5555  **
5556  *b Arguments:
5557  **
5558  *a link_index - index of the link; indices start at 0
5559  */
5560  const char* get_link_name_at_index(int link_index);
5561 
5562  /*l
5563  *b Returns:
5564  **
5565  ** the number of shapes on the specified link
5566  **
5567  *b Arguments:
5568  **
5569  *a link_name - name of the link
5570  */
5571  int get_num_link_shapes(const char* link_name);
5572 
5573  /*l
5574  *b Returns:
5575  **
5576  ** the name of the shape at the specified index on the link
5577  **
5578  *b Arguments:
5579  **
5580  *a link_name - name of the link
5581  *a shape_index - index of the shape on the link; indices start at 0
5582  */
5583  const char* get_link_shape_name_at_index(const char* link_name,
5584  int shape_index);
5585 
5587  int get_num_connection_points();
5588 
5591  const char * get_connection_point_name_at_index(int index);
5592 
5595  int get_num_connection_points_with_type(diguyConnectionPointType type);
5596 
5599  const char * get_connection_point_name_with_type(diguyConnectionPointType type, int index);
5600 
5602  void set_link_visibility(const char* link_or_connection_name, int visible, int shape_index = -1);
5603 
5604 /*****************************************************************************/
5613  diguyLinkController * get_link_controller(const char * link_name);
5616 
5619  int set_link_translation_override(const char * link_name, float x, float y, float z, float ramp_time = .25f);
5620 
5623  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);
5624 
5626  int end_link_translation_override(const char * link_name, float ramp_time = .25f);
5627 
5629  int set_link_rotation_override(const char * link_name, float rz, float rx, float ry, float ramp_time = .25f);
5630  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);
5631 
5633  int end_link_rotation_override(const char * link_name, float ramp_time = .25f);
5634 
5635 
5636 /*****************************************************************************/
5645  int get_num_articulated_parts();
5647 
5649  const char * get_articulated_part_link_name(int index);
5650 
5652  int get_articulated_part_id(int index);
5653 
5655  const char * map_articulated_part_id_to_link(int id);
5656 
5657 
5658 /*****************************************************************************/
5680 #ifdef CPLUSPLUS_ONLY
5681 
5682  /*l
5683  *b Description:
5684  **
5685  ** The following prototype should be used for the altitude
5686  ** function:
5687  **
5688  *e float altitude_func(diguyCharacter* character,
5689  *e float x,
5690  *e float y,
5691  *e float old_z);
5692  **
5693  ** When a character needs new altitude info, DI-Guy calls this
5694  ** function with a pointer to the diguyCharacter in question,
5695  ** the character's current (x, y) coordinates, and its previous
5696  ** altitude in old_z.
5697  **
5698  ** The altitude function should then compute and return the new
5699  ** altitude based on this information. This can be done in a
5700  ** number of ways; a typical approach is to do an intersection
5701  ** test with the visual scene. Some users might want to implement
5702  ** fairly complex behavior, such as attempting to make all four
5703  ** wheels of a vehicle touch the terrain, or causing a character
5704  ** to drift slowly towards the ground.
5705  **
5706  ** A default altitude function that should be set for all
5707  ** characters can be set by calling
5708  ** diguyScenario::set_default_character_altitude_function().
5709  **
5710  ** This function is normally called for all characters if the flags
5711  ** for enabling it in free movement or path-following mode are
5712  ** set (see below). Some character systems, such as certain kinds
5713  ** of vehicle control code, will also use the scenario altitude
5714  ** function.
5715  **
5716  *b Callable From:
5717  **
5718  *- - C++
5719  */
5720  int set_altitude_function(diguyAltitudeFunction* altitude_function);
5721 
5722  /*l
5723  *b Returns:
5724  **
5725  ** current altitude function; see set_altitude_function()
5726  **
5727  *b Callable From:
5728  **
5729  *- - C++
5730  */
5731  diguyAltitudeFunction* get_altitude_function();
5732 
5733 #endif
5734 
5735  /*l
5736  *b Description:
5737  **
5738  ** This function sets whether the character's altitude function is
5739  ** enabled in free position mode. Altitude functions are set by the
5740  ** functions set_altitude_function() or
5741  ** diguyScenario::set_default_character_altitude_function().
5742  **
5743  *b Arguments:
5744  **
5745  *a enabled - pass 1 to enable, 0 to disable
5746  **
5747  *b Mode Effects:
5748  **
5749  *- - This function will not change the position mode.
5750  **
5751  *b Mode Restrictions:
5752  **
5753  *- - This function will only affect characters in free position mode.
5754  **
5755  *b Returns:
5756  **
5757  ** 0 on success, -1 on failure
5758  */
5759  int set_altitude_function_enabled_in_free_position_mode(int enabled);
5760 
5761  /*l
5762  *b Returns:
5763  **
5764  ** whether the character's altitude function is enabled in free
5765  ** position mode; see
5766  ** set_altitude_function_enabled_in_free_position_mode()
5767  */
5768  int get_altitude_function_enabled_in_free_position_mode();
5769 
5770  /*l
5771  *b Description:
5772  **
5773  ** This function sets whether the character's altitude function is
5774  ** enabled in path position mode. Altitude functions are set by
5775  ** the functions set_altitude_function() or
5776  ** diguyScenario::set_default_character_altitude_function().
5777  **
5778  *b Arguments:
5779  **
5780  *a enabled - pass 1 to enable, 0 to disable
5781  **
5782  *b Mode Effects:
5783  **
5784  *- - This function will not change the position mode.
5785  **
5786  *b Mode Restrictions:
5787  **
5788  *- - This function will only affect characters in path position mode.
5789  **
5790  *b Returns:
5791  **
5792  ** 0 on success, -1 on failure
5793  */
5794  int set_altitude_function_enabled_in_path_position_mode(int value);
5795 
5796  /*l
5797  *b Returns:
5798  **
5799  ** whether the character's altitude function is enabled in path
5800  ** position mode;
5801  ** see set_altitude_function_enabled_in_path_position_mode()
5802  */
5803  int get_altitude_function_enabled_in_path_position_mode();
5804 
5805  /*l
5806  *b Description
5807  **
5808  ** This function sets the altitude update rate of the character.
5809  **
5810  ** The default value for new characters is 100.
5811  **
5812  ** Note that characters that are load managed (get_is_load_managed()
5813  ** returns 1) have this parameter managed automatically. The
5814  ** corresponding function for load managed characters is
5815  ** diguyLoadManager::set_zone_altitude_update_rate().
5816  **
5817  *b Arguments:
5818  **
5819  *a update_rate - percentage of scenario ticks for which altitude
5820  *a should update; can be between 1 and 100
5821  **
5822  ** Passing 100 means altitude will update every tick.
5823  ** Passing 50 means altitude will update every other tick.
5824  **
5825  *b Returns:
5826  **
5827  ** 0 on success, -1 on failure
5828  */
5829  int set_altitude_update_rate(int update_rate);
5830 
5832  int get_altitude_update_rate();
5833 
5834  /*l
5835  *b Description
5836  **
5837  ** This function sets the altitude interpolation rate of the
5838  ** character. This function only has an effect if the character's
5839  ** altitude function is enabled.
5840  **
5841  ** When the altitude function determines that the character's Z
5842  ** position should be updated to bring it closer to the ground, the
5843  ** altitude interpolation rate determines how quickly the Z height
5844  ** is adjusted.
5845  **
5846  ** The default value is 10.
5847  **
5848  *b Arguments:
5849  **
5850  *a interpolation_rate - how much of the error will be made up
5851  *a each second
5852  **
5853  ** An interpolation_rate of 100 means that all error will be made
5854  ** up each frame.
5855  */
5856  void set_altitude_interpolation_rate(float interpolation_rate);
5857 
5859  float get_altitude_interpolation_rate();
5860 
5861 /*****************************************************************************/
5973  /*l
5974  *b Description:
5975  **
5976  ** Returns the number of variables in this character's pose array.
5977  ** See get_pose_in_radians() for an example of use.
5978  **
5979  *b Returns:
5980  **
5981  ** size of this character's pose array
5982  */
5983  int get_pose_array_size();
5984 
5985 #ifdef CPLUSPLUS_ONLY
5986 
5987  /*l
5988  *b Description:
5989  **
5990  ** Fills an array of floats with the character's current joint angles.
5991  ** Angles are expressed in radians. The size of the float array must
5992  ** be at least as large as that returned by get_pose_array_size().
5993  **
5994  *b Arguments:
5995  **
5996  *a pose_array - an array of floats
5997  **
5998  *b Returns:
5999  **
6000  ** 0 on success, -1 on failure
6001  **
6002  *b Callable From:
6003  **
6004  *- - C++
6005  **
6006  *b C++ Example:
6007  **
6008  *e diguyCharacter* ch = scenario->get_character_at_index(0);
6009  *e float* pose_array;
6010  *e
6011  *e // allocate a float array of the proper size
6012  *e int n = ch->get_pose_array_size();
6013  *e pose_array = new float[n];
6014  *e
6015  *e // get the pose array
6016  *e ch->get_pose_in_radians(pose_array);
6017  */
6018  int get_pose_in_radians(float* pose_array);
6019 
6021  int get_pose_in_quaternions(float* pose_array);
6022 
6023 #endif
6024 
6025  /*l
6026  *b Description:
6027  **
6028  ** Creates and returns a pose override object. The newly created
6029  ** pose override object is added to the character's previously
6030  ** created override objects, if any.
6031  **
6032  ** How the pose override interacts with other effects that affect
6033  ** the pose of the character depends on the override stage. See
6034  ** the section "Pose Override Stages" for a discussion of pose
6035  ** override stages.
6036  **
6037  *b Arguments:
6038  **
6039  *a override_stage - the stage in the DI-Guy motion engine at
6040  *a which the override should be applied
6041  **
6042  *b Returns:
6043  **
6044  ** object of type diguyCharacterPoseOverride
6045  */
6046  diguyCharacterPoseOverride* create_pose_override(int override_stage = 3);
6047 
6048  /*l
6049  *b Description:
6050  **
6051  ** Destroys a pose override object, ending its influence on the
6052  ** character.
6053  **
6054  *b Arguments:
6055  **
6056  *a po - pose override object to be destroyed
6057  **
6058  *b Returns:
6059  **
6060  ** 0 on success, -1 on failure
6061  */
6062  int destroy_pose_override(diguyCharacterPoseOverride* po);
6063 
6064  /*l
6065  *b Returns:
6066  **
6067  ** the number of pose overrides belonging to this character
6068  */
6069  int get_num_pose_overrides();
6070 
6071  /*l
6072  *b Returns:
6073  **
6074  ** pointer of type diguyCharacterPoseOverride; NULL if no
6075  ** pose override at the specified index
6076  **
6077  *b Arguments:
6078  **
6079  *a index - index of the pose override; indices start at 0
6080  */
6081  diguyCharacterPoseOverride* get_pose_override_at_index(int index);
6082 
6083  /*l
6084  *b Description:
6085  **
6086  ** Creates and returns a pose override object that completely
6087  ** overrides all other character pose operations, including motions,
6088  ** aiming, gazing, gestures, other pose overrides, etc. The values
6089  ** set in the complete pose override object will be the values used
6090  ** to animate the character.
6091  **
6092  ** Having only one thing that affects a character's pose allows for
6093  ** much faster updating of the character.
6094  **
6095  ** There can only be one complete pose override object per character.
6096  **
6097  ** To remove the complete pose override, call
6098  ** destroy_complete_pose_override().
6099  **
6100  *b Returns:
6101  **
6102  ** object of type diguyCharacterPoseOverride
6103  */
6104  diguyCharacterPoseOverride* create_complete_pose_override();
6105 
6106  /*l
6107  *b Description:
6108  **
6109  ** Removes and destroys the complete pose override created by
6110  ** create_complete_pose_override().
6111  */
6112  void destroy_complete_pose_override();
6113 
6114 
6115 /*****************************************************************************/
6121  /*l
6122  *b Description:
6123  **
6124  ** This function sets the current azimuth, elevation, and
6125  ** distance of the character's gaze. A fixed point in 3D space
6126  ** is then found using the two angles and the given distance
6127  ** from the DI-Guy coordinate system origin. Angles are
6128  ** given with respect to the DI-Guy coordinate system.
6129  **
6130  ** See set_position() for a description of the coordinate
6131  ** system.
6132  **
6133  ** Gazing will continue until end_gaze() is called.
6134  **
6135  ** This function will have no effect on a dead character (see
6136  ** die_now() and get_dead()).
6137  **
6138  *b Arguments:
6139  **
6140  *a azimuth - rotation in degrees about up (vertical) axis;
6141  *a positive rotates to character's left
6142  *a elevation - rotation in degrees about forward (horizontal) axis;
6143  *a positive rotates down
6144  *a distance - deprecated as of 13.2
6145  *a is_new_gaze - set to 1 if this is a new gaze;
6146  *a set to 0 if this is continuing an already started
6147  *a gaze
6148  **
6149  *b Returns:
6150  **
6151  ** 0 on success, -1 on failure
6152  */
6153  int gaze_at_angle(float azimuth,
6154  float elevation,
6155  float distance,
6156  int is_new_gaze = 1);
6157 
6158  /*l
6159  *b Description:
6160  **
6161  ** This function is identical to gaze_at_angle() except that it uses
6162  ** body local coordinates for the character. The angles
6163  ** are given with respect to the idealized position of the
6164  ** character. Use get_position() to learn the idealized position.
6165  ** The distance is between the idealized position of the character
6166  ** and the fixation point.
6167  **
6168  ** This function will have no effect on a dead character (see
6169  ** die_now() and get_dead()).
6170  ** distance argument - deprecated as of 13.2
6171  */
6172  int gaze_at_angle_local(float azimuth,
6173  float elevation,
6174  float distance = 10000.0f,
6175  int is_new_gaze = 1);
6176 
6177  /*l
6178  *b Description:
6179  **
6180  ** This function sets the current fixation point of the character's
6181  ** gaze. Point coordinates are given in meters in the DI-Guy
6182  ** global coordinate system. The function uses default gaze behavior
6183  ** settings. Gazing will continue until end_gaze() is called.
6184  **
6185  ** This function will have no effect on a dead character (see
6186  ** die_now() and get_dead()).
6187  **
6188  *b Arguments:
6189  **
6190  *a tx, ty, tz - position in meters from the DI-Guy global
6191  *a origin
6192  *a is_new_gaze - set to 1 if this is a new gaze;
6193  *a set to 0 if this is continuing an already started
6194  *a gaze
6195  **
6196  *b Returns:
6197  **
6198  ** 0 on success, -1 on failure
6199  */
6200  int gaze_at_point(float tx,
6201  float ty,
6202  float tz,
6203  int is_new_gaze = 1);
6204 
6205  /*l
6206  *b Description:
6207  **
6208  ** This function is identical to gaze_at_point() except that it uses
6209  ** body local coordinates for the character. Use get_position()
6210  ** to learn the idealized position of the character if necessary.
6211  **
6212  ** This function will have no effect on a dead character (see
6213  ** die_now() and get_dead()).
6214  */
6215  int gaze_at_point_local(float tx,
6216  float ty,
6217  float tz,
6218  int is_new_gaze = 1);
6219 
6220  /*l
6221  *b Description:
6222  **
6223  ** This function effectively does a gaze_at_point() each tick.
6224  ** The point to be gazed at is updated each tick to be the position
6225  ** of the specified link on the specified character.
6226  **
6227  ** This function will have no effect on a dead character (see
6228  ** die_now() and get_dead()).
6229  **
6230  *b Arguments:
6231  **
6232  *a target_character_name - name of the character to be
6233  *a gazed at
6234  *a target_character_link_name - link on the character that should
6235  *a be gazed at; pass NULL to gaze at
6236  *a the position link of the character
6237  *a offset_tx, offset_ty, offset_tz - offset onto the link, in meters
6238  **
6239  *b Returns:
6240  **
6241  ** 0 on success, -1 on failure
6242  **
6243  *b Available as Decision Bead/Event
6244  **
6245  *b C++ Example:
6246  **
6247  *e // gaze at the head of character "soldier-1".
6248  *e ch->gaze_at_character("soldier-1",
6249  *e "cervical",
6250  *e 0.0,
6251  *e 0.0,
6252  *e 0.0);
6253  */
6254  int gaze_at_character(const char* target_character_name,
6255  const char* target_character_link_name = NULL,
6256  float offset_tx = 0.0f,
6257  float offset_ty = 0.0f,
6258  float offset_tz = 0.0f);
6259 
6260  /*l
6261  *b Returns:
6262  **
6263  ** 1 if the character is actively gazing, 0 if not
6264  */
6265  int get_gaze_is_active();
6266 
6267  /*l
6268  *b Returns:
6269  **
6270  ** the current gaze point relative to the DI-Guy
6271  ** global coordinate system
6272  */
6273  int get_gaze_point(float* x, float* y, float* z);
6274 
6275  /*l
6276  *b Description:
6277  **
6278  ** A gaze is acquired if the final link in the gaze link chain
6279  ** has fully oriented toward the gaze target, even if other
6280  ** links in the gaze chain are still moving.
6281  **
6282  ** If the gaze is acquired, but any links in the gaze chain
6283  ** are still moving, the gaze is considered acquired but not
6284  ** steady (see get_gaze_is_steady().) If all links have reached
6285  ** a relatively steady state, the gaze is considered acquired
6286  ** and steady.
6287  **
6288  ** If either the acquired or steady status of a gaze has changed
6289  ** (e.g., was acquired but now is not, or was steady but now
6290  ** a link is moving), the diguyCharacter callback with callback_id
6291  ** CALLBACK_ID_GAZE_STATUS will be called.
6292  **
6293  *b Returns:
6294  **
6295  *- - 1 if the final link in the gaze can and has become oriented
6296  *- toward the gaze target
6297  *- - 0 if not
6298  *- - -1 on error
6299  */
6300  int get_gaze_is_acquired();
6301 
6302  /*l
6303  *b Description:
6304  **
6305  ** A gaze is steady if it is acquired, and if all links involved
6306  ** in the gaze have reached a steady state.
6307  **
6308  ** For example, since the eyes move faster than the neck, which
6309  ** moves faster than the back, it's possible for the gaze to
6310  ** be acquired (see get_gaze_is_acquired()) by the eyes as the
6311  ** neck and back are still moving. As the neck and back move into
6312  ** a more natural position, the eyes will not need to be turned
6313  ** as far to keep the gaze acquired.
6314  **
6315  ** If either the acquired or steady status of a gaze has changed
6316  ** (e.g., was acquired but now is not, or was steady but now
6317  ** a link is moving), the diguyCharacter callback with callback_id
6318  ** CALLBACK_ID_GAZE_STATUS will be called.
6319  **
6320  *b Returns:
6321  **
6322  *- - 1 if all links participating in the gaze have reached a
6323  *- relatively steady state
6324  *- - 0 if not
6325  *- - -1 on error
6326  */
6327  int get_gaze_is_steady();
6328 
6329  /*l
6330  *b Description:
6331  **
6332  ** This function removes the fixation target of an ongoing gaze,
6333  ** allowing the character to return to a non-gaze posture and
6334  ** behavior. This effectively frees the character's posture to
6335  ** other influences.
6336  */
6337  int end_gaze();
6338 
6339  /*l
6340  *b Description:
6341  **
6342  ** This function is similar to gaze_at_angle(), but sets the target
6343  ** of left pointing rather than gaze.
6344  **
6345  ** This function will have no effect on a dead character (see
6346  ** die_now() and get_dead()).
6347  **
6348  *b Arguments:
6349  **
6350  *a azimuth - rotation in degrees about up (vertical) axis;
6351  *a positive rotates to character's left
6352  *a elevation - rotation in degrees about forward (horizontal) axis;
6353  *a positive rotates down
6354  *a distance - distance in meters from the position of the character
6355  *a to the lpoint target; positive values only
6356  *a is_new_lpoint - set to 1 if this is a new lpoint;
6357  *a set to 0 if this is continuing an already started
6358  *a lpoint
6359  *a base_gesture_name - the underlying gesture that should be used for
6360  *a motion of the arm; this is a placeholder
6361  *a argument for future functionality and should
6362  *a be set to NULL
6363  */
6364  int lpoint_at_angle(float azimuth,
6365  float elevation,
6366  float distance,
6367  int is_new_lpoint = 1,
6368  const char* base_gesture_name = 0);
6369 
6370  /*l
6371  *b Description:
6372  **
6373  ** This function is identical to gaze_at_local() except that it uses
6374  ** body local coordinates for the character. Use get_position()
6375  ** to learn the idealized position of the character if necessary.
6376  **
6377  ** This function will have no effect on a dead character (see
6378  ** die_now() and get_dead()).
6379  */
6380  int lpoint_at_angle_local(float azimuth,
6381  float elevation,
6382  float distance = 10000.0f,
6383  int is_new_lpoint = 1,
6384  const char* base_gesture_name = 0);
6385 
6386  /*l
6387  *b Description:
6388  **
6389  ** This function sets the current fixation point for the character's
6390  ** left pointing. Point coordinates are given in meters in the
6391  ** DI-Guy global coordinate system.
6392  **
6393  ** See set_position() for a description of the coordinate
6394  ** system.
6395  **
6396  ** Pointing will continue until end_lpoint() is called.
6397  **
6398  ** This function will have no effect on a dead character (see
6399  ** die_now() and get_dead()).
6400  **
6401  *b Arguments:
6402  **
6403  *a tx, ty, tz - position in meters from the DI-Guy global
6404  *a origin of the lpoint target
6405  *a is_new_gaze - set to 1 if this is a new lpoint;
6406  *a set to 0 if this is continuing an already started
6407  *a lpoint
6408  *a base_gesture_name - the underlying gesture that should be used for
6409  *a motion of the arm; this is a placeholder
6410  *a argument for future functionality and should
6411  *a be set to NULL
6412  **
6413  *b Returns:
6414  **
6415  ** 0 on success, -1 on failure
6416  */
6417  int lpoint_at_point(float tx,
6418  float ty,
6419  float tz,
6420  int is_new_lpoint = 1,
6421  const char* base_gesture_name = 0);
6422 
6423  /*l
6424  *b Description:
6425  **
6426  ** This function is identical to lpoint_at_local() except that it uses
6427  ** body local coordinates for the character. Use get_position()
6428  ** to learn the idealized position of the character if necessary.
6429  **
6430  ** This function will have no effect on a dead character (see
6431  ** die_now() and get_dead()).
6432  */
6433  int lpoint_at_point_local(float tx,
6434  float ty,
6435  float tz,
6436  int is_new_lpoint = 1,
6437  const char* base_gesture_name = 0);
6438 
6439  /*l
6440  *b Description:
6441  **
6442  ** This function is identical to gaze_at_character(), but sets the
6443  ** target of left pointing rather than gaze.
6444  **
6445  ** This function will have no effect on a dead character (see
6446  ** die_now() and get_dead()).
6447  */
6448  int lpoint_at_character(const char* target_character_name,
6449  const char* target_character_link_name = NULL,
6450  float offset_tx = 0.0f,
6451  float offset_ty = 0.0f,
6452  float offset_tz = 0.0f);
6453 
6454  /*l
6455  *b Returns:
6456  **
6457  ** the current lpoint target point relative to the DI-Guy
6458  ** global coordinate system
6459  */
6460  int get_lpoint_point(float* x, float* y, float* z);
6461 
6462  /*l
6463  *b Returns:
6464  **
6465  ** the current base gesture of the lpoint
6466  */
6467  const char* get_lpoint_base_gesture_name();
6468 
6469  /*l
6470  *b Returns:
6471  **
6472  ** 1 if the character is actively lpointing, 0 if not
6473  */
6474  int get_lpoint_is_active();
6475 
6476  /*l
6477  *b Returns:
6478  **
6479  ** 1 if the final link in the lpoint can and has become oriented
6480  ** toward the lpoint target;
6481  ** 0 if not;
6482  ** -1 on error
6483  */
6484  int get_lpoint_is_acquired();
6485 
6486  /*l
6487  *b Returns:
6488  **
6489  ** 1 if all links participating in the lpoint have reached a
6490  ** relatively steady state;
6491  ** 0 if not;
6492  ** -1 on error
6493  */
6494  int get_lpoint_is_steady();
6495 
6496  /*l
6497  *b Description:
6498  **
6499  ** This function removes the fixation target of an ongoing lpoint,
6500  ** allowing the character to return to a non-point posture and
6501  ** behavior. This effectively frees the character's posture to
6502  ** other influences.
6503  */
6504  int end_lpoint();
6505 
6506  /*l
6507  *b Description:
6508  **
6509  ** This function sets all gaze control parameters back to their
6510  ** default settings. This undoes modifications to gaze control
6511  ** parameters made by the following calls:
6512  **
6513  *- - set_gaze_param_desired_locate_time()
6514  *- - set_gaze_link_uses_desired_locate_time()
6515  *- - set_gaze_link_azimuth_limits()
6516  *- - set_gaze_link_elevation_limits()
6517  *- - set_gaze_link_azimuth_tolerance()
6518  *- - set_gaze_link_elevation_tolerance()
6519  *- - set_gaze_link_max_angular_vel()
6520  *- - set_gaze_link_scale_factor()
6521  **
6522  *b Returns:
6523  **
6524  ** 0 on success, -1 on failure
6525  */
6526  int set_gaze_params_to_defaults();
6527 
6528  /*l
6529  *b Description:
6530  **
6531  ** This function sets the desired amount of time in seconds it
6532  ** will take for the gaze or point target to be acquired.
6533  **
6534  ** Having a desired locate time effectively limits how fast links
6535  ** in the gaze chain can turn; they will turn as fast as it
6536  ** takes for them to arrive at their proper values, or as fast
6537  ** as their maximum angular velocity, whichever is longer.
6538  **
6539  ** The use of desired locate time can be turned on and off on a
6540  ** link by link bases using the function
6541  ** set_gaze_link_uses_desired_locate_time().
6542  **
6543  ** This value is only a guideline and may be overridden on a link
6544  ** by link basis during the actual gaze, as links try not to
6545  ** exceed their maximum angular velocities.
6546  **
6547  ** The default locate time is 1.0 seconds.
6548  **
6549  *b Arguments:
6550  **
6551  *a t - lower value results in faster turning rate
6552  **
6553  *b Returns:
6554  **
6555  ** 0 on success, -1 on failure
6556  */
6557  int set_gaze_param_desired_locate_time(float t);
6558 
6559  /*l
6560  *b Returns:
6561  **
6562  ** the most recent setting of set_gaze_param_desired_locate_time()
6563  */
6564  float get_gaze_param_desired_locate_time();
6565 
6566  /*l
6567  *b Description:
6568  **
6569  ** This function sets whether the specified link will pay attention
6570  ** to the desired locate time (as set by
6571  ** set_gaze_param_desired_locate_time()), or whether the link turns
6572  ** as fast as its maximum angular velocity allows (as set by
6573  ** set_gaze_link_max_angular_vel()).
6574  **
6575  ** Note that if this value is set to 1, the link still pays attention
6576  ** to its maximum angular velocity as an upper limit on how fast
6577  ** it can turn.
6578  **
6579  ** Valid link names and defaults:
6580  **
6581  *a orientation - 1
6582  *a back - 1
6583  *a cervical - 1
6584  *a eye_l - 0
6585  *a shoulder_l - 1
6586  *a elbow_l - 1
6587  **
6588  *b Arguments:
6589  **
6590  *a link_name - name of the link
6591  *a uses_desired_locate_time - 1 to use desired locate time, 0
6592  *a to disregard
6593  **
6594  *b Returns:
6595  **
6596  ** 0 on success, -1 on failure
6597  */
6598  int set_gaze_link_uses_desired_locate_time(const char* link_name,
6599  int uses_desired_locate_time);
6600 
6601  /*l
6602  *b Returns:
6603  **
6604  ** the most recent setting of set_gaze_link_uses_desired_locate_time()
6605  */
6606  int get_gaze_link_uses_desired_locate_time(const char* link_name);
6607 
6608  /*l
6609  *b Description:
6610  **
6611  ** This function sets the maximum amount the character can turn
6612  ** the specified link horizontally in pursuit of a gaze or point
6613  ** target.
6614  **
6615  ** Valid link names and defaults:
6616  **
6617  *a back - -45 to 45
6618  *a cervical - -80 to 80
6619  *a eye_l - -50 to 50
6620  *a shoulder_l - -30 to 135
6621  *a elbow_l - -30 to 10
6622  **
6623  *b Arguments:
6624  **
6625  *a link_name - name of the link
6626  *a min - value <= 0; in degrees
6627  *a max - value >= 0; in degrees
6628  **
6629  *b Returns:
6630  **
6631  ** 0 on success, -1 on failure
6632  */
6633  int set_gaze_link_azimuth_limits(const char* link_name, float min, float max);
6634 
6635  /*l
6636  *b Returns:
6637  **
6638  ** the most recent setting of set_gaze_link_azimuth_max()
6639  */
6640  int get_gaze_link_azimuth_limits(const char* link_name,
6641  float* min,
6642  float* max);
6643 
6644  /*l
6645  *b Description:
6646  **
6647  ** This function sets the maximum amount the character can turn
6648  ** the specified link vertically in pursuit of a gaze or point
6649  ** target.
6650  **
6651  ** Valid link names and defaults:
6652  **
6653  *a back - -15 to 45
6654  *a cervical - -80 to 45
6655  *a eye_l - -40 to 40
6656  *a shoulder_l - -80 to 80
6657  *a elbow_l - -170 to 0
6658  **
6659  *b Arguments:
6660  **
6661  *a link_name - name of the link
6662  *a min - value <= 0; in degrees
6663  *a max - value >= 0; in degrees
6664  **
6665  *b Returns:
6666  **
6667  ** 0 on success, -1 on failure
6668  */
6669  int set_gaze_link_elevation_limits(const char* link_name,
6670  float min,
6671  float max);
6672 
6674  int get_gaze_link_elevation_limits(const char* link_name,
6675  float* min,
6676  float* max);
6677 
6678  /*l
6679  *b Description:
6680  **
6681  ** This function sets how much difference there can be between
6682  ** the link's current horizontal orientation and the gaze or point
6683  ** target before the link begins to turn to acquire the gaze or
6684  ** point target.
6685  **
6686  ** The combination of this function and
6687  ** set_gaze_link_scale_factor() determine how close the link will
6688  ** turn toward the gaze or point target.
6689  **
6690  ** With a looser (higher) tolerance the link will not turn as much
6691  ** toward the target. With a tighter (lower) tolerance the link
6692  ** will turn more toward the target.
6693  **
6694  ** Valid link names and defaults:
6695  **
6696  *a orientation - -30 to 30
6697  *a back - -45 to 45
6698  *a cervical - -5 to 5
6699  *a eye_l - -1 to 1
6700  *a shoulder_l - -5 to 5
6701  *a elbow_l - -5 to 5
6702  **
6703  *b Arguments:
6704  **
6705  *a link_name - name of the link
6706  *a min - value <= 0; in degrees
6707  *a max - value >= 0; in degrees
6708  **
6709  *b Returns:
6710  **
6711  ** 0 on success, -1 on failure
6712  */
6713  int set_gaze_link_azimuth_tolerance(const char* link_name,
6714  float min,
6715  float max);
6716 
6718  int get_gaze_link_azimuth_tolerance(const char* link_name,
6719  float* min,
6720  float* max);
6721 
6722  /*l
6723  *b Description:
6724  **
6725  ** The elevation equivalent of set_gaze_link_azimuth_tolerance(),
6726  **
6727  ** Valid link names and defaults:
6728  **
6729  *a orientation - -90 to 90
6730  *a back - -45 to 45
6731  *a cervical - -5 to 5
6732  *a eye_l - -1 to 1
6733  *a shoulder_l - -5 to 5
6734  *a elbow_l - -5 to 5
6735  **
6736  *b Arguments:
6737  **
6738  *a link_name - name of the link
6739  *a min - value <= 0; in degrees
6740  *a max - value >= 0; in degrees
6741  **
6742  *b Returns:
6743  **
6744  ** 0 on success, -1 on failure
6745  */
6746  int set_gaze_link_elevation_tolerance(const char* link_name,
6747  float min,
6748  float max);
6749 
6751  int get_gaze_link_elevation_tolerance(const char* link_name,
6752  float* min,
6753  float* max);
6754 
6755  /*l
6756  *b Description:
6757  **
6758  ** This function sets the maximum angular velocity that the
6759  ** back link angles may attain in pursuit of a gaze or point target.
6760  **
6761  ** Valid link names and defaults:
6762  **
6763  *a back - 30 deg/s
6764  *a cervical - 60 deg/s
6765  *a eye_l - 180 deg/s
6766  *a shoulder_l - 180 deg/s
6767  *a elbow_l - 180 deg/s
6768  **
6769  *b Arguments:
6770  **
6771  *a link_name - name of the link
6772  *a angular_vel - angular velocity in degrees per second
6773  **
6774  *b Returns:
6775  **
6776  ** 0 on success, -1 on failure
6777  */
6778  int set_gaze_link_max_angular_vel(const char* link_name, float angular_vel);
6779 
6781  int get_gaze_link_max_angular_vel(const char* link_name, float* angular_vel);
6782 
6783  /*l
6784  *b Description:
6785  **
6786  ** This function sets how much the link will make up the difference
6787  ** toward the gaze or point target.
6788  **
6789  ** The combination of this function and
6790  ** the tolerances determine how close the
6791  ** link will turn toward the gaze or point target.
6792  **
6793  ** With a smaller scale factor the link will not turn as much toward
6794  ** the target. With a higher scale factor the link will turn more
6795  ** toward the target.
6796  **
6797  ** For example, if the gaze or point target is at 60 degrees yaw in
6798  ** back coordinates and the scale factor is 0.5, the back will turn
6799  ** 30 degrees in pursuit of the target.
6800  **
6801  ** Valid link names and defaults:
6802  **
6803  *a back - 0.75
6804  *a cervical - 0.5
6805  *a eye_l - 1.0
6806  *a shoulder_l - 0.9
6807  *a elbow_l - 1.0
6808  **
6809  *b Arguments:
6810  **
6811  *a link_name - name of the link
6812  *a scale_factor - scale factor between 0 and 1
6813  **
6814  *b Returns:
6815  **
6816  ** 0 on success, -1 on failure
6817  */
6818  int set_gaze_link_scale_factor(const char* link_name, float scale_factor);
6819 
6821  int get_gaze_link_scale_factor(const char* link_name, float* scale_factor);
6822 
6823  /*l
6824  *b Description:
6825  **
6826  ** This function sets whether the character can turn the specified
6827  ** link in pursuit of the gaze target.
6828  **
6829  ** Valid link names and defaults:
6830  **
6831  *a orientation - 0
6832  *a back - 1
6833  *a cervical - 1
6834  *a eye_l - 1 if character has movable eyes, else 0
6835  *a shoulder_l - 0
6836  *a elbow_l - 0
6837  **
6838  *b Arguments:
6839  **
6840  *a link_name - name of the link
6841  *a enabled - 1 to enable, 0 to disable
6842  **
6843  *b Returns:
6844  **
6845  ** 0 on success, -1 on failure
6846  */
6847  int set_link_enabled_for_gaze(const char* link_name, int enabled);
6848 
6850  int get_link_enabled_for_gaze(const char* link_name);
6851 
6852  /*l
6853  *b Description:
6854  **
6855  ** This function sets whether the character can change its current
6856  ** posture in pursuit of the gaze target.
6857  **
6858  ** Gaze can change current posture by default.
6859  **
6860  *b Arguments:
6861  **
6862  *a enabled - 1 to enable, 0 to disable
6863  **
6864  *b Returns:
6865  **
6866  ** 0 on success, -1 on failure
6867  */
6868  int set_gaze_can_change_posture(int enabled);
6869 
6871  int get_gaze_can_change_posture();
6872 
6873  /*l
6874  *b Description:
6875  **
6876  ** This function sets whether the character can change its current
6877  ** variant in pursuit of the gaze target.
6878  **
6879  ** Gaze can change current variant by default.
6880  **
6881  *b Arguments:
6882  **
6883  *a enabled - 1 to enable, 0 to disable
6884  **
6885  *b Returns:
6886  **
6887  ** 0 on success, -1 on failure
6888  */
6889  int set_gaze_can_change_variant(int enabled);
6890 
6892  int get_gaze_can_change_variant();
6893 
6894  /*l
6895  *b Description:
6896  **
6897  ** This function sets whether the character can move the specified
6898  ** link in pursuit of the lpoint target.
6899  **
6900  ** Valid link names and defaults:
6901  **
6902  *a orientation - 0
6903  *a back - 1
6904  *a cervical - 0
6905  *a eye_l - 0
6906  *a shoulder_l - 1
6907  *a elbow_l - 1
6908  **
6909  *b Arguments:
6910  **
6911  *a link_name - name of the link
6912  *a enabled - 1 to enable, 0 to disable
6913  **
6914  *b Returns:
6915  **
6916  ** 0 on success, -1 on failure
6917  */
6918  int set_link_enabled_for_lpoint(const char* link_name, int enabled);
6919 
6921  int get_link_enabled_for_lpoint(const char* link_name);
6922 
6923  /*l
6924  *b Description:
6925  **
6926  ** This function adjusts the current azimuth and elevation offsets
6927  ** of the character's head. If a gaze is ongoing, then the nod will
6928  ** be supplemented to the gazing, and the character will attempt to
6929  ** maintain its gaze.
6930  **
6931  ** This function will have no effect on a dead character (see
6932  ** die_now() and get_dead()).
6933  **
6934  *b Arguments:
6935  **
6936  *a azimuth - rotation offset about z (vertical) axis, in degrees;
6937  *a positive rotates to character's left
6938  *a elevation - rotation offset about y (horizontal) axis, in degrees;
6939  *a positive rotates down
6940  *a duration - how long it should take to attain the new azimuth
6941  *a and elevation
6942  **
6943  *b Returns:
6944  **
6945  ** 0 on success, -1 on failure
6946  */
6947  int set_nod(float azimuth,
6948  float elevation,
6949  float duration = 0.5f);
6950 
6951  /*l
6952  *b Description:
6953  **
6954  ** This function causes the character to nod its head for the
6955  ** specified number of times over the specified duration.
6956  **
6957  ** If nod_count is 0.5, the elevation of the head will move from its
6958  ** current elevation straight to nod_elevation_out. The arguments
6959  ** nod_elevation0 and nod_elevation1 will be ignored.
6960  **
6961  ** If nod_count is 1.0, the elevation of the head will move from
6962  ** its current elevation to nod_elevation0, then to
6963  ** nod_elevation_out. The argument nod_elevation1 will be ignored.
6964  **
6965  ** If nod_count is 1.5 or greater, the nod elevation will begin at
6966  ** its current elevation, move to nod_elevation0, then alternate
6967  ** between nod_elevation0 and nod_elevation1, before finally ending
6968  ** at nod_elevation_out.
6969  **
6970  ** The head will maintain an elevation offset of nod_elevation_out
6971  ** until a new call to nod_head() or set_nod() is made.
6972  **
6973  ** This function overrides any nod settings made by the set_nod()
6974  ** function.
6975  **
6976  ** This function will have no effect on a dead character (see
6977  ** die_now() and get_dead()).
6978  **
6979  *b Arguments:
6980  **
6981  *a duration - for how long the nod should be executed
6982  *a nod_count - how many nods the character should perform;
6983  *a this will be rounded to the nearest multiple
6984  *a of 0.5
6985  *a nod_elevation0 - elevation of initial nod in degrees
6986  *a nod_elevation1 - elevation of return nod in degrees
6987  *a nod_elevation_out - ending elevation when nod is complete
6988  **
6989  *b Returns:
6990  **
6991  ** 0 on success, -1 on failure
6992  **
6993  *b Available as Decision Bead/Event
6994  */
6995  int nod_head(float duration,
6996  float nod_count,
6997  float nod_elevation0 = 15.0f,
6998  float nod_elevation1 = 0.0f,
6999  float nod_elevation_out = 0.0f);
7000 
7001  /*l
7002  *b Description:
7003  **
7004  ** This function is similar to nod_head(), except the direction
7005  ** of head movement is side to side rather than up and down.
7006  ** See the nod_head() function for a detailed description of usage.
7007  **
7008  ** This function will have no effect on a dead character (see
7009  ** die_now() and get_dead()).
7010  **
7011  *b Arguments:
7012  **
7013  *a duration - for how long the shake should be executed
7014  *a shake_count - how shakes the character should perform; this
7015  *a will be rounded to the nearest multiple of
7016  *a 0.5
7017  *a shake_azimuth0 - azimuth of initial shake in degrees
7018  *a shake_azimuth1 - azimuth of return shake in degrees
7019  *a shake_azimuth_out - ending azimuth when shake is complete
7020  **
7021  *b Returns:
7022  **
7023  ** 0 on success, -1 on failure
7024  **
7025  *b Available as Decision Bead/Event
7026  */
7027  int shake_head(float duration,
7028  float shake_count,
7029  float shake_azimuth0 = -20.0f,
7030  float shake_azimuth1 = 20.0f,
7031  float shake_azimuth_out = 0.0f);
7032 
7033  /*l
7034  *b Returns:
7035  **
7036  ** current nod azimuth setting; see set_nod(), nod_head(), and
7037  ** shake_head()
7038  */
7039  float get_nod_azimuth();
7040 
7041  /*l
7042  *b Returns:
7043  **
7044  ** current nod elevation setting; see set_nod(), nod_head(), and
7045  ** shake_head()
7046  */
7047  float get_nod_elevation();
7048 
7049 
7050 /*****************************************************************************/
7071  /*l
7072  *b Description:
7073  **
7074  ** This function sets the current desired azimuth and elevation of
7075  ** the character's aim. The angles are in character-local
7076  ** coordinates. Zero values mean straight ahead and level.
7077  ** Aiming will continue until end_aim() is called.
7078  **
7079  ** This function effectively calls aim_at_angle_local(), with a
7080  ** distance of 10000 meters, and is_new_aim set to 1.
7081  **
7082  ** This function will have no effect on a dead character (see
7083  ** die_now() and get_dead()).
7084  **
7085  *b Arguments:
7086  **
7087  *a azimuth - rotation about z (vertical) axis, in degrees;
7088  *a positive rotates to character's left
7089  *a elevation - rotation about y (horizontal) axis, in degrees;
7090  *a positive rotates down
7091  **
7092  *b Returns:
7093  **
7094  ** 0 on success, -1 on failure
7095  */
7096  int set_aim(float azimuth, float elevation);
7097 
7098  /*l
7099  *b Description:
7100  **
7101  ** This function sets the current azimuth, elevation, and
7102  ** distance of the character's aim. A fixed point in 3D space is
7103  ** then found using the two angles and the given distance from
7104  ** the character's idealized position. Angles are given with
7105  ** respect to the DI-Guy global coordinate system.
7106  **
7107  ** See set_position() for a description of the coordinate
7108  ** system.
7109  **
7110  ** Aiming will continue until end_aim() is called.
7111  **
7112  ** This function will have no effect on a dead character (see
7113  ** die_now() and get_dead()).
7114  **
7115  *b Arguments:
7116  **
7117  *a azimuth - rotation in degrees about up (vertical) axis;
7118  *a begins at 0 at the positive X axis of the DI-Guy
7119  *a coordinate system and proceeds counter-clockwise
7120  *a elevation - rotation in degrees about horizontal axis; positive
7121  *a value rotates down
7122  *a distance - distance in meters from the idealized position of the
7123  *a character to the aim target; positive values only,
7124  *a typically this is a large value (e.g. 10,000 meters)
7125  *a is_new_aim - set to 1 if this is a new aim, for jumping to a
7126  *a new target;
7127  *a set to 0 if this is continuing an already
7128  *a started aim, for tracking an existing target
7129  **
7130  *b Returns:
7131  **
7132  ** 0 on success, -1 on failure
7133  */
7134  int aim_at_angle(float azimuth,
7135  float elevation,
7136  float distance,
7137  int is_new_aim = 1);
7138 
7139  /*l
7140  *b Description:
7141  **
7142  ** This function is identical to aim_at_angle() except that the
7143  ** angles are relative to the character's frame of reference. These
7144  ** relative angles will be maintained even if the character rotates.
7145  **
7146  ** Use get_position() to learn the idealized position. The
7147  ** distance is between the idealized position of the character
7148  ** and the fixation point. Aiming will continue until end_aim()
7149  ** is called.
7150  **
7151  ** This function will have no effect on a dead character (see
7152  ** die_now() and get_dead()).
7153  */
7154  int aim_at_angle_local(float azimuth,
7155  float elevation,
7156  float distance,
7157  int is_new_aim = 1);
7158 
7159  /*l
7160  *b Description:
7161  **
7162  ** This function is identical to aim_at_angle() and aim_at_angle_local(),
7163  ** but includes velocity that will modify the angles every frame.
7164  ** This can be useful in networked simulations where targeting velocity is published.
7165  **
7166  ** This function will have no effect on a dead character (see
7167  ** die_now() and get_dead()).
7168  */
7169  int aim_at_angle_with_velocity(float azimuth, float elevation, float az_vel, float el_vel, int local, int is_new_aim = 1);
7170 
7171  /*l
7172  *b Description:
7173  **
7174  ** This function sets the current fixation point of the
7175  ** character's aim. Point coordinates are given in meters in the
7176  ** DI-Guy global coordinate system.
7177  **
7178  ** The function uses default aim behavior settings. Aiming will
7179  ** continue until end_aim() is called.
7180  **
7181  ** This function will have no effect on a dead character (see
7182  ** die_now() and get_dead()).
7183  **
7184  *b Arguments:
7185  **
7186  *a tx, ty, tz - position in meters from the DI-Guy global
7187  *a origin
7188  *a is_new_aim - set to 1 if this is a new aim;
7189  *a set to 0 if this is continuing an already started aim
7190  **
7191  *b Returns:
7192  **
7193  ** 0 on success, -1 on failure
7194  */
7195  int aim_at_point(float x, float y, float z, int is_new_aim = 1);
7196 
7197  /*l
7198  *b Description:
7199  **
7200  ** This function is identical to aim_at_point() except that the
7201  ** coordinates are relative to the character, in its own coordinate
7202  ** system. Use get_position() to learn the idealized position of the
7203  ** character if necessary.
7204  **
7205  ** This function will have no effect on a dead character (see
7206  ** die_now() and get_dead()).
7207  */
7208  int aim_at_point_local(float x, float y, float z, int is_new_aim = 1);
7209 
7210  /*l
7211  *b Description:
7212  **
7213  ** This function effectively does an aim_at_point() each tick.
7214  ** The point to be aimed at is updated each tick to be the position
7215  ** of the specified link on the specified character.
7216  **
7217  ** This function will have no effect on a dead character (see
7218  ** die_now() and get_dead()).
7219  **
7220  *b Arguments:
7221  **
7222  *a target_character_name - name of the character to be
7223  *a aimed at
7224  *a target_character_link_name - link on the character that should
7225  *a be aimed at; pass NULL or "" to
7226  *a aim at the position link of the
7227  *a character. If NULL is passed,
7228  *a function will make best effort to
7229  *a choose a character-appropriate link
7230  *a to target.
7231  *a offset_tx, offset_ty, offset_tz - offset onto the link, in meters
7232  **
7233  *b Returns:
7234  **
7235  ** 0 on success, -1 on failure
7236  **
7237  *b Available as Decision Bead/Event
7238  **
7239  *b C++ Example:
7240  **
7241  *e // aim at the head of character "soldier-1".
7242  *e ch->aim_at_character("soldier-1",
7243  *e "cervical",
7244  *e 0.0,
7245  *e 0.0,
7246  *e 0.0);
7247  */
7248  int aim_at_character(const char* target_character_name,
7249  const char* target_character_link_name = NULL,
7250  float offset_tx = 0.0f,
7251  float offset_ty = 0.0f,
7252  float offset_tz = 0.0f);
7253 
7254  /*l
7255  *b Description:
7256  **
7257  ** This function terminates aiming started by the set_aim(),
7258  ** aim_at_point(), aim_at_point_local(), aim_at_angle(),
7259  ** aim_at_angle_local(), and aim_at_character() functions.
7260  */
7261  void end_aim();
7262 
7264  const char * get_aim_at_character();
7265 
7267  float get_aim_azimuth();
7268 
7270  float get_aim_elevation();
7271 
7272  /*l
7273  *b Description:
7274  **
7275  ** This function returns values that can be used to compute the
7276  ** character's weapon's trajectory, i.e. the mathematical ray that
7277  ** comes out of the end of the barrel.
7278  **
7279  *b Returns:
7280  **
7281  ** 1 if the character is aiming, 0 if not
7282  **
7283  *b Arguments:
7284  **
7285  *a muzzle_x, muzzle_y, muzzle_z - position of muzzle in meters from
7286  *a the origin
7287  *a far_x, far_y, far_z - position of end target in meters from the
7288  *a origin
7289  **
7290  ** Pass NULL for any values that are not needed.
7291  ** Note: values will be zero if the character isn't currently aiming
7292  */
7293  int get_aim_trajectory(float* muzzle_x, float* muzzle_y, float* muzzle_z,
7294  float* far_x, float* far_y, float* far_z);
7295 
7296  /*l
7297  *b Description:
7298  **
7299  ** Not all actions of a character will be affected by aim
7300  ** commands. This function returns 1 if this character
7301  ** is currently in an aim-able action.
7302  **
7303  *b Returns:
7304  **
7305  ** 1 if current action is aim-able; 0 if not
7306  */
7307  int get_aim_is_possible();
7308 
7309  /*l
7310  *b Returns:
7311  **
7312  ** 1 if the aim is acquired, 0 if not
7313  */
7314  int get_aim_is_acquired();
7315 
7316  /*l
7317  *b Returns:
7318  **
7319  ** 1 if all links participating in the aim have reached a
7320  ** relatively steady state, 0 if not, -1 on error
7321  */
7322  int get_aim_is_steady();
7323 
7324 
7325  /*l
7326  *b Returns:
7327  **
7328  ** 1 if character is currently aiming, 0 if not
7329  */
7330  int get_is_aiming();
7331 
7332 
7333  /******************************************************
7334  **
7335  *3 Aim Algorithm 8 Parameters
7336  **
7337  ** This aim algorithm works by adjusting the aiming character's pose
7338  ** such that the difference between the current aim angles and the
7339  ** desired aim angles is decreased each scenario tick.
7340  **
7341  ** How much of that difference that is made up each frame is
7342  ** determined by the factor parameters. The difference between the
7343  ** desired aim angles and the current aim angles, multiplied by a
7344  ** calculated factor, is added to the current aim angles each frame.
7345  ** This causes the aim to "home in" on the desired aim angles.
7346  **
7347  ** For example, if for each frame the calculated factor is 0.5, half
7348  ** of the difference between the desired and current aim angles is
7349  ** made up.
7350  **
7351  ** Unless otherwise specified, all functions callable from:
7352  **
7353  *- - C++
7354  *- - Script
7355  */
7356 
7357  /*l
7358  *b Description:
7359  **
7360  ** This function sets the steady-state factor that is used once
7361  ** an aim is no longer considered "new".
7362  **
7363  ** See the function set_aim_param_new_aim_duration() for information
7364  ** on when an aim is considered new, and how the effective acquire
7365  ** is calculated from this steady-state acquire factor and the
7366  ** new aim factor.
7367  **
7368  *b Arguments:
7369  **
7370  *a factor - unitless value between 0 and 1; default is 0.6
7371  */
7372  void set_aim_param_acquire_factor(float factor);
7373 
7374  /*l
7375  *b Returns:
7376  **
7377  ** the current aim acquire factor parameter
7378  */
7379  float get_aim_param_acquire_factor();
7380 
7381  /*l
7382  *b Description:
7383  **
7384  ** This function sets the factor that is used when an aim is
7385  ** considered new.
7386  **
7387  ** See the function set_aim_param_new_aim_duration() for information
7388  ** on when an aim is considered new, and how the effective acquire
7389  ** is calculated from this new aim factor and the steady-state acquire
7390  ** factor.
7391  **
7392  *b Arguments:
7393  **
7394  *a factor - unitless value between 0 and 1; default is 0.05
7395  */
7396  void set_aim_param_new_aim_factor(float factor);
7397 
7399  float get_aim_param_new_aim_factor();
7400 
7401  /*l
7402  *b Description:
7403  **
7404  ** This function sets how long an aim is considered "new".
7405  **
7406  ** When an aim is brand-new, the effective acquire factor is equal
7407  ** to the new aim factor as set by set_aim_param_new_aim_factor().
7408  ** When the new aim duration has expired, the effective acquire factor
7409  ** is equal to the steady-state acquire factor as set by
7410  ** set_aim_param_acquire_factor(). In between, the effective acquire
7411  ** factor moves smoothly between the two.
7412  **
7413  ** For example, say that the new aim factor is 0.1, the acquire factor
7414  ** is 0.5, and the new aim duration is 0.2 seconds.
7415  ** If a new aim is started, say by a call to aim_at_angle_local(),
7416  ** the effective acquire factor of the first frame will be 0.1. Over
7417  ** the next 0.2 seconds, the effective acquire factor will smoothly
7418  ** ramp up to 0.5, where it will stay until the aim is acquired.
7419  **
7420  *b Arguments:
7421  **
7422  *a duration - how long, in seconds, a new aim should be considered
7423  *a new; default is 1 second
7424  */
7425  void set_aim_param_new_aim_duration(float duration);
7426 
7428  float get_aim_param_new_aim_duration();
7429 
7430  /*l
7431  *b Description:
7432  **
7433  ** This function sets the maximum factor that can be used for any
7434  ** single frame for aim convergence attempts.
7435  **
7436  ** See set_aim_param_acquire_factor() for a discussion of why setting
7437  ** this too close to 1 is not recommended.
7438  **
7439  *b Arguments:
7440  **
7441  *a factor - unitless value between 0 and 1; default is 0.95
7442  */
7443  void set_aim_param_max_per_frame_adj_factor(float factor);
7444 
7446  float get_aim_param_max_per_frame_adj_factor();
7447 
7448  /*l
7449  *b Description:
7450  **
7451  ** This function sets how close the current aim azimuth must be to
7452  ** the desired aim azimuth in order for the aim to be considered
7453  ** acquired.
7454  **
7455  ** Note that the aim isn't fully acquired until both azimuth and
7456  ** elevation are acquired.
7457  **
7458  ** Setting this value too close to 0 will result in the aim never
7459  ** being acquired.
7460  **
7461  *b Arguments:
7462  **
7463  *a range - how close, in degrees, the azimuth must be for the
7464  *a aim to be acquired; default is 0.5 degrees
7465  */
7466  void set_aim_param_azimuth_acquired_range(float range);
7467 
7469  float get_aim_param_azimuth_acquired_range();
7470 
7471  /*l
7472  *b Description:
7473  **
7474  ** This function sets how close the current aim elevation must be to
7475  ** the desired aim elevation in order for the aim to be considered
7476  ** acquired.
7477  **
7478  ** Note that the aim isn't fully acquired until both azimuth and
7479  ** elevation are acquired.
7480  **
7481  ** Setting this value too close to 0 will result in the aim never
7482  ** being acquired.
7483  **
7484  *b Arguments:
7485  **
7486  *a range - how close, in degrees, the elevation must be for the
7487  *a aim to be acquired; default is 1.0 degrees
7488  */
7489  void set_aim_param_elevation_acquired_range(float range);
7490 
7492  float get_aim_param_elevation_acquired_range();
7493 
7494  /*l
7495  *b Description:
7496  **
7497  ** This function attempts to have the character reach its desired
7498  ** aim angles instantly, every frame.
7499  **
7500  ** Set enabled to 0 to disable instant aim convergence.
7501  **
7502  */
7503  void set_aim_converge_every_frame( int enabled );
7504 
7506  int get_aim_converge_every_frame();
7507 
7510  int set_aim_variable_interpolation_time(float time);
7511  float get_aim_variable_interpolation_time();
7512 
7513 /*****************************************************************************/
7517  const char* get_aim_at_link();
7519 
7521  int get_aim_at_link_offset(float* offset_x, float* offset_y, float* offset_z);
7522 
7524  const char* get_gaze_at_link();
7525 
7527  int get_gaze_at_link_offset(float* offset_x, float* offset_y, float* offset_z);
7528 
7529 /*****************************************************************************/
7539  /*l
7540  *b Description:
7541  **
7542  ** This function causes a character to fire his weapon.
7543  **
7544  ** Different weapons have different "munition types", which specify,
7545  ** among other things, the sound to be played, the network info to be
7546  ** sent, and muzzle flash effect. See
7547  ** get_weapon_muzzle_munition_type() for more information on munition
7548  ** types.
7549  **
7550  ** If the weapon fires live rounds (as set by
7551  ** set_weapon_fires_live_rounds()) this function also computes a
7552  ** bullet trajectory, perhaps hitting and killing another character.
7553  **
7554  ** This function will have no effect on a dead character (see
7555  ** die_now() and get_dead()).
7556  **
7557  *b Returns:
7558  **
7559  ** 0 on success, -1 on failure
7560  **
7561  *b Available as Decision Bead/Event
7562  */
7563  int fire_weapon(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
7564 
7565  /*l
7566  *b Description:
7567  **
7568  ** This function causes a character to fire his weapon the
7569  ** specified number of times. This causes a muzzle flash and
7570  ** the weapon's sound (if any) to be played.
7571  **
7572  ** The sound played will be one of, in order:
7573  **
7574  *- - the passed override_sound_name, or
7575  *- - the sound set by set_weapon_sound_override(), or
7576  *- - the default weapon sound based on the character's appearance
7577  **
7578  ** If the weapon fires live rounds (as set by
7579  ** set_weapon_fires_live_rounds()), this function also computes a
7580  ** trajectory for each round, perhaps hitting and killing
7581  ** another character.
7582  **
7583  ** This function will have no effect on a dead character (see
7584  ** die_now() and get_dead()).
7585  **
7586  *b Arguments:
7587  **
7588  *a count - number of times weapon should be fired
7589  *a override_sound_name - override sound to be played
7590  *a dt - time between firings if count > 1
7591  *a muzzle - muzzle on which flash should appear
7592  **
7593  *b Returns:
7594  **
7595  ** 0 on success, -1 on failure
7596  **
7597  *b Available as Decision Bead/Event
7598  */
7599  int fire_weapon_n_times(int count,
7600  float dt = 0.2f,
7601  const char* override_sound_name = NULL,
7603 
7604  /*l
7605  *b Description:
7606  **
7607  ** Fires a bullet at point (x, y) from the camera, using this
7608  ** character as the attacker.
7609  **
7610  *i Currently OpenGL only.
7611  **
7612  ** This function will have no effect on a dead character (see
7613  ** die_now() and get_dead()).
7614  **
7615  *b Returns:
7616  **
7617  ** number of hits
7618  */
7619  int fire_screen_space_bullet(diguyView* view, float x, float y);
7620 
7621  /*l
7622  *b Returns:
7623  **
7624  ** number of times weapon has been fired from specified muzzle
7625  **
7626  *b Available as Decision Bead/Event
7627  */
7628  int get_weapon_fire_count(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
7629 
7630  /*l
7631  *b Description:
7632  **
7633  ** This function sets the default muzzle that will flash when
7634  ** the character fires its weapon due to a call to fire_weapon()
7635  ** or fire_weapon_n_times().
7636  **
7637  ** The default value is DIGUY_MUZZLE_DEFAULT.
7638  **
7639  *b Arguments:
7640  **
7641  *a muzzle - the muzzle that will flash; muzzle 1 is common
7642  **
7643  *b Returns:
7644  **
7645  ** 0 on success, -1 on failure
7646  */
7647  int set_default_weapon_muzzle(diguyMuzzle muzzle);
7648 
7649  /*l
7650  *b Returns:
7651  **
7652  ** current default weapon muzzle that flashes when the character's
7653  ** weapon is fired; see set_default_weapon_muzzle()
7654  */
7655  diguyMuzzle get_default_weapon_muzzle();
7656 
7657  /*l
7658  *b Description:
7659  **
7660  ** When the character fires its weapon, the results depend on the
7661  ** munition type of the muzzle fired from. Munition types specify,
7662  ** among other things:
7663  **
7664  *- - sound played
7665  *- - muzzle flash effect
7666  *- - network data sent (DIS septet)
7667  *- - detonation effect
7668  *- - detonation radius
7669  *- - etc.
7670  **
7671  ** Default munition types for the each muzzle are set automatically
7672  ** when the character's appearance is set. The munition type of the
7673  ** weapon can be overridden by calling
7674  ** set_weapon_munition_type_override().
7675  **
7676  ** Current munition types include:
7677  **
7678  *- - m16
7679  *- - m4
7680  *- - m60
7681  *- - m240
7682  *- - m249
7683  *- - m9
7684  *- - hand_gun
7685  *- - 50cal
7686  *- - m256
7687  *- - ak47
7688  *- - pk74
7689  *- - dragunov
7690  *- - sa80
7691  *- - rpg
7692  *- - m203
7693  *- - 40mm_hedp
7694  *- - javelin
7695  *- - stinger
7696  *- - at4
7697  *- - sa7
7698  *- - molotov_cocktail
7699  *- - 60mm_mortar
7700  *- - 82mm_mortar
7701  *- - 155mm_artillery
7702  *- - IED_mortar
7703  *- - VBIED
7704  *- - m242
7705  *- - 120mm
7706  *- - 125mm
7707  *- - ced
7708  *- - pepper_spray
7709  **
7710  *b Returns:
7711  **
7712  ** munition type of specified muzzle
7713  */
7714  const char* get_weapon_muzzle_munition_type(diguyMuzzle muzzle);
7715 
7717  const char* get_default_muzzle_munition_type();
7718 
7719  /*l
7720  *b Description:
7721  **
7722  ** This function allows the default munition type to be overridden.
7723  ** The default value is NULL (don't override default munition type).
7724  **
7725  *b Arguments:
7726  **
7727  *a munition_type - name of a munition type
7728  **
7729  *b Returns:
7730  **
7731  ** 0 on success, -1 on failure
7732  */
7733  int set_weapon_munition_type_override(const char* munition_type);
7734 
7736  const char* get_weapon_munition_type_override();
7737 
7738  /*l
7739  *b Description:
7740  **
7741  ** This function sets whether the character's weapons fire live
7742  ** rounds. If so, when fire_weapon() and fire_weapon_n_times() are
7743  ** called the trajectory of the bullet will be calculated and checked
7744  ** against characters in the scenario.
7745  **
7746  ** The default value is 1.
7747  **
7748  *b Arguments:
7749  **
7750  *a weapon_fires_live_rounds - set to 1 for live rounds; set to 0
7751  *a for "blanks"
7752  **
7753  *b Returns:
7754  **
7755  ** 0 on success, -1 on failure
7756  **
7757  *b Available as Decision Bead/Event
7758  */
7759  int set_weapon_fires_live_rounds(int weapon_fires_live_rounds);
7760 
7761  /*l
7762  *b Returns:
7763  **
7764  ** current setting of whether weapon fires live rounds or blanks; see
7765  ** set_weapon_fires_live_rounds()
7766  **
7767  *b Available as Decision Bead/Event
7768  */
7769  int get_weapon_fires_live_rounds();
7770 
7771  /*l
7772  *b Description:
7773  **
7774  ** A weapon sound is played when the character fires its weapon
7775  ** due to a call to fire_weapon() or fire_weapon_n_times().
7776  ** The sound that is played is generally derived from the weapon's
7777  ** munition type, which can be different for each muzzle.
7778  **
7779  ** This function overrides the default sound that will be played.
7780  ** Note that this overrides the sound for all muzzles.
7781  **
7782  ** The default value is NULL (don't override default sound).
7783  **
7784  ** To *not* play a sound at all, set the weapon sound gain override
7785  ** to 0.
7786  **
7787  *b Arguments:
7788  **
7789  *a sound - name of a sound defined in the scenario;
7790  *a pass NULL to specify that default should be played
7791  **
7792  *b Returns:
7793  **
7794  ** 0 on success, -1 on failure
7795  */
7796  int set_weapon_sound_override(const char* sound_name);
7797 
7798  /*l
7799  *b Description:
7800  **
7801  ** The function returns the current weapon sound override, if one
7802  ** is set; see set_weapon_sound_override().
7803  **
7804  ** This function will not return NULL. The empty string ("") is
7805  ** returned if a weapon sound override is not set.
7806  **
7807  *b Returns:
7808  **
7809  ** name of weapon sound override
7810  */
7811  const char* get_weapon_sound_override();
7812 
7813  /*l
7814  *b Description:
7815  **
7816  ** This function overrides the default gain on the sound played
7817  ** due to a call to fire_weapon() or fire_weapon_n_times().
7818  **
7819  ** Pass 1.0 to use the sound's default amplitude. Lower numbers
7820  ** decrease volume, higher numbers increase volume.
7821  **
7822  ** Pass 0.0 to completely disable playing of weapon sound.
7823  **
7824  ** The default value is 3.0.
7825  **
7826  ** See set_weapon_sound_override().
7827  **
7828  *b Arguments:
7829  **
7830  *a sound_gain - amount by which to change sound volume
7831  **
7832  *b Returns:
7833  **
7834  ** 0 on success, -1 on failure
7835  */
7836  int set_weapon_sound_gain_override(float gain);
7837 
7839  float get_weapon_sound_gain_override();
7840 
7841  /*l
7842  *b Description:
7843  **
7844  ** This function provides aiming assistance by making it possible for
7845  ** roughly-aimed weapons to hit targets. When spread is nonzero,
7846  ** fire_weapon searches for a target within a conical space centered
7847  ** on the muzzle. Within this cone, the live character within weapon
7848  ** range, and with the smallest angular deviation from the weapon, is
7849  ** chosen, by default, as the target. Other function calls may alter
7850  ** this aiming behavior, making it aim only at enemy targets, for
7851  ** example, or making it prefer close targets to far ones.
7852  **
7853  *b Arguments:
7854  **
7855  *a spread - angular deviation from weapon muzzle within which a
7856  *a target will be found
7857  **
7858  ** Spread values above 145 are suicidal (character can shoot himself).
7859  ** 90 is the highest sensible value, which covers everything ahead
7860  ** of the weapon muzzle. A value of 0 is the default, meaning that
7861  ** only targets in line with the muzzle are hit.
7862  */
7863  void set_weapon_spread(float spread);
7864 
7865  /*l
7866  *b Description:
7867  **
7868  ** This function affects how targets are chosen when
7869  ** the character's weapon_spread is nonzero. Only
7870  ** characters more than near_range meters away from the muzzle
7871  ** will be fired upon. Characters which are closer than
7872  ** near_range meters will not be fired upon.
7873  **
7874  ** This value does not affect weapon behavior when weapon_spread
7875  ** is zero.
7876  **
7877  ** If this function is never called for a character, it is as if
7878  ** the function had been called with a value of zero.
7879  **
7880  *b Arguments:
7881  **
7882  *a near_range - distance closer than which no character will be
7883  *a targeted
7884  */
7885  void set_weapon_near_range(float near_range);
7886  float get_weapon_near_range();
7887 
7888  /*l
7889  *b Description:
7890  **
7891  ** This function sets the range of the character's
7892  ** weapon.
7893  **
7894  ** If this function is never called for a character, it is as if
7895  ** the function had been called with a value of 500.0.
7896  **
7897  *b Arguments:
7898  **
7899  *a far_range - range of the weapon in meters
7900  */
7901  void set_weapon_far_range(float far_range);
7902  float get_weapon_far_range();
7903 
7904  /*l
7905  *b Description:
7906  **
7907  ** This function sets a weapon's ratio of hits to fired rounds. A
7908  ** value of 1.0 (the default) means the weapon will hit everything it
7909  ** is aimed at. Values less than 1.0 cause the weapon to
7910  ** probabilistically miss targets, even when perfectly aimed at them.
7911  ** A value of zero means the weapon doesn't hit anything, even if it
7912  ** is perfectly aimed. A value of 0.5 will hit half of the time.
7913  */
7914  void set_weapon_hit_ratio(float hit_ratio);
7915 
7916  /*l
7917  *b Description:
7918  **
7919  ** This function sets the number of potential impacts a fired round
7920  ** can have. The default is 1. Specifying more than 1 means the
7921  ** round will completely go through objects, triggering a
7922  ** CALLBACK_ID_IMPACT callback each time, until the maximum number of
7923  ** impacts has been reached.
7924  */
7925  void set_weapon_max_impacts(int val);
7926 
7927  /*l
7928  *b Returns:
7929  **
7930  ** state of accessory1
7931  */
7932  int get_accessory1_state();
7933 
7934  /*l
7935  *b Returns:
7936  **
7937  ** state of the character's rifle
7938  */
7939  int get_rifle_state();
7940 
7941  /*l
7942  *b Description
7943  **
7944  ** This function sets whether the projectiles of certain appearances'
7945  ** weapons (such as rocket launchers and RPGs) are visible. Note that
7946  ** most weapons do not have visible projectiles and this function will
7947  ** therefore have no effect.
7948  **
7949  *b Arguments:
7950  **
7951  *a muzzle - which muzzle's projectile should be shown/hidden
7952  *a is_visible - pass 1 to show, pass 0 to hide
7953  **
7954  *b Returns:
7955  **
7956  ** 0 on success, -1 on failure
7957  */
7958  int set_weapon_projectile_is_visible(diguyMuzzle muzzle, int is_visible);
7959 
7960  /*l
7961  *b Description
7962  **
7963  ** This function returns the most recent setting of
7964  ** set_weapon_projectile_is_visible().
7965  **
7966  *b Arguments:
7967  **
7968  *a muzzle - which muzzle's projectile should be queried
7969  **
7970  *b Returns:
7971  **
7972  ** 1 if visible, 0 if not
7973  */
7974  int get_weapon_projectile_is_visible(diguyMuzzle muzzle);
7975 
7976  /*l
7977  *b Description:
7978  **
7979  ** Retrieves the position and direction of the character's weapon.
7980  **
7981  *b Arguments:
7982  **
7983  *a muzzle_tx, muzzle_ty, muzzle_tz - muzzle position, and beginning
7984  *a of aim vector
7985  *a end_pt_tx, end_pt_ty, end_pt_tz - end point of aim vector
7986  *a muzzle_rz, muzzle_rx, muzzle_ry - orientation of muzzle in degrees
7987  *a muzzle - the muzzle for which the aim vector is needed
7988  *a in_character_local_coordinates - pass 0 for values in world
7989  *a coordinates (the default), 1 for values in character-local
7990  *a coordinates
7991  **
7992  ** The muzzle position and end point are in meters from the origin
7993  ** (if using world coordinates) or in meters from the character's
7994  ** position (if using character-local coordinates).
7995  **
7996  ** The distance of the end point from the muzzle position should
7997  ** be the weapon's far range, set by set_weapon_far_range().
7998  **
7999  ** Pass NULL for any values that are not needed.
8000  **
8001  ** *Note:* The muzzle argument is currently not used, and is present
8002  ** for future implementation.
8003  **
8004  *b Returns:
8005  **
8006  ** 0 on success, -1 on failure
8007  */
8008  int get_weapon_aim_vector(float* muzzle_tx, float* muzzle_ty, float* muzzle_tz,
8009  float* end_pt_tx = NULL, float* end_pt_ty = NULL, float* end_pt_tz = NULL,
8010  float* muzzle_rz = NULL, float* muzzle_rx = NULL, float* muzzle_ry = NULL,
8011  int in_character_local_coordinates = 0,
8013 
8014  /*l
8015  *b Description
8016  **
8017  ** This function returns the link the passed muzzle is associated
8018  ** with. For example, soldier rifle muzzles are attached to the
8019  ** "rifle_joint" link.
8020  **
8021  ** Call get_muzzle_offset() to get the offset of the muzzle on this
8022  ** link.
8023  **
8024  *b Arguments:
8025  **
8026  *a muzzle - muzzle of interest
8027  **
8028  *b Returns:
8029  **
8030  ** name of link, or NULL if the character doesn't have the specified
8031  ** muzzle
8032  */
8033  const char* get_muzzle_link(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
8034 
8035  /*l
8036  *b Description
8037  **
8038  ** This function returns the offset of the muzzle from the link it
8039  ** is attached to as returned by get_muzzle_link().
8040  **
8041  *b Arguments:
8042  **
8043  *a muzzle - muzzle of interest
8044  *a offset_x, offset_y, offset_z - variables in which to return results
8045  **
8046  *b Returns:
8047  **
8048  ** 0 on success, -1 on failure
8049  */
8050  int get_muzzle_offset(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT,
8051  float* offset_x = NULL,
8052  float* offset_y = NULL,
8053  float* offset_z = NULL);
8054 
8055  /*l
8056  *b Description
8057  **
8058  ** This function sets the highest horizontal error possible when the
8059  ** weapon is fired. If non-0, a random horizontal error angle will
8060  ** be computed and added to the weapon's horizontal aim angle.
8061  **
8062  *b Arguments:
8063  **
8064  *a h_error - highest possible horizontal error
8065  **
8066  *b Returns:
8067  **
8068  ** 0 on success, -1 on failure
8069  */
8070  int set_weapon_max_azimuth_error(float h_error);
8071 
8073  float get_weapon_max_azimuth_error();
8074 
8075  /*l
8076  *b Description:
8077  **
8078  ** Similar to set_weapon_max_azimuth_error(), but for vertical aim.
8079  */
8080  int set_weapon_max_elevation_error(float v_error);
8081 
8083  float get_weapon_max_elevation_error();
8084 
8085  /*l
8086  *b Description
8087  **
8088  ** This function sets whether tracer effects will be shown when
8089  ** the weapon is fired. Not all weapons will support this effect.
8090  **
8091  *b Arguments:
8092  **
8093  *a enabled - pass 1 to enable, 0 to disable
8094  **
8095  *b Returns:
8096  **
8097  ** 0 on success, -1 on failure
8098  */
8099  int set_weapon_tracers_enabled(int enabled);
8100 
8102  int get_weapon_tracers_enabled();
8103 
8104  /*l
8105  *b Returns:
8106  **
8107  ** number of rounds until next tracer
8108  */
8109  int get_weapon_rounds_until_tracer(diguyMuzzle muzzle);
8110 
8111 
8112  /*l
8113  *b Description:
8114  **
8115  ** Similar to diguyScenario::trigger_detonation(), but detonation
8116  ** occurs at character's position.
8117  **
8118  *b Arguments:
8119  **
8120  *a munition_name - name of the munition to detonate
8121  *a attacker_name - this MUST be specified if the detonation is being
8122  *a broadcast over the network
8123  *a radius_override - defaults to the data in the munition config file
8124  *a broadcast_on_network - pass 0 to not broadcast detonation on DIS
8125  *a network
8126  **
8127  ** Note: Overriding the detonation radius will NOT work on broadcast
8128  ** detonations since the override value is not transmitted.
8129  */
8130  int trigger_detonation_on_character(const char* munition_name,
8131  const char* attacker_name = NULL,
8132  float radius_override = -1.0f,
8133  int broadcast_on_network = 1);
8134 
8135 
8136 /*****************************************************************************/
8147  /*l
8148  *b Description:
8149  **
8150  ** This function changes the face of the character to reflect the
8151  ** specified user-defined named facial expression.
8152  **
8153  ** Currently affects only "facefx" appearances.
8154  **
8155  *b Arguments:
8156  **
8157  *a facex_name - name of face expression to be applied
8158  *a blend_duration - how long (in seconds) to take to change the face
8159  *a strength - a multiplier between 0 and 1 on the expression
8160  **
8161  ** Face expressions available by default in new scenarios are:
8162  **
8163  *- - Neutral
8164  *- - Smile_cl
8165  *- - Trust
8166  *- - Sad
8167  *- - Mad
8168  *- - Distrust
8169  *- - Conniving
8170  *- - Smile
8171  *- - BrowsDown
8172  *- - BrowsUp
8173  **
8174  ** New face expressions can be added using the
8175  ** diguyScenario::create_face_expression() function.
8176  **
8177  *b Returns:
8178  **
8179  ** 0 on success, -1 on failure
8180  **
8181  *b Available as Decision Bead/Event
8182  **
8183  *b C++ Example:
8184  **
8185  *e diguyCharacter* ch = scenario->get_character_at_index(0);
8186  *e
8187  *e // take one second to get mad
8188  *e ch->set_face_expression("Mad", 1.0);
8189  */
8190  int set_face_expression(const char* facex_name, float blend_duration, float strength = 1.0f);
8191 
8192  /*l
8193  *b Description:
8194  **
8195  ** This function sets the current azimuth and elevation of the
8196  ** character's eyes.
8197  **
8198  ** Currently affects only "facefx" appearances.
8199  **
8200  *b Arguments:
8201  **
8202  *a azimuth - rotation about up (vertical) axis, in degrees;
8203  *a positive rotates to character's left
8204  *a elevation - rotation about forward (horizontal) axis, in degrees;
8205  *a positive rotates down
8206  *a blend_time - how long to take to reach new orientation
8207  **
8208  *b Returns:
8209  **
8210  ** 0 on success, -1 on failure
8211  **
8212  */
8213  int set_orientation_eyes(float azimuth,
8214  float elevation,
8215  float blend_time = 0.0f);
8216 
8217  /*l
8218  *b Description:
8219  **
8220  ** This function gets the current azimuth and elevation of the
8221  ** character's eyes. It currently doesn't take blending into account.
8222  **
8223  ** Currently affects only "facefx" appearances.
8224  **/
8225  int get_orientation_eyes(float* azimuth, float* elevation);
8226 
8227  /*l
8228  *b Description:
8229  **
8230  ** Sets how open the eyes are. The eyes will stay at this level
8231  ** indefinitely. To get automatic blinking behavior, call blink().
8232  **
8233  *b Arguments:
8234  **
8235  *a droop_amount - 1 = eyes closed, 0 = eyes open, 0.5 = half open
8236  **
8237  *b Returns:
8238  **
8239  ** 0 on success, -1 on failure
8240  **
8241  *b Available as Decision Bead/Event
8242  */
8243  int set_eye_droop(float droop_amount, float blend_time = 0.0f);
8244 
8246  float get_eye_droop();
8247 
8248  /*l
8249  *b Description:
8250  **
8251  ** This function blinks the eyes. To have the eyes close to a
8252  ** specific amount and stay there, call set_eye_droop().
8253  **
8254  ** Only characters with expressive face appearances can blink.
8255  **
8256  *b Arguments:
8257  **
8258  *a duration_in - how long in seconds the first part of the blink
8259  *a (typically eyes closing) should take
8260  *a duration_out - how long in seconds the second part of the blink
8261  *a (typically eyes opening) should take
8262  *a target_in - how closed the eyes should be at duration_in
8263  *a target_out - how open the eyes should be at duration_out and
8264  *a thereafter
8265  *a tin - time at which blink should occur; default is now
8266  **
8267  *b Returns:
8268  **
8269  ** 0 on success, -1 on failure
8270  **
8271  *b Available as Decision Bead/Event
8272  */
8273  int blink(float duration_in = 0.1f,
8274  float duration_out = 0.2f,
8275  float target_in = 1.0f,
8276  float target_out = 0.0f,
8277  float tin = DIGUY_DEFAULT_FLOAT);
8278 
8279  /*l
8280  *b Description:
8281  **
8282  ** This function enables automatic eye blinking, so that blinks
8283  ** will happen without further function calls. The various
8284  ** controlling factors of blinks are set by the following functions:
8285  **
8286  *- - set_automatic_blink_duration_in()
8287  *- - set_automatic_blink_duration_out()
8288  *- - set_automatic_blink_target_in()
8289  *- - set_automatic_blink_target_out()
8290  **
8291  ** See blink() for information on what these factors mean.
8292  **
8293  ** Only characters with expressive face appearances can blink.
8294  **
8295  *b Arguments:
8296  **
8297  *a enabled - pass 1 to enable automatic blinks; 0 to disable
8298  *a period - how many seconds between each blink
8299  *a period_variation - variation on how many seconds between
8300  *a each blink
8301  **
8302  ** If blinks are enabled, the first blink will happen immediately.
8303  ** Successive blinks will happen between times (period -
8304  ** period_variation) and (period + period_variation) after the
8305  ** previous blink ends.
8306  **
8307  *b Returns:
8308  **
8309  ** 0 on success, -1 on failure
8310  **
8311  *b Available as Decision Bead/Event
8312  */
8313  int set_automatic_blinks_enabled(int enabled,
8314  float period = 6.0f,
8315  float period_variation = 3.0f);
8316 
8318  int get_automatic_blinks_enabled();
8319 
8320  /*l
8321  *b Description:
8322  **
8323  ** This function sets how long it will take the eye to close during
8324  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8325  ** blink().
8326  **
8327  *b Arguments:
8328  **
8329  *a duration_in - time in seconds for eye droop to go from droop
8330  *a target in to target out
8331  **
8332  *b Available as Decision Bead/Event
8333  */
8334  void set_automatic_blink_duration_in(float duration_in);
8335 
8337  float get_automatic_blink_duration_in();
8338 
8339  /*l
8340  *b Description:
8341  **
8342  ** This function sets how long it will take the eye to open during
8343  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8344  ** blink().
8345  **
8346  *b Arguments:
8347  **
8348  *a duration_out - time in seconds for eye droop to go from droop
8349  *a target out to target in
8350  **
8351  *b Available as Decision Bead/Event
8352  */
8353  void set_automatic_blink_duration_out(float duration_out);
8354 
8356  float get_automatic_blink_duration_out();
8357 
8358  /*l
8359  *b Description:
8360  **
8361  ** This function sets how much the eye will close during
8362  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8363  ** blink().
8364  **
8365  *b Arguments:
8366  **
8367  *a target_in - how far to close eye; 1.0 is all closed, 0.0 is
8368  *a all open
8369  **
8370  *b Available as Decision Bead/Event
8371  */
8372  void set_automatic_blink_target_in(float target_in);
8373 
8375  float get_automatic_blink_target_in();
8376 
8377  /*l
8378  *b Description:
8379  **
8380  ** This function sets how much the eye will open during
8381  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8382  ** blink().
8383  **
8384  *b Arguments:
8385  **
8386  *a target_out - how far to open eye; 1.0 is all closed, 0.0 is
8387  *a all open
8388  **
8389  *b Available as Decision Bead/Event
8390  */
8391  void set_automatic_blink_target_out(float target_out);
8392 
8394  float get_automatic_blink_target_out();
8395 
8396  /*l
8397  *b Returns:
8398  **
8399  ** 1 if the character is speaking, 0 if not. With a FaceFX character
8400  ** this is true if a character is actively playing a FaceFX animation
8401  */
8402  int is_speaking();
8403 
8404  /*l
8405  *b Description:
8406  **
8407  ** FaceFX animations are referred to as a group/animation name.
8408  ** This function allows you to set the current group once.
8409  ** See diguyScenario::facefx_mount_animset() for how to load a new
8410  ** animset on an actor.
8411  */
8412  int set_current_facefx_animation_group(const char* anim_group);
8413 
8414  /*l
8415  *b Returns:
8416  **
8417  ** the current FaceFX animation group set for this character
8418  */
8419  const char* get_current_facefx_animation_group();
8420 
8421  /*l
8422  *b Returns:
8423  **
8424  ** the name of the FaceFX actor that goes with the current head
8425  ** appearance; returns NULL if there's no FaceFX actor
8426  */
8427  const char* get_facefx_actor();
8428 
8429  /*l
8430  *b Description:
8431  **
8432  ** Mounts an animset on the current FaceFX actor. See also
8433  ** diguyScenario::facefx_mount_animset()
8434  */
8435  int facefx_mount_animset(const char* file_name);
8436 
8437  /*l
8438  *b Description:
8439  **
8440  ** Plays a FaceFX animation. This is the main way a facial animation
8441  ** sequence is triggered. The animation can be named
8442  ** "group_name/animation" or just "animation" if the proper group has
8443  ** been set with set_current_facefx_animation_group().
8444  */
8445  int play_facefx_animation(const char* animation,
8446  float magnitude_scale = 1.0f,
8447  float duration_scale = 1.0f,
8448  float blendin_time = 0.1f,
8449  float blendout_time = 0.1f,
8450  int loop = 0);
8451 
8452  /*l
8453  *b Description:
8454  **
8455  ** Stops all active FaceFX animations.
8456  */
8457  int stop_facefx_animations(float blend_time = 0.25f, int stop_sounds = 1);
8458 
8459  /*****************************************************************************/
8464  /*l
8465  *b Returns:
8466  **
8467  ** the number of nodes in the FaceFX actor's face graph
8468  */
8469  int get_num_facefx_nodes();
8470 
8471  /*l
8472  *b Returns:
8473  **
8474  ** the name of the node with index 'index' in the FaceFX actor's face
8475  ** graph
8476  */
8477  const char* get_facefx_node_name(int index);
8478 
8479  /*l
8480  *b Returns:
8481  **
8482  ** the index of the node with name 'node_name'
8483  */
8484  int find_facefx_node_index(const char* node_name);
8485 
8486  /*l
8487  *b Description:
8488  **
8489  ** Allows low level control of individual nodes of the characters face
8490  ** graph. End users can use this function to get finer grained
8491  ** control over eye direction and emotional state.
8492  */
8493  int set_facefx_node_value(int node_index,
8494  float value,
8495  float blend_time = 0.25f);
8496 
8497  /*l
8498  *b Description:
8499  **
8500  ** Retrieves the current final value of a node
8501  **/
8502  float get_facefx_node_value(int node_index);
8503 
8504 /*****************************************************************************/
8548  /*l
8549  *b Description:
8550  **
8551  ** This function creates (but does not begin) the specified gesture.
8552  ** Exact control over the gesture, such as number of repetitions,
8553  ** when the gesture should begin, when it should end, when it
8554  ** should reach specific points within the gestures, etc., is then
8555  ** possible by making calls through the returned
8556  ** diguyCharacterGesture object.
8557  **
8558  ** To begin execution of the gesture, call the begin_now() function
8559  ** of the diguyCharacterGesture object.
8560  **
8561  ** *Do not* call delete on the returned object. It should be
8562  ** destroyed either by calling destroy_gesture(), or by calling
8563  ** set_automatic_destroy_flag(1) on the diguyCharacterGesture
8564  ** object.
8565  **
8566  *b Arguments:
8567  **
8568  *a gesture_name - name of the gesture of create
8569  **
8570  *b Returns:
8571  **
8572  ** pointer to object of type diguyCharacterGesture
8573  */
8574  diguyCharacterGesture* create_gesture(const char* gesture_name);
8575 
8576  /*l
8577  *b Description:
8578  **
8579  ** This function destroys a gesture object created by
8580  ** create_gesture().
8581  **
8582  *b Arguments:
8583  **
8584  *a gesture - gesture to destroy
8585  **
8586  *b Returns:
8587  **
8588  ** 0 on success, -1 on failure
8589  */
8590  int destroy_gesture(diguyCharacterGesture* gesture);
8591 
8592  /*l
8593  *b Description:
8594  **
8595  ** This function executes the specified gesture or motion file on disk.
8596  **
8597  ** The gesture will automatically begin and end. The only control
8598  ** over the executed gesture is whether is should be ended or aborted
8599  ** early. See end_executing_gesture() and abort_executing_gesture().
8600  ** For full control of gesture attributes, use create_gesture()
8601  ** instead.
8602  **
8603  ** A gesture takes over control of a subset of a character's pose
8604  ** variables and can be overlaid on top of most base actions of the
8605  ** character.
8606  **
8607  ** Note that gestures should be preloaded at the beginning of a
8608  ** scenario to avoid a hitch in frame rate. See the function
8609  ** diguyScenario::preload_gesture().
8610  **
8611  ** This function will have no effect on a dead character (see
8612  ** die_now() and get_dead()).
8613  **
8614  *b Arguments:
8615  **
8616  *a gesture_name - name of the gesture to execute, as of diguy 13.2 this can be
8617  *a a bdm file, and a full body gesture will be created on the fly.
8618  *a reps - how many times the gesture should be
8619  *a repeated; default is 1 if no duration
8620  *a is specified, or best fit if there is
8621  *a a duration specified
8622  *a overall_duration - for how long the gesture should be executed;
8623  *a default is such that no time scaling occurs
8624  *a channel_A_weight - the weight given to channel A of the
8625  *a gesture; ignored if the gesture does not
8626  *a have multiple channels
8627  **
8628  ** If the gesture is a multi-stage gesture, the overall duration
8629  ** will be spread proportionately over each stage.
8630  **
8631  *b Returns:
8632  **
8633  ** 0 on success, -1 on failure
8634  **
8635  *b Available as Decision Bead/Event
8636  */
8637  int execute_gesture(const char* gesture_name,
8638  int reps = DIGUY_DEFAULT_INT,
8639  float overall_duration = DIGUY_DEFAULT_FLOAT,
8640  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8641 
8642  /*l
8643  *b Description:
8644  **
8645  ** The gesture will automatically begin and end. The only control
8646  ** over the executed gesture is whether is should be ended or aborted
8647  ** early. See end_executing_gesture() and abort_executing_gesture().
8648  ** For full control of gesture attributes, use create_gesture()
8649  ** instead.
8650  **
8651  ** If the specified gesture is not a 1 stage gesture, no gesture
8652  ** is executed and an error value is returned.
8653  **
8654  ** The specified gesture can be a one or two channel 1 stage gesture,
8655  ** in which case the specified channel weight will be used over the
8656  ** course of the entire gesture.
8657  **
8658  ** A 1 stage gesture is a comprised of a single motion that begins
8659  ** and ends the gesture.
8660  **
8661  ** n repetitions of a 1 stage gesture will repeat the stage 1
8662  ** motion n times.
8663  **
8664  ** This function will have no effect on a dead character (see
8665  ** die_now() and get_dead()).
8666  **
8667  *b Arguments:
8668  **
8669  *a gesture_name - name of the gesture of execute
8670  *a reps - how many times the gesture should be
8671  *a repeated; default is 1 if no duration
8672  *a is specified, or best fit if there is
8673  *a a duration specified
8674  *a stage1_duration - how long stage 1 of the gesture should take;
8675  *a default is such that no time scaling occurs
8676  *a channel_A_weight - the weight given to channel A of the
8677  *a gesture; ignored if the gesture does not
8678  *a have multiple channels
8679  **
8680  *b Returns:
8681  **
8682  ** 0 on success, -1 on failure
8683  */
8684  int execute_1stage_gesture(const char* gesture_name,
8685  int reps = DIGUY_DEFAULT_INT,
8686  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8687  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8688 
8689  /*l
8690  *b Description:
8691  **
8692  ** This function is similar to execute_1stage_gesture().
8693  **
8694  ** Stage 1 of a 2 stage gesture is a motion that begins the gesture
8695  ** and leads to the "peak" of the gesture.
8696  **
8697  ** Stage 2 of a 2 stage gesture is the motion that returns the
8698  ** gesture from the "peak" to the starting position.
8699  **
8700  ** n repetitions of a 2 stage gesture will repeat the stage 1 motion
8701  ** followed by the stage 2 motion n times.
8702  **
8703  ** This function will have no effect on a dead character (see
8704  ** die_now() and get_dead()).
8705  **
8706  *b Arguments:
8707  **
8708  *a gesture_name - name of the gesture of execute
8709  *a reps - how many times the gesture should be
8710  *a repeated; default is 1 if no duration
8711  *a is specified, or best fit if there is
8712  *a a duration specified
8713  *a stage1_duration - how long stage 1 of the gesture should take,
8714  *a i.e., how far into the gesture the "peak"
8715  *a will occur;
8716  *a default is such that no time scaling occurs
8717  *a stage2_duration - how long stage 2 of the gesture should take;
8718  *a default is such that no time scaling occurs
8719  *a channel_A_weight - the weight given to channel A of the
8720  *a gesture; ignored if the gesture does not
8721  *a have multiple channels
8722  **
8723  *b Returns:
8724  **
8725  ** 0 on success, -1 on failure
8726  */
8727  int execute_2stage_gesture(const char* gesture_name,
8728  int reps = DIGUY_DEFAULT_INT,
8729  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8730  float stage2_duration = DIGUY_DEFAULT_FLOAT,
8731  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8732 
8733  /*l
8734  *b Description:
8735  **
8736  ** This function is similar to execute_1stage_gesture().
8737  **
8738  ** Stage 1 of a 3 stage gesture is a motion that begins the gesture
8739  ** and leads to stage 2; e.g., raising the right arm in preparation
8740  ** for waving.
8741  **
8742  ** Stage 2 of a 3 stage gesture is a motion that can loop
8743  ** indefinitely; e.g., waving the right arm back and forth.
8744  **
8745  ** Stage 3 of a 3 stage gesture is the motion that ends the gesture;
8746  ** e.g., returning the right arm to the side of the body to complete
8747  ** the wave.
8748  **
8749  ** n repetitions of a 3 stage gesture will play the stage 1 motion
8750  ** once, followed by n reps of the stage 2 motion, followed by 1
8751  ** stage 3 motion.
8752  **
8753  ** This function will have no effect on a dead character (see
8754  ** die_now() and get_dead()).
8755  **
8756  *b Arguments:
8757  **
8758  *a gesture_name - name of the gesture of execute
8759  *a reps - how many times the gesture should be
8760  *a repeated; default is 1 if no duration
8761  *a is specified, or best fit if there is
8762  *a a duration specified
8763  *a stage1_duration - how long stage 1 of the gesture should take;
8764  *a default is such that no time scaling occurs
8765  *a stage2_duration - how long each repetition of stage 2 of the
8766  *a gesture should take;
8767  *a default is such that no time scaling occurs
8768  *a stage3_duration - how long stage 3 of the gesture should take;
8769  *a default is such that no time scaling occurs
8770  *a channel_A_weight - the weight given to channel A of the
8771  *a gesture; ignored if the gesture does not
8772  *a have multiple channels
8773  **
8774  *b Returns:
8775  **
8776  ** 0 on success, -1 on failure
8777  */
8778  int execute_3stage_gesture(const char* gesture_name,
8779  int reps = DIGUY_DEFAULT_INT,
8780  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8781  float stage2_duration = DIGUY_DEFAULT_FLOAT,
8782  float stage3_duration = DIGUY_DEFAULT_FLOAT,
8783  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8784 
8785  /*l
8786  *b Description:
8787  **
8788  ** The gesture will automatically begin and end. The only control
8789  ** over the executed gesture is whether is should be ended or aborted
8790  ** early. See end_executing_gesture() and abort_executing_gesture().
8791  ** For full control of gesture attributes, use create_gesture()
8792  ** instead.
8793  **
8794  ** This function serves as a quick way of executing a table gesture.
8795  ** There are many capabilities of table gestures that are accessible
8796  ** only through the full diguyCharacterGesture object.
8797  **
8798  ** If the specified gesture is not a table gesture, no gesture is
8799  ** executed and an error value is returned.
8800  **
8801  ** A table stage gesture is a comprised of a table of gesture actions
8802  ** that can be transitioned between without going through a neutral
8803  ** position.
8804  **
8805  ** n repetitions of a table gesture will repeat the loop action
8806  ** n times.
8807  **
8808  ** This function will have no effect on a dead character (see
8809  ** die_now() and get_dead()).
8810  **
8811  *b Arguments:
8812  **
8813  *a gesture_name - name of the gesture of execute
8814  *a reps - how many times the gesture should be repeated;
8815  *a default is 1
8816  *a loop_action - which action in the gesture should be looped;
8817  *a default is action at index 1 of table
8818  *a begin_action - which action the gesture should begin from;
8819  *a default is action at index 0
8820  *a end_action - which action the gesture should end at;
8821  *a default is action at index 0
8822  **
8823  *b Returns:
8824  **
8825  ** 0 on success, -1 on failure
8826  */
8827  int execute_table_gesture(const char* gesture_name,
8828  int reps = DIGUY_DEFAULT_INT,
8829  const char* loop_action = NULL,
8830  const char* begin_action = NULL,
8831  const char* end_action = NULL);
8832 
8833  /*l
8834  *b Description:
8835  **
8836  ** Executes the given gesture and performs the given action as a table action.
8837  **
8838  *b Arguments:
8839  **
8840  *a gesture_name - name of the gesture to execute
8841  *a desired_action - name of table action to perform
8842  **
8843  *b Returns:
8844  **
8845  ** 0 on success, -1 on failure
8846  **
8847  **/
8848  int set_executing_table_gesture_desired_action(const char* gesture_name,
8849  const char* desired_action);
8850 
8851  /*l
8852  *b Description:
8853  **
8854  ** This function alerts the specified gesture that it should end.
8855  ** The gesture will stop repeating and play its "out" motions as
8856  ** soon as possible.
8857  **
8858  ** In order to immediately stop the gesture, use the
8859  ** abort_executing_gesture() function.
8860  **
8861  *b Arguments:
8862  **
8863  *a gesture_name - name of executing gesture to end
8864  **
8865  *b Returns:
8866  **
8867  ** 0 on success, -1 on failure
8868  **
8869  *b See Also:
8870  **
8871  ** abort_executing_gesture()
8872  */
8873  int end_executing_gesture(const char* gesture_name);
8874 
8875  /*l
8876  *b Description:
8877  **
8878  ** This function aborts a gesture previously executed by one of
8879  ** the execute_*_gesture() calls, if it is currently executing.
8880  ** If a gesture with the given name is not executing, this function
8881  ** will have no effect.
8882  **
8883  ** This call won't cause the gesture to switch to its "out" motion;
8884  ** it is a straight-forward blend out of whatever the gesture is
8885  ** currently doing. Use the end_executing_gesture() call to make
8886  ** the gesture play its "out" motion as soon as possible,
8887  ** therefore ending the gesture in a smoother way.
8888  **
8889  *b Arguments:
8890  **
8891  *a gesture_name - name of executing gesture to abort
8892  *a max_rampdown_interval - max amount of time spent trying to
8893  *a smooth over any motion seams; set
8894  *a to 0.5 for a smooth transition, set
8895  *a to 0 for an immediate abort
8896  **
8897  *b Returns:
8898  **
8899  ** 0 on success, -1 on failure
8900  **
8901  *b See Also:
8902  **
8903  ** end_executing_gesture(), abort_all_gestures()
8904  */
8905  int abort_executing_gesture(const char* gesture_name,
8906  float max_rampdown_interval = .5f);
8907 
8908  /*l
8909  *b Description:
8910  **
8911  ** This function alerts all active gestures that they should end.
8912  ** The gestures will stop repeating and play their "out" motions as
8913  ** soon as possible.
8914  **
8915  ** In order to immediately stop all gestures, use the
8916  ** abort_all_gestures() function.
8917  **
8918  *b Returns:
8919  **
8920  ** 0 on success, -1 on failure
8921  **
8922  *b See Also:
8923  **
8924  ** abort_all_gestures(), diguyCharacterGesture::end_gesture()
8925  */
8926  int end_all_gestures();
8927 
8928  /*l
8929  *b Description:
8930  **
8931  ** This function aborts all active gestures. All gestures will
8932  ** immediately begin to lose their effect on the
8933  ** character's pose.
8934  **
8935  ** This won't cause the gestures to switch to their "out" motions;
8936  ** it is a straight-forward blend out of whatever the gesture is
8937  ** currently doing. Use the end_all_gestures() call to make all
8938  ** active gestures play their "out" motions as soon as possible,
8939  ** therefore ending the gestures in a smoother way.
8940  **
8941  *b Arguments:
8942  **
8943  *a max_rampdown_interval - max amount of time spent trying to
8944  *a smooth over any motion seams; set
8945  *a to 0.5 for a smooth transition, set
8946  *a to 0 for an immediate abort
8947  **
8948  *b Returns:
8949  **
8950  ** 0 on success, -1 on failure
8951  **
8952  *b See Also:
8953  **
8954  ** end_all_gestures(), diguyCharacterGesture::abort_now()
8955  */
8956  int abort_all_gestures(float max_rampdown_interval);
8957 
8958 
8959 /*****************************************************************************/
8991  /*l
8992  *b Description:
8993  **
8994  ** This function will play the specified sound. The sound will be
8995  ** "ambient"; i.e., it will be equally audible from everywhere within
8996  ** the world. Use the function play_3d_sound() to play a sound that
8997  ** moves with the character.
8998  **
8999  ** This function will have no effect on a dead character (see
9000  ** die_now() and get_dead()).
9001  **
9002  ** Unless the sound loops, the sound will play to completion and then
9003  ** stop. To stop the sound early or stop a looping sound call
9004  ** diguyCharacter::stop_all_sounds() or diguyCharacter::stop_sound().
9005  **
9006  *b Arguments
9007  **
9008  *a sound_name - name of sound to play
9009  *a sound_gain - by how much sound's amplitude should be multiplied
9010  *a sound_loop - indicates that sound should loop indefinitely
9011  **
9012  ** There must be a diguySound in the scenario with the passed
9013  ** sound_name. See diguyScenario::create_sound().
9014  **
9015  ** See set_current_voice_actor() for information on how a voice actor
9016  ** can change which sound in the scenario is selected.
9017  **
9018  *b Returns:
9019  **
9020  ** 0 on success, -1 on failure
9021  **
9022  *b Available as Decision Bead/Event
9023  */
9024  int play_sound(const char* sound_name,
9025  float sound_gain = 1.0f,
9026  int sound_loops = 0);
9027 
9028  /*l
9029  *b Description:
9030  **
9031  ** This function will play the specified sound at the character's
9032  ** location. As the character moves, the sound will move with it.
9033  ** Use the function play_sound() to play a sound that is ambient and
9034  ** does not move with the character.
9035  **
9036  ** Note that not all sound modules support 3D sounds.
9037  **
9038  ** This function will have no effect on a dead character (see
9039  ** die_now() and get_dead()).
9040  **
9041  ** Unless the sound loops, the sound will play to completion and then
9042  ** stop. To stop the sound early or stop a looping sound call
9043  ** diguyCharacter::stop_all_sounds() or diguyCharacter::stop_sound().
9044  **
9045  *b Arguments
9046  **
9047  *a sound_name - the name of the sound to play
9048  *a sound_gain - by how much the sound's amplitude
9049  *a should be multiplied
9050  *a sound_loop - indicates that the sound should loop
9051  *a indefinitely
9052  **
9053  ** There must be a diguySound in the scenario with the passed
9054  ** sound_name. See diguyScenario::create_sound().
9055  **
9056  ** See set_current_voice_actor() for information on how a voice actor
9057  ** can change which sound in the scenario is selected.
9058  **
9059  *b Returns:
9060  **
9061  ** 0 on success, -1 on failure
9062  **
9063  *b Available as Decision Bead/Event
9064  */
9065  int play_3d_sound(const char* sound_name,
9066  float sound_gain = 1.0f,
9067  int sound_loops = 0);
9068 
9069  /*l
9070  *b Description:
9071  **
9072  ** This function creates (but does not start playing) an instance of
9073  ** the specified sound.
9074  **
9075  ** Exact control over the sound instance is possible by making calls
9076  ** through the returned diguySoundInstance object.
9077  **
9078  ** To begin playing the sound, call diguySoundInstance::begin_now().
9079  **
9080  ** *Do not* call delete on the returned object. It should be
9081  ** destroyed either by calling diguyCharacter::destroy_sound_instance()
9082  ** or by calling diguySoundInstance::set_automatic_destroy_flag(1) on
9083  ** the returned object.
9084  **
9085  *b Arguments:
9086  **
9087  *a sound_name - name of the sound for which to create an instance
9088  **
9089  ** There must be a diguySound in the scenario with the passed
9090  ** sound_name. See diguyScenario::create_sound().
9091  **
9092  *b Returns:
9093  **
9094  ** pointer to object of type diguySoundInstance
9095  */
9096  diguySoundInstance* create_sound_instance(const char* sound_name);
9097 
9098  /*l
9099  *b Description:
9100  **
9101  ** This function destroys a sound instance object created by
9102  ** create_sound_instance().
9103  **
9104  ** Do not destroy a sound for which the
9105  ** diguySoundInstance::set_automatic_destroy_flag(1) has been called.
9106  **
9107  *b Arguments:
9108  **
9109  *a sound_instance - sound instance to destroy
9110  **
9111  *b Returns:
9112  **
9113  ** 0 on success, -1 on failure
9114  */
9115  int destroy_sound_instance(diguySoundInstance* sound_instance);
9116 
9117  /*l
9118  *b Description:
9119  **
9120  ** This function stops all active sound instances from this character.
9121  ** All sounds being played by this character will fade out and stop
9122  ** after rampdown_time, by default fade out is instant.
9123  **
9124  ** Sound instances that are automatically managed will be destroyed.
9125  ** This includes sound started by a call to
9126  ** diguyCharacter::play_sound() or a sound instance whose
9127  ** set_automatic_destroy_flag() function has been called.
9128  **
9129  ** diguySoundInstance pointers returned by a call to
9130  ** diguyCharacter::create_sound_instance(), which have not been set to
9131  ** be automatically destroyed, will still be valid.
9132  **
9133  *b Arguments:
9134  **
9135  *a rampdown_time - how long to fade out the sound
9136  **
9137  *b Returns:
9138  **
9139  ** 0 on success, -1 on failure
9140  **
9141  *b Available as Decision Bead/Event
9142  */
9143  int stop_all_sounds(float rampdown_time = 0.0f);
9144 
9145  /*l
9146  *b Description:
9147  **
9148  ** This function stops a named sound instance from this character.
9149  **
9150  ** Sound instances that are automatically managed will be destroyed.
9151  ** This includes sound started by a call to
9152  ** diguyCharacter::play_sound() or a sound instance whose
9153  ** set_automatic_destroy_flag() function has been called.
9154  **
9155  ** diguySoundInstance pointers returned by a call to
9156  ** diguyCharacter::create_sound_instance(), which have not been set to
9157  ** be automatically destroyed, will still be valid.
9158  **
9159  *b Arguments:
9160  **
9161  *a sound_name - the name of the sound to stop
9162  *a rampdown_time - how long to fade out the sound
9163  **
9164  *b Returns:
9165  **
9166  ** 0 on success, -1 on failure
9167  **
9168  *b Available as Decision Bead/Event
9169  */
9170  int stop_sound(const char* sound_name, float rampdown_time = 0.0f);
9171 
9172  /*l
9173  *b Returns:
9174  **
9175  ** 1 if the character is playing a the sound specified, 0 if not
9176  */
9177  int is_playing_sound(const char* sound_name);
9178 
9179  /*l
9180  *b Description:
9181  **
9182  ** Sets the "voice actor" for the character.
9183  **
9184  ** Having a voice actor can change which sounds from the scenario a
9185  ** character selects when the diguyCharacter::play_sound() or
9186  ** diguyCharacter::play_3d_sound().
9187  **
9188  ** When play_sound() is called the character asks the scenario for
9189  ** the sound with the specified name. If a voice actor has been set
9190  ** the character will first ask the scenario for the sound name
9191  ** prepended with the voice actor and a slash ("/"). If there isn't
9192  ** a sound with that modified name, it will ask the scenario for a
9193  ** sound with the exact specified name.
9194  **
9195  ** For example, if the character has the voice actor "carl" and is
9196  ** told to play the sound "run_away", the character will first look
9197  ** for a sound named "carl/run_away". If that isn't found, it will
9198  ** look for a sound named "run_away". (If that isn't found no sound
9199  ** is played.)
9200  **
9201  *b Lua Example:
9202  **
9203  ** A more specific example: say that various characters in the
9204  ** scenario need to say "hello". Some of the characters are male,
9205  ** some are female. There are two ways this can be set up.
9206  **
9207  ** The first way, not using a voice actor, is to have two sounds
9208  ** specified in the scenario: "male_hello" and "female_hello". These
9209  ** sounds specify the sound files "male_hello.wav" and
9210  ** "female_hello.wav", respectively. A male character would then do
9211  ** the following to say hello:
9212  **
9213  *e male_character:play_sound("male_hello")
9214  **
9215  ** A female character would do:
9216  **
9217  *e female_character:play_sound("female_hello")
9218  **
9219  ** This is fine, except when one script or character mind needs to be
9220  ** shared by a range of characters, some male and some female.
9221  **
9222  ** In this case it's better to use a voice actor. Say that the sounds
9223  ** specified above have the names "male/hello" and "female/hello";
9224  ** they still have the separate sound files specified. If the
9225  ** character has its voice actor specified as "male" and is told to
9226  ** play the sound "hello", it will select the sound "male/hello" as
9227  ** the sound to play. If its voice actor is "female" and is told to
9228  ** play the sound "hello", it will select the sound "female/hello".
9229  **
9230  *e -- called earlier: character:set_voice_actor("male")
9231  *e character:play_sound("hello") -- plays sound "male/hello"
9232  **
9233  *e -- called earlier: character:set_voice_actor("female")
9234  *e character:play_sound("hello") -- plays sound "female/hello"
9235  **
9236  *b Arguments:
9237  **
9238  *a voice_actor - name of voice actor
9239  **
9240  ** voice_actor can be an arbitrary string. It doesn't need to match
9241  ** any character name, but should have matching sounds specified in
9242  ** the scenario.
9243  **
9244  *b Returns:
9245  **
9246  ** 0 on success, -1 on failure
9247  */
9248  int set_current_voice_actor(const char* voice_actor);
9249 
9251  const char* get_current_voice_actor();
9252 
9253 
9254 /*****************************************************************************/
9290  /*l
9291  *b Description:
9292  **
9293  ** This function returns the state of the character in the form
9294  ** required by DIS.
9295  **
9296  ** Note that there is no corresponding set_DIS_lifeform_state()
9297  ** function. The lifeform state is derived from the character's
9298  ** action, posture, and variant information.
9299  **
9300  *b Returns:
9301  **
9302  ** one of the following values defined in diguy_dis_constants.h:
9303  **
9304  *- DIGUY_DIS_LIFEFORM_UNUSED (0)
9305  *- DIGUY_DIS_LIFEFORM_UPRIGHT_STANDING_STILL (1)
9306  *- DIGUY_DIS_LIFEFORM_UPRIGHT_WALKING (2)
9307  *- DIGUY_DIS_LIFEFORM_UPRIGHT_RUNNING (3)
9308  *- DIGUY_DIS_LIFEFORM_KNEELING (4)
9309  *- DIGUY_DIS_LIFEFORM_PRONE (5)
9310  *- DIGUY_DIS_LIFEFORM_CRAWLING (6)
9311  *- DIGUY_DIS_LIFEFORM_SWIMMING (7)
9312  *- DIGUY_DIS_LIFEFORM_PARACHUTING (8)
9313  *- DIGUY_DIS_LIFEFORM_JUMPING (9)
9314  *- DIGUY_DIS_LIFEFORM_SITTING (10)
9315  *- DIGUY_DIS_LIFEFORM_SQUATTING (11)
9316  *- DIGUY_DIS_LIFEFORM_CROUCHING (12)
9317  *- DIGUY_DIS_LIFEFORM_WADING (13)
9318  **
9319  *b Callable For Networked Entities That Are:
9320  **
9321  *- - DIS published and reflected
9322  */
9323  int get_DIS_lifeform_state();
9324 
9325  /*l
9326  *b Description:
9327  **
9328  ** This function returns the position of the character's
9329  ** primary weapon, in the form required by DIS.
9330  **
9331  *b Returns:
9332  **
9333  ** one of the following values defined in diguy_dis_constants.h:
9334  **
9335  *- DIGUY_DIS_PRIMARY_WEAPON_NOT_PRESENT (0)
9336  *- DIGUY_DIS_PRIMARY_WEAPON_STOWED (1)
9337  *- DIGUY_DIS_PRIMARY_WEAPON_DEPLOYED (2)
9338  *- DIGUY_DIS_PRIMARY_WEAPON_IN_FIRING_POSITION (3)
9339  **
9340  *b Callable For Networked Entities That Are:
9341  **
9342  *- - DIS published
9343  */
9344  int get_DIS_primary_weapon_position();
9345 
9346  /*l
9347  *b Description:
9348  **
9349  ** This function returns the position of the character's
9350  ** secondary weapon, in the form required by DIS.
9351  **
9352  *b Returns:
9353  **
9354  ** one of the following values defined in diguy_dis_constants.h:
9355  **
9356  *- DIGUY_DIS_SECONDARY_WEAPON_NOT_PRESENT (0)
9357  *- DIGUY_DIS_SECONDARY_WEAPON_STOWED (1)
9358  *- DIGUY_DIS_SECONDARY_WEAPON_DEPLOYED (2)
9359  *- DIGUY_DIS_SECONDARY_WEAPON_IN_FIRING_POSITION (3)
9360  **
9361  *b Callable For Networked Entities That Are:
9362  **
9363  *- - DIS published
9364  */
9365  int get_DIS_secondary_weapon_position();
9366 
9367  /*l
9368  *b Description:
9369  **
9370  ** This function sets the Marking Text for characters that are
9371  ** published to the network by DI-Guy Networking. The default
9372  ** network marking is the empty string "".
9373  **
9374  ** This function should only be called for published characters.
9375  ** The Marking Text is set internally for reflected characters.
9376  **
9377  *b Returns:
9378  **
9379  ** 0 on success, -1 on failure
9380  **
9381  *b Callable For Networked Entities That Are:
9382  **
9383  *- - DIS published
9384  *- - HLA published
9385  */
9386  int set_network_marking(const char* network_marking);
9387 
9388  /*l
9389  *b Description:
9390  **
9391  ** This function gets the Marking Text for characters.
9392  **
9393  ** For published characters this value will be what was most
9394  ** recently set by set_network_marking().
9395  **
9396  ** For reflected characters this value will be read from the
9397  ** reflected characters' entity state information.
9398  **
9399  *b Returns:
9400  **
9401  ** character's Marking Text; will never be NULL
9402  **
9403  *b Callable For Networked Entities That Are:
9404  **
9405  *- - DIS published and reflected
9406  *- - HLA published and reflected
9407  */
9408  const char* get_network_marking();
9409 
9410  /*l
9411  *b Description:
9412  **
9413  ** This function sets whether this character will be published
9414  ** by DI-Guy Networking. This value is persistent, and does
9415  ** not depend on whether there actually *is* currently a
9416  ** network connection.
9417  **
9418  ** The default is 1, the character is published.
9419  **
9420  ** This function should *not* be called for reflected characters.
9421  ** It affects to both DIS and HLA networking.
9422  **
9423  *b Returns:
9424  **
9425  ** 0 on success, -1 on failure
9426  **
9427  *b Callable For Networked Entities That Are:
9428  **
9429  *- - DIS published
9430  *- - HLA published
9431  */
9432  int set_is_network_published(int is_network_published);
9433 
9434  /*l
9435  *b Description:
9436  **
9437  ** This function returns whether the character is published
9438  ** by DI-Guy Networking. It will always return 0 for reflected
9439  ** characters.
9440  **
9441  ** This function can be called for any character.
9442  **
9443  *b Returns:
9444  **
9445  ** 1 if published, 0 if not
9446  **
9447  *b Available as Decision Bead/Event
9448  **
9449  *b Callable For Networked Entities That Are:
9450  **
9451  *- - DIS published and reflected
9452  *- - HLA published and reflected
9453  */
9454  int get_is_network_published();
9455 
9456  /*l
9457  *b Description:
9458  **
9459  ** Experimental function that returns a vrlink entity state repository,
9460  ** useful for adding additional information to a diguy that we don't usually
9461  ** model.
9462  */
9463  DtEntityStateRepository * get_vrlink_entity_state_repository();
9464 
9465  /*l
9466  *b Description:
9467  **
9468  ** This function returns whether the character is a
9469  ** reflected character created by DI-Guy Networking.
9470  **
9471  ** This function can be called for any character.
9472  **
9473  *b Returns:
9474  **
9475  ** 1 if reflected, 0 if not
9476  **
9477  *b Available as Decision Bead/Event
9478  **
9479  *b Callable For Networked Entities That Are:
9480  **
9481  *- - DIS published and reflected
9482  *- - HLA published and reflected
9483  */
9484  int get_is_network_reflected();
9485 
9486  /*l
9487  *b Description:
9488  **
9489  ** This function returns whether this character is in a
9490  ** "paused" state. This will only be true for reflected
9491  ** characters.
9492  **
9493  ** A reflected character will be paused if the network
9494  ** entity it is representing is paused; i.e., its personal
9495  ** timeline is not advancing. The most common case of this
9496  ** is when this character is reflecting a published character
9497  ** of a DI-Guy Scenario application that is in a paused or
9498  ** stopped state.
9499  **
9500  ** If DI-Guy Scenario, paused characters will remain frozen
9501  ** in their current postures.
9502  **
9503  *b Returns:
9504  **
9505  ** 1 if paused, 0 if not
9506  **
9507  *b Available as Decision Bead/Event
9508  */
9509  int get_is_network_paused();
9510 
9511  /*l
9512  *b Description:
9513  **
9514  ** Overrides built-in logic for network pausing, becomes end user's responsibility
9515  ** to manage
9516  */
9517  int set_is_network_paused(int paused);
9518 
9519  /*l
9520  *b Description:
9521  **
9522  ** This function returns the character's "network entity number".
9523  ** This number is valid and persistent regardless of whether the
9524  ** character is currently published.
9525  **
9526  ** This number is primarily used internally by DI-Guy Networking
9527  ** for creating entity IDs.
9528  **
9529  *b Returns:
9530  **
9531  ** character's network entity number
9532  **
9533  *b Callable For Networked Entities That Are:
9534  **
9535  *- - DIS published and reflected
9536  *- - HLA published and reflected
9537  */
9538  int get_network_entity_number();
9539 
9540  /*l
9541  *b Description:
9542  **
9543  ** This function returns the name of an action for a character,
9544  ** given the DIS damage state, lifeform state, primary weapon
9545  ** state, speed of the character, and direction of travel.
9546  ** Constants are all defined in diguy_dis_constants.h:
9547  **
9548  *b Arguments:
9549  **
9550  *a damage_state - one of the values listed below
9551  *a life_form_state - one of the values listed below
9552  *a primary_weapon_state - one of the values listed below
9553  *a speed - in meters/second
9554  *a forward - whether the action should move
9555  *a forward (pass 1), or backward (pass 0)
9556  **
9557  ** Valid values for damage_state:
9558  **
9559  *- - DIGUY_DIS_DAMAGE_NONE (0)
9560  *- - DIGUY_DIS_DAMAGE_SLIGHT (1)
9561  *- - DIGUY_DIS_DAMAGE_MODERATE (2)
9562  *- - DIGUY_DIS_DAMAGE_DESTROYED (3)
9563  **
9564  ** Valid values for life_form_state:
9565  **
9566  *- - DIGUY_DIS_LIFEFORM_UNUSED (0)
9567  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_STANDING_STILL (1)
9568  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_WALKING (2)
9569  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_RUNNING (3)
9570  *- - DIGUY_DIS_LIFEFORM_KNEELING (4)
9571  *- - DIGUY_DIS_LIFEFORM_PRONE (5)
9572  *- - DIGUY_DIS_LIFEFORM_CRAWLING (6)
9573  *- - DIGUY_DIS_LIFEFORM_SWIMMING (7)
9574  *- - DIGUY_DIS_LIFEFORM_PARACHUTING (8)
9575  *- - DIGUY_DIS_LIFEFORM_JUMPING (9)
9576  *- - DIGUY_DIS_LIFEFORM_SITTING (10)
9577  *- - DIGUY_DIS_LIFEFORM_SQUATTING (11)
9578  *- - DIGUY_DIS_LIFEFORM_CROUCHING (12)
9579  *- - DIGUY_DIS_LIFEFORM_WADING (13)
9580  **
9581  ** Valid values for primary_weapon_state:
9582  **
9583  *- - DIGUY_DIS_PRIMARY_WEAPON_NOT_PRESENT (0)
9584  *- - DIGUY_DIS_PRIMARY_WEAPON_STOWED (1)
9585  *- - DIGUY_DIS_PRIMARY_WEAPON_DEPLOYED (2)
9586  *- - DIGUY_DIS_PRIMARY_WEAPON_IN_FIRING_POSITION (3)
9587  **
9588  ** Note that a backward motion can be requested in a couple of
9589  ** ways: either by passing a negative speed, or by passing
9590  ** 0 for the forward argument, or both.
9591  **
9592  *b Returns:
9593  **
9594  ** name of an action if a match is found, NULL if not
9595  **
9596  *b Callable For Networked Entities That Are:
9597  **
9598  *- - DIS published
9599  */
9600  const char* get_action_from_entity_state(int damage_state,
9601  int life_form_state,
9602  int primary_weapon_state,
9603  float speed,
9604  int forward);
9605 
9606  /*l
9607  *b Description:
9608  **
9609  ** Sets the damage state for the network published character.
9610  ** Depending on the appearance configuration info the character may automatically switch to a new appearance.
9611  **
9612  *b Arguments:
9613  **
9614  *a state - one of the values listed below
9615  **
9616  ** Valid values for state (defined in diguy_dis_constants.h):
9617  **
9618  *- - DIGUY_DIS_DAMAGE_NONE (0)
9619  *- - DIGUY_DIS_DAMAGE_SLIGHT (1)
9620  *- - DIGUY_DIS_DAMAGE_MODERATE (2)
9621  *- - DIGUY_DIS_DAMAGE_DESTROYED (3)
9622  **
9623  *b Callable For Networked Entities That Are:
9624  **
9625  *- - DIS published
9626  */
9627  void set_DIS_damage_state(int state);
9628 
9631  int get_DIS_damage_state();
9632 
9633  /*l
9634  *b Description:
9635  **
9636  ** Returns the name of damage state appearances based on the base appearance of the character.
9637  ** NULL if there is no appearance specified.
9638  */
9639  const char * get_damage_state_appearance_name(int state);
9640 
9641  /*l
9642  *b Description:
9643  **
9644  ** Sets the smoke state for a network published character.
9645  ** Starts or stops the "smoke" and "engine_smoke" appearance
9646  ** effects as appropriate.
9647  **
9648  *b Arguments:
9649  **
9650  *a state - one of the values listed below
9651  **
9652  ** Valid values for state (defined in diguy_dis_constants.h):
9653  **
9654  *- - DIGUY_DIS_SMOKE_NOT_SMOKING (0)
9655  *- - DIGUY_DIS_SMOKE_SMOKE_PLUME (1)
9656  *- - DIGUY_DIS_SMOKE_ENGINE_SMOKE (2)
9657  *- - DIGUY_DIS_SMOKE_ENGINE_SMOKE_AND_SMOKE_PLUME (3)
9658  **
9659  *b Callable For Networked Entities That Are:
9660  **
9661  *- - DIS published
9662  */
9663  void set_DIS_smoke_state(int state);
9664 
9667  int get_DIS_smoke_state();
9668 
9669  /*l
9670  *b Description:
9671  **
9672  ** Sets the flames state for a network published character.
9673  ** Starts or stops the "flames" appearance effect as appropriate.
9674  **
9675  *b Arguments:
9676  **
9677  ** state - one of the values listed below
9678  **
9679  ** Valid values for state (defined in diguy_dis_constants.h):
9680  **
9681  *- - DIGUY_DIS_FLAMES_NONE (0)
9682  *- - DIGUY_DIS_FLAMES_PRESENT (1)
9683  **
9684  *b Callable For Networked Entities That Are:
9685  **
9686  *- - DIS published
9687  */
9688  void set_DIS_flames_state(int state);
9689 
9692  int get_DIS_flames_state();
9693 
9694  /*l
9695  *b Description:
9696  **
9697  ** Sets the power plant state for a network published character.
9698  ** Vehicle power plants default to being on.
9699  **
9700  *b Arguments:
9701  **
9702  ** state - one of the values listed below
9703  **
9704  ** Valid values for state (defined in diguy_dis_constants.h):
9705  **
9706  *- - DIGUY_DIS_POWER_PLANT_OFF (0)
9707  *- - DIGUY_DIS_POWER_PLANT_ON (1)
9708  **
9709  *b Callable For Networked Entities That Are:
9710  **
9711  *- - DIS published
9712  */
9713  void set_DIS_power_plant_state(int state);
9714 
9717  int get_DIS_power_plant_state();
9718 
9721  void set_emissivity(float r, float g, float b, float lerp_time = .25);
9722 
9725  void get_emissivity(float *r, float *g, float *b);
9726 
9727  /*l
9728  *b Description:
9729  **
9730  ** Sets the trailing effect state for a network published character.
9731  **
9732  *b Arguments:
9733  **
9734  ** state - one of the values listed below
9735  **
9736  ** Valid values for state (defined in diguy_dis_constants.h):
9737  **
9738  *- - DIGUY_DIS_TRAILING_EFFECT_NONE (0)
9739  *- - DIGUY_DIS_TRAILING_EFFECT_SMALL (1)
9740  *- - DIGUY_DIS_TRAILING_EFFECT_MEDIUM (2)
9741  *- - DIGUY_DIS_TRAILING_EFFECT_LARGE (3)
9742  **
9743  *b Callable For Networked Entities That Are:
9744  **
9745  *- - DIS published
9746  */
9747  void set_DIS_trailing_effect_state(int state);
9748 
9751  int get_DIS_trailing_effect_state();
9752 
9755  void set_head_lights_state(int state);
9756 
9758  int get_head_lights_state() const;
9759 
9761  void set_tail_lights_state(int state);
9762 
9764  int get_tail_lights_state() const;
9765 
9766 /*****************************************************************************/
9776  /*l
9777  *b Description:
9778  **
9779  ** This function will create a new active formation with this
9780  ** character as its leader. The formation followers will fall
9781  ** into the formation given by the formation name.
9782  **
9783  ** The formation is broken up, or disbanded, by calling
9784  ** break_formation().
9785  **
9786  *b Arguments:
9787  **
9788  *a formation_name - the name of the formation
9789  *a snap_to_position_flag - if 1, following characters will
9790  *a immediately snap to their assigned
9791  *a positions; otherwise following characters
9792  *a will move toward their assigned
9793  *a positions from their current positions
9794  *a break_existing_formations_flag - if 1, any formations this
9795  *a character is leading with be broken
9796  *a as if the break_formation() call were
9797  *a made
9798  **
9799  *b Returns:
9800  **
9801  ** 0 on success, -1 on failure
9802  **
9803  *b Available as Decision Bead/Event
9804  */
9805  int call_formation(const char* formation_name,
9806  int snap_to_position_flag = 0,
9807  int break_existing_formations_flag = 1);
9808 
9809  /*l
9810  *b Description:
9811  **
9812  ** This function breaks up a formation initiated by call_formation().
9813  **
9814  *b Arguments:
9815  **
9816  *a formation_name - the name of the formation to break;
9817  *a passing NULL or "(all)" will break all formations
9818  *a this character is leading
9819  **
9820  *b Returns:
9821  **
9822  ** 0 on success, -1 on failure
9823  **
9824  *b Available as Decision Bead/Event
9825  */
9826  int break_formation(const char* formation_name = NULL);
9827 
9828 
9829 /*****************************************************************************/
9837  /*l
9838  *b Description:
9839  **
9840  ** This function adds a copy of the specified scenario guide
9841  ** to the character. Any changes that are subsequently made
9842  ** to the added guide -- for example by a call to
9843  ** diguyCharacterGuide::set_algorithm_float_parameter() -- are
9844  ** private to this copy of the guide and will not affect others.
9845  **
9846  ** The guide will be enabled by default. Guides can be disabled
9847  ** by calling diguyCharacterGuide::set_guide_enabled(0), or by
9848  ** passing 1 for the argument automatically_disable_when_acquired.
9849  **
9850  ** Note that disabling a guide is not the same as removing it.
9851  ** Disabled guides are still a part of the character and can
9852  ** later be re-enabled by calling diguyCharacterGuide::set_enabled().
9853  **
9854  *b Arguments:
9855  **
9856  *a guide_name - name of guide to find and copy
9857  *a automatically_disable_when_acquired - set to 1 to have the guide
9858  *a be automatically disabled when it has acquired
9859  *a its target
9860  **
9861  *b Returns:
9862  **
9863  ** object of type diguyCharacterGuide; if a guide with guide_name
9864  ** is not found, returns NULL
9865  */
9866  diguyCharacterGuide* add_guide(const char* guide_name,
9867  int automatically_disable_when_acquired = 0);
9868 
9869  /*l
9870  *b Description:
9871  **
9872  ** This function creates a new guide and adds it to the character.
9873  **
9874  ** The guide will be enabled by default. Guides can be disabled
9875  ** by calling diguyCharacterGuide::set_guide_enabled(), or by
9876  ** passing 1 for the argument automatically_disable_when_acquired.
9877  **
9878  ** Important note: a new guide will always be created, even if one with
9879  ** the same name already exists
9880  **
9881  *b Arguments:
9882  **
9883  *a guide_name - name of guide to find and copy
9884  *a guide_algorithm - name of guide algorithm to be used
9885  *a automatically_disable_when_acquired - set to 1 to have the guide
9886  *a be automatically disabled when it has
9887  *a acquired its target
9888  **
9889  *b Returns:
9890  **
9891  ** object of type diguyCharacterGuide; if a guide with guide_name
9892  ** is not found, returns NULL
9893  */
9894  diguyCharacterGuide* create_guide(const char* guide_name,
9895  const char* guide_algorithm,
9896  int automatically_disable_when_acquired = 0);
9897 
9898  /*l
9899  *b Description:
9900  **
9901  ** Like create_guide(), but returns guide if it already exists
9902  **
9903  *b Arguments:
9904  **
9905  *a guide_name - name of guide to find and copy
9906  *a guide_algorithm - name of guide algorithm to be used
9907  *a automatically_disable_when_acquired - set to 1 to have the guide
9908  *a be automatically disabled when it has
9909  *a acquired its target
9910  **
9911  *b Returns:
9912  **
9913  ** object of type diguyCharacterGuide; if a guide with guide_name
9914  ** is not found, returns NULL
9915  */
9916  diguyCharacterGuide* find_or_create_guide(const char* guide_name,
9917  const char* guide_algorithm,
9918  int automatically_disable_when_acquired = 0);
9919 
9920  /*l
9921  *b Description:
9922  **
9923  ** This function returns a pointer to the specified guide
9924  ** of the character, if is exists.
9925  **
9926  *b Arguments:
9927  **
9928  *a guide_name - name of guide to find
9929  **
9930  *b Returns:
9931  **
9932  ** object of type diguyCharacterGuide; if a guide with guide_name
9933  ** is not found, returns NULL
9934  */
9935  diguyCharacterGuide* find_guide(const char* guide_name);
9936 
9937  /*l
9938  *b Description:
9939  **
9940  ** This function removes the specified guide from the
9941  ** character.
9942  **
9943  *b Arguments:
9944  **
9945  *a guide_name - name of the guide to remove; must match name
9946  *a used by add_guide() or create_guide() call
9947  **
9948  *b Returns:
9949  **
9950  ** 0 on success, -1 on failure
9951  */
9952  int remove_guide_with_name(const char* guide_name);
9953 
9954  /*l
9955  *b Description:
9956  **
9957  ** This function removes the specified guide from the
9958  ** character.
9959  **
9960  *b Arguments:
9961  **
9962  *a guide - object returned by add_guide() call
9963  **
9964  *b Returns:
9965  **
9966  ** 0 on success, -1 on failure
9967  */
9968  int remove_guide(diguyCharacterGuide* guide);
9969 
9970  /*l
9971  *b Description:
9972  **
9973  ** This function removes all guides from the character.
9974  **
9975  *b Returns:
9976  **
9977  ** 0 on success, -1 on failure
9978  */
9979  int remove_all_guides();
9980 
9981  /*l
9982  *b Description:
9983  **
9984  ** This function removes all guides that are disabled.
9985  **
9986  *b Returns:
9987  **
9988  ** 0 on success, -1 on failure
9989  */
9990  int remove_all_disabled_guides();
9991 
9992 
9993 /*****************************************************************************/
10003  /*l
10004  *b Description:
10005  **
10006  ** This function adds a "motion texture" to the character. A
10007  ** motion texture is a relatively long (usually 10 seconds or
10008  ** more) loop that will add natural-looking, low amplitude
10009  ** joint angle adjustments.
10010  **
10011  ** This function will have no effect on a dead character (see
10012  ** die_now() and get_dead()).
10013  **
10014  *b Arguments:
10015  **
10016  *a motex_name - name of the motion texture to add; see below
10017  *a texture_gain - the relative amplitude of the motion texture;
10018  *a higher numbers result in more pronounced
10019  *a movements
10020  *a end_previous_motex - flag denoting whether this motion texture
10021  *a replaces all previously added motion
10022  *a textures; pass 1 to end existing textures
10023  *a rampup_interval - how long, in seconds, to take ramping up
10024  *a into the motion texture
10025  **
10026  ** List of currently available motion textures:
10027  **
10028  *- - "default"
10029  *- - "motex_stand_casual"
10030  **
10031  ** If 1 is passed for the argument end_previous_motex, the
10032  ** rampup_interval argument will be used as the interval for
10033  ** ending existing motion textures.
10034  **
10035  *b Returns:
10036  **
10037  ** 0 on success, -1 on failure
10038  **
10039  */
10040  int add_motion_texture(const char* motex_name = "default",
10041  float texture_gain = 1.0f,
10042  int end_previous_motex = 1,
10043  float rampup_interval = 0.2f);
10044 
10045  /*l
10046  *b Description:
10047  **
10048  ** This function gradually ends any active motion textures added by
10049  ** add_motion_texture().
10050  **
10051  *b Arguments:
10052  **
10053  *a rampdown_interval - how long, in seconds, to take ending the
10054  *a motion texture
10055  **
10056  *b Returns:
10057  **
10058  ** 0 on success, -1 on failure
10059  */
10060  int end_motion_texture(float rampdown_interval = 0.2f);
10061 
10062  /*l
10063  *b Description:
10064  **
10065  ** This function sets an initial motion texture that should be
10066  ** used by the character whenever the character is loaded from
10067  ** a scenario or the character's scenario is reset.
10068  **
10069  ** The gain of the motion texture can be set by calling
10070  ** set_initial_motion_texture_gain(). The initial motion
10071  ** texture gain is 1.0 by default.
10072  **
10073  *b See Also:
10074  **
10075  ** add_motion_texture(), set_initial_motion_texture_gain()
10076  **
10077  *b Arguments:
10078  **
10079  *a motex_name - name of the motion texture
10080  **
10081  *b Returns:
10082  **
10083  ** 0 on success, -1 on failure
10084  */
10085  int set_initial_motion_texture(const char* motex_name);
10086 
10087  /*l
10088  *b Description:
10089  **
10090  ** This function returns the initial motion texture as set
10091  ** by a call to set_initial_motion_texture().
10092  **
10093  *b Returns:
10094  **
10095  ** name of initial motion texture
10096  */
10097  const char* get_initial_motion_texture();
10098 
10099  /*l
10100  *b Description:
10101  **
10102  ** This function sets the gain of the initial motion texture
10103  ** of the character. The initial motion texture can be set
10104  ** by calling set_initial_motion_texture().
10105  **
10106  *b Arguments:
10107  **
10108  *a motex_gain - gain of the motion texture; higher gains
10109  *a result in more pronounced motion
10110  **
10111  *b Returns:
10112  **
10113  ** 0 on success, -1 on failure
10114  */
10115  int set_initial_motion_texture_gain(float motex_gain);
10116 
10117  /*l
10118  *b Description:
10119  **
10120  ** This function returns the initial motion texture gain as set
10121  ** by a call to set_initial_motion_texture_gain().
10122  **
10123  *b Returns:
10124  **
10125  ** gain of initial motion texture
10126  */
10127  float get_initial_motion_texture_gain();
10128 
10129 
10130 /*****************************************************************************/
10140  /*l
10141  *b Description:
10142  **
10143  ** This function sets what type of "history" will be kept for the
10144  ** character.
10145  **
10146  ** If time is run backwards in a scenario, characters
10147  ** with history will replay the motions they performed at that
10148  ** time. Characters without history will stay frozen in place
10149  ** until time advances past the point from which it was run
10150  ** backwards.
10151  **
10152  ** The default is DIGUY_HISTORY_TYPE_NONE for characters created
10153  ** using the diguyScenario::create_character() function.
10154  ** Characters loaded from a .dss file will retain their history
10155  ** settings from the DI-Guy Scenario editing session.
10156  **
10157  *b Arguments:
10158  **
10159  *a history_type - history type to be used for the character
10160  **
10161  ** history_type should be one of the following values:
10162  **
10163  *i DIGUY_HISTORY_TYPE_NONE
10164  **
10165  ** This history type saves no history.
10166  **
10167  *i DIGUY_HISTORY_TYPE_COMPLETE
10168  **
10169  ** This history type saves all of a character's history.
10170  **
10171  ** The initial amount of history to be saved, before memory buffers
10172  ** need to be resized, can be set by the function
10173  ** set_history_size_t(). The size by which memory buffers grow each
10174  ** time they do need to get resized by be set by
10175  ** set_history_size_increment_t().
10176  **
10177  *i DIGUY_HISTORY_TYPE_FIRST
10178  **
10179  ** This history type is no longer supported. Characters from
10180  ** a .dss that have this history type will have their history
10181  ** type set to DIGUY_HISTORY_TYPE_COMPLETE.
10182  **
10183  *i DIGUY_HISTORY_TYPE_LAST
10184  **
10185  ** This history type is no longer supported. Characters from
10186  ** a .dss that have this history type will have their history
10187  ** type set to DIGUY_HISTORY_TYPE_COMPLETE.
10188  **
10189  *b Returns:
10190  **
10191  ** 0 on success, -1 on failure
10192  */
10193  int set_history_type(diguyHistoryType history_type);
10194 
10195  /*l
10196  *b Returns:
10197  **
10198  ** the current history type of the character; see
10199  ** set_history_type()
10200  */
10201  diguyHistoryType get_history_type();
10202 
10203  /*l
10204  *b Description:
10205  **
10206  ** This function sets the size of the character's history
10207  ** buffer, in seconds.
10208  **
10209  *b Arguments:
10210  **
10211  *a t - length of history buffer, in seconds
10212  **
10213  *b Returns:
10214  **
10215  ** 0 on success, -1 on failure
10216  */
10217  int set_history_size_t(float t);
10218 
10219  /*l
10220  *b Description:
10221  **
10222  ** This function returns the current history buffer size.
10223  ** See set_history_size_t().
10224  **
10225  *b Returns:
10226  **
10227  ** current history size
10228  */
10229  float get_history_size_t();
10230 
10231  /*l
10232  *b Description:
10233  **
10234  ** This function sets the size of the character's history
10235  ** buffer increment, in seconds.
10236  **
10237  *b Arguments:
10238  **
10239  *a t - length of history buffer increment, in seconds
10240  **
10241  *b Returns:
10242  **
10243  ** 0 on success, -1 on failure
10244  */
10245  int set_history_size_increment_t(float t);
10246 
10247  /*l
10248  *b Description:
10249  **
10250  ** This function returns the current history buffer size increment.
10251  ** See set_history_size_increment_t().
10252  **
10253  *b Returns:
10254  **
10255  ** current history size increment
10256  */
10257  float get_history_size_increment_t();
10258 
10259 
10260 /*****************************************************************************/
10270  /*l
10271  *b Description:
10272  **
10273  ** This function sets the desired posture of the character. This,
10274  ** along with the desired variant, is used primarily by some guides.
10275  ** Specifically, to help choose which actions are used to reach the
10276  ** desired position and orientation of the character.
10277  **
10278  ** Pass DIGUY_MOTION_POSTURE_ANY for there to be no desired posture.
10279  **
10280  *b Arguments:
10281  **
10282  *a posture - new desired posture
10283  */
10284  void set_desired_posture(diguyMotionPosture desired_posture);
10285 
10286  /*l
10287  *b Returns:
10288  **
10289  ** current desired posture of the character
10290  */
10291  diguyMotionPosture get_desired_posture();
10292 
10293  /*l
10294  *b Description:
10295  **
10296  ** This function sets the desired variant of the character. This,
10297  ** along with the desired posture, is used primarily by some guides.
10298  ** Specifically, to help choose which actions are used to reach the
10299  ** desired position and orientation of the character.
10300  **
10301  ** Pass DIGUY_MOTION_VARIANT_ANY for there to be no desired variant.
10302  **
10303  *b Arguments:
10304  **
10305  *a variant - new desired variant
10306  */
10307  void set_desired_variant(diguyMotionVariant desired_variant);
10308 
10310  diguyMotionVariant get_desired_variant();
10311 
10312  /*l
10313  *b Description:
10314  **
10315  ** This function looks up the character action that most closely
10316  ** matches the given criteria.
10317  **
10318  *b Arguments:
10319  **
10320  *a direction - the direction of travel relative to
10321  *a the character's facing direction
10322  *a posture - overall desired posture; pass
10323  *a DIGUY_MOTION_POSTURE_ANY
10324  *a to specify that any posture will do
10325  *a variant - overall desired variant; pass
10326  *a DIGUY_MOTION_VARIANT_ANY
10327  *a to specify that any variant will do
10328  *a speed - speed in meters per second
10329  *a comparison - how the passed speed should compare
10330  *a to the action's speed
10331  *a comparison_tolerance - tolerance of comparison
10332  *a match_posture_before_variant - pass 1 if posture should be matched
10333  *a before variant if an exact match is
10334  *a not found; pass 0 if variant should
10335  *a be matched before posture
10336  *a posture_alternate1 - if an exact match is not found, use this
10337  *a as the first alternate posture; pass
10338  *a DIGUY_MOTION_POSTURE_UNKNOWN
10339  *a to specify that no alternate should be used
10340  *a posture_alternate2 - if an exact match is not found, use this
10341  *a as the second alternate posture; pass
10342  *a DIGUY_MOTION_POSTURE_UNKNOWN
10343  *a to specify that no alternate should be used
10344  *a variant_alternate1 - if an exact match is not found, use this
10345  *a as the first alternate variant; pass
10346  *a DIGUY_MOTION_VARIANT_UNKNOWN
10347  *a to specify that no alternate should be used
10348  *a variant_alternate2 - if an exact match is not found, use this
10349  *a as the second alternate variant; pass
10350  *a DIGUY_MOTION_VARIANT_UNKNOWN
10351  *a to specify that no alternate should be used
10352  *a return_random_match - (Experimental) if multiple actions match the
10353  *a specified criteria randomly return one of
10354  *a them. Typically only used for still motions
10355  *a and restricted to EQUAL and NEAREST
10356  *a comparisons
10357  **
10358  ** The direction argument should be one of the following:
10359  **
10360  *- - DIGUY_MOTION_DIRECTION_NONE - does not move character
10361  *- - DIGUY_MOTION_DIRECTION_FORWARD - moves character forward
10362  *- - DIGUY_MOTION_DIRECTION_BACKWARD - moves character backward
10363  *- - DIGUY_MOTION_DIRECTION_LEFT - moves character left
10364  *- - DIGUY_MOTION_DIRECTION_RIGHT - moves character right
10365  *- - DIGUY_MOTION_DIRECTION_UP - moves character up
10366  *- - DIGUY_MOTION_DIRECTION_DOWN - moves character down
10367  *- - DIGUY_MOTION_DIRECTION_TURN_LEFT - turns character left
10368  *- - DIGUY_MOTION_DIRECTION_TURN_RIGHT - turns character right
10369  *- - DIGUY_MOTION_DIRECTION_NONLINEAR - moves character in
10370  *- multiple directions
10371  *- - DIGUY_MOTION_DIRECTION_LINEAR_OFFAXIS - moves character in a
10372  *- line, but not on any
10373  *- of the principle axes
10374  **
10375  ** Not every direction is supported by every character. If the
10376  ** character does not have any actions that move in the specified
10377  ** direction, the returned action will be NULL.
10378  **
10379  ** Use the calls diguyScenario::get_character_type_num_directions()
10380  ** and diguyScenario::get_character_type_direction_at_index() to
10381  ** enumerate which directions a character can travel.
10382  **
10383  ** The posture arguments should be one of the following:
10384  **
10385  *- - DIGUY_MOTION_POSTURE_UNKNOWN - unknown posture
10386  *- - DIGUY_MOTION_POSTURE_ANY - any posture; a wildcard
10387  *- - DIGUY_MOTION_POSTURE_UPRIGHT - upright posture; e.g., standing
10388  *- or walking
10389  *- - DIGUY_MOTION_POSTURE_CROUCHED - crouched posture; e.g., kneeling
10390  *- or walking low
10391  *- - DIGUY_MOTION_POSTURE_PRONE - prone posture; e.g., lying prone
10392  *- or crawling
10393  *- - DIGUY_MOTION_POSTURE_SITTING - sitting posture
10394  **
10395  ** The posture arguments specify the overall posture the action
10396  ** should have. Most characters have an upright posture.
10397  ** The other postures a character has is dependent on character type.
10398  ** Passing DIGUY_MOTION_POSTURE_ANY for the arguments posture,
10399  ** posture_alternate1, or posture_alternate2 means that the posture of
10400  ** the action should not be used to determine a match.
10401  **
10402  ** Use the calls diguyScenario::get_character_type_num_postures()
10403  ** and diguyScenario::get_character_type_posture_at_index() to
10404  ** enumerate which postures a specific character type has.
10405  **
10406  ** The variant arguments specify the overall mood the action should
10407  ** convey. Most characters have a "normal" variant. The other
10408  ** variants a character has is dependent on character type. Passing
10409  ** DIGUY_MOTION_VARIANT_ANY for the arguments variant,
10410  ** variant_alternate1, or variant_alternate2 means that the variant of
10411  ** the action should not be used to determine a match.
10412  **
10413  ** Use the calls diguyScenario::get_character_type_num_variants()
10414  ** and diguyScenario::get_character_type_variant_at_index() to
10415  ** enumerate which variants a specific character type has.
10416  **
10417  ** The comparison argument should be one of the following:
10418  **
10419  *- - DIGUY_PARAMETER_COMPARISON_EQUAL - matched action's speed
10420  *- must be within
10421  *- comparison_tolerance of
10422  *- passed speed
10423  *- - DIGUY_PARAMETER_COMPARISON_NEAREST - matched action's speed
10424  *- is closer than any other
10425  *- potential match's, but
10426  *- still within
10427  *- comparison_tolerance
10428  *- - DIGUY_PARAMETER_COMPARISON_GREATER - matched action's speed
10429  *- faster than passed speed,
10430  *- but still within
10431  *- comparison_tolerance
10432  *- - DIGUY_PARAMETER_COMPARISON_LESS - matched action's speed
10433  *- slower than passed speed,
10434  *- but still within
10435  *- comparison_tolerance
10436  *-
10437  ** The difference between DIGUY_PARAMETER_COMPARISON_EQUAL and
10438  ** DIGUY_PARAMETER_COMPARISON_NEAREST is largely in the
10439  ** value used for comparison_tolerance if DIGUY_DEFAULT_FLOAT is
10440  ** passed; the comparison_tolerance argument defaults to 0.001 for
10441  ** DIGUY_PARAMETER_COMPARISON_EQUAL, and 16384.0 for all
10442  ** other comparison types. Otherwise these two comparison types
10443  ** operate the same.
10444  **
10445  *b Returns:
10446  **
10447  ** name of an action if a match is found, NULL if not
10448  **
10449  *b C++ Example:
10450  **
10451  *e diguyCharacter* ch = scenario->get_character_at_index(0);
10452  *e const char* new_action;
10453  *e
10454  *e //
10455  *e // Get an action that moves forward in an upright posture,
10456  *e // whose speed move at least 2.0 meters per second:
10457  *e //
10458  *e new_action = ch->get_action_from_description(
10459  *e DIGUY_MOTION_DIRECTION_FORWARD,
10460  *e DIGUY_MOTION_POSTURE_UPRIGHT,
10461  *e DIGUY_MOTION_VARIANT_ANY,
10462  *e 2.0,
10463  *e DIGUY_PARAMETER_COMPARISON_GREATER, DIGUY_DEFAULT_FLOAT);
10464  *e
10465  *e //
10466  *e // Get an action that is standing still, with the variant
10467  *e // DIGUY_MOTION_VARIANT_READY. If no action has that variant,
10468  *e // try DIGUY_MOTION_VARIANT_AIM as variant_alternate1,
10469  *e // and DIGUY_MOTION_VARIANT_ANY as variant_alternate2:
10470  *e //
10471  *e new_action = ch->get_action_from_description(
10472  *e DIGUY_MOTION_DIRECTION_NONE,
10473  *e DIGUY_MOTION_POSTURE_ANY,
10474  *e DIGUY_MOTION_VARIANT_READY,
10475  *e 0.0,
10476  *e DIGUY_PARAMETER_COMPARISON_NEAREST, DIGUY_DEFAULT_FLOAT,
10477  *e 0,
10478  *e DIGUY_MOTION_POSTURE_UNKNOWN,
10479  *e DIGUY_MOTION_POSTURE_UNKNOWN,
10480  *e DIGUY_MOTION_VARIANT_AIM,
10481  *e DIGUY_MOTION_VARIANT_ANY);
10482  **
10483  */
10484  const char* get_action_from_description(diguyMotionDirection direction,
10485  diguyMotionPosture posture,
10486  diguyMotionVariant variant,
10487  float speed,
10489  float comparison_tolerance = DIGUY_DEFAULT_FLOAT,
10490  int match_posture_before_variant = 1,
10491  diguyMotionPosture posture_alternate1 = DIGUY_MOTION_POSTURE_UNKNOWN,
10492  diguyMotionPosture posture_alternate2 = DIGUY_MOTION_POSTURE_UNKNOWN,
10493  diguyMotionVariant variant_alternate1 = DIGUY_MOTION_VARIANT_UNKNOWN,
10494  diguyMotionVariant variant_alternate2 = DIGUY_MOTION_VARIANT_UNKNOWN,
10495  int return_random_match = 0);
10496 
10497  /*l
10498  *b Description:
10499  **
10500  ** This function is very similar to get_action_from_description(),
10501  ** but substitutes turn amount per action iteration for speed.
10502  **
10503  *b Arguments:
10504  **
10505  *a direction - the direction of travel relative to
10506  *a the character's facing direction
10507  *a posture - overall desired posture; pass
10508  *a DIGUY_MOTION_POSTURE_ANY
10509  *a to specify that any posture will do
10510  *a variant - overall desired variant; pass
10511  *a DIGUY_MOTION_VARIANT_ANY
10512  *a to specify that any variant will do
10513  *a turn_amount - how many degrees each iteration of the
10514  *a action should turn the character
10515  *a comparison - how the passed turn amount should compare
10516  *a to the action's turn amount
10517  *a comparison_tolerance - tolerance of comparison
10518  *a match_posture_before_variant - pass 1 if posture should be matched
10519  *a before variant if an exact match is
10520  *a not found; pass 0 if variant should
10521  *a be matched before posture
10522  *a posture_alternate1 - if an exact match is not found, use this
10523  *a as the first alternate posture; pass
10524  *a DIGUY_MOTION_POSTURE_UNKNOWN
10525  *a to specify that no alternate should be used
10526  *a posture_alternate2 - if an exact match is not found, use this
10527  *a as the second alternate posture; pass
10528  *a DIGUY_MOTION_POSTURE_UNKNOWN
10529  *a to specify that no alternate should be used
10530  *a variant_alternate1 - if an exact match is not found, use this
10531  *a as the first alternate variant; pass
10532  *a DIGUY_MOTION_VARIANT_UNKNOWN
10533  *a to specify that no alternate should be used
10534  *a variant_alternate2 - if an exact match is not found, use this
10535  *a as the second alternate variant; pass
10536  *a DIGUY_MOTION_VARIANT_UNKNOWN
10537  *a to specify that no alternate should be used
10538  **
10539  ** The direction argument should be one of the following:
10540  **
10541  *- - DIGUY_MOTION_DIRECTION_TURN_LEFT - turns character left
10542  *- - DIGUY_MOTION_DIRECTION_TURN_RIGHT - turns character right
10543  **
10544  ** Not every direction is supported by every character. If the
10545  ** character does not have any actions that move in the specified
10546  ** direction, the returned action will be NULL.
10547  **
10548  ** The turn amount argument should be a positive number.
10549  **
10550  ** Refer to get_action_from_description() for more information on
10551  ** other arguments.
10552  **
10553  *b Returns:
10554  **
10555  ** name of an action if a match is found, NULL if not
10556  **
10557  */
10558  const char* get_turning_action_from_description(diguyMotionDirection direction,
10559  diguyMotionPosture posture,
10560  diguyMotionVariant variant,
10561  float turn_amount,
10563  float comparison_tolerance = DIGUY_DEFAULT_FLOAT,
10564  int match_posture_before_variant = 1,
10565  diguyMotionPosture posture_alternate1 = DIGUY_MOTION_POSTURE_UNKNOWN,
10566  diguyMotionPosture posture_alternate2 = DIGUY_MOTION_POSTURE_UNKNOWN,
10567  diguyMotionVariant variant_alternate1 = DIGUY_MOTION_VARIANT_UNKNOWN,
10568  diguyMotionVariant variant_alternate2 = DIGUY_MOTION_VARIANT_UNKNOWN);
10569 
10570 
10571 /*****************************************************************************/
10581  /*l
10582  *b Returns:
10583  **
10584  ** number of variables the character has
10585  */
10586  int get_num_variables();
10587 
10588  /*l
10589  *b Returns:
10590  **
10591  ** pointer of type diguyVariable; NULL if no
10592  ** variable at the specified index
10593  **
10594  *b Arguments:
10595  **
10596  *a index - index of the variable; indices start at 0
10597  */
10598  diguyVariable* get_variable_at_index(int index);
10599 
10600  /*l
10601  *b Description:
10602  **
10603  ** This function returns a pointer to the specified variable.
10604  **
10605  *b Arguments:
10606  **
10607  *a name - name of variable to be found
10608  **
10609  *b Returns:
10610  **
10611  ** pointer of type diguyVariable; NULL if not found
10612  */
10613  diguyVariable* find_variable(const char* name);
10614 
10615  /*l
10616  *b Description:
10617  **
10618  ** This function finds the variable with the given name or
10619  ** creates it if it doesn't exist.
10620  **
10621  *b Arguments:
10622  **
10623  *a name - name of the variable to find or create
10624  **
10625  *b Returns:
10626  **
10627  ** pointer of type diguyVariable; should never be NULL
10628  */
10629  diguyVariable* find_or_create_variable(const char* name);
10630 
10631  /*l
10632  *b Description:
10633  **
10634  ** This function destroys the passed variable.
10635  **
10636  *b Arguments:
10637  **
10638  *a variable - pointer to a diguyVariable
10639  **
10640  *b Returns:
10641  **
10642  ** 0 on success, -1 on failure
10643  */
10644  int destroy_variable(diguyVariable* variable);
10645 
10646  /*l
10647  *b Returns:
10648  **
10649  ** 1 if variable is equal to passed value,
10650  ** 0 if not
10651  **
10652  *b Arguments:
10653  **
10654  *a varname - name of variable to compare
10655  *a value - value to compare against
10656  **
10657  *b Available as Decision Bead/Event
10658  */
10659  int variable_equal_to_int(const char* varname, int value);
10660 
10661  /*l
10662  *b Returns:
10663  **
10664  ** 1 if variable is greater than passed value,
10665  ** 0 if not
10666  **
10667  *b Arguments:
10668  **
10669  *a varname - name of variable to compare
10670  *a value - value to compare against
10671  **
10672  *b Available as Decision Bead/Event
10673  */
10674  int variable_greater_than_int(const char* varname, int value);
10675 
10676  /*l
10677  *b Returns:
10678  **
10679  ** 1 if variable is less than passed value,
10680  ** 0 if not
10681  **
10682  *b Arguments:
10683  **
10684  *a varname - name of variable to compare
10685  *a value - value to compare against
10686  **
10687  *b Available as Decision Bead/Event
10688  */
10689  int variable_less_than_int(const char* varname, int value);
10690 
10691  /*l
10692  *b Returns:
10693  **
10694  ** 1 if variable is equal to passed value,
10695  ** 0 if not
10696  **
10697  *b Arguments:
10698  **
10699  *a varname - name of variable to compare
10700  *a value - value to compare against
10701  **
10702  *b Available as Decision Bead/Event
10703  */
10704  int variable_equal_to_float(const char* varname, float value);
10705 
10706  /*l
10707  *b Returns:
10708  **
10709  ** 1 if variable is greater than passed value,
10710  ** 0 if not
10711  **
10712  *b Arguments:
10713  **
10714  *a varname - name of variable to compare
10715  *a value - value to compare against
10716  **
10717  *b Available as Decision Bead/Event
10718  */
10719  int variable_greater_than_float(const char* varname, float value);
10720 
10721  /*l
10722  *b Returns:
10723  **
10724  ** 1 if variable is less than passed value,
10725  ** 0 if not
10726  **
10727  *b Arguments:
10728  **
10729  *a varname - name of variable to compare
10730  *a value - value to compare against
10731  **
10732  *b Available as Decision Bead/Event
10733  */
10734  int variable_less_than_float(const char* varname, float value);
10735 
10736  /*l
10737  *b Returns:
10738  **
10739  ** 1 if variable is equal than passed value,
10740  ** 0 if not
10741  **
10742  *b Arguments:
10743  **
10744  *a varname - name of variable to compare
10745  *a value - value to compare against
10746  **
10747  *b Available as Decision Bead/Event
10748  */
10749  int variable_equal_to_string(const char* varname, const char* value);
10750 
10751  /*l
10752  *b Returns:
10753  **
10754  ** 1 if variable is greater than passed value (comes
10755  ** later alphabetically), 0 if not
10756  **
10757  *b Arguments:
10758  **
10759  *a varname - name of variable to compare
10760  *a value - value to compare against
10761  **
10762  *b Available as Decision Bead/Event
10763  */
10764  int variable_greater_than_string(const char* varname, const char* value);
10765 
10766  /*l
10767  *b Returns:
10768  **
10769  ** 1 if variable is less than passed value (comes
10770  ** sooner alphabetically), 0 if not
10771  **
10772  *b Arguments:
10773  **
10774  *a varname - name of variable to compare
10775  *a value - value to compare against
10776  **
10777  *b Available as Decision Bead/Event
10778  */
10779  int variable_less_than_string(const char* varname, const char* value);
10780 
10781  /*l
10782  *b Description:
10783  **
10784  ** This function decrements the variable by the passed amount.
10785  **
10786  *b Arguments:
10787  **
10788  *a varname - name of variable to modify
10789  *a value - amount to decrement
10790  **
10791  *b Returns:
10792  **
10793  ** 0 on success, -1 on failure
10794  **
10795  *b Available as Decision Bead/Event
10796  */
10797  int variable_decrement_value_as_int(const char* varname, int value = 1);
10798 
10799  /*l
10800  *b Description:
10801  **
10802  ** This function increments the variable by the passed amount.
10803  **
10804  *b Arguments:
10805  **
10806  *a varname - name of variable to modify
10807  *a value - amount to increment
10808  **
10809  *b Returns:
10810  **
10811  ** 0 on success, -1 on failure
10812  **
10813  *b Available as Decision Bead/Event
10814  */
10815  int variable_increment_value_as_int(const char* varname, int value = 1);
10816 
10817  /*l
10818  *b Description:
10819  **
10820  ** This function is a convenience function for setting the variable
10821  ** to a new integer value without retrieving the diguyVariable
10822  ** object.
10823  **
10824  *b Arguments:
10825  **
10826  *a varname - name of variable to modify
10827  *a value - new value
10828  *a create_if_doesnt_exist - pass 1 to create the variable if it
10829  *a doesn't exist
10830  **
10831  *b Returns:
10832  **
10833  ** 0 on success, -1 on failure
10834  **
10835  *b Available as Decision Bead/Event
10836  */
10837  int variable_set_value_as_int(const char* varname,
10838  int value,
10839  int create_if_doesnt_exist = 1);
10840 
10841  /*l
10842  *b Description:
10843  **
10844  ** Short form of variable_set_value_as_int().
10845  */
10846  int set_ivar(const char* varname,
10847  int value,
10848  int create_if_doesnt_exist = 1);
10849 
10850  /*l
10851  *b Description:
10852  **
10853  ** This function is a convenience function for retrieving the
10854  ** value of a variable without retrieving the diguyVariable
10855  ** object.
10856  **
10857  ** If the variable doesn't exist and create_if_doesnt_exist is
10858  ** 0, the returned value will be 0.
10859  **
10860  *b Arguments:
10861  **
10862  *a varname - name of variable to query
10863  *a create_if_doesnt_exist - pass 1 to create the variable if it
10864  *a doesn't exist
10865  **
10866  *b Returns:
10867  **
10868  ** value of variable as int
10869  */
10870  int get_ivar(const char* varname,
10871  int create_if_doesnt_exist = 1);
10872 
10873  /*l
10874  *b Description:
10875  **
10876  ** Similar to variable_set_value_as_int(), for sets a
10877  ** floating point value instead.
10878  */
10879  int variable_set_value_as_float(const char* varname,
10880  float value,
10881  int create_if_doesnt_exist = 1);
10882 
10883  /*l
10884  *b Description:
10885  **
10886  ** Short form of variable_set_value_as_float().
10887  */
10888  int set_fvar(const char* varname,
10889  float value,
10890  int create_if_doesnt_exist = 1);
10891 
10892  /*l
10893  *b Description:
10894  **
10895  ** Similar to variable_get_value_as_int(), for returns a
10896  ** floating point value instead.
10897  **
10898  ** If the variable doesn't exist and create_if_doesnt_exist is
10899  ** 0, the returned value will be 0.0.
10900  */
10901  float get_fvar(const char* varname,
10902  int create_if_doesnt_exist = 1);
10903 
10904  /*l
10905  *b Description:
10906  **
10907  ** Similar to variable_set_value_as_int(), for sets a
10908  ** string value instead.
10909  */
10910  int variable_set_value_as_string(const char* varname,
10911  const char* value,
10912  int create_if_doesnt_exist = 1);
10913 
10914  /*l
10915  *b Description:
10916  **
10917  ** Short form of variable_set_value_as_string().
10918  */
10919  int set_svar(const char* varname,
10920  const char* value,
10921  int create_if_doesnt_exist = 1);
10922 
10923  /*l
10924  *b Description:
10925  **
10926  ** Similar to variable_get_value_as_int(), for returns a
10927  ** string value instead.
10928  **
10929  ** If the variable doesn't exist and create_if_doesnt_exist is
10930  ** 0, the returned value will be "".
10931  */
10932  const char* get_svar(const char* varname,
10933  int create_if_doesnt_exist = 1);
10934 
10935 
10936 /*****************************************************************************/
10951  /*l
10952  *b Description:
10953  **
10954  ** This function returns a pointer to the label object of
10955  ** the character.
10956  **
10957  ** Currently character labels are only enabled in DI-Guy Scenario.
10958  **
10959  *b Returns:
10960  **
10961  ** pointer to the character's label
10962  */
10963  diguyViewLabel* get_name_label();
10964 
10965  /*l
10966  *b Description:
10967  **
10968  ** This function sets the text of the character's label.
10969  ** By default the label text matches the character's name.
10970  **
10971  ** Currently character labels are only enabled in DI-Guy Scenario.
10972  **
10973  *b Arguments:
10974  **
10975  *a label_text - new text for the label
10976  **
10977  *b Returns:
10978  **
10979  ** 0 on success, -1 on failure
10980  */
10981  int set_label_text(const char* label_text);
10982 
10983  /*l
10984  *b Description:
10985  **
10986  ** This function returns the character's label text.
10987  ** See set_label_text().
10988  **
10989  *b Returns:
10990  **
10991  ** current label text; the returned pointer will never be NULL
10992  */
10993  const char* get_label_text();
10994 
10995  /*l
10996  *b Description:
10997  **
10998  ** This function sets whether the label of this character
10999  ** is visible. This setting will only be taken into account
11000  ** if the visibility flag for Character Labels is set to
11001  ** "Per Object".
11002  **
11003  ** Currently character labels are only enabled in DI-Guy Scenario.
11004  **
11005  *b Arguments:
11006  **
11007  *a is_visible - pass 1 to show, pass 0 to hide
11008  **
11009  *b Returns:
11010  **
11011  ** 0 on success, -1 on failure
11012  */
11013  int set_label_is_visible(int is_visible);
11014 
11015  /*l
11016  *b Description:
11017  **
11018  ** This function returns the most recent setting of
11019  ** set_label_is_visible().
11020  **
11021  *b Returns:
11022  **
11023  ** 1 if visible, 0 if not
11024  */
11025  int get_label_is_visible();
11026 
11027  /*l
11028  *b Description:
11029  **
11030  ** This function sets the text color of the character's label. By
11031  ** default the label text color is opaque white.
11032  **
11033  ** Currently character labels are only enabled in DI-Guy Scenario.
11034  **
11035  *b Arguments:
11036  **
11037  *a r, g, b, a - the red, green, blue, and alpha
11038  *a components of the text color
11039  **
11040  ** An alpha component of 0 makes the text completely transparent.
11041  ** An alpha component of 1 makes the text completely opaque.
11042  ** Values in between result in varying levels of transparency.
11043  **
11044  *b Returns:
11045  **
11046  ** 0 on success, -1 on failure
11047  */
11048  int set_label_text_color(float r, float g, float b, float a);
11049 
11050  /*l
11051  *b Description:
11052  **
11053  ** Alternate version of set_label_text_color().
11054  */
11055  int set_label_text_color_vec4(const diguyVec4f & color);
11056 
11057  /*l
11058  *b Description:
11059  **
11060  ** This function returns, in the passed variable pointers, the
11061  ** most recent setting of set_label_text_color().
11062  **
11063  *b Returns:
11064  **
11065  ** 0 on success, -1 on failure
11066  */
11067  int get_label_text_color(float* r, float* g, float* b, float* a);
11068 
11069  /*l
11070  *b Description:
11071  **
11072  ** Alternate version of get_label_text_color().
11073  */
11074  diguyVec4f get_label_text_color_vec4();
11075 
11076  /*l
11077  *b Description:
11078  **
11079  ** This function sets the text shadow color of the character's label.
11080  ** By default the label text shadow color is gray.
11081  **
11082  ** Currently character labels are only enabled in DI-Guy Scenario.
11083  **
11084  *b Arguments:
11085  **
11086  *a r, g, b, a - the red, green, blue, and alpha
11087  *a components of the text shadow color
11088  **
11089  ** An alpha component of 0 makes the text completely transparent.
11090  ** An alpha component of 1 makes the text completely opaque.
11091  ** Values in between result in varying levels of transparency.
11092  **
11093  *b Returns:
11094  **
11095  ** 0 on success, -1 on failure
11096  */
11097  int set_label_text_shadow_color(float r, float g, float b, float a);
11098 
11099  /*l
11100  *b Description:
11101  **
11102  ** Alternate version of set_label_text_shadow_color().
11103  */
11104  int set_label_text_shadow_color_vec4(const diguyVec4f & color);
11105 
11106  /*l
11107  *b Description:
11108  **
11109  ** This function returns, in the passed variable pointers, the
11110  ** most recent setting of set_label_text_shadow_color().
11111  **
11112  *b Returns:
11113  **
11114  ** 0 on success, -1 on failure
11115  */
11116  int get_label_text_shadow_color(float* r, float* g, float* b, float* a);
11117 
11118  /*l
11119  *b Description:
11120  **
11121  ** Alternate version of get_label_text_shadow_color().
11122  */
11123  diguyVec4f get_label_text_shadow_color_vec4();
11124 
11125  /*l
11126  *b Description:
11127  **
11128  ** This function sets the whether the text shadow is visible.
11129  **
11130  *b Arguments:
11131  **
11132  *a visible - pass 1 to make shadow visible, 0 to make it invisible
11133  **
11134  *b Returns:
11135  **
11136  ** 0 on success, -1 on failure
11137  */
11138  int set_label_text_shadow_is_visible(int is_visible);
11139 
11140  /*l
11141  *b Returns:
11142  **
11143  ** 1 if text shadow is visible, 0 if not
11144  */
11145  int get_label_text_shadow_is_visible();
11146 
11147  /*l
11148  *b Description:
11149  **
11150  ** This function sets the background color of the character's
11151  ** label. By default the label background color is transparent
11152  ** blue.
11153  **
11154  ** Currently character labels are only enabled in DI-Guy Scenario.
11155  **
11156  *b Arguments:
11157  **
11158  *a r, g, b, a - the red, green, blue, and alpha
11159  *a components of the text color
11160  **
11161  ** An alpha component of 0 makes the text completely transparent.
11162  ** An alpha component of 1 makes the text completely opaque.
11163  ** Values in between result in varying levels of transparency.
11164  **
11165  *b Returns:
11166  **
11167  ** 0 on success, -1 on failure
11168  */
11169  int set_label_background_color(float r, float g, float b, float a);
11170 
11171  /*l
11172  *b Description:
11173  **
11174  ** Alternate version of set_label_background_color().
11175  */
11176  int set_label_background_color_vec4(const diguyVec4f & color);
11177 
11178  /*l
11179  *b Description:
11180  **
11181  ** This function returns, in the passed variable pointers, the
11182  ** most recent setting of set_label_background_color().
11183  **
11184  *b Returns:
11185  **
11186  ** 0 on success, -1 on failure
11187  */
11188  int get_label_background_color(float* r, float* g, float* b, float* a);
11189 
11190  /*l
11191  *b Description:
11192  **
11193  ** Alternate version of get_label_background_color().
11194  */
11195  diguyVec4f get_label_background_color_vec4();
11196 
11197  /*l
11198  *b Description:
11199  **
11200  ** This function sets how high the label of the character will float
11201  ** above the character.
11202  **
11203  *b Arguments:
11204  **
11205  *a offset - offset, in meters, of label above character
11206  */
11207  void set_label_link_offset_override(float offset);
11208 
11209  /*l
11210  *b Returns:
11211  **
11212  ** how high the label of the character will float above the character
11213  */
11214  float get_label_link_offset_override();
11215 
11216  /*l
11217  *b Description:
11218  **
11219  ** This function sets whether the label text should show some basic
11220  ** state information about the character instead of its name or
11221  ** the text set by set_label_text().
11222  **
11223  ** The state shown is: Character name, current path, current action.
11224  ** The current path and current action will change as the character
11225  ** moves through paths and actions.
11226  **
11227  *b Arguments:
11228  **
11229  *a show_state - pass 1 to show state, 0 to show original text
11230  */
11231  int set_label_shows_character_state(int show_state);
11232 
11233  /*l
11234  *b Returns:
11235  **
11236  ** whether character state information is shown instead of the
11237  ** character's name or other label text
11238  */
11239  int get_label_shows_character_state();
11240 
11241 
11242 /*****************************************************************************/
11255  /*l
11256  *b Returns:
11257  **
11258  ** pointer of type diguyImpact; NULL if there has been no recent
11259  ** impact recorded; useful for finding out who or what was hit
11260  */
11261  diguyImpact* get_last_impact_record();
11262 
11263  /*l
11264  *b Returns:
11265  **
11266  ** the last impact number
11267  */
11268  int get_last_impact_number();
11269 
11270  /*l
11271  *b Returns:
11272  **
11273  ** the processed flag on the diguyImpact class
11274  */
11275  int get_last_impact_been_processed();
11276 
11277  /*l
11278  *b Description:
11279  **
11280  ** Sets the processed flag on the diguyImpact object.
11281  */
11282  void set_last_impact_been_processed();
11283 
11284  /*l
11285  *b Description:
11286  **
11287  ** Sets the maximum number of unprocessed impacts there can be.
11288  **
11289  ** The unprocessed impact array is a first-in-first-out queue. If an
11290  ** impact occurs that pushes the number of unprocessed impacts past
11291  ** this maximum number, earlier impacts will be dropped from the
11292  ** array.
11293  **
11294  ** The initial value is 10.
11295  */
11296  void set_max_unprocessed_impacts(int max_unprocessed_impacts);
11297 
11298  /*l
11299  *b Returns:
11300  **
11301  ** maximum number of unprocessed impacts
11302  */
11303  int get_max_unprocessed_impacts();
11304 
11305  /*l
11306  *b Returns:
11307  **
11308  ** the last impact link
11309  */
11310  const char* get_last_impact_link();
11311 
11312  /*l
11313  *b Returns:
11314  **
11315  ** 1 if the last impact link is the link named
11316  */
11317  int get_last_impact_link_is(const char* link_name);
11318 
11319  /*l
11320  *b Returns:
11321  **
11322  ** 1 if the last impact resulted from an impact with a vehicle,
11323  ** 0 if not
11324  */
11325  int get_last_impact_is_from_vehicle();
11326 
11327  /*l
11328  *b Returns:
11329  **
11330  ** 1 if the last impact speed is greater than the passed speed,
11331  ** 0 if not
11332  */
11333  int get_last_impact_speed_is_greater_than(float impact_speed);
11334 
11335  /*l
11336  *b Description:
11337  **
11338  ** Sets if impacts are ever processed on this character.
11339  ** Useful for temporary effects and the like.
11340  */
11341  void set_is_immune_to_impacts(int immune);
11342 
11343  /*l
11344  *b Returns:
11345  **
11346  ** 1 if the character is immune to impacts
11347  ** 0 if not
11348  */
11349  int get_is_immune_to_impacts();
11350 
11351 
11352 /*****************************************************************************/
11374  /*l
11375  *b Description:
11376  **
11377  ** This function starts the specified appearance effect on
11378  ** the character.
11379  **
11380  ** The following appearance effects are available:
11381  **
11382  *- - "brake_lights"
11383  *- - "debris"
11384  *- - "debris_dark"
11385  *- - "dust"
11386  *- - "engine_smoke"
11387  *- - "explosion"
11388  *- - "explosion_dark"
11389  *- - "flames"
11390  *- - "flashing_lights"
11391  *- - "ground_dust_burst"
11392  *- - "headlights"
11393  *- - "rotor_wash"
11394  *- - "smoke"
11395  *- - "smoke_dark"
11396  *- - "smoke_trail"
11397  **
11398  *b Arguments:
11399  **
11400  *a effect - name of appearance effect to be started
11401  *a override_link - link to attach to; overrides default
11402  *a override_scale - scale to use for effect; overrides default
11403  *a override_offset_x - x offset to use for effect; overrides default
11404  *a override_offset_y - y offset to use for effect; overrides default
11405  *a override_offset_z - z offset to use for effect; overrides default
11406  *a override_duration - overrides how long the effect should show
11407  *a before automatically ending
11408  **
11409  *b Returns:
11410  **
11411  ** 0 on success, -1 on failure
11412  **
11413  *b Available as Decision Bead/Event
11414  */
11415  int begin_appearance_effect(const char* effect,
11416  const char* override_link = NULL,
11417  float override_scale = DIGUY_DEFAULT_FLOAT,
11418  float override_offset_x = DIGUY_DEFAULT_FLOAT,
11419  float override_offset_y = DIGUY_DEFAULT_FLOAT,
11420  float override_offset_z = DIGUY_DEFAULT_FLOAT,
11421  float override_duration = DIGUY_DEFAULT_FLOAT);
11422 
11423  /*l
11424  *b Description:
11425  **
11426  ** This function ends the specified appearance effect on the
11427  ** character.
11428  **
11429  ** The active particles of the effect will go to completion. Use
11430  ** stop_all_appearance_effects() to immediately stop effects,
11431  ** including their active particles.
11432  **
11433  ** If the effect hasn't been started, nothing happens.
11434  **
11435  *b Arguments:
11436  **
11437  *a effect - name of appearance effect to be ended
11438  *a override_link - optional override link effect is attached to
11439  **
11440  ** Pass "all" for the effect argument to end all of this character's
11441  ** appearance effects.
11442  **
11443  *b Returns:
11444  **
11445  ** 0 on success, -1 on failure
11446  **
11447  *b Available as Decision Bead/Event
11448  */
11449  int end_appearance_effect(const char* effect,
11450  const char* override_link = NULL);
11451 
11452  /*l
11453  *b Description:
11454  **
11455  ** This function stops the specified appearance effect on the
11456  ** character.
11457  **
11458  ** The active particle systems of the effect will immediately be
11459  ** removed. Use end_appearance_effect() to gradually stop effects;
11460  ** that function lets active particles move to completion.
11461  **
11462  ** If the effect hasn't been started, nothing happens.
11463  **
11464  *b Arguments:
11465  **
11466  *a effect - name of appearance effect to be ended
11467  *a override_link - optional override link effect is attached to
11468  **
11469  ** Pass "all" for the effect argument to stop all of this character's
11470  ** appearance effects.
11471  **
11472  *b Returns:
11473  **
11474  ** 0 on success, -1 on failure
11475  **
11476  *b Available as Decision Bead/Event
11477  */
11478  int stop_appearance_effect(const char* effect,
11479  const char* override_link = NULL);
11480 
11481  /*l
11482  *b Description:
11483  **
11484  ** Equivalent to stop_appearance_effect("all");
11485  */
11486  int stop_all_appearance_effects();
11487 
11488  /*l
11489  *b Description:
11490  **
11491  ** This function checks to see if the specified appearance effect
11492  ** has been started with begin_appearance_effect().
11493  **
11494  *b Arguments:
11495  **
11496  *a effect - name of appearance effect to check
11497  *a override_link - optional override link effect is attached to
11498  **
11499  *b Returns:
11500  **
11501  ** 1 if appearance is active, 0 if not
11502  */
11503  int appearance_effect_is_active(const char* effect,
11504  const char* override_link = NULL);
11505 
11506 
11507 /*****************************************************************************/
11520  /*l
11521  *b Description:
11522  **
11523  ** This function returns a pointer to a diguyChainSimulation if the
11524  ** character is a chain_simulation type of character.
11525  **
11526  *b Returns:
11527  **
11528  ** pointer to a diguyChainSimulation
11529  */
11530  diguyChainSimulation* get_chain_simulation();
11531 
11532 
11533 /*****************************************************************************/
11546  /*l
11547  *b Description:
11548  **
11549  ** This function returns a pointer to a diguyVehicleController if the
11550  ** character has one.
11551  **
11552  *b Returns:
11553  **
11554  ** pointer to a diguyVehicleController; may return NULL if character
11555  ** does not have a vehicle controller object
11556  */
11557  diguyVehicleController* get_vehicle_controller();
11558 
11559  /*l
11560  *b Description:
11561  **
11562  ** For most characters playing a travel forward action, the
11563  ** character's facing direction matches the direction of travel. For
11564  ** example, when humans walk forward their pelvis is generally
11565  ** aligned in the direction of travel.
11566  **
11567  ** Some vehicle characters behave differently. For vehicles whose
11568  ** front wheels steer, when turning the vehicle body will pivot around
11569  ** the rear axle. Only gradually will the rear of the vehicle swing
11570  ** in behind the direction of travel. Think of a car making a very
11571  ** sharp turn, and how the rear of the car swings in behind the front
11572  ** as the turn is completed.
11573  **
11574  ** This function will return the orientation of the body of the
11575  ** vehicle; i.e., the orientation of the forward vector along the
11576  ** vehicle's long axis. As mentioned above this may be different
11577  ** than the orientation of the direction of travel.
11578  **
11579  ** This function will return valid results for all characters, though
11580  ** the returned values from this function and that of
11581  ** get_orientation() will be the same for non-vehicle characters.
11582  **
11583  *b Returns:
11584  **
11585  ** 0 on success, -1 on failure
11586  */
11587  int get_vehicle_body_orientation(float* rz, float* rx, float* ry);
11588 
11589 
11590 /*****************************************************************************/
11607  /*l
11608  *b Description:
11609  **
11610  ** This function sets the name of the shader technique that will be
11611  ** used by the character when the scenario is using the specified
11612  ** render mode. See diguyScenario::set_current_render_mode().
11613  **
11614  ** Note that care should be taken when changing the shader of
11615  ** characters with skinned appearances. A shader capable of properly
11616  ** transforming vertices must be used for such characters.
11617  **
11618  ** The shader with the given name should be loaded first. If the
11619  ** shader technique is not one of DI-Guy's stock shaders, a custom
11620  ** shader technique can be loaded explicitly by calling
11621  ** the diguyApp::load_shader_program() function.
11622  **
11623  *b NOTE:
11624  **
11625  ** The specified shader technique may not take effect immediately,
11626  ** if the scenario's current render mode is different than the
11627  ** passed render mode. See
11628  ** diguyScenario::set_current_render_mode().
11629  **
11630  *b Arguments:
11631  **
11632  *a shader_name - shader technique name; can be NULL
11633  *a render_mode - render mode to modify; passing NULL will
11634  *a modify shader "normal" render mode
11635  **
11636  *b Returns:
11637  **
11638  ** 0 on success, -1 on failure
11639  */
11640  int set_render_mode_shader(const char* shader_name,
11641  const char* render_mode = NULL);
11642 
11643  /*l
11644  *b Description:
11645  **
11646  ** This function resets the shader technique for the specified render
11647  ** mode to its default. This will be the shader technique name
11648  ** returned by
11649  ** diguyScenario::get_default_character_shader_program_name().
11650  **
11651  ** If the specified render mode is the current scenario render mode,
11652  ** the current shader will change immediately. If not, the change
11653  ** will not take effect until the specified render mode becomes the
11654  ** current scenario render mode. See
11655  ** diguyScenario::set_current_render_mode().
11656  **
11657  *b Arguments:
11658  **
11659  *a render_mode - render mode to modify; passing NULL will
11660  *a modify shader of "normal" render mode
11661  */
11662  void reset_render_mode_shader_to_default(const char* render_mode = NULL);
11663 
11664  /*l
11665  *b Description:
11666  **
11667  ** This function returns the name of the shader technique that will be used by
11668  ** the character when the scenario is using the specified render
11669  ** mode.
11670  **
11671  *b Arguments:
11672  **
11673  *a render_mode - render mode for which to get technique name;
11674  *a pass NULL for "normal" render mode
11675  **
11676  *b Returns:
11677  **
11678  ** name of shader technique; NULL if none or error
11679  */
11680  const char* get_render_mode_shader(const char* render_mode = NULL);
11681 
11682  /*l
11683  *b Description:
11684  **
11685  ** This function returns the shader program that is in use by the
11686  ** character. Shader programs are shared objects that can be used
11687  ** by multiple characters. This is here for backwards compatibility,
11688  ** and just returns the highest quality shader technique shader.
11689  **
11690  *b Returns:
11691  **
11692  ** object of type diguyGraphicsShaderProgram; NULL if none
11693  */
11694  diguyGraphicsShaderProgram* get_shader_program();
11695 
11696  /*l
11697  *b Description:
11698  **
11699  ** This function returns the shader technique that is in use by the
11700  ** character. Shader techniques own a number of shader objects.
11701  **
11702  *b Returns:
11703  **
11704  ** object of type diguyGraphicsShaderTechnique; NULL if none
11705  */
11706  diguyGraphicsShaderTechnique* get_shader_technique();
11707 
11708  /*l
11709  *b Description:
11710  **
11711  ** This function overrides the current shader with the specified
11712  ** temporary shader. This temporary shader will remain in effect
11713  ** until:
11714  **
11715  *- - the scenario is reset
11716  *- - reset_current_shader_to_default() is called
11717  *- - set_temporary_current_shader() is called with NULL
11718  **
11719  *b Arguments:
11720  **
11721  *a shader_name - shader name; can be NULL
11722  **
11723  ** Passing NULL for the shader name will un-set the temporary shader,
11724  ** resetting the render mode shader to its default.
11725  **
11726  *b Returns:
11727  **
11728  ** 0 on success, -1 on failure
11729  */
11730  int set_temporary_current_shader(const char* shader_name);
11731 
11732  /*l
11733  *b Description:
11734  **
11735  ** This is a convenience function for resetting the current render
11736  ** mode shader to its default.
11737  **
11738  ** It is equivalent to retrieving the current render mode using
11739  ** diguyScenario::get_current_render_mode(), and calling
11740  ** reset_render_mode_shader_to_default() with that render mode.
11741  */
11742  void reset_current_shader_to_default();
11743 
11744  /*l
11745  *b Description:
11746  **
11747  ** This is a convenience function for refreshing the shader
11748  ** of a character. Usually used in conjunction with logic
11749  ** provided by the user with the graphics API.
11750  */
11751  void trigger_shader_refresh();
11752 
11753  /*l
11754  *b Description:
11755  **
11756  ** This function returns the shader instance that is in use by the
11757  ** character. Each character has its own shader instance.
11758  **
11759  ** Note that the shader instance of a character can change over the
11760  ** lifetime of the character. For example, it will change if the
11761  ** appearance of the character changes. Therefore the returned
11762  ** pointer should not be stored, but should be re-read each time
11763  ** it is needed.
11764  **
11765  *b Returns:
11766  **
11767  ** object of type diguyGraphicsShaderInstance; NULL if none
11768  */
11769  diguyGraphicsShaderInstance* get_shader_instance();
11770 
11771  /*l
11772  *b Description:
11773  **
11774  ** This function resets current values of the variables of the shader
11775  ** back to their initial reset values.
11776  */
11777  void reset_shader_instance_variables_to_initial_values();
11778 
11779  /*l
11780  *b Description:
11781  **
11782  ** This function resets the current and initial values of variables
11783  ** of the shader to the built-in DI-Guy configuration defaults.
11784  */
11785  void reset_shader_instance_variables_to_program_defaults();
11786 
11787 
11788 /*****************************************************************************/
11812  /*l
11813  *b Description:
11814  **
11815  ** This function sets the named character as the attack
11816  ** target of this agent. This agent will pursue the
11817  ** target until it is within range, and then will fire its
11818  ** weapon in an attempt to kill the target.
11819  **
11820  ** This function will implicitly put this agent into the
11821  ** attack behavior.
11822  **
11823  ** The current focus character will be set the specified character.
11824  ** Pass NULL or the empty string ("") to not change the focus
11825  ** character, but still change to the pursue behavior.
11826  **
11827  ** The current focus group will be un-set.
11828  **
11829  *b Arguments:
11830  **
11831  *a character_name - character to attack
11832  **
11833  *b Returns:
11834  **
11835  ** 0 on success, -1 on failure
11836  **
11837  *b Available as Decision Bead/Event
11838  */
11839  int agent_attack_character(const char* character_name);
11840 
11841  /*l
11842  *b Description:
11843  **
11844  ** This function is similar to agent_attack_character(), but instead
11845  ** will choose attack targets from the characters in the specified
11846  ** group.
11847  **
11848  ** This function will implicitly put this agent into the attack
11849  ** behavior.
11850  **
11851  ** The current focus group will be set to the specified group. Pass
11852  ** NULL or the empty string ("") to not change the focus group, but
11853  ** still change to the attack behavior.
11854  **
11855  ** The current focus character will be un-set.
11856  **
11857  *b Arguments:
11858  **
11859  *a group_name - name of group from which attack targets should
11860  *a be chosen
11861  **
11862  *b Returns:
11863  **
11864  ** 0 on success, -1 on failure
11865  **
11866  *b Available as Decision Bead/Event
11867  */
11868  int agent_attack_group(const char* group_name);
11869 
11870  /*l
11871  *b Description:
11872  **
11873  ** See diguyAgentParams::set_attack_zone_enabled().
11874  */
11875  int agent_set_attack_zone_enabled(int use_attack_zone);
11876 
11877  /*l
11878  *b Description:
11879  **
11880  ** See diguyAgentParams::get_attack_zone_enabled().
11881  */
11882  int agent_get_attack_zone_enabled();
11883 
11884  /*l
11885  *b Description:
11886  **
11887  ** See diguyAgentParams::set_attack_zone().
11888  */
11889  int agent_set_attack_zone(float x, float y, float z, float radius);
11890 
11891  /*l
11892  *b Description:
11893  **
11894  ** See diguyAgentParams::get_attack_zone().
11895  */
11896  int agent_get_attack_zone(float* x, float* y, float* z, float* radius);
11897 
11904  /*l
11905  *b Description:
11906  **
11907  ** This function adds a flee object to this agent.
11908  ** This agent will attempt to move away from the specified
11909  ** character until it is beyond the specified flee distance.
11910  **
11911  ** Note: Currently there can only be one flee object. This
11912  ** restriction will be lifted in a future version.
11913  **
11914  ** This function will implicitly put this agent into the
11915  ** flee behavior.
11916  **
11917  ** Neither the current focus character nor group will be
11918  ** changed by this function.
11919  **
11920  *b Arguments:
11921  **
11922  *a character_name - character from which to flee
11923  *a distance - minimum distance to move away from character
11924  *a danger_level - how "strong" the flee should be; set from
11925  *a 0 to 100
11926  **
11927  ** The danger_level argument is not currently used, but will be in
11928  ** a future version.
11929  **
11930  *b Returns:
11931  **
11932  ** 0 on success, -1 on failure
11933  **
11934  *b Available as Decision Bead/Event
11935  */
11936  int agent_flee_character(const char* character_name,
11937  float distance,
11938  int danger_level = 50);
11939 
11940  /*l
11941  *b Description:
11942  **
11943  ** This function adds a flee object to this agent. This agent
11944  ** will attempt to move away from the specified group until it is
11945  ** beyond the specified flee distance.
11946  **
11947  ** This function will implicitly put this agent into the flee
11948  ** behavior.
11949  **
11950  ** Neither the current focus character nor group will be changed
11951  ** by this function.
11952  **
11953  *b Arguments:
11954  **
11955  *a group_name - group from which to flee
11956  *a distance - minimum distance to move away from character
11957  *a danger_level - how "strong" the flee should be; set from
11958  *a 0 to 100
11959  **
11960  ** The danger_level argument is not currently used, but will be in
11961  ** a future version.
11962  **
11963  *b Returns:
11964  **
11965  ** 0 on success, -1 on failure
11966  **
11967  *b Available as Decision Bead/Event
11968  */
11969  int agent_flee_group(const char* group_name,
11970  float distance,
11971  int danger_level = 50);
11972 
11973  /*l
11974  *b Description:
11975  **
11976  ** This function is similar to agent_flee_group(), but the
11977  ** agent will instead flee the members of the specified
11978  ** crowd.
11979  */
11980  int agent_flee_crowd(const char* crowd_name,
11981  float distance,
11982  int danger_level = 50);
11983 
11984  /*l
11985  *b Description:
11986  **
11987  ** This function adds a flee object to this agent.
11988  ** This agent will attempt to move away from the specified
11989  ** location until it is beyond the specified flee distance.
11990  **
11991  ** Note: Currently there can only be one flee object. This
11992  ** restriction will be lifted in a future version.
11993  **
11994  ** This function will implicitly put this agent into the
11995  ** flee behavior.
11996  **
11997  ** Neither the current focus character nor group will be
11998  ** changed by this function.
11999  **
12000  *b Arguments:
12001  **
12002  *a x, y, z - location from which to flee
12003  *a distance - minimum distance to move away from character
12004  *a danger_level - how "strong" the flee should be; set from
12005  *a 0 to 100
12006  **
12007  ** The danger_level argument is not currently used, but will be in
12008  ** a future version.
12009  **
12010  *b Returns:
12011  **
12012  ** 0 on success, -1 on failure
12013  */
12014  int agent_flee_location(float x, float y, float z,
12015  float distance,
12016  int danger_level = 50);
12017 
12018  /*l
12019  *b Description:
12020  **
12021  ** This function removes all flee objects.
12022  **
12023  ** This function has no effect on current behavior.
12024  **
12025  *b Returns:
12026  **
12027  ** 0 on success, -1 on failure
12028  **
12029  *b Available as Decision Bead/Event
12030  */
12031  void agent_remove_all_flee_objects();
12032 
12043  /*l
12044  *b Description:
12045  **
12046  ** This function puts this agent into the mingle behavior, in which
12047  ** it will choose semi-random points in the specified region and
12048  ** subregion to move to. The agent will remain at the selected
12049  ** points for some amount of time, and the select a new point.
12050  **
12051  ** If all members of a crowd have this behavior they will tend to get
12052  ** together in small groups.
12053  **
12054  ** Use diguyAgentParams::set_move_on_t_min() and
12055  ** diguyAgentParams::set_move_on_t_max() for setting how long the
12056  ** agent will remain at the selected mingle points.
12057  **
12058  *b Arguments:
12059  **
12060  *a region_name - region in which to mingle
12061  *a subregion_name - subregion in which to mingle
12062  **
12063  ** The behavior region will be set the specified region. Pass NULL
12064  ** or "(current)" to not change the current behavior region.
12065  **
12066  *b Returns:
12067  **
12068  ** 0 on success, -1 on failure
12069  **
12070  *b Available as Decision Bead/Event
12071  */
12072  int agent_mingle_in_region(const char* region_name = "(current)",
12073  const char* subregion_name = "base");
12074 
12085  /*l
12086  *b Description:
12087  **
12088  ** This function is similar to agent_mingle_in_region(), but agents
12089  ** will pick completely random points and not try to clump together
12090  ** in small groups.
12091  **
12092  *b Returns:
12093  **
12094  ** 0 on success, -1 on failure
12095  **
12096  *b Available as Decision Bead/Event
12097  */
12098  int agent_wander_region(const char* region_name = "(current)",
12099  const char* subregion_name = "base");
12100 
12111  /*l
12112  *b Description:
12113  **
12114  ** This function will cause this agent to pursue the specified
12115  ** character. This agent will attempt to move toward the specified
12116  ** character until it is within its still distance as specified in
12117  ** its agent params.
12118  **
12119  ** This function will implicitly put this agent into the pursue
12120  ** behavior.
12121  **
12122  ** The current focus group will be set to the specified group. Pass
12123  ** NULL or the empty string ("") to not change the focus group, but
12124  ** still change to the attack behavior.
12125  **
12126  ** The current focus character will be un-set.
12127  **
12128  *b Arguments:
12129  **
12130  *a character_name - character to pursue
12131  **
12132  *b Returns:
12133  **
12134  ** 0 on success, -1 on failure
12135  **
12136  *b Available as Decision Bead/Event
12137  */
12138  int agent_pursue_character(const char* character_name);
12139 
12140  /*l
12141  *b Description:
12142  **
12143  ** This function is similar to agent_pursue_character(), but the
12144  ** point toward the agent will move will be offset from the pursued
12145  ** character by the passed offset.
12146  */
12147  int agent_pursue_character_with_offset(const char* character_name,
12148  float offset_x,
12149  float offset_y);
12150 
12151  /*l
12152  *b Description:
12153  **
12154  ** This function is similar to agent_pursue_character(), but instead
12155  ** will choose pursue characters from the characters in the specified
12156  ** group.
12157  **
12158  ** This function will implicitly put this agent into the pursue
12159  ** behavior.
12160  **
12161  ** The current focus group will be set to the specified group. Pass
12162  ** NULL or the empty string ("") to not change the focus group, but
12163  ** still change to the pursue behavior.
12164  **
12165  ** The current focus character will be un-set.
12166  **
12167  *b Arguments:
12168  **
12169  *a group_name - name of group from which pursue characters should
12170  *a be chosen
12171  **
12172  *b Returns:
12173  **
12174  ** 0 on success, -1 on failure
12175  **
12176  *b Available as Decision Bead/Event
12177  */
12178  int agent_pursue_group(const char* group_name);
12179 
12180  /*l
12181  *b Description:
12182  **
12183  ** Calls a formation with this character as a leader, oriented towards
12184  ** (target_x, target_y).
12185  **
12186  *b Returns:
12187  **
12188  ** 0 on success, -1 on failure
12189  */
12190  int agent_call_formation(const char* formation_name,
12191  float target_x,
12192  float target_y);
12193 
12204  /*l
12205  *b Description:
12206  **
12207  ** This function has the character travel along its behavior path
12208  ** shape, typically to the end and then back to the beginning. It
12209  ** will put the agent into the travel behavior.
12210  **
12211  *b Arguments:
12212  **
12213  *a direction - should be either "forward" or "backward"; pass NULL
12214  *a for default forward
12215  *a at_end - what to do when end of path reached
12216  *a waypoint_index - index of waypoint to start at; -1 for nearest,
12217  *a -2 for random
12218  *a offset_y - sideways offset from behavior path
12219  **
12220  ** Valid values for at_end are:
12221  **
12222  *- - "reverse"
12223  *- - "loop"
12224  *- - "stop"
12225  *- - "teleport"
12226  **
12227  ** See the documentation for diguyNavPathAtEnd for information on
12228  ** what each value means.
12229  */
12230  int agent_travel_behavior_path(const char* direction = NULL,
12231  const char* at_end = NULL,
12232  int waypoint_index = -1,
12233  float offset_y = 0.5f);
12234 
12235  /*l
12236  *b Description:
12237  **
12238  ** Similar to agent_travel_behavior_path(), but specific path can be
12239  ** set rather than using behavior path.
12240  */
12241  int agent_travel_path_shape(const char* path_shape_name,
12242  const char* direction = NULL,
12243  const char* at_end = NULL,
12244  int waypoint_index = -1,
12245  float offset_y = 0.5f);
12246 
12247  /*l
12248  *b Description:
12249  **
12250  ** The agent will create a travel path around the border of the
12251  ** region specified. A CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED
12252  ** callback will be triggered every time a character completes a loop
12253  ** around the border.
12254  **
12255  *b Arguments:
12256  **
12257  *a region_name - the name of the region to patrol; leaving blank or
12258  *a passing NULL will use the agent's current region
12259  *a subregion - name of the subregion to use; defaults to the base
12260  *a subregion
12261  **
12262  *b Returns:
12263  **
12264  ** 0 on success, -1 on failure
12265  */
12266  int agent_travel_region_border(const char* region_name = NULL,
12267  const char* subregion_name = "base");
12268 
12269  /*l
12270  *b Description:
12271  **
12272  ** Agent will attempt to create a navigation path on the via_region
12273  ** and then travel it. An A* path planning algorithm is used to find
12274  ** the path, cost preferences from the character's current
12275  ** diguyAgentParams are used in the search.
12276  **
12277  *b Note: as of DI-Guy 12 there is a version of this function
12278  ** agent_move_to_point_bg() that uses a multi-threaded infrastructure.
12279  ** We strongly recommend using it for future developments.
12280  **
12281  *b Arguments:
12282  **
12283  *a x, y, z - the target location
12284  *a via_region - the name of the region to run A* on (pass in "*"
12285  *a to have the code attempt to find the nearest
12286  *a region automatically.)
12287  *a subregion_name - the name of the subregion to restrict search to
12288  **
12289  *b Returns:
12290  **
12291  ** 0 on success, -1 on failure
12292  */
12293  int agent_move_to_point(float x, float y, float z,
12294  const char* via_region = NULL,
12295  const char* subregion_name = "base");
12296 
12297  /*l
12298  *b Description:
12299  **
12300  ** A multi-threaded version of agent_move_to_point(). See that
12301  ** function for more information.
12302  **
12303  ** We recommend switching to using this over the single threaded
12304  ** version. When the path result has been computed a callback with id
12305  ** CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED is triggered and the result is
12306  ** stored in get_path_planning_result(). You can also poll for
12307  ** completion via get_is_path_planning().
12308  **
12309  *b Returns:
12310  **
12311  ** diguyNavPathSearchResults enum value
12312  **
12313  ** The return value is typically DIGUY_NAV_PATH_ERROR_NONE (0) on
12314  ** success, DIGUY_NAV_PATH_ERROR_SEARCH_QUEUED if this has been queued
12315  ** for multi-threading, or a negative value on failure.
12316  */
12317  int agent_move_to_point_bg(float x, float y, float z,
12318  const char* via_region = NULL,
12319  const char* subregion_name = "base");
12320 
12321  /*l
12322  *b Description:
12323  **
12324  ** Agent will attempt to create a navigation path on the region
12325  ** via_region and then travel it. An A* path planning algorithm is
12326  ** used to find the path.
12327  **
12328  ** The subregion masks are used to specify which subregions to use or
12329  ** avoid. Cost bias values can be used to make tweak how strong the
12330  ** repulsion values are.
12331  **
12332  *b Note:
12333  **
12334  ** As of DI-Guy 12 there is a version of this function
12335  ** agent_move_to_point_via_subregions_bg that uses a multi-threaded
12336  ** infrastructure. We strongly recommend using it for future
12337  ** developments.
12338  **
12339  ** This function will fail and return -1 if a path cannot be found.
12340  **
12341  *b Arguments:
12342  **
12343  *a x, y, z - the target location
12344  *a via_region - the name of the region to run A* on (pass in "*"
12345  *a to have the code attempt to find the nearest
12346  *a region automatically)
12347  *a preferred_subregions_mask - diguySubregionMask value of regions
12348  *a preferred for travel
12349  *a cost_bias_for_preferred_regions - how much cheaper it will be
12350  *a to cross spaces that are part of desired subregion;
12351  *a should be < 1.0
12352  *a cost_bias_for_neutral_regions - how much more expensive it will be
12353  *a to cross spaces that are not part of desired subregion; see
12354  *a below for more information
12355  *a repulsed_regions_mask - diguySubregionMask value of regions *not*
12356  *a preferred for travel
12357  *a cost_bias_for_repulsed_regions - how much more expensive it will be
12358  *a to cross regions that are marked as repulsive; pass
12359  *a DIGUY_DEFAULT_FLOAT to avoid completely
12360  **
12361  ** Pass DIGUY_DEFAULT_FLOAT for cost_bias_for_neutral_regions and
12362  ** cost_bias_for_repulsed_regions to specify that they should be
12363  ** avoided completely.
12364  **
12365  ** The preferred_subregions_mask and repulsed_regions_mask use
12366  ** DI-Guy subregion mask values combined together. For example,
12367  ** DIGUY_SUBREGION_MASK_SIDEWALK | DIGUY_SUBREGION_MASK_CROSSWALK.
12368  **
12369  ** For cost_bias_for_neutral_regions, specifying a non-zero value for
12370  ** this lowers the likelihood that searches fail on disjointed
12371  ** subregions. A value < 1 will cause the planner to run faster but
12372  ** explore fewer points, possibly missing preferred regions. Values
12373  ** greater then 1 will explore more points but will be slower.
12374  **
12375  *b NOTE:
12376  **
12377  *b THIS API has changed for DI-GUY 11.
12378  **
12379  ** cost_bias_for_preferred_regions has been added and the neutral and
12380  ** repulsed default values have changed.
12381  **
12382  *b Returns:
12383  **
12384  ** 0 on success, -1 on failure
12385  */
12386  int agent_move_to_point_via_subregions(float x, float y, float z,
12387  const char* via_region = NULL,
12388  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12389  float cost_bias_for_preferred_regions = 0.25f,
12390  float cost_bias_for_neutral_regions = 1.1f,
12391  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12392  float cost_bias_for_repulsed_regions = 10.0f,
12393  int cost_rule = 0);
12394 
12395  /*l
12396  *b Description:
12397  **
12398  ** A multi-threaded version of agent_move_to_point_via_subregions().
12399  ** We recommend switching to using this over the single threaded
12400  ** version. When the result is found a
12401  ** CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED is triggered and the result is
12402  ** stored in get_path_planning_result(), you can also poll for
12403  ** completion via get_is_path_planning().
12404  **
12405  *b Returns:
12406  **
12407  ** diguyNavPathSearchResults enum value
12408  **
12409  ** The return value is typically DIGUY_NAV_PATH_ERROR_NONE (0) on
12410  ** success, DIGUY_NAV_PATH_ERROR_SEARCH_QUEUED if this has been queued
12411  ** for multi-threading, or a negative value on failure.
12412  */
12413  int agent_move_to_point_via_subregions_bg(float x, float y, float z,
12414  const char* via_region = NULL,
12415  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12416  float cost_bias_for_preferred_regions = 0.25f,
12417  float cost_bias_for_neutral_regions = 1.1f,
12418  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12419  float cost_bias_for_repulsed_regions = 10.0f,
12420  int cost_rule = 0);
12421 
12422  /*l
12423  *b Returns:
12424  **
12425  ** diguyNavPathSearchResults value after agent_move_to_point_bg()
12426  ** or agent_move_to_point_via_subregions_bg() has been called when
12427  ** the multi-threaded path planner has completed.
12428  */
12429  int get_path_planning_result();
12430 
12431  /*l
12432  *b Returns:
12433  **
12434  ** 1 if character is currently waiting for a result from the
12435  ** multi-threaded path planner, else 0
12436  */
12437  int get_is_path_planning();
12438 
12439  /*l
12440  *b Description:
12441  **
12442  ** Agent will attempt to create a navigation path on the via_region
12443  ** to a point in the target region, and then travel it. An A* path
12444  ** planning algorithm is used to find the path. Cost preferences from
12445  ** the character's current diguyAgentParams are used in the search.
12446  **
12447  *b Arguments:
12448  **
12449  *a region - target region
12450  *a subregion_name - target subregion
12451  *a via_region - name of the region travel in
12452  **
12453  *b Returns:
12454  **
12455  ** 0 on success, -1 on failure
12456  **
12457  *b Available as Decision Bead/Event
12458  */
12459  int agent_move_to_region(const char* region,
12460  const char* subregion_name = "base",
12461  const char* via_region = NULL);
12462 
12463  /*l
12464  *b Description:
12465  **
12466  ** Similar to agent_move_to_point_via_subregions(), but for moving to
12467  ** another region.
12468  **
12469  *b NOTE:
12470  **
12471  *b THIS API has changed for DI-GUY 11.
12472  **
12473  ** cost_bias_for_preferred_regions has been added and the neutral and
12474  ** repulsed default values have changed.
12475  **
12476  *b See Also:
12477  **
12478  ** diguyScenario::set_max_distance_planning_multiplier();
12479  ** diguyScenario::get_time_spent_path_planning_this_frame();
12480  **
12481  *b Returns:
12482  **
12483  ** 0 on success, -1 on failure
12484  */
12485  int agent_move_to_region_via_subregions(const char* region_name,
12486  const char* subregion_name = "base",
12487  const char* via_region = NULL,
12488  float cost_bias_for_preferred_regions = 0.25f,
12489  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12490  float cost_bias_for_neutral_regions = 1.1f,
12491  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12492  float cost_bias_for_repulsed_regions = 10.0f);
12493 
12504  /*l
12505  *b Description:
12506  **
12507  ** The agent will begin following the specified path, using the path
12508  ** follow behavior (DIGUY_AGENT_BEHAVIOR_PATH_FOLLOW).
12509  **
12510  ** The path follow behavior allows an agent to approximately follow a
12511  ** diguyCharacterPath without being in path position mode. The agent
12512  ** can respond to external stimuli (e.g., run away from gunfire), and
12513  ** later return to and resume the path.
12514  **
12515  ** Currently the path must be a path previously defined for the
12516  ** character, through either DI-Guy Scenario or via path API calls.
12517  **
12518  *b Arguments:
12519  **
12520  *a path_name - name of a path of this character
12521  **
12522  *b Returns:
12523  **
12524  ** 0 on success, -1 on failure
12525  **
12526  *b Available as Decision Bead/Event
12527  */
12528  int agent_path_follow(const char* path_name);
12529 
12530  /*l
12531  *b Description:
12532  **
12533  ** The agent will resume following the path specified by a previous
12534  ** call to agent_path_follow(). This will put the agent back into
12535  ** the path follow behavior.
12536  **
12537  *b Returns:
12538  **
12539  ** 0 on success, -1 on failure
12540  **
12541  *b Available as Decision Bead/Event
12542  */
12543  int agent_resume_path_follow();
12544 
12545  /*l
12546  *b Returns:
12547  **
12548  ** the path being followed in path behavior mode
12549  */
12550  diguyCharacterPath* agent_get_path_follow_path();
12551 
12552  /*l
12553  *b Description:
12554  **
12555  ** In path follow behavior the agent moves along the path specified
12556  ** in agent_path_follow(). How far along the agent is on the path is
12557  ** specified in seconds. This function returns that time.
12558  **
12559  ** Note that advancing along the path may be paused for some reason,
12560  ** typically because the agent is resuming path follow behavior
12561  ** after being in a different behavior, or the agent is too far away
12562  ** from the current desired position on the path. In this case the
12563  ** returned time may not advance for awhile until the agent is close
12564  ** enough to the path to resume advancing along it.
12565  **
12566  ** Call diguyAgentParams::set_path_follow_pause_t_when_off_path()
12567  ** to set whether time will be paused when off of the path.
12568  **
12569  ** Call diguyAgentParams::set_path_follow_unpause_t_at_radius() to
12570  ** set how close the agent must be to the last point on the path
12571  ** before time will resume.
12572  **
12573  *b Returns:
12574  **
12575  ** how far, in seconds, the agent is along its path follow path
12576  */
12577  float agent_get_path_follow_path_t();
12578 
12579  /*l
12580  *b Returns:
12581  **
12582  ** 1 if time along the path is not advancing, else 0
12583  */
12584  int agent_get_path_follow_path_t_paused();
12585 
12596  /*l
12597  *b Returns:
12598  **
12599  ** the crowd this agent is a part of, if any; returns NULL if not in
12600  ** a crowd
12601  */
12602  diguyCrowd* agent_get_crowd();
12603 
12604  /*l
12605  *b Description:
12606  **
12607  ** This function allows the end user to directly change an agent's
12608  ** current behavior. This function currently the only way to start
12609  ** an agent "idling".
12610  */
12611  int agent_begin_behavior(const char* behavior_name);
12612 
12613  /*l
12614  *b Description:
12615  **
12616  ** This function sets the behavior of the agent to "none".
12617  */
12618  int agent_stop_behavior();
12619 
12620  /*l
12621  *b Description:
12622  **
12623  ** This function is a convenience function that changes the focus
12624  ** character of this agent's current crowd params.
12625  **
12626  ** This can also be done by getting the character's current params
12627  ** using get_agent_current_params(), and then calling
12628  ** set_focus_character() on that object. This function
12629  ** call, however, is available in decisions.
12630  **
12631  ** The agent currently need not be part of a crowd for this function
12632  ** to work.
12633  **
12634  *b Arguments:
12635  **
12636  *a character_name - name of character to become new focus
12637  *a character; pass NULL or "" to un-set
12638  *a the focus character
12639  **
12640  *b Returns:
12641  **
12642  ** 0 on success, -1 on failure
12643  **
12644  *b Available as Decision Bead/Event
12645  */
12646  int agent_set_current_focus_character(const char* character_name);
12647 
12648  /*l
12649  *b Description:
12650  **
12651  ** This function returns the current character this agent
12652  ** is focused on. This will either be the character named
12653  ** by the focus character, or the character chosen from the
12654  ** focus group to be the current focus character.
12655  **
12656  ** The agent currently need not be part of a crowd for this function
12657  ** to work.
12658  **
12659  *b Returns:
12660  **
12661  *a pointer to type diguyCharacter
12662  */
12663  diguyCharacter* agent_get_current_focus_character();
12664 
12665  /*l
12666  *b Description:
12667  **
12668  ** Similar to set_current_focus_character(), but sets
12669  ** the current focus group instead of character.
12670  **
12671  ** The agent currently need not be part of a crowd for this function
12672  ** to work.
12673  **
12674  *b Arguments:
12675  **
12676  *a group_name - name of group to become new focus
12677  *a group; pass NULL or "" to un-set
12678  *a the focus group
12679  **
12680  *b Returns:
12681  **
12682  ** 0 on success, -1 on failure
12683  **
12684  *b Available as Decision Bead/Event
12685  */
12686  int agent_set_current_focus_group(const char* group_name);
12687 
12688  /*l
12689  *b Description:
12690  **
12691  ** This function returns the initial agent parameters of
12692  ** this agent. The initial parameters of this agent
12693  ** can then be edited through this object.
12694  **
12695  ** Changes to the initial parameters will have no effect until
12696  ** the scenario is reset.
12697  **
12698  ** The current agent parameters will be set to these
12699  ** initial parameters whenever the scenario is reset.
12700  **
12701  ** The agent currently need not be part of a crowd for this function
12702  ** to work.
12703  **
12704  *b Returns:
12705  **
12706  *a pointer to type diguyAgentParams
12707  */
12708  diguyAgentParams* agent_get_initial_params();
12709 
12710  /*l
12711  *b Description:
12712  **
12713  ** This function returns the current agent parameters of
12714  ** this agent. The current parameters of this agent
12715  ** can then be edited through this object.
12716  **
12717  ** Changes to the current parameters should take effect immediately.
12718  **
12719  ** The current agent parameters will be reset to the
12720  ** initial parameters whenever the scenario is reset.
12721  **
12722  ** The agent currently need not be part of a crowd for this function
12723  ** to work.
12724  **
12725  *b Returns:
12726  **
12727  *a pointer to type diguyAgentParams
12728  */
12729  diguyAgentParams* agent_get_current_params();
12730 
12731  /*l
12732  *b Description:
12733  **
12734  ** This function gets the name of the agent's current profile.
12735  **
12736  *b Returns:
12737  **
12738  ** the name of the agent's current profile
12739  */
12740  const char* agent_get_current_params_profile_name();
12741 
12742  /*l
12743  *b Description:
12744  **
12745  ** This function sets this agent's current agent parameters from the
12746  ** specified crowd profile.
12747  **
12748  ** The agent currently need not be part of a crowd for this function
12749  ** to work.
12750  **
12751  *b Arguments:
12752  **
12753  *a profile_name - name of existing crowd profile
12754  *a retain_focus_objects - pass 1 to not change focus object from
12755  *a current focus
12756  *a retain_navigation_values - pass 1 to not change current navigation
12757  *a parameters
12758  *a retain_behavior - pass 1 to not change current behavior
12759  **
12760  ** Navigation values are things like:
12761  **
12762  *- - behavior path
12763  *- - behavior region and subregion
12764  *- - region masks
12765  *- - cost biases
12766  *- - path planner settings
12767  **
12768  *b Returns:
12769  **
12770  ** 0 on success, -1 on failure
12771  **
12772  *b Available as Decision Bead/Event
12773  */
12774  int agent_set_current_params_from_profile(const char* profile_name,
12775  int retain_focus_objects = 1,
12776  int retain_navigation_values = 1,
12777  int retain_behavior = 0);
12778 
12779  /*l
12780  *b Description:
12781  **
12782  ** Similar to agent_set_current_params_from_profile(), but initial
12783  ** parameters are changed.
12784  */
12785  int agent_set_initial_params_from_profile(const char* profile_name);
12786 
12787  /*l
12788  *b Description:
12789  **
12790  ** This function sets the current parameters from the agent's
12791  ** initial parameters.
12792  */
12793  void agent_set_current_params_from_initial_params();
12794 
12795  /*l
12796  *b Description:
12797  **
12798  ** This function sets whether the borders of the current behavior
12799  ** region of the agent is solid.
12800  **
12801  ** If they are, the agent will treat the walls as if they are
12802  ** solid walls in the environment. If not, the agent is free to
12803  ** walk through them.
12804  **
12805  ** The agent currently need not be part of a crowd for this function
12806  ** to work.
12807  **
12808  *b Arguments:
12809  **
12810  *a is_solid - 1 if region border should be solid, 0 if not
12811  **
12812  *b Available as Decision Bead/Event
12813  */
12814  void agent_set_current_behavior_region_border_is_solid(int is_solid);
12815 
12816  /*l
12817  *b Description:
12818  **
12819  ** If the agent is in a behavior that stays in one place before moving
12820  ** to another, such as wander or mingle, this function will request
12821  ** that the agent move on to the next location.
12822  **
12823  *b Available as Decision Bead/Event
12824  */
12825  void agent_move_on();
12826 
12827 
12828  /*l
12829  *b Description:
12830  **
12831  ** This function controls if the AI will attempt to automatically change variants
12832  ** depending on the behavior. This should only change how still motions are performed
12833  ** when the default variant is Normal. Characters in wander and idle will automatically
12834  ** shift to ambient still motions, mingle will alternate between socialize and ambient
12835  ** motions. Attack should automatically switch from aiming to ambient.
12836  ** defaults to being on.
12837  */
12838  int agent_set_auto_variant_selection(int selection_enabled);
12839 
12840  /*l
12841  *b Description:
12842  **
12843  ** Returns if automatic variant selection is enabled, defaults to being on.
12844  */
12845  int agent_get_auto_variant_selection();
12846 
12847  /*l
12848  *b Description:
12849  **
12850  ** Returns current travel path or nav path.
12851  */
12852  diguyPathShape * agent_get_current_traveled_path();
12853 
12854  /*l
12855  *b Description:
12856  **
12857  ** Allows agent to determine speed zone based on distance to endpoint of current
12858  ** path. With this off, speed zones are determined by "desired position", which
12859  ** when following a path is not the endpoint, but a point on the path a short
12860  ** distance ahead of the current position.
12861  **
12862  ** The default value is false.
12863  **
12864  ** Enable this if you want the character to automatically run when following a
12865  ** long path.
12866  */
12867  void agent_set_use_speed_zones_on_paths(int enabled);
12868 
12869  /*l
12870  *b Description:
12871  **
12872  ** Returns the current value set by agent_set_use_speed_zones_on_paths().
12873  */
12874  int agent_get_use_speed_zones_on_paths();
12875 
12876 #ifdef CPLUSPLUS_ONLY
12877 
12933  /*l
12934  *b Description:
12935  **
12936  ** This function sets a feeler function that will be used by this
12937  ** character for environment collision detection. The feeler will
12938  ** replace any existing feeler function (including the default
12939  ** function used in DI-Guy Scenario).
12940  **
12941  ** See the "User-Defined Feelers" information for more information.
12942  **
12943  *b Arguments:
12944  **
12945  *a feeler_function - pointer to user-defined feeler function
12946  **
12947  *b Returns:
12948  **
12949  ** 0 on success, -1 on failure
12950  **
12951  *b Callable From:
12952  **
12953  *- - C++
12954  */
12955  int agent_set_feeler_function(diguyFeelerFunction* feeler_function);
12956 
12957  /*l
12958  *b Returns:
12959  **
12960  ** current feeler function; see set_feeler_function()
12961  **
12962  *b Callable From:
12963  **
12964  *- - C++
12965  */
12966  diguyFeelerFunction* agent_get_feeler_function();
12967 
12968 #endif
12969 
12970 
12971 /*****************************************************************************/
12977  /*l
12978  *b Description:
12979  **
12980  ** Creates a Lua mind object based off of the contents of base_class.
12981  **
12982  *b Arguments:
12983  **
12984  *a base_class - the class to use as the basis for the character's
12985  *a mind
12986  *a init_arg1-2 - experimental optional arguments passed to the init
12987  *a function; your lua init function will need to take
12988  *a arguments
12989  **
12990  */
12991  int create_lua_mind(const char* base_class, const char* init_arg1 = NULL,
12992  const char* init_arg2 = NULL);
12993 
12994  /*l
12995  *b Description:
12996  **
12997  ** Returns the name of the mind, e.g. "luaPedestrian". This is, in other
12998  ** words, the mind's base class
12999  */
13000  const char *get_mind_name();
13001 
13002  /*l
13003  *b Description:
13004  **
13005  ** Agent characters with minds will typically have the mind be in
13006  ** some state, such as "patrolling", "fleeing", "mobbing", etc. This
13007  ** function returns the name of that state.
13008  **
13009  ** Currently this is only applicable to characters with Lua minds.
13010  **
13011  *b Returns:
13012  **
13013  ** the name of the agent's current mind state
13014  */
13015  const char* get_mind_current_state_name();
13016 
13017  /*l
13018  *b Description:
13019  **
13020  ** This function causes callback functions with the callback id
13021  ** CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED to be called.
13022  ** It's intended use is for mind implementations that need to
13023  ** signal that the mind's current state has changed.
13024  **
13025  ** Currently this is only applicable to characters with Lua minds.
13026  */
13027  void do_mind_current_state_changed_callback();
13028 
13029  /*l
13030  *b Description:
13031  **
13032  ** How long until the character's main coroutine thread should be
13033  ** resumed. This function is typically used by various luaCharacter
13034  ** sleep functions.
13035  **
13036  *b Arguments:
13037  **
13038  *a sleep_length - how long relative to the current time the character
13039  *a should sleep
13040  */
13041  int set_sleep_timer(float sleep_length);
13042 
13043  /*l
13044  *b Returns:
13045  **
13046  ** How long until the character's main coroutine thread resumes,
13047  ** relative to the current time.
13048  */
13049  float get_sleep_timer();
13050 
13051  /*l
13052  *b Description:
13053  **
13054  ** The frequency at which the luaCharacter's heartbeat function
13055  ** should run. This defaults to once per second. The character
13056  ** must have a Lua function named heartbeat.
13057  **
13058  *b Arguments:
13059  **
13060  *a heartbeat_dt - frequency of heartbeat
13061  */
13062  int set_heartbeat_dt(float heartbeat_dt);
13063 
13064  /*l
13065  *b Description:
13066  **
13067  ** This function allows the addition of additional heartbeat
13068  ** functions.
13069  **
13070  *b Arguments:
13071  **
13072  *a function_name - the name of the Lua function to treat as a
13073  *a heartbeat; the function_name should not include
13074  *a the name of the character object
13075  *a heartbeat_dt - frequency of heartbeat
13076  **
13077  *b Returns:
13078  **
13079  ** 0 on success, -1 on failure
13080  */
13081  int add_secondary_heartbeat(const char* function_name,
13082  float heartbeat_dt);
13083 
13084  /*l
13085  *b Description:
13086  **
13087  ** This function removes an added heartbeat function.
13088  **
13089  *b Arguments:
13090  **
13091  *a function_name - the name of the Lua function to treat as a
13092  *a heartbeat; the function_name should not include
13093  *a the name of the character object
13094  **
13095  *b Returns:
13096  **
13097  ** 0 on success, -1 on failure
13098  */
13099  int remove_secondary_heartbeat(const char* function_name);
13100 
13101  /*l
13102  *b Description:
13103  **
13104  ** The frequency at which a luaCharacter's secondary heartbeat
13105  ** function should run. The character must have a Lua function named
13106  ** function_name.
13107  **
13108  *b Arguments:
13109  **
13110  *a function_name - heartbeat function to adjust
13111  *a heartbeat_dt - frequency of heartbeat
13112  **
13113  *b Returns:
13114  **
13115  ** 0 on success, -1 on failure
13116  */
13117  int set_secondary_heartbeat_dt(const char* function_name, float heartbeat_dt);
13118 
13119  /*l
13120  *b Description:
13121  **
13122  ** This function creates a request that whenever the specified
13123  ** callback is triggered, the character is woken up with a message.
13124  ** The message will be of the form:
13125  *>
13126  *- - message_type = "callback"
13127  *- - message = the string representation of the callback
13128  *<
13129  ** A good example of the use for this is a flexible "move to"
13130  ** command:
13131  **
13132  *b Lua Example:
13133  **
13134  *e self.character:add_wakeup_callback(diguyCharacter_CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED);
13135  *e -- begin to move to a location
13136  *e self.character:agent_move_to_region_via_subregions("navmesh", "green", "navmesh",
13137  *e DIGUY_SUBREGION_MASK_BASE, 12);
13138  *e -- sleep till arrived
13139  *e self:sleep(100);
13140  *e self.character:remove_wakeup_callback(diguyCharacter_CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED);
13141  **
13142  ** Effectively the character will wake up either after 100 seconds or
13143  ** when they arrive at their desired destination.
13144  **
13145  *b Arguments:
13146  **
13147  *a callback - the callback id that should wake up the character
13148  **
13149  *b Returns:
13150  **
13151  ** 0 on success, -1 on failure
13152  */
13153  int add_wakeup_callback(int callback);
13154 
13155  /*l
13156  *b Description:
13157  **
13158  ** This function removes a request to trigger a message when a
13159  ** callback is triggered.
13160  **
13161  *b Arguments:
13162  **
13163  *a callback - callback id that should no longer wake up the
13164  *a character
13165  **
13166  *b Returns:
13167  **
13168  ** 0 on success, -1 on failure
13169  */
13170  int remove_wakeup_callback(int callback);
13171 
13172  /*l
13173  *b Description:
13174  **
13175  ** This function removes all requests to trigger a message when
13176  ** callbacks are triggered.
13177  **
13178  *b Returns:
13179  **
13180  ** 0 on success, -1 on failure
13181  */
13182  int remove_all_wakeup_callbacks();
13183 
13184  /*l
13185  *b Description:
13186  **
13187  ** This function check for a requests to trigger a message when
13188  ** a given callback is triggered.
13189  **
13190  *b Returns:
13191  **
13192  ** 0 on false, 1 on true
13193  */
13194  int has_wakeup_callback(int callback);
13195 
13196  /*l
13197  *b Description:
13198  **
13199  ** This function wakes up a character and sends them a message.
13200  ** Currently this is only applicable to characters with Lua minds.
13201  **
13202  *b Arguments:
13203  **
13204  *a sender - who is sending the message
13205  *a message_type - what type of message is being sent
13206  *a message - the message string
13207  *a message_params - optional parameter string
13208  **
13209  *b Returns:
13210  **
13211  ** number of times message was successfully parsed
13212  */
13213  int agent_accept_message(const char* sender,
13214  const char* message_type,
13215  const char* message,
13216  const char* message_params = NULL);
13217 
13218  /*l
13219  **
13220  *b Description:
13221  **
13222  ** This function wakes up nearby characters and sends them a message.
13223  ** The sender of the message is implicitly set to the individual
13224  ** calling the broadcast function
13225  **
13226  ** Currently this is only applicable to characters with Lua minds.
13227  **
13228  *b Arguments:
13229  **
13230  *a radius - how far to broadcast the message
13231  *a message_type - what type of message is being sent
13232  *a message - the message string
13233  *a message_params - optional parameter string
13234  **
13235  *b Returns:
13236  **
13237  ** number of times message was successfully parsed
13238  */
13239  int agent_broadcast_message(float radius,
13240  const char* message_type,
13241  const char* message,
13242  const char* message_params = NULL);
13243 
13244  /*l
13245  *b Description:
13246  **
13247  ** This function wakes up nearby characters in the group specified
13248  ** and sends them a message. The sender of the message is implicitly
13249  ** set to the individual calling the broadcast function.
13250  **
13251  ** Currently this is only applicable to characters with Lua minds.
13252  **
13253  *b Arguments:
13254  **
13255  *a group_name - group to broadcast message to
13256  *a radius - how far to broadcast the message
13257  *a message_type - what type of message is being sent
13258  *a message - the message string
13259  *a message_params - optional parameter string
13260  **
13261  **
13262  *b Returns:
13263  **
13264  ** number of times message was successfully parsed,
13265  ** -1 on failure
13266  */
13267  int agent_broadcast_message_to_group(const char* group_name,
13268  float radius,
13269  const char* message_type,
13270  const char* message,
13271  const char* message_params = NULL);
13272 
13273  /*l
13274  **
13275  *b Returns:
13276  **
13277  ** name of character's lua mind object; typically this is the
13278  ** character's name with '-' replaced by '_'
13279  */
13280  const char* get_lua_object_name();
13281 
13282  /*l
13283  *b Description:
13284  **
13285  ** Sets the specified field of the mind to the string field_value.
13286  */
13287  void set_mind_field_as_string(const char* field_name,
13288  const char* field_value);
13289 
13290  /*l
13291  *b Description:
13292  **
13293  ** Queries the luaCharacter object for a specific field, and attempts
13294  ** to convert it into a string. This works for strings and
13295  ** numbers.
13296  **
13297  ** This returned pointer will stay valid until the next time this
13298  ** function is called, so if the results need to be saved they must
13299  ** be copied.
13300  **
13301  *b Returns:
13302  **
13303  ** field_name as string
13304  */
13305  const char* get_mind_field_as_string(const char* field_name,
13306  int warn_if_no_field = 1);
13307 
13308  /*l
13309  *b Description:
13310  **
13311  ** Sets the specified field of the mind to the floating point
13312  ** number field_value.
13313  */
13314  void set_mind_field_as_float(const char* field_name, float field_value);
13315 
13316  /*l
13317  *b Description:
13318  **
13319  ** Similar to get_mind_field_as_string(), but returns field as
13320  ** a float.
13321  **
13322  *b Returns:
13323  **
13324  ** field_name as double
13325  */
13326  float get_mind_field_as_float(const char* field_name,
13327  int warn_if_no_field = 1,
13328  int* found_field = NULL);
13329 
13330  /*l
13331  *b Description:
13332  **
13333  ** Sets the specified field of the mind to the integer number
13334  ** field_value.
13335  */
13336  void set_mind_field_as_int(const char* field_name, int field_value);
13337 
13338  /*l
13339  *b Description:
13340  **
13341  ** Similar to get_mind_field_as_int(), but returns field as
13342  ** an integer.
13343  **
13344  *b Returns:
13345  **
13346  ** field_name as int
13347  */
13348  int get_mind_field_as_int(const char* field_name,
13349  int warn_if_no_field = 1,
13350  int* found_field = NULL);
13351 
13352  /*l
13353  *b Description:
13354  **
13355  ** Attempts to run a luaCharacter member function, and can optionally
13356  ** return the function's result. Lua return values can be converted
13357  ** to strings and numbers -- other data types will cause an error.
13358  **
13359  ** This returned pointer will stay valid until the next time this
13360  ** function is called, so if the results need to be saved they must
13361  ** be copied.
13362  **
13363  *b *Note:* This function should be considered experimental, as the
13364  *b API may change.
13365  **
13366  *b Arguments:
13367  **
13368  *a function_name - luaCharacter function field to invoke
13369  *a argument - optional string argument to the function
13370  *a has_return_string - 0 or 1; determines if lua interface should
13371  *a attempt to retrieve a string value
13372  **
13373  *b Returns:
13374  **
13375  ** Lua function return value
13376  */
13377  const char* evaluate_mind_function(const char* function_name,
13378  const char* argument = NULL,
13379  int has_return_string = 0);
13380 
13381  /*l
13382  *b Description:
13383  **
13384  ** This function produces a string with a long list of character
13385  ** information, including: current path, crowd, behavior, lua state,
13386  ** lua call stack, wakeup callbacks and lua object fields. It is
13387  ** meant to help with debugging agents.
13388  **
13389  ** This returned pointer will stay valid until the next time this
13390  ** function is called, so if the results need to be saved they must
13391  ** be copied.
13392  **
13393  *b Arguments:
13394  **
13395  *a include_stack - pass 1 to include callstack info, 0 to not
13396  *a include_locals - pass 1 to include local variable info, 0 to not
13397  **
13398  *b Returns:
13399  **
13400  ** string containing character information
13401  */
13402  const char* get_ai_state_string(int include_stack = 1, int include_locals = 1);
13403 
13404 
13405 /*****************************************************************************/
13415 /*
13416  *3 Visibility Tests
13417  */
13418 
13419  /*l
13420  *b Description:
13421  **
13422  ** This function tests whether this character can see the passed
13423  ** character. Currently this tests if the cervical link of this
13424  ** character has a clear line of sight to either the cervical or the
13425  ** position links of the target. Currently the orientation of this
13426  ** character isn't factored in.
13427  **
13428  ** This function does not fail if other characters are between the
13429  ** two characters in question.
13430  **
13431  ** Checking visibility is only an option if an octtree is generated
13432  ** from scene objects; typically only DI-Guy Scenario does this.
13433  ** Outside of DI-Guy Scenario set_character_los_function() should be
13434  ** used if no octtree is present.
13435  **
13436  *b Arguments:
13437  **
13438  *a character - character to check
13439  *a los_check_type - currently unused but passed to callback function
13440  *a if end users wish to pass an additional parameter
13441  **
13442  *b Returns:
13443  **
13444  ** 1 if character is visible, 0 if not
13445  */
13446  int check_character_visibility(diguyCharacter* character,
13447  int los_check_type = 0);
13448 
13449  /*l
13450  *b Description:
13451  **
13452  ** This function tests whether this character can see the x, y, z
13453  ** location specified. Currently this tests if the cervical link of
13454  ** this character has a clear line of sight to the x, y, z location.
13455  ** Currently the orientation of this character isn't factored in.
13456  **
13457  ** This function does not fail if other characters are between the
13458  ** character and the location in question.
13459  **
13460  ** Checking visibility is only an option if an octtree is generated
13461  ** from scene objects; typically only DI-Guy Scenario does this.
13462  **
13463  *b Arguments:
13464  **
13465  *a x, y, z - location to check
13466  **
13467  *b Returns:
13468  **
13469  ** 1 if location is visible, 0 if not
13470  */
13471  int check_point_visibility(float x, float y, float z);
13472 
13473 
13474 
13475 /*****************************************************************************/
13492 #ifdef CPLUSPLUS_ONLY
13493 
13494  /*l
13495  *b Description:
13496  **
13497  ** When a character needs to check if it can see a location, DI-Guy
13498  ** calls this function with a pointer to the diguyCharacter in
13499  ** question, and the coordinates of the point that is being looked
13500  ** at. This currently happens when an agent is told to move to a new
13501  ** region.
13502  **
13503  ** The following prototype should be used for the point line-of-sight
13504  ** function:
13505  **
13506  *e int diguyPointLOSFunction(diguyCharacter* character,
13507  *e float x,
13508  *e float y,
13509  *e float z);
13510  **
13511  ** The function should then check if the desired location is visible.
13512  ** This can be done in a number of ways; a typical approach is to do
13513  ** an intersection test with the static scene.
13514  **
13515  ** The function should return 1 if the path to the target is clear, 0
13516  ** if there is an obstruction.
13517  **
13518  ** A default point line-of-sight function can be set for all
13519  ** subsequently created characters by calling
13520  ** diguyScenario::set_default_point_los_function().
13521  **
13522  *b Callable From:
13523  **
13524  *- - C++
13525  */
13526  int set_point_los_function(diguyPointLOSFunction* point_los_function);
13527 
13528  /*l
13529  *b Returns:
13530  **
13531  ** current point line-of-sight function; see set_point_los_function()
13532  **
13533  *b Callable From:
13534  **
13535  *- - C++
13536  */
13537  diguyPointLOSFunction* get_point_los_function();
13538 
13539  /*l
13540  *b Description:
13541  **
13542  ** When a character needs to check if it can see another character,
13543  ** DI-Guy calls this function with a pointer to the diguyCharacter in
13544  ** question. This can happen when check_character_visibility() is
13545  ** invoked or when AI attack code assesses if it should take a shot.
13546  **
13547  ** The following prototype should be used for the character
13548  ** line-of-sight function:
13549  **
13550  *e int diguyCharacterLOSFunction(diguyCharacter* character,
13551  *e diguyCharacter* target_character,
13552  *e int los_test_type) // (currently unused)
13553  **
13554  ** Currently the los_test_type argument defaults to 0 and is not used
13555  ** internally. It is, however, available in
13556  ** check_character_visibility() and will be passed to the callback.
13557  ** This can be useful if the end user wants to write scripting code
13558  ** that has alternative Line of Sight tests depending on agent
13559  ** conditions. (e.g. a test that factors in the character's field of
13560  ** view.)
13561  **
13562  ** The function then checks if the target character is visible. This
13563  ** can be done in a number of ways; a typical approach is to do an
13564  ** intersection test with the static scene. The default
13565  ** implementation tests the path from the characters head to the
13566  ** target's head and then to the target's feet.
13567  **
13568  ** The function should return 1 if the path to the target is clear,
13569  ** and 0 if there is an obstruction.
13570  **
13571  ** A default character line-of-sight function can be set for all
13572  ** subsequently created characters by calling
13573  ** diguyScenario::set_default_character_los_function().
13574  **
13575  *b Callable From:
13576  **
13577  *- - C++
13578  */
13579  int set_character_los_function(diguyCharacterLOSFunction* character_los_function);
13580 
13581  /*l
13582  *b Returns:
13583  **
13584  ** current character line-of-sight function; see
13585  ** set_character_los_function()
13586  **
13587  *b Callable From:
13588  **
13589  *- - C++
13590  */
13591  diguyCharacterLOSFunction* get_character_los_function();
13592 
13593 #endif
13594 
13595 
13596 /*****************************************************************************/
13613  int get_num_ik_chains();
13615 
13617  const char * get_ik_chain_name_at_index(int index);
13618 
13619  /*b Description:
13620  ** Moves the end effector for the specified ik chain to a location in the world.
13621  **
13622  *b Arguments:
13623  *a ik_chain_target - index of ik chain
13624  *a x,y,z - world location of where to move the IK end effector to.
13625  *a ramp_time - how long to take blending in solution
13626  **
13627  *b Returns:
13628  ** -1 on failure, 0 on success
13629  */
13630  int set_ik_target_world(int ik_chain_target, float x, float y, float z, float ramp_time = .25f);
13631 
13632  /*b Description:
13633  ** Moves the end effector for the specified ik chain to a location relative to the character.
13634  **
13635  *b Arguments:
13636  *a ik_chain_target - index of ik chain
13637  *a x,y,z - local location of where to move the IK end effector to.
13638  *a ramp_time - how long to take blending in solution
13639  **
13640  *b Returns:
13641  ** -1 on failure, 0 on success
13642  */
13643  int set_ik_target_local(int ik_chain_target, float x, float y, float z, float ramp_time = .25f);
13644 
13645  /*b Description:
13646  ** Resets the end effector to be solely driven by the animation system */
13647  int disable_ik_target(int ik_chain_target, float ramp_time = .25f);
13648 
13649  /*b Description:
13650  ** Sets the distance to the primary camera, this should be automatically set in OpenGL
13651  ** or if you set the camera position, in retained mode renderers you will need to set this
13652  ** manually. Currently only used by IK system for performance culling.
13653  */
13654  void set_distance_to_primary_camera(float camera_dist);
13655 
13657  float get_distance_to_primary_camera();
13658 
13659 /*****************************************************************************/
13675  /*l
13676  *b Description:
13677  **
13678  ** This function sets the initial character simulator this character
13679  ** will use. The current simulator will be set to this value on
13680  ** scenario reset.
13681  **
13682  ** The current simulator can be set by calling
13683  ** set_current_character_simulator().
13684  **
13685  ** The default simulator is
13686  ** DIGUY_CHARACTER_SIMULATOR_DIGUY_MOTION_ENGINE.
13687  **
13688  ** Requires active physics module if character simulator is set to
13689  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13690  **
13691  *b Arguments:
13692  **
13693  *a character_simulator - which simulator to use at reset
13694  **
13695  *b Returns:
13696  **
13697  ** 0 on success, -1 on failure
13698  */
13699  int set_initial_character_simulator(diguyCharacterSimulator character_simulator);
13700 
13701  /*l
13702  *b Returns:
13703  **
13704  ** initial character simulator
13705  */
13706  diguyCharacterSimulator get_initial_character_simulator();
13707 
13708  /*l
13709  *b Description:
13710  **
13711  ** This function sets the current character simulator this character
13712  ** will use. The current simulator will be reset to the initial
13713  ** character simulator on scenario reset.
13714  **
13715  ** The initial simulator can be set by calling
13716  ** set_initial_character_simulator().
13717  **
13718  *b Arguments:
13719  **
13720  *a character_simulator - new current character simulator
13721  **
13722  *b Returns:
13723  **
13724  ** 0 on success, -1 on failure
13725  */
13726  int set_current_character_simulator(diguyCharacterSimulator character_simulator);
13727 
13728  /*l
13729  *b Returns:
13730  **
13731  ** current character simulator
13732  */
13733  diguyCharacterSimulator get_current_character_simulator();
13734 
13735  /*l
13736  *b Description:
13737  **
13738  ** This function sets the initial physics simulation mode this
13739  ** character will use. The current simulation mode will be set to
13740  ** this value on scenario reset.
13741  **
13742  ** The current simulation mode can be set by calling
13743  ** set_current_physics_simulation_mode().
13744  **
13745  ** The default simulation mode is
13746  ** DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER.
13747  **
13748  ** The physics simulation mode will have no effect unless the current
13749  ** character simulator is
13750  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13751  **
13752  *b Arguments:
13753  **
13754  *a physics_simulation_mode - which simulation mode to use at reset
13755  **
13756  *b Returns:
13757  **
13758  ** 0 on success, -1 on failure
13759  */
13760  int set_initial_physics_simulation_mode(diguyPhysicsSimulationMode physics_simulation_mode);
13761 
13762  /*l
13763  *b Returns:
13764  **
13765  ** initial physics simulation mode
13766  */
13767  diguyPhysicsSimulationMode get_initial_physics_simulation_mode();
13768 
13769  /*l
13770  *b Description:
13771  **
13772  ** This function sets the current physics simulation mode this
13773  ** character will use. The current simulation mode will be reset to
13774  ** the initial physics simulator mode on scenario reset.
13775  **
13776  ** The initial simulation mode can be set by calling
13777  ** set_initial_physics_simulation_mode().
13778  **
13779  ** The physics simulation mode will have no effect unless the current
13780  ** character simulator is
13781  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13782  **
13783  *b Arguments:
13784  **
13785  *a physics_simulation_mode - new current physics simulation mode
13786  **
13787  *b Returns:
13788  **
13789  ** 0 on success, -1 on failure
13790  */
13791  int set_current_physics_simulation_mode(diguyPhysicsSimulationMode physics_simulation_mode);
13792 
13793  /*l
13794  *b Returns:
13795  **
13796  ** initial physics simulation mode
13797  */
13798  diguyPhysicsSimulationMode get_current_physics_simulation_mode();
13799 
13800  /*l
13801  *b Description:
13802  **
13803  ** This function sets the physics collision group this character will
13804  ** be in when being simulated. For improved performance, collision
13805  ** detection between various characters and scene objects will not
13806  ** be performed, based on which collision groups the objects are in.
13807  **
13808  ** By default:
13809  **
13810  *- - characters in character group n collide against props in prop
13811  *- group n and scene objects in scene object group n
13812  *- in group n
13813  *- - characters in group ghost don't collide against any other
13814  *- characters, but do against scene objects and props
13815  *- - characters in group everything collide against all characters,
13816  *- props, and scene objects
13817  *- - all props collide against all other props and scene objects
13818  **
13819  ** Collision group relationships can be modified using
13820  ** diguyApp::set_collision_group_detection_flag().
13821  **
13822  *b Arguments:
13823  **
13824  *a physics_simulation_mode - new current physics simulation mode
13825  **
13826  *b Returns:
13827  **
13828  ** 0 on success, -1 on failure
13829  */
13830  int set_physics_collision_group(diguyPhysicsCollisionGroup collision_group);
13831 
13832  /*l
13833  *b Returns:
13834  **
13835  ** physics collision group
13836  */
13837  diguyPhysicsCollisionGroup get_physics_collision_group();
13838 
13839  /*l
13840  *b Description:
13841  **
13842  ** This function sets a time at which active simulation of a physics
13843  ** controlled character will stop. This is useful for:
13844  **
13845  *- - reducing simulation processing overhead
13846  *- - freezing a simulation that is mostly in steady state, but some
13847  *- small part remains oscillating
13848  **
13849  ** The physics controlled character will remain frozen in the last
13850  ** computed simulated pose.
13851  **
13852  *b Arguments:
13853  **
13854  *a t - scenario t at which simulation will freeze
13855  **
13856  ** t should be large enough for the simulation to reach a reasonably
13857  ** steady state, such as a human lying on the ground. A value that
13858  ** is usually reasonable is around 5 seconds.
13859  */
13860  void set_stop_physics_sim_at_t(float t);
13861 
13862  /*l
13863  *b Description:
13864  **
13865  ** Similar to set_stop_physics_sim_at_t(), but the passed time will
13866  ** be relative to the current simulation time as returned by
13867  ** diguyScenario::get_t().
13868  */
13869  void set_stop_physics_sim_in_t_seconds(float relative_t);
13870 
13871  /*l
13872  *b Returns:
13873  **
13874  ** time at which physics simulation will freeze
13875  */
13876  float get_stop_physics_sim_at_t();
13877 
13878  /*l
13879  *b Description:
13880  **
13881  ** This function applied an impulse force to the character. An
13882  ** impulse is a force that is applied all at one time, such as an
13883  ** explosion shock wave.
13884  **
13885  *b Arguments:
13886  **
13887  *a link - link to which impulse should be applied
13888  *a impulse_magnitude_[xyz] - magnitude of impulse in x direction
13889  *a link_offset_[xyz] - offset on link at which to apply impulse
13890  *a set_simulation_drives_character - pass 1 to automatically change
13891  *a the character's current simulation mode
13892  *a to DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER
13893  */
13894  void apply_impulse_to_physics_sim(const char* link,
13895  float impulse_magnitude_x,
13896  float impulse_magnitude_y,
13897  float impulse_magnitude_z,
13898  float link_offset_x = 0.0f,
13899  float link_offset_y = 0.0f,
13900  float link_offset_z = 0.0f,
13901  int set_simulation_drives_character = 1);
13902 
13903  /*l
13904  *b Description:
13905  **
13906  ** Similar to apply_impulse_to_physics_sim(), but impulse can be
13907  ** calculated relative to a world position. This is useful if, for
13908  ** example, a character should react to a nearby explosion.
13909  **
13910  *b Arguments:
13911  **
13912  *a link - link to which impulse should be applied
13913  *a impulse_magnitude_[xyz] - magnitude of impulse
13914  *a impulse_generator_position_[xyz] - world coordinates of impulse
13915  *a generating object
13916  *a max_distance - maximum distance from above position at
13917  *a which the impulse can affect this
13918  *a character
13919  *a impulse_rolloff - how much the impulse magnitude should
13920  *a decrease as distance from impulse source
13921  *a increases
13922  *a link_offset_[xyz] - offset on link at which to apply impulse
13923  *a set_simulation_drives_character - pass 1 to automatically change
13924  *a the character's current simulation mode
13925  *a to DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER
13926  */
13927  void apply_impulse_to_physics_sim_from_world_position(const char* link,
13928  float impulse_magnitude_x,
13929  float impulse_magnitude_y,
13930  float impulse_magnitude_z,
13931  float impulse_generator_position_x,
13932  float impulse_generator_position_y,
13933  float impulse_generator_position_z,
13934  float max_distance = 20.0f,
13935  float impulse_rolloff = 0.0f,
13936  float link_offset_x = 0.0f,
13937  float link_offset_y = 0.0f,
13938  float link_offset_z = 0.0f,
13939  int set_simulation_drives_character = 1);
13940 
13941 /*****************************************************************************/
13945  /*l
13946  *b Description:
13947  **
13948  ** Sets texture load behavior to DIGUY_LOAD_INSTANTLY, DIGUY_LOAD_PRIORITY_ASYNC, or
13949  ** DIGUY_LOAD_ASYNC
13950  */
13951  static int set_texture_load_behavior(diguyGraphicsTextureLoadingBehavior mode);
13952 
13953  /*l
13954  *b Returns current behavior, as set in set_texture_load_behavior()
13955  */
13956  static diguyGraphicsTextureLoadingBehavior get_texture_load_behavior();
13957 
13958  /*l
13959  *b Description:
13960  **
13961  ** Sets maximum quality of shader to use (actual quality varies
13962  ** by distance from camera). See diguyGraphicsShaderQualityLevel for
13963  ** possible values.
13964  **
13965  *b Arguments:
13966  **
13967  *a quality_level - a value between DIGUY_GRAPHICS_SHADER_QUALITY_UNLIT
13968  *- and DIGUY_GRAPHICS_SHADER_QUALITY_MAX
13969  */
13970  static int set_max_shader_quality_level(int quality_level);
13971 
13973  static int get_max_shader_quality_level();
13974 
13975 
13976 /****************************************************************************/
13983 /****************************************************************************/
13984 
13985  /*l
13986  ** Sets if this character will play back animation events that have been
13987  ** added to motion inits in the action table.
13988  */
13989  int set_animation_events_enabled(int enable);
13990  int get_animation_events_enabled();
13991 
13992 
13993  /*l
13994  *b Description:
13995  **
13996  ** This function returns how many channels the specified action has.
13997  ** If an action has more than one channel, the relative weights of
13998  ** its channels can be set using the set_action_channel_weight()
13999  ** function.
14000  **
14001  *b Arguments:
14002  **
14003  *a action_name - name of action to be queried
14004  **
14005  *b Returns:
14006  **
14007  ** number of channels in specified action
14008  */
14009  int get_action_num_channels(const char* action_name);
14010 
14011  /*l
14012  *b Description:
14013  **
14014  ** This function sets the weight one channel of a multi-channel
14015  ** action.
14016  **
14017  ** The passed weight should be between 0 and 1. The weights of
14018  ** the other channels in the action will be adjusted so that the
14019  ** total weight of all channels is 1.
14020  **
14021  *b Arguments:
14022  **
14023  *a action_name - name of action to be affected
14024  *a channel - which channel's weight to set
14025  *a weight - weight of the channel, between 0 and 1
14026  **
14027  *b Returns:
14028  **
14029  ** 0 on success, -1 on failure
14030  */
14031  int set_action_channel_weight(const char* action_name,
14032  char channel,
14033  float weight);
14034 
14035  /*l
14036  *b Description:
14037  **
14038  ** This function returns the weight of one channel of a multi-channel
14039  ** action.
14040  **
14041  *b Arguments:
14042  **
14043  *a action_name - name of action to be queried
14044  *a channel - which channel's weight to return
14045  **
14046  *b Returns:
14047  **
14048  ** weight of a channel
14049  */
14050  float get_action_channel_weight(const char* action_name,
14051  char channel);
14052 
14053  /*l
14054  *b Description:
14055  **
14056  ** This function returns the number of seconds before the transition
14057  ** to the desired action begins. If the character is already
14058  ** performing the desired action the function returns 0.
14059  **
14060  *b THIS FUNCTION DOES NOT YET RETURN VALID RESULTS.
14061  **
14062  *b Returns:
14063  **
14064  ** time to reach desired action, in seconds
14065  */
14066  float get_time_to_reach_desired_action();
14067 
14068  /*l
14069  *b Description:
14070  **
14071  ** Maps a character type map field to its value. See diguyCharacterTypeMap.
14072  **
14073  ** Returns:
14074  **
14075  ** The value, as a string.
14076  */
14077  const char* get_type_map_field(diguyCharacterTypeMapField field);
14078 
14079  /*l
14080  *b Description:
14081  **
14082  ** Maps a character type map field to its value, using a string version (e.g.
14083  ** "age") of the field name. See diguyCharacterTypeMap.
14084  **
14085  ** Returns:
14086  **
14087  ** The value, as a string.
14088  */
14089  const char* get_type_map_field_using_string(const char* field);
14090 
14093  float get_normalized_age() const;
14094 
14095  /*l
14096  *b Description:
14097  **
14098  ** This function performs a "micro merge", allowing a diguyCharacter
14099  ** to have objects added to it by parsing a .dss file fragment in the
14100  ** form of a string.
14101  **
14102  ** This function can be used, for example, to add paths to
14103  ** dynamically created agents. A Lua Package can contain a number of
14104  ** text strings representing local paths for agents. On character
14105  ** creation these strings can be merged in and turned into
14106  ** per-character objects.
14107  **
14108  ** The DI-Guy Scenario path page has a "Display Asset" button for
14109  ** generating merge_object() compatible strings.
14110  **
14111  ** There is also a diguyScenario::merge_object() function that allows
14112  ** the merging of text blocks that represent sounds and particle
14113  ** systems.
14114  **
14115  ** Note: the parser is very sensitive to tabs and formatting!
14116  */
14117  int merge_object(const char* object);
14118 
14119  /*l
14120  *b Description:
14121  **
14122  ** Returns 1 if any active character in the named group is visible,
14123  ** otherwise 0.
14124  **
14125  *b Arguments:
14126  **
14127  *a group_name
14128  *a max_distance_to_check
14129  */
14130  int is_active_character_in_group_visible(const char* group_name,
14131  float max_distance_to_check = 100000.0f);
14132 
14133  /*l
14134  *b Description:
14135  **
14136  ** Gets local space bounding box, this function is currently expensive
14137  ** and should be used with care.
14138  **
14139  *b Arguments:
14140  **
14141  *a x1,y1,z1,x2,y2,z2 - output parameters
14142  **
14143  *b Returns:
14144  **
14145  ** 0 on success, -1 on failure
14146  ** (float * arguments converted to return values in Lua)
14147  */
14148  int get_local_space_bounding_box(float* x1, float* y1, float* z1,
14149  float* x2, float* y2, float* z2);
14150 
14151  /*l
14152  *b Description:
14153  **
14154  ** This causes a character's mind to get an update call even if time
14155  ** isn't passing in the scenario. This is occasionally useful for
14156  ** characters that are managing the UI.
14157  **
14158  ** Note that there is now a luaUIStateMachine that might be a better
14159  ** solution.
14160  */
14161  void set_mind_always_updates(int force_update);
14162 
14164  int get_mind_always_updates();
14165 
14166  /*l
14167  ** Returns angle in degrees from character's "forward facing" vector
14168  ** to the specified action bead, on the specified path
14169  */
14170  float get_angle_to_path(const char* path_name,
14171  const char* action_bead_name = NULL);
14172 
14173 
14176  void set_scene_graph_mask(unsigned int mask);
14177 
14179  unsigned int get_scene_graph_mask();
14180 
14181 
14186  diguyMotionEngineSnapshot get_motion_engine_snapshot();
14187 
14189  int apply_motion_engine_snapshot(const diguyMotionEngineSnapshot & action_info);
14190 
14191 
14196  int set_local_to_world_orientation_matrix( float rz, float rx, float ry);
14198  int set_local_to_world_orientation_matrix(
14199  float a0, float a1, float a2,
14200  float b0, float b1, float b2,
14201  float c0, float c1, float c2, int transpose = 0);
14202 
14203 
14206  int set_always_update_regardless_of_dt(int val);
14208  int get_always_update_regardless_of_dt();
14209 
14210  void set_shader_matrixes_out_of_date();
14211 
14212 /****************************************************************************/
14213 /****************************************************************************/
14224 /****************************************************************************/
14225 /****************************************************************************/
14226 /****************************************************************************/
14227 
14228  // Deprecated as of 13.0;
14230  int aim_converge(int max_iterations = 30);
14231 
14233  void set_aim_algorithm(int aim_algorithm);
14234 
14236  int get_aim_algorithm();
14237 
14238  // Deprecated as of 9.1.3; use diguyCharacter::get_position_link() instead.
14239  // diguyGraphicsLink* get_base_link();
14240 
14241  // Deprecated as of 9.0.1; use set_apply_actor_scale_to_action_bead_travel() instead.
14242  // void set_apply_actor_scale_to_action_bead_xy_travel(int apply_scale_flag);
14243 
14244  // Deprecated as of 9.0.1; use get_apply_actor_scale_to_action_bead_travel() instead.
14245  // int get_apply_actor_scale_to_action_bead_xy_travel();
14246 
14247  /*l
14248  ** Deprecated as of 9.1.4. In general setting the weapon sound
14249  ** should no longer be necessary, as weapon sounds are now specified
14250  ** by the weapon's munition type. If this function is called, it
14251  ** will have the same effect as calling
14252  ** diguyCharacter::set_weapon_sound_override().
14253  */
14254  // int set_default_weapon_sound(const char* sound_name);
14255 
14256  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14257  //const char* get_default_weapon_sound();
14258 
14259  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14260  // int set_default_weapon_sound_gain(float gain);
14261 
14262  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14263  // float get_default_weapon_sound_gain();
14264 
14265  // Deprecated as of 9.1.4. Call set_weapon_munition_type_override() instead.
14266  // int set_weapon_munition_type(const char* munition_type);
14267 
14268  // Deprecated as of 9.1.4. Call get_weapon_munition_type_override() instead.
14269  // const char* get_weapon_munition_type();
14270 
14271  // Deprecated as of 10.5.2. Call set_weapon_max_azimuth_error() instead.
14272  // int set_weapon_horizontal_error(float h_error);
14273 
14274  // Deprecated as of 10.5.2. Call get_weapon_max_azimuth_error() instead.
14275  // float get_weapon_horizontal_error();
14276 
14277  // Deprecated as of 10.5.2. Call set_weapon_max_elevation_error() instead.
14278  // int set_weapon_vertical_error(float v_error);
14279 
14280  // Deprecated as of 10.5.2. Call get_weapon_max_elevation_error() instead.
14281  // float get_weapon_vertical_error();
14282 
14283  // Added as of 10.1.6. Invokes the old implementation of
14284  // begin_appearance_effect().
14285  //int begin_legacy_appearance_effect(const char* effect,
14286  // const char* override_link = "",
14287  // float override_scale = DIGUY_DEFAULT_FLOAT,
14288  // float override_offset_x = DIGUY_DEFAULT_FLOAT,
14289  // float override_offset_y = DIGUY_DEFAULT_FLOAT,
14290  // float override_offset_z = DIGUY_DEFAULT_FLOAT);
14291 
14292 
14293  // Added as of 10.1.6. Invokes the old implementation of
14294  // end_appearance_effect().
14295  //
14296  //int end_legacy_appearance_effect(const char* effect);
14297 
14298  // Added as of 10.1.6. Invokes the old implementation of
14299  // appearance_effect_is_active().
14300  //int legacy_appearance_effect_is_active(const char* effect);
14301 
14302  // Deprecated as of 10.1.8. Use set_render_mode_shader() instead.
14303  //int set_shader_program(const char* shader_name);
14304 
14305  // Deprecated as of 10.5.2. Use get_render_mode_shader() instead.
14306  //const char* get_recommended_appearance_shader_program_name();
14307 
14308  // Deprecated as of 10.5.1. Use merge_object() instead.
14309  //int merge_asset(const char* asset);
14310 
14311  // Deprecated as of 10.5.2. Use get_DIS_trailing_effect_state() instead.
14312  // void set_DIS_smoke_trail_state(int state);
14313 
14314  // Deprecated as of 10.5.2. Use get_DIS_trailing_effect_state() instead.
14315  // int get_DIS_smoke_trail_state();
14316 
14317  // Deprecated as of 12.0.0. Not supported in FaceFX.
14318  //int speak(const char* string);
14319 
14320 
14321  // Deprecated as of 12.0.0. Not supported in FaceFX.
14322  //int set_viseme(const char* viseme_name, float weight);
14323 
14324  // Deprecated as of 12.0.0. Not supported in FaceFX.
14325  //float get_viseme(const char* viseme_name);
14326 
14327 
14328  // Deprecated as of 12.0.0. Not supported in FaceFX.
14329  //int set_orientation_eye_left(float azimuth, float elevation);
14330 
14331  // Deprecated as of 12.0.0. Not supported in FaceFX.
14332  //int set_orientation_eye_right(float azimuth, float elevation);
14333 
14334  // Deprecated as of 12.0.0. Not supported in FaceFX.
14335  //float get_azimuth_eye_left();
14336 
14337  // Deprecated as of 12.0.0. Not supported in FaceFX.
14338  //float get_elevation_eye_left();
14339 
14340  // Deprecated as of 12.0.0. Not supported in FaceFX.
14341  //float get_azimuth_eye_right();
14342 
14343  // Deprecated as of 12.0.0. Not supported in FaceFX.
14344  //float get_elevation_eye_right();
14345 
14346  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14347  //int set_weapon_shell_eject_enabled(int enabled);
14348 
14349  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14350  //int get_weapon_shell_eject_enabled();
14351 
14352  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14353  //int set_weapon_smoke_enabled(int enabled);
14354 
14355  // Deprecated as of 13.2 keys off of scenario weapons fire effects now
14356  //int get_weapon_smoke_enabled();
14357 /****************************************************************************/
14358 /****************************************************************************/
14359 
14364 #ifdef CPLUSPLUS_ONLY
14365 
14366  bdiScenarioCharacter* get_scripted_object();
14367 private:
14368 
14369  /*l
14370  ** A private constructor.
14371  */
14372  diguyCharacter(bdiScenarioCharacter* character);
14373 
14374  /*l
14375  ** A private destructor.
14376  */
14377  ~diguyCharacter();
14378 
14379  /*l
14380  ** A pointer to internal data.
14381  */
14382  bdiScenarioCharacter* m_scripted_object;
14383 
14384  friend class bdiPublishedCharacter;
14385  friend class bdiScenarioCharacter;
14386  friend class diguySensorRegion;
14387  friend class diguyScenario;
14388 
14389 #endif
14390 
14391 };
14392 
14393 
14394 #endif /* __diguyCharacter_H */
14395 
Definition: diguyViewLabel.h:44
A class that represents the unique per-character shader object.
Definition: diguyGraphicsShaderInstance.h:55
diguyGraphicsTextureLoadingBehavior
Definition: diguy_constants.h:370
Experimental class for helping with multichannel synchronization.
Definition: diguyMotionEngineSnapshot.h:6
#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:64
diguyCallbackReturn diguyCharacterCallback(diguyCharacter *character, int callback_id, void *callback_params, void *callback_user_data)
Definition: diguy_typedefs.h:48
diguyCharacterTypeMapField
This enumeration allows type map fields to be queried using a numerical value rather than a string na...
Definition: diguyCharacterTypeMap.h:33
The class that represents what parameters an agent is currently using to carry out their base behavio...
Definition: diguyAgentParams.h:39
wrapper around a chain simulation
Definition: diguyChainSimulation.h:35
diguyHistoryType
DI-Guy history types.
Definition: diguy_constants.h:280
Definition: diguyPathShape.h:30
diguyMotionDirection
Definition: diguyMotionDirection.h:26
Definition: diguy_vector_classes.h:154
A class that represents a bullet impact in the world, often used by AIs to make reaction decisions...
Definition: diguyImpact.h:41
A bead that sits on a character's spline path and triggers a new gaze.
Definition: diguyCharacterPathGazeBead.h:34
Definition: diguyMotionPosture.h:32
diguyConnectionPointType
Definition: diguyConnectionPointType.h:27
Definition: diguy_constants.h:165
#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:74
Definition: diguy_constants.h:183
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:181
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:1674
diguyCharacterClass
DI-Guy character classes.
Definition: diguy_constants.h:110
Attached to certain types of more complex vehicles, to manage their behavior.
Definition: diguyVehicleController.h:49
float diguyAltitudeFunction(diguyCharacter *character, float x, float y, float old_z, int *valid)
Definition: diguy_typedefs.h:54
int diguyCharacterLOSFunction(diguyCharacter *character, diguyCharacter *target_character, int visibility_type)
Definition: diguy_typedefs.h:103
Represents the scenario currently being portrayed.
Definition: diguyScenario.h:94
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:80
Definition: diguyWaypoint.h:29
Definition: diguySensorRegion.h:38
int diguyPointLOSFunction(diguyCharacter *character, float x, float y, float z)
Definition: diguy_typedefs.h:108
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:61
static double t
4 Header files and forward declarations
Definition: simple_playback_ogl.cpp:55
Definition: diguy_constants.h:1507
Definition: diguyMotionVariant.h:54
diguyParameterComparison
This is an enumeration of the different parameter comparison options that can be specified to various...
Definition: diguy_constants.h:163
A class that allows end users to override a character's animation on a joint level.
Definition: diguyCharacterPoseOverride.h:37
diguyCallbackReturn
DI-Guy callbacks return a value of type diguyCallbackReturn, which will be DIGUY_CALLBACK_STOP or DIG...
Definition: diguy_constants.h:96
diguyMotionVariant
Definition: diguyMotionVariant.h:26
diguyCharacterMode
This is an enumeration of the different modes a DI-Guy character can be in.
Definition: diguy_constants.h:148
A class representing a overlaid performance on a character's base animation.
Definition: diguyCharacterGesture.h:45
A bead that sits on a character's spline path and triggers a new script evaluation.
Definition: diguyCharacterPathScriptBead.h:34
Definition: diguySoundInstance.h:29
Definition: diguyVariable.h:38
diguyCharacterAppearanceTypes
DI-Guy character appearance query API, this is for diguyCharacter::get_num_appearances_of_type() ...
Definition: diguy_constants.h:132
diguyPhysicsSimulationMode
This enumeration lists the modes that a DI-Guy character physics sim can be in, when the character si...
Definition: diguy_constants.h:1691
diguyPhysicsCollisionGroup
This enumeration lists the collision groups that a DI-Guy physics sim object can be in...
Definition: diguy_constants.h:1707
This class implements shader lod system for use with DI-Guy character graphics.
Definition: diguyGraphicsShaderTechnique.h:152
This class implements shader programs for use with DI-Guy character graphics.
Definition: diguyGraphicsShaderProgram.h:96
The class that represents a DI-Guy Crowd, DI-Guy AI agents can be given orders at an individual level...
Definition: diguyCrowd.h:47
Represents algorithm for steering and maneuvering a character towards a goal point.
Definition: diguyCharacterGuide.h:561
diguyMotionPosture
Definition: diguyMotionPosture.h:26
A bead that sits on a character's spline path and triggers a new aim event.
Definition: diguyCharacterPathAimBead.h:34