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