DI-Guy SDK Documentation  13.1
diguyCharacter.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2015 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>
30 #include <diguyCharacterTypeMap.h>
31 #include <diguyMotionDirection.h>
32 #include <diguyMotionPosture.h>
33 #include <diguyMotionVariant.h>
34 
35 class bdiScenarioCharacter;
36 class diguyAgentParams;
38 class diguyCharacter;
42 class diguyCharacterPath;
47 class diguyCrowd;
48 class diguyGraphicsLink;
51 class diguyViewLabel;
52 class diguyPathShape;
53 class diguyScenario;
54 class diguyWaypoint;
55 class diguySoundInstance;
56 class diguyImpact;
57 class diguyVariable;
59 class diguyView;
60 class DtEntityStateRepository;
63 
64 #endif
65 
66 
79 /****************************************************************************/
80 class BDI_DECLSPEC_diguy diguyCharacter
81 {
82 
83 public:
84 
85 /*****************************************************************************/
95  /*l
96  *b Description:
97  **
98  ** Returns the name of the object. This pointer will never be NULL.
99  */
100  const char* get_name();
101 
102  /*l
103  *b Description:
104  **
105  ** This function sets the name of this object.
106  **
107  *b Returns:
108  **
109  ** 0 on success, -1 on failure
110  */
111  int set_name(const char* name);
112 
113  /*l
114  *b Description:
115  **
116  ** Returns the type name of the object, should be 'character'. This pointer will never be
117  ** NULL.
118  */
119  const char* get_type_name();
120 
121  /*l
122  *b Description:
123  **
124  ** All characters are assigned a unique identifier, or uid. This
125  ** function returns this character's uid.
126  **
127  ** *Note*: unique identifiers will change between DI-Guy runs!
128  **
129  */
130  long get_uid();
131 
132  /*l
133  *b Description:
134  **
135  ** Returns the index of the object. This index may change if
136  ** characters are created or destroyed, so it should not be considered
137  ** a unique identifier for the character. See get_uid().
138  */
139  int get_index();
140 
141  /*l
142  *b Description:
143  **
144  ** This function updates the character. The character's position and
145  ** pose will be set to be what it will be (or was) at the specified t.
146  **
147  ** If the scenario has control of t (return value of
148  ** get_t_controlled_by_scenario_t() is 0), then this function's
149  ** effects will be overridden the next time diguyScenario::update() is
150  ** called with a new t.
151  **
152  ** Note: diguyScenario::update() must be called as or more frequently
153  ** than diguyCharacter::update() for proper DI-Guy operation.
154  ** diguyCharacter::update() is intended for load management use, where
155  ** the user intends to update far away or out-of-frustum characters
156  ** less frequently than the overall scenario. This is done in con-
157  ** junction with set_t_controlled_by_scenario_t(0) for the character.
158  ** diguyCharacter::update() is not intended as a replacement for
159  ** diguyScenario::update().
160  **
161  *b Returns:
162  **
163  ** 0 on success, -1 on failure
164  **
165  *b Arguments:
166  **
167  *a t - new time for the character
168  *a full_update - set to 1 to cause full update of character
169  */
170  int update(float t, int full_update = 1);
171 
172  /*l
173  *b Description:
174  **
175  ** This function sets the current type of this character.
176  **
177  *b Arguments:
178  **
179  *a type - name of the new desired type
180  **
181  *b See Also:
182  **
183  ** get_character_type_string()
184  */
185  void set_character_type(const char* type);
186 
187  /*l
188  *b Description:
189  **
190  ** Returns the type of the character (never NULL).
191  **
192  ** Character types specify the types of motions the character will be
193  ** able to perform. Some characters can move like soldiers, others
194  ** can move like civilians, still others can move like specific
195  ** animals.
196  **
197  ** The character type is explicitly specified in the call to
198  ** diguyScenario::create_character().
199  **
200  ** Examples of character types are:
201  *>
202  *- - soldier
203  *- - male_pedestrian
204  *- - horse
205  *- - prop
206  *<
207  */
208  const char* get_character_type_string();
209 
210  /*l
211  *b Description:
212  **
213  ** Returns the class of the character (never NULL).
214  **
215  ** Character classes are a higher level description than character
216  ** types, and allow for more generalized logic. For example, instead
217  ** of having something happen when one of a large set of specific
218  ** character types enters a region, something can happen when any
219  ** human enters the region.
220  **
221  ** Character classes are not specified directly, but are instead
222  ** derived from the character type. (In DI-Guy, all soldiers are
223  ** humans, for example.)
224  **
225  ** Examples of character classes are:
226  *>
227  *- - human
228  *- - vehicle
229  *- - object
230  *- - animal
231  *<
232  */
233  const char* get_character_class();
234 
236  diguyCharacterClass get_character_class_type();
237 
238  /*l
239  *b Description:
240  **
241  ** Returns the scenario that this character is a part of.
242  */
243  diguyScenario* get_scenario();
244 
245  /*l
246  *b Description:
247  **
248  ** This is the top-level on/off switch for the character. A character
249  ** that is not enabled has very little processing overhead: it is
250  ** neither updated during an update() call, nor is it drawn during a
251  ** draw() call. A disabled character will remain disabled until
252  ** set_enabled(1) is called on it; nothing else implicitly re-enables
253  ** the character.
254  **
255  ** There are several other diguyCharacter functions that have somewhat
256  ** similar effects that may be more appropriate at times:
257  **
258  *- - set_current_tin() and set_current_tout(): These functions
259  *- show and animate the character starting at time tin ("T In"),
260  *- and ending at time tout ("T Out")
261  *- - set_invisible_flag(): This function disables drawing of
262  *- the character, but the character still updates and changes
263  *- position.
264  **
265  ** Refer to the documentation of these functions for more information.
266  **
267  *b Returns:
268  **
269  ** always return 0
270  */
271  int set_enabled(int enabled);
272 
273  /*l
274  *b Description:
275  **
276  ** Returns whether the character is enabled, as set by the
277  ** set_enabled() call. New characters are enabled by default.
278  **
279  *b Returns:
280  **
281  ** 1 if the character is enabled, 0 if not
282  */
283  int get_enabled();
284 
285  /*l
286  *b Description:
287  **
288  ** Sets whether this character is drawn automatically by the scenario.
289  **
290  ** Note depending on the rendering environment if this flag is set to 0,
291  ** it is up to the user to call the character draw_pass1() and draw_pass2()
292  ** calls at the appropriate time.
293  **
294  *b Arguments:
295  **
296  *a flag - pass 1 for character drawing to automatically be
297  *a handled by scenario (this is the default);
298  *a 0 for it not to be
299  **
300  *b Returns:
301  **
302  ** 0 on success, -1 on failure
303  */
304  int set_drawn_by_scenario_flag(int flag);
305 
306  /*l
307  *b Description:
308  **
309  ** Returns whether character drawing is done automatically by the
310  ** scenario.
311  **
312  *b Returns:
313  **
314  ** 1 if character drawing is done by the scenario;
315  ** 0 if not
316  **
317  *b See Also:
318  **
319  ** set_drawn_by_scenario_flag()
320  */
321  int get_drawn_by_scenario_flag();
322 
323  /*l
324  *b Description:
325  **
326  ** This function makes the character invisible; i.e., draw() calls
327  ** for the character will have no effect. Note that the character
328  ** will still update its position and pose during update() calls. To
329  ** more thoroughly disable a character, consider the functions
330  ** set_enabled() and set_current_tout().
331  **
332  *b Arguments:
333  **
334  *a invisible_flag - pass 1 to make character invisible, 0 to
335  *a make it visible
336  **
337  *b Available as Decision Bead/Event
338  */
339  void set_invisible_flag(int invisible_flag);
340 
341  /*l
342  *b Returns:
343  **
344  ** the character's invisible flag, as set by set_invisible_flag()
345  */
346  int get_invisible_flag();
347 
348  /*l
349  *b Description:
350  **
351  ** Returns whether the character is active. A character is
352  ** active if:
353  **
354  *- - it is enabled as per the set_enabled() call
355  *- - it is within its tin/tout interval as set by the
356  *- set_current_tin() and set_current_tout() calls
357  *- - it is not "network paused" (get_is_network_paused()
358  *- returns 0)
359  **
360  *b Returns:
361  **
362  ** 1 if the character is active, 0 if not
363  **
364  *b Available as Decision Bead
365  */
366  int get_is_active();
367 
368  /*l
369  *b Description:
370  **
371  ** Returns whether the character will be drawn during scenario and
372  ** character draw() calls. A character will be drawn if:
373  **
374  *- - it is enabled as per the set_enabled() call
375  *- - it is within its tin/tout interval as set by the
376  *- set_current_tin() and set_current_tout() calls
377  *- - its invisible flag is 0, as set by the
378  *- set_invisible_flag() call
379  **
380  ** There is no corresponding set_is_drawn() function; use
381  ** set_invisible_flag() to explicitly make a character not be drawn.
382  **
383  *b Returns:
384  **
385  ** 1 if the character will be drawn, 0 if not
386  */
387  int get_is_drawn();
388 
392  int get_was_drawn_last_frame();
393 
395  int set_was_drawn_last_frame(int drawn);
396 
398  int get_is_culled();
399 
405  int set_is_culled(int culled);
406 
407  /*l
408  *b Returns:
409  **
410  ** 1 if the character is temporary (created by diguyScenario::create_temporary_character()
411  ** call; 0 if not
412  */
413  int get_is_temporary();
414 
415  /*l
416  *b Description:
417  **
418  ** This function returns 1 if the character has been recycled from the
419  ** character recycle bin, 0 if not.
420  **
421  ** See diguyScenario::send_character_to_recycle_bin()
422  ** and diguyScenario::retrieve_character_from_recycle_bin().
423  */
424  int get_is_recycled();
425 
426  /*l
427  *b Description:
428  **
429  ** This function sets how the character's t (time) is controlled. If
430  ** 1, the character's t will be set by the scenario on each call to
431  ** diguyScenario::update(). If 0, the character should be updated by
432  ** calls to update().
433  **
434  *b Arguments:
435  **
436  *a t_controlled_by_scenario_t - 1 for controlled by scenario, 0 for
437  *a manual update
438  **
439  *b Returns:
440  **
441  ** 0 on success, -1 on failure
442  */
443  int set_t_controlled_by_scenario_t(int t_controlled_by_scenario_t);
444 
445  /*l
446  *b Returns:
447  **
448  ** whether character's t is controlled by the scenario;
449  ** see set_t_controlled_by_scenario_t()
450  */
451  int get_t_controlled_by_scenario_t();
452 
453  /*l
454  *b Description:
455  **
456  ** This function sets the initial tin ("T In") time of the character.
457  ** See set_current_tin() for a discussion of how tin and tout times
458  ** affect the character.
459  **
460  ** When the scenario is reset or loaded from a .dss file, the current
461  ** tin value will be set to this initial tin value.
462  **
463  ** Note that this function cannot be called once the scenario has
464  ** begun running (diguyScenario::get_t() returns > 0).
465  **
466  ** Note that both tin and tout times are scenario-relative times, not
467  ** character-relative.
468  **
469  ** This call makes an implicit call to set_current_tin() with the
470  ** same value.
471  **
472  *b Arguments:
473  **
474  *a tin - new value of initial tin in seconds
475  **
476  *b Returns:
477  **
478  ** 0 on success, -1 on failure
479  */
480  int set_initial_tin(float tin, int override_time_warning = 0);
481 
482  /*l
483  *b Description:
484  **
485  ** This function sets the initial tout ("T Out") time of the
486  ** character. See set_current_tin() for a discussion of how tin and
487  ** tout times affect the character.
488  **
489  ** When the scenario is reset or loaded from a .dss file, the current
490  ** tout value will be set to this initial tout value.
491  **
492  ** Note that this function cannot be called once the scenario has
493  ** begun running (diguyScenario::get_t() returns > 0).
494  **
495  ** Note that both tin and tout times are scenario-relative times, not
496  ** character-relative.
497  **
498  ** This call makes an implicit call to set_current_tout() with the
499  ** same value.
500  **
501  *b Arguments:
502  **
503  *a tout - new value of initial tout in seconds
504  **
505  *b Returns:
506  **
507  ** 0 on success, -1 on failure
508  */
509  int set_initial_tout(float tout);
510 
511  /*l
512  *b Description:
513  **
514  ** This function sets the current tin ("T In") time of the character.
515  ** The character will not be visible nor will it start moving or
516  ** animating until the scenario reaches this time.
517  **
518  ** There are two ways the tin and tout times of the character can be
519  ** used:
520  **
521  ** The first is to set them to their desired values when the scenario
522  ** begins. If, for example, it is known that this character should
523  ** only be visible and active from 60 seconds to 80 seconds, the tin
524  ** and tout times can be set to 60 and 80, respectively. The
525  ** scenario will then spend very little time for character updates
526  ** and draws outside of these limits.
527  **
528  ** The second is to use them to quickly "trigger" a character to
529  ** become visible and start moving. This is done by setting the
530  ** initial values of tin and tout to very high values, and then
531  ** changing them to lower values when the character should become
532  ** active. Consider the following example: This character is
533  ** waiting just inside a doorway, and should emerge when another
534  ** character comes close. If the tin time of the character is very
535  ** high, very little time will be taken for this character's updates
536  ** and draws. When the other character does come close, this
537  ** character's tin time can be set to "now" (the scenario's current
538  ** t, as returned by diguyScenario::get_t()). This character will
539  ** then become visible and start moving out of the doorway.
540  **
541  ** The default current tin time is the current time of the scenario
542  ** when the character is created.
543  **
544  ** Note that both tin and tout times are scenario-relative times, not
545  ** character-relative.
546  **
547  *b Arguments:
548  **
549  *a tin - new value of current tin in seconds
550  **
551  *b Returns:
552  **
553  ** 0 on success, -1 on failure
554  */
555  int set_current_tin(float tin);
556 
557  /*l
558  *b Description:
559  **
560  ** Same as set_current_tin(), but time is set to current scenario time.
561  **
562  *b Returns:
563  **
564  ** 0 on success, -1 on failure
565  **
566  *b Available as Decision Bead/Event
567  */
568  int set_current_tin_to_now();
569 
570  /*l
571  *b Description:
572  **
573  ** This function returns the current tin time of the character. See
574  ** set_current_tin().
575  **
576  *b Returns:
577  **
578  ** Current tin time in seconds.
579  */
580  float get_current_tin();
581 
582  /*l
583  *b Description:
584  **
585  ** This function sets the current tout ("T Out") time of the
586  ** character. If tout is enabled the character will become invisible
587  ** and will stop moving and animating when the scenario reaches this
588  ** time.
589  **
590  ** Note that both tin and tout times are scenario-relative times, not
591  ** character-relative.
592  **
593  ** Default tout time is 60000 seconds.
594  **
595  *b Arguments:
596  **
597  *a tout - new value of current tout in seconds
598  *a disable_character_at_tout - this argument is present to keep
599  *a the function prototype will remain
600  *a backward compatible; it has no effect
601  */
602  int set_current_tout(float tout,
603  int disable_character_at_tout = 0);
604 
605  /*l
606  *b Description:
607  **
608  ** Same as set_current_tout(), but time is set to current scenario
609  ** time.
610  **
611  *b Returns:
612  **
613  ** 0 on success, -1 on failure
614  **
615  *b Available as Decision Bead
616  */
617  int set_current_tout_to_now();
618 
619  /*l
620  *b Description:
621  **
622  ** This function returns the current tout ("T Out") time of the
623  ** character in seconds. See set_current_tout().
624  */
625  float get_current_tout();
626 
627  /*l
628  *b Description:
629  **
630  ** This function sets what will happen when the character reaches its
631  ** tout time. If set to 0, the character will ignore the tout time
632  ** and continue indefinitely.
633  */
634  void set_tout_enabled(int tout_enabled);
635 
636  /*l
637  *b Description:
638  **
639  ** This function returns the whether tout is enabled.
640  **
641  ** See set_tout_enabled().
642  **
643  *b Returns:
644  **
645  ** 1 if tout enabled, 0 if not
646  */
647  int get_tout_enabled();
648 
649  /*l
650  *b Description:
651  **
652  ** When the motion data of a character is interpolated a quick
653  ** interpolation method can be used which may yield incorrect results,
654  ** or an expensive interpolation method can be used which will yield
655  ** correct results at the expense of time. The threshold at which
656  ** the interpolation method changes is specified by this function.
657  **
658  *b Arguments:
659  **
660  *a threshold - float between 0 (careful never) and 1 (careful always);
661  ** default is 0.7
662  **
663  ** DI-Guy compares the careful interpolation threshold to the cosine
664  ** of an angle. Both the threshold and the cosine are dimensionless
665  ** and thus have no units.
666  **
667  *b Returns:
668  **
669  ** 0 on success, -1 on failure
670  */
671  int set_careful_interpolation_threshold(float threshold);
672 
673  /*l
674  *b Returns:
675  **
676  ** most recent setting of the careful interpolation threshold;
677  ** see set_careful_interpolation_threshold()
678  */
679  float get_careful_interpolation_threshold();
680 
681  /*l
682  *b Description:
683  **
684  ** Sets whether the motion data of the character is interpolated.
685  ** Interpolation is disabled by default for better performance. For
686  ** applications achieving high frame rates, smoother motion may be
687  ** achieved by turning interpolation on.
688  **
689  *b Arguments:
690  **
691  *a flag - 0 by default
692  **
693  *b Returns:
694  **
695  ** 0 on success, -1 on failure
696  */
697  int set_motion_interpolation_flag(int flag);
698 
699  /*l
700  *b Returns:
701  **
702  ** most recent setting of the motion interpolation flag; see
703  ** set_motion_interpolation_flag()
704  */
705  int get_motion_interpolation_flag();
706 
707  /*l
708  *b Description:
709  **
710  ** Sets the scale of the character on each of the three major axes.
711  **
712  *b Arguments:
713  **
714  *a scale_x, scale_y, scale_z - the factor by which to scale along
715  *a the given axis
716  **
717  *b Returns:
718  **
719  ** 0 on success, -1 on failure
720  */
721  int set_scale(float scale_x, float scale_y, float scale_z);
722 
723  /*l
724  *b Description:
725  **
726  ** Returns the scale of the character.
727  **
728  *b Arguments:
729  **
730  *a sx, sy, sz - scale of the character along each axis
731  **
732  ** Pass NULL for any values that are not needed.
733  **
734  *b Returns:
735  **
736  ** 0 on success, -1 on failure
737  */
738  int get_scale(float* scale_x, float* scale_y, float* scale_z);
739 
740  /*l
741  *b Description:
742  **
743  ** Sets the parent of this character to be the passed character.
744  ** This means that the coordinate system of this character will be
745  ** local to the parent character rather than the world coordinate
746  ** system.
747  **
748  *b Arguments:
749  **
750  *a parent_name - character to which this character should
751  *a be attached; pass NULL to have no parent
752  *a and be attached to the world
753  *a parent_link_name - name of the link or connection point to which this character's
754  *a position link should attach; pass "" to attach
755  *a to the parent's position link
756  **
757  *b Returns:
758  **
759  ** 0 on success, -1 on failure
760  **
761  *b Available as Decision Bead/Event
762  */
763  int set_parent(const char* parent_name, const char* parent_link_name = "");
764 
765  /*l
766  *b Description:
767  **
768  ** Gets the parent of this character.
769  **
770  *b Returns:
771  **
772  ** pointer to type diguyCharacter; NULL if no parent
773  **
774  *b Available as Decision Bead/Event
775  */
776  diguyCharacter* get_parent();
777 
778  /*l
779  *b Description:
780  **
781  ** Gets the link name that the character is parented to, if any.
782  **
783  *b Returns:
784  **
785  ** name of link, NULL if no parent
786  */
787  const char* get_parent_link_name();
788 
789  /*l
790  *b Description:
791  **
792  ** Detaches a character from its parent and reattaches it to the
793  ** world. This is equivalent to diguyCharacter::set_parent(NULL).
794  **
795  *b Returns:
796  **
797  ** 0 on success, -1 on failure
798  **
799  *b Available as Decision Bead/Event
800  */
801  int unset_parent();
802 
803  /*l
804  *b Description:
805  **
806  ** Gets the number of children the character has.
807  */
808  int get_num_children();
809 
810  /*l
811  *b Description:
812  **
813  ** This function returns a pointer to the nth child of the character.
814  **
815  *b Returns:
816  **
817  ** pointer of type diguyCharacter; NULL if no
818  ** child at the specified index
819  **
820  *b Arguments:
821  **
822  *a index - index of the child; indices start at 0
823  */
824  diguyCharacter* get_child_at_index(int index);
825 
826  /*l
827  *b Description:
828  **
829  ** Gets if a character is a static object, by default any blitzed .
830  ** in props are.
831  **
832  *b Returns:
833  **
834  ** 1 if true, 0 if false
835  */
836  int get_is_scene_object();
837 
838  /*l
839  *b Description:
840  **
841  ** Sets if a character is a static object. By default any blitzed
842  ** in props are.
843  **
844  *b Arguments:
845  **
846  *a is_scene_object - pass 1 to make the object a scene object,
847  *a 0 to not
848  **
849  *b Returns:
850  **
851  ** 0 on success, -1 on failure
852  */
853  int set_is_scene_object(int is_scene_object);
854 
855  /*l
856  *b Description:
857  **
858  ** Gets the bounding radius currently used for this character
859  ** for purposes of culling it from the draw operation.
860  **
861  *b Returns:
862  **
863  ** The current draw-culling bounding radius for the character, in
864  ** meters.
865  */
866  float get_bounding_radius();
867 
868  /*l
869  *b Description:
870  **
871  ** Gets the default draw-culling bounding radius for this
872  ** character, as specified in its actor cfg file. See
873  ** actor_vehicle.cfg for an example.
874  **
875  *b Returns:
876  **
877  ** The default draw-culling bounding radius for the character.
878  */
879  float get_default_bounding_radius();
880 
881  /*l
882  *b Description:
883  **
884  ** Sets the current draw-culling bounding radius to be used for
885  ** this character.
886  */
887  void set_bounding_radius(float f);
888 
889  /*l
890  *b Description:
891  **
892  ** This function returns the number of seconds before the blend
893  ** into the next motion begins. If the character is already
894  ** in a blend between motions the function returns 0.
895  **
896  ** Note that this function is of limited practical use; in most
897  ** cases get_time_to_reach_desired_action() returns
898  ** information that is more useful.
899  **
900  *b Returns:
901  **
902  ** time to next blend, in seconds
903  **
904  *b Mode Restrictions:
905  **
906  *- - This function can only be called in free action mode.
907  */
908  float get_time_to_transition();
909 
910  /*l
911  *b Returns:
912  **
913  ** the action mode of the character
914  */
915  diguyCharacterMode get_action_mode();
916 
917  /*l
918  *b Returns:
919  **
920  ** the position mode of the character
921  */
922  diguyCharacterMode get_position_mode();
923 
924  /*l
925  *b Description:
926  **
927  ** This function speeds up or slows down the character. Setting
928  ** this value greater than 1 will cause character actions to
929  ** be played back at a slower pace, setting to less that 1 will
930  ** cause character actions to be played at a faster pace.
931  **
932  ** This will override other factors that may scale the time
933  ** scale factor of a character. (For example, smaller scale
934  ** characters will generally move faster.)
935  **
936  ** Call unset_t_scale_factor() to allow other factors such
937  ** as scale or desired speed to determine the time scale factor.
938  **
939  *b Mode Restrictions:
940  **
941  *- - This function can only be called in free action mode.
942  **
943  *b Arguments:
944  **
945  *a t_scale_factor - time scale factor
946  **
947  *b Returns:
948  **
949  ** 0 on success, -1 on failure
950  */
951  int set_t_scale_factor(float t_scale_factor);
952 
953  /*l
954  *b Description:
955  **
956  ** This function removes the manual setting of the time
957  ** scale factor as set by set_t_scale_factor().
958  **
959  *b Mode Restrictions:
960  **
961  *- - This function can only be called in free action mode.
962  **
963  *b Returns:
964  **
965  ** 0 on success, -1 on failure
966  */
967  int unset_t_scale_factor();
968 
969  /*l
970  *b Description:
971  **
972  ** This function determines whether this character is within the
973  ** specified distance of another.
974  **
975  *b Arguments:
976  **
977  *a character - character to be checked
978  *a distance - distance to character in meters
979  **
980  *b Returns:
981  **
982  ** 1 if within distance; 0 if not
983  */
984  int is_within_distance_n_of_character(const char* character_name,
985  float distance);
986 
987  /*l
988  *b Description:
989  **
990  ** This function determines whether this character is within the
991  ** specified distance of any members of the specified group.
992  **
993  *b Arguments:
994  **
995  *a group_name - name of group to be checked
996  *a distance - distance in meters
997  **
998  *b Returns:
999  **
1000  ** 1 if member of group is within distance; 0 if not
1001  */
1002  int is_within_distance_n_of_member_of_group(const char* group_name,
1003  float distance);
1004 
1005  /*l
1006  *b Description:
1007  **
1008  ** This function determines whether a character is a member of
1009  ** a particular group.
1010  **
1011  ** Also see diguyCharacterGroup::is_member().
1012  **
1013  *b Arguments:
1014  **
1015  *a group_name - name of group to be checked
1016  **
1017  *b Returns:
1018  **
1019  ** 1 if character is in group, 0 if not
1020  */
1021  int is_group_member(const char* group_name);
1022 
1023  /*l
1024  *b Description:
1025  **
1026  ** This function returns the number of groups that a character is a
1027  ** member of.
1028  **
1029  ** Also see diguyCharacterGroup::is_member().
1030  */
1031  int get_num_group_memberships();
1032 
1033  /*l
1034  *b Description:
1035  **
1036  ** This function returns a pointer to the nth group that this
1037  ** character is a member of.
1038  **
1039  ** Also see diguyCharacterGroup::is_member().
1040  **
1041  *b Returns:
1042  **
1043  ** pointer of type diguyCharacterGroup; NULL if no
1044  ** group at the specified index
1045  **
1046  *b Arguments:
1047  **
1048  *a index - index of the group; indices start at 0
1049  */
1050  diguyCharacterGroup* get_group_membership_at_index(int index);
1051 
1052  /*l
1053  *b Description:
1054  **
1055  ** This function will check all characters in the scenario and return
1056  ** the nearest character that is both alive and enabled. An optional
1057  ** argument specifies whether to skip characters that are invisible
1058  ** to the caller because a scene object is in the way. Checking
1059  ** visibility is only an option if an octtree is generated from scene
1060  ** objects. Typically only DI-Guy Scenario does this.
1061  **
1062  *b Arguments:
1063  **
1064  *a check_visibility - whether to check that characters are
1065  *a visible to calling character; pass 1
1066  *a to check, 0 to not check
1067  *a xy_distance - whether to include the z component
1068  *a in distance calculations; pass 1 to
1069  *a check only XY distance, 0 to check
1070  *a XYZ distance
1071  **
1072  *b Returns:
1073  **
1074  ** pointer of type diguyCharacter; may be NULL
1075  */
1076  diguyCharacter* get_nearest_active_character(int check_visibility,
1077  int xy_distance = 0,
1078  float max_distance_to_check = 100000);
1079 
1080  /*l
1081  *b Description:
1082  **
1083  ** This function will check all characters in a group and return the
1084  ** nearest character that is both alive and enabled. An optional
1085  ** argument specifies whether to skip characters that are invisible
1086  ** to the caller because a scene object is in the way. Checking
1087  ** visibility is only an option if an octtree is generated from scene
1088  ** objects. Typically only DI-Guy Scenario does this.
1089  **
1090  *b Arguments:
1091  **
1092  *a group_name - name of group to check
1093  *a check_visibility - whether to check that characters are
1094  *a visible to calling character; pass 1
1095  *a to check, 0 to not check
1096  *a xy_distance - whether to include the z component
1097  *a in distance calculations; pass 1 to
1098  *a check only XY distance, 0 to check
1099  *a XYZ distance
1100  **
1101  *b Returns:
1102  **
1103  ** pointer of type diguyCharacter; may be NULL
1104  */
1105  diguyCharacter* get_nearest_active_character_in_group(const char* group_name,
1106  int check_visibility = 1,
1107  int xy_distance = 0,
1108  float max_distance_to_check = 100000);
1109 
1110  /*l
1111  *b Description:
1112  **
1113  ** This function will check all characters in the scenario and return
1114  ** a random character within max_distance that is both alive and
1115  ** enabled. An optional argument specifies whether to skip characters
1116  ** that are invisible to the caller because a scene object is in the
1117  ** way. Checking visibility is only an option if an octtree is
1118  ** generated from scene objects. Typically only DI-Guy Scenario does
1119  ** this.
1120  **
1121  *b Arguments:
1122  **
1123  *a check_visibility - whether to check that characters are
1124  *a visible to calling character; pass 1
1125  *a to check, 0 to not check
1126  *a max_distance - how far away the search cut off should be pass
1127  *a in -1.0f to use all characters
1128  *a xy_distance - whether to include the z component
1129  *a in distance calculations; pass 1 to
1130  *a check only XY distance, 0 to check
1131  *a XYZ distance
1132  **
1133  *b Returns:
1134  **
1135  ** pointer of type diguyCharacter; may be NULL
1136  */
1137  diguyCharacter* get_random_active_character(float max_distance = 10.0f,
1138  int check_visibility = 1,
1139  int xy_distance = 0);
1140 
1141  /*l
1142  *b Description:
1143  **
1144  ** This function will check all characters in a group and return a
1145  ** random character within max_distance that is both alive and
1146  ** enabled. An optional argument specifies whether to skip characters
1147  ** that are invisible to the caller because a scene object is in the
1148  ** way. Checking visibility is only an option if an octtree is
1149  ** generated from scene objects. Typically only DI-Guy Scenario does
1150  ** this.
1151  **
1152  *b Arguments:
1153  **
1154  *a group_name - name of group to check
1155  *a max_distance - how far away the search cut off should be, pass
1156  *a in -1.0f to use all characters
1157  *a check_visibility - whether to check that characters are
1158  *a visible to calling character; pass 1
1159  *a to check, 0 to not check
1160  *a xy_distance - whether to include the z component
1161  *a in distance calculations; pass 1 to
1162  *a check only XY distance, 0 to check
1163  *a XYZ distance
1164  **
1165  *b Returns:
1166  **
1167  ** pointer of type diguyCharacter; may be NULL
1168  */
1169  diguyCharacter* get_random_active_character_in_group(const char* group_name,
1170  float max_distance = 10,
1171  int check_visibility = 1,
1172  int xy_distance = 0);
1173 
1174  /*l
1175  *b Description:
1176  **
1177  ** This function returns the 3D distance from this character to the
1178  ** specified character, in meters. The distance is calculated from
1179  ** the characters' idealized positions.
1180  */
1181  float get_distance_to_character(diguyCharacter* character);
1182 
1183  /*l
1184  *b Description:
1185  **
1186  ** This function returns the 2D distance in X and Y coordinates only
1187  ** from this character to the specified character, in meters. The
1188  ** distance is calculated from the characters' idealized positions.
1189  */
1190  float get_distance_xy_to_character(diguyCharacter* character);
1191 
1192  /*l
1193  *b Description:
1194  **
1195  ** This function returns the 3D distance from this character to the
1196  ** specified impact, in meters. The distance is calculated from the
1197  ** characters' idealized positions.
1198  */
1199  float get_distance_to_impact(diguyImpact* impact);
1200 
1201  /*l
1202  *b Description:
1203  **
1204  ** Each character has a "random factor" between 0 and 1. This value
1205  ** is persistent with the character; i.e., the random factor will
1206  ** stay constant for the entire lifetime of the character.
1207  **
1208  ** This random factor can be used to add some variability between
1209  ** different characters.
1210  **
1211  ** Though each character has a random factor that has a very good
1212  ** chance of being different from all other characters' in the
1213  ** scenario, this is not guaranteed and so should not be used as a
1214  ** unique identifier.
1215  **
1216  ** An example of use: Instead of all characters beginning an action
1217  ** or behavior at the same time, have each one begin (random_factor *
1218  ** 2.0) seconds from the current time. This will result in more
1219  ** natural looking behavior as characters one by one begin the new
1220  ** behavior in the next two seconds, rather than all beginning at
1221  ** once.
1222  **
1223  *b Returns:
1224  **
1225  ** the character's random factor, a value between 0 and 1
1226  */
1227  float get_random_factor();
1228 
1229 
1230 /*****************************************************************************/
1235  /*l
1236  *b Description:
1237  **
1238  ** This function draws this character in immediate mode graphics
1239  ** environments (see below). This is the equivalent of calling
1240  ** draw_pass1() immediately followed by draw_pass2().
1241  **
1242  *b Returns:
1243  **
1244  ** 0 on success, -1 on failure
1245  **
1246  *i OpenGL Version:
1247  **
1248  ** This function immediately draws this character. Either this
1249  ** function or draw_pass1() and draw_pass2() should be called once per
1250  ** frame.
1251  */
1252  int draw();
1253 
1254  /*l
1255  *b Description:
1256  **
1257  ** This function, along with draw_pass2(), allows the drawing of
1258  ** opaque and transparent polygons to be separated. This function
1259  ** draws all opaque polygons of this character.
1260  **
1261  *b Returns:
1262  **
1263  ** 0 on success, -1 on failure
1264  **
1265  *i OpenGL Version:
1266  **
1267  ** This function immediately draws the opaque character parts. Either
1268  ** this function or draw() should be called once per frame.
1269  */
1270  int draw_pass1();
1271 
1272  /*l
1273  *b Description:
1274  **
1275  ** Same as draw_pass1(), but draws transparent character parts.
1276  */
1277  int draw_pass2();
1278 
1279 #ifdef CPLUSPLUS_ONLY
1280 
1281  /*l
1282  *b Returns:
1283  **
1284  ** A pointer to the character's graphics.
1285  **
1286  *i Vega Prime Version:
1287  **
1288  ** The return pointer may be cast to point to a vpDiguyCharacter,
1289  ** which is derived from vpObject.
1290  **
1291  *i OpenGL Version:
1292  **
1293  ** This function returns NULL.
1294  **
1295  *i DI-Guy Graphics API:
1296  **
1297  ** This function returns the pointer set from the most recent
1298  ** set_graphics_ptr() call.
1299  */
1300  void* get_graphics_ptr();
1301 
1302  /*l
1303  *b Description:
1304  **
1305  ** Sets a graphics environment-specific pointer to graphics data.
1306  ** The pointer can be retrieved using get_graphics_ptr().
1307  **
1308  *b Arguments:
1309  **
1310  *a graphics_ptr - pointer to graphics data
1311  **
1312  *b Returns:
1313  **
1314  ** 0 on success, -1 on failure
1315  **
1316  *i OpenGL Version:
1317  **
1318  *b This function should not be called for these environments.
1319  **
1320  *i DI-Guy Graphics API Version:
1321  **
1322  ** This function allows graphics environment-specific data to be
1323  ** stored for later retrieval by get_graphics_ptr(). DI-Guy does
1324  ** not directly use the pointer, beyond returning it using the
1325  ** get_graphics_ptr() function.
1326  */
1327  int set_graphics_ptr(void* graphics_ptr);
1328 
1329  /*l
1330  *b Description:
1331  **
1332  ** This function sets a generic node pointer that can later be
1333  ** retrieved by the get_graphics_api_node_ptr() call. The pointer is
1334  ** otherwise not used.
1335  **
1336  *i Callback Info:
1337  **
1338  ** This function can be safely be called in the
1339  ** CALLBACK_ID_SET_GRAPHICS_API_NODE_PTR callback.
1340  **
1341  *b Arguments:
1342  **
1343  *a node_ptr - generic void* pointer
1344  */
1345  void set_graphics_api_node_ptr(void* node_ptr);
1346 
1347  /*l
1348  *b Returns:
1349  **
1350  ** pointer set by most recent call to set_graphics_api_node_ptr
1351  */
1352  void* get_graphics_api_node_ptr();
1353 
1354  /*l
1355  *b Description:
1356  **
1357  ** This function stores a pointer to user data.
1358  **
1359  *b Arguments:
1360  **
1361  *a user_data - pointer for user's own use; DI-Guy will
1362  *a do nothing to the contents of this pointer
1363  *a beyond passing it back when requested
1364  *a by get_user_data()
1365  **
1366  *b Returns:
1367  **
1368  ** 0 on success, -1 on failure
1369  */
1370  int set_user_data(void* user_data);
1371 
1372  /*l
1373  *b Returns:
1374  **
1375  ** The user data pointer set by set_user_data()
1376  */
1377  void* get_user_data();
1378 
1379 #endif
1380 
1381 /*****************************************************************************/
1391  /*l
1392  *b Description:
1393  **
1394  ** This function sets the desired action of the character.
1395  **
1396  ** This function will put the character into free action mode. If
1397  ** the character was in path action mode, actions will no longer be
1398  ** set by action beads on the path.
1399  **
1400  ** If the character is in path position mode and 1 is passed for
1401  ** retain_path_shape, the character will stay in path position mode.
1402  ** If 0 is passed for retain_path_shape, the character will be put
1403  ** into free position mode.
1404  **
1405  ** If the character is in free position mode the retain_path_shape
1406  ** argument will have no effect.
1407  **
1408  ** If this call is interrupting a character in path action mode
1409  ** and path position mode, the character will not be able to resume
1410  ** the interrupted path unless retain_path_shape is set to 1.
1411  ** See resume_interrupted_path().
1412  **
1413  ** This function will have no effect on a dead character (see
1414  ** die_now() and get_dead()).
1415  **
1416  *b Mode Effects:
1417  **
1418  *- - This function will put the character into free action mode.
1419  *- - This function may change the position mode; see Description.
1420  **
1421  *b Arguments:
1422  **
1423  *a action_name - name of the desired action to be performed by
1424  *a the character
1425  *a speed - the speed at which the character should travel
1426  *a while performing the action; pass
1427  *a DIGUY_DEFAULT_FLOAT for the optimal speed to
1428  *a be used
1429  *a retain_path_shape - pass 1 to remain in path position mode; pass
1430  *a 0 to change to free position mode
1431  **
1432  *b Returns:
1433  **
1434  ** 0 on success, -1 on failure
1435  */
1436  int set_desired_action(const char* action_name,
1437  float speed = DIGUY_DEFAULT_FLOAT,
1438  int retain_path_shape = 0);
1439 
1444  const char* get_desired_action();
1445 
1447  int get_desired_action_index();
1448 
1450  const char* get_current_action();
1451 
1453  int get_current_action_index();
1454 
1456  diguyMotionDirection get_current_action_direction();
1457 
1458  /*l
1459  *b Description:
1460  **
1461  ** This function returns the transition state of the action
1462  ** of a character. When commanding an action, DI-Guy may
1463  ** transition the character through one or more intermediate
1464  ** actions to reach the final action. For example, a character
1465  ** with the action "walk" that is commanded to "prone" would
1466  ** transition through the intermediate action "stand".
1467  **
1468  *b Returns:
1469  **
1470  ** 1 if the character is transitioning between actions
1471  ** 0 otherwise
1472  */
1473  int get_is_in_action_transition();
1474 
1475  /*l
1476  *b Description:
1477  **
1478  ** This function forces the current action of the character to be the
1479  ** action identified by action_name.
1480  **
1481  ** See set_desired_action() for a discussion of the effects on
1482  ** position mode.
1483  **
1484  ** This function will have no effect on a dead character (see
1485  ** die_now() and get_dead()).
1486  **
1487  ** By passing a value greater than 0 for t_offset_into_new_action,
1488  ** the character can be made to begin the action partway in. This is
1489  ** useful when forcing actions for a lot of characters at the same
1490  ** time; without the offset, the characters would move in lockstep.
1491  **
1492  ** The most recent forced action, the time at which it was forced,
1493  ** and any time offset can be queried using the functions
1494  ** get_most_recent_forced_action(),
1495  ** get_most_recent_forced_action_t(), and
1496  ** get_most_recent_forced_action_t_offset().
1497  **
1498  *b Mode Effects:
1499  **
1500  *- - This function will put the character into free action mode.
1501  *- - This function may change the position mode; see Description.
1502  **
1503  *b Arguments:
1504  **
1505  *a action_name - name of the action to be performed by
1506  *a the character
1507  *a speed - the speed at which the character should
1508  *a travel while performing the action; pass
1509  *a DIGUY_DEFAULT_FLOAT for the optimal speed
1510  *a to be used
1511  *a include_transition_arc - flag for whether the transition
1512  *a motion from the current action to
1513  *a the new action is included;
1514  *a pass 1 for best chance of good looking
1515  *a transition;
1516  *a pass 0 for fastest response
1517  *a max_rampdown_interval - max amount of time spent trying to
1518  *a smooth over any motion seams; set
1519  *a to 0.5 for a smooth transition, set
1520  *a to 0 for a potentially rough transition
1521  *a retain_path_shape - pass 1 to remain in path position mode;
1522  *a pass 0 to change to free position mode
1523  *a t_offset_into_new_action - how much to shift time forward into
1524  *a new action; must be >= 0; see comment
1525  *a above for more info
1526  **
1527  *b Returns:
1528  **
1529  ** 0 on success, -1 on failure
1530  */
1531  int force_action(const char* action_name,
1532  float speed = DIGUY_DEFAULT_FLOAT,
1533  int include_transition_arc = 1,
1534  float max_rampdown_interval = 0.5f,
1535  int retain_path_shape = 0,
1536  float t_offset_into_new_action = 0.0f);
1537 
1538  /*l
1539  *b Description:
1540  **
1541  ** This function is similar to force_action(), but allows the
1542  ** specification of how long the interruption should last.
1543  **
1544  ** This function will have no effect on a dead character (see
1545  ** die_now() and get_dead()).
1546  **
1547  *b Mode Restrictions:
1548  **
1549  *- - This function can only be called if the character is in
1550  *- path action mode *and* path position mode.
1551  **
1552  *b Mode Effects:
1553  **
1554  *- - This function will put the character into free action mode.
1555  *- - This function will not change the position mode.
1556  **
1557  *b Arguments:
1558  **
1559  *a duration - how long the action should be performed before
1560  *a an automatic resume_interrupted_path() call is
1561  *a made
1562  **
1563  *b Returns:
1564  **
1565  ** 0 on success, -1 on failure
1566  */
1567  int force_action_with_duration(const char* action_name,
1568  float duration,
1569  int include_transition_arc = 1,
1570  float max_rampdown_interval = 0.5f);
1571 
1572  /*l
1573  *b Description:
1574  **
1575  ** This function forces the current action of the character to be the
1576  ** action identified by action_name, to be executed along the path
1577  ** shape specified by path_shape_name.
1578  **
1579  ** This function will have no effect on a dead character (see
1580  ** die_now() and get_dead()).
1581  **
1582  *b Mode Effects:
1583  **
1584  *- - This function will put the character into free action mode.
1585  *- - This function will put the character into path position mode.
1586  **
1587  *b Arguments:
1588  **
1589  *a action_name - name of the action to be performed by
1590  *a the character
1591  *a path_shape_name - name of the path shape on which action
1592  *a should be performed
1593  *a waypoint_name - name of waypoint on path shape to begin at;
1594  *a default of NULL will start at first waypoint
1595  *a distance_into_path - distance into path shape to start at, if
1596  *a waypoint_name isn't specified
1597  **
1598  *b Returns:
1599  **
1600  ** 0 on success, -1 on failure
1601  */
1602  int force_action_and_path_shape(const char* action_name,
1603  const char* path_shape_name,
1604  const char* waypoint_name = NULL,
1605  float distance_into_path = 0.0f);
1606 
1607  /*l
1608  *b Description:
1609  **
1610  ** This function returns the most recently forced action as set by
1611  ** by force_action(), force_action_with_duration(), or
1612  ** force_action_and_path_shape().
1613  **
1614  *b Returns:
1615  **
1616  ** the name of the most recent forced action, or NULL if no action
1617  ** has been forced
1618  */
1619  const char* get_most_recent_forced_action();
1620 
1621  /*l
1622  *b Description:
1623  **
1624  ** This function returns the time at which the most recently forced
1625  ** action occurred.
1626  **
1627  *b Returns:
1628  **
1629  ** time at which force action occurred; -1.0 if no action has been
1630  ** forced
1631  */
1632  float get_most_recent_forced_action_t();
1633 
1634  /*l
1635  *b Description:
1636  **
1637  ** This function returns the action time offset of the most recently
1638  ** forced action. This is typically value of the
1639  ** t_offset_into_new_action argument of the force_action() call.
1640  **
1641  *b Returns:
1642  **
1643  ** time at which force action occurred; -1.0 if no action has been
1644  ** forced
1645  */
1646  float get_most_recent_forced_action_t_offset();
1647 
1648 
1649  /*l
1650  *b Description:
1651  **
1652  ** This function adds a "pending action" to the character. This is
1653  ** essentially a delayed set_desired_action() call. The desired
1654  ** action will be set at the passed scenario t, just as if
1655  ** set_desired_action() is called at that time.
1656  **
1657  ** *Note:* Any call to set_desired_action() or force_action(), or
1658  ** their related variants, will clear any pending actions.
1659  **
1660  *b Arguments:
1661  **
1662  *a action - name of pending desired action
1663  *a scenario_t - time at which to set desired action
1664  *a remove_existing_pending_actions - pass 1 to remove any previously
1665  *a added pending actions, 0 to leave them
1666  *a speed - as passed to set_desired_action()
1667  *a retain_path_shape - as passed to set_desired_action()
1668  **
1669  *b Returns:
1670  **
1671  ** 0 on success, -1 on failure
1672  */
1673  int add_pending_desired_action(const char* action,
1674  float scenario_t,
1675  int remove_existing_pending_actions = 0,
1676  float speed = DIGUY_DEFAULT_FLOAT,
1677  int retain_path_shape = 1);
1678 
1679  /*l
1680  *b Description:
1681  **
1682  ** Similar to add_pending_desired_action(), but will do a
1683  ** force_action() at the passed scenario_t instead of a
1684  ** set_desired_action().
1685  **
1686  ** *Note:* Any call to set_desired_action() or force_action(), or
1687  ** their related variants, will clear any pending actions.
1688  **
1689  *b Returns:
1690  **
1691  ** 0 on success, -1 on failure
1692  */
1693  int add_pending_force_action(const char* action,
1694  float scenario_t,
1695  int remove_existing_pending_actions = 0,
1696  float speed = DIGUY_DEFAULT_FLOAT,
1697  int include_transition_arc = 1,
1698  float max_rampdown_interval = 0.5f,
1699  int retain_path_shape = 1,
1700  float first_arc_time_shift = 0.0f);
1701 
1702  /*l
1703  *b Returns:
1704  **
1705  ** 1 if the passed action name is an action available to this
1706  ** character, 0 if not
1707  */
1708  int is_valid_action(const char* action);
1709 
1710  /*l
1711  *b Description:
1712  **
1713  ** This function sends this character a signal to die as soon as
1714  ** possible. The character will transition to a dead action.
1715  **
1716  ** The following side-effects will also happen:
1717  *>
1718  *- - all aiming is ended
1719  *- - all gazing is ended
1720  *- - all pointing is ended
1721  *- - head nodding and shaking are stopped
1722  *- - all gestures are aborted
1723  *- - all sounds originated by the character are stopped
1724  *- - Destroyed appearance might be switched to.
1725  *<
1726  ** Many function calls will have no effect on dead characters;
1727  ** see individual function descriptions for limitations.
1728  **
1729  ** Use the get_dead() call to retrieve the dead state of a
1730  ** character.
1731  **
1732  *b Mode Effects:
1733  **
1734  *- - This function will put the character into free action mode.
1735  *- - This function will not change the position mode.
1736  **
1737  *b Returns:
1738  **
1739  ** 0 on success, -1 on failure
1740  **
1741  *b Available as Decision Bead/Event
1742  */
1743  int die_now(const char* preferred_dead_action_name = "(default)");
1744 
1745  /*l
1746  *b Description:
1747  **
1748  ** This function revives a dead character. The limitations of dead
1749  ** characters will be lifted from the revived character; e.g., the
1750  ** character will be able to gaze, execute gestures, etc.
1751  **
1752  *b Returns:
1753  **
1754  ** 0 on success, -1 on failure
1755  **
1756  *b Available as Decision Bead/Event
1757  */
1758  int revive_now(const char* preferred_revive_action_name = "(default)");
1759 
1760  /*l
1761  *b Description:
1762  **
1763  ** This function returns whether or not the character is dead.
1764  ** Characters can be killed by die_now() function calls, as well as
1765  ** by being hit by weapon fire.
1766  **
1767  *b Returns:
1768  **
1769  ** 1 if character is dead (die_now() function has been called),
1770  ** 0 if not.
1771  */
1772  int get_dead();
1773 
1774  /*l
1775  *b Description:
1776  **
1777  ** Sets the speed the character should attempt to move, in meters per
1778  ** second.
1779  **
1780  ** This setting takes effect immediately. To set a desired action
1781  ** and a desired speed at the same time, use the speed argument of
1782  ** the set_desired_action() call.
1783  **
1784  ** This desired speed setting can be undone in a couple of ways:
1785  **
1786  *- 1. by calling set_speed() with an argument of
1787  *- DIGUY_DEFAULT_FLOAT, or
1788  *- 2. by calling set_desired_action(), or
1789  *- 3. by calling one of the force_action() functions
1790  **
1791  *b Arguments:
1792  **
1793  *a speed - desired speed in meters per second
1794  **
1795  *b Returns:
1796  **
1797  ** 0 on success, -1 on failure
1798  */
1799  int set_speed(float speed);
1800 
1801  /*l
1802  *b Returns:
1803  **
1804  ** the approximate speed at which the character is moving, in meters
1805  ** per second
1806  */
1807  float get_speed();
1808 
1809  /*l
1810  *b Returns:
1811  **
1812  ** The desired speed of the character, in meters per second. Calls to
1813  ** set_speed(), set_desired_action(), or force_action() assign
1814  ** the character a desired speed, to which it transitions over some
1815  ** amount of time. If the speed-setting was instantaneous, the current
1816  ** speed will be returned.
1817  */
1818  float get_desired_speed();
1819 
1820 /*****************************************************************************/
1837  /*l
1838  *b Description:
1839  **
1840  ** Sets a generic parameter that can be mapped to a blend tree driver.
1841  ** Useful for creating animations that can play back at different vertical angles.
1842  */
1843  int set_animation_target_el(float elevation, float ramp_time = .25f);
1844 
1846  float get_animation_target_el();
1847 
1848  /*l
1849  *b Description:
1850  **
1851  ** Sets a generic parameter that can be mapped to a blend tree driver.
1852  ** Useful for creating animations that can play back at different horizontal angles.
1853  */
1854  int set_animation_target_az(float azimuth, float ramp_time = .25f);
1855 
1857  float get_animation_target_az();
1858 
1859  /*l
1860  *b Description:
1861  **
1862  ** Sets a generic parameter in world space that can be mapped to a blend tree driver.
1863  ** The locomotion actions are driven by these values allowing one action to go
1864  ** many different direction.
1865  ** Internally this is mapped to local space.
1866  **
1867  ** In practical terms, this means that a character with the appropriate animation blend
1868  ** tree can be made to move at an arbitrary speed in an arbitrary direction, provided
1869  ** that the blend tree supports these motions. One example would be a soldier who can
1870  ** "strafe" from side to side while pointing his weapon in a certain direction. Another
1871  ** example would be a car that can travel forwards or backwards at a speed within a
1872  ** continuous range.
1873  **
1874  ** Users can see a demonstration of this feature in the character view by selecting an
1875  ** appropriate character type (e.g. vehicle_09), appearance (e.g. taxi_2013), and
1876  ** action ("movement"). The exercise blend tree widget will allow adjustments.
1877  **
1878  */
1879  void set_animation_velocity(float vel_x, float vel_y, float vel_z, float ramp_time = .25f);
1880 
1882  void get_animation_velocity(float *vel_x, float *vel_y, float *vel_z);
1883 
1884  /*l
1885  *b Description:
1886  **
1887  ** Sets a generic parameter in local space that can be mapped to a blend tree driver.
1888  ** The locomotion actions are driven by these values allowing one action to go
1889  ** many different directions.
1890  **
1891  ** Similar to set_animation_velocity() in terms of overall practical details.
1892  ** Note that the local velocity setting will affect the character's world velocity.
1893  */
1894  void set_animation_local_velocity(float vel_x, float vel_y, float vel_z, float ramp_time = .25f);
1895 
1897  void get_animation_local_velocity(float *vel_x, float *vel_y, float *vel_z);
1898 
1899  /*l
1900  *b Description:
1901  **
1902  ** Sets a generic parameter in that can be mapped to a blend tree driver.
1903  ** The locomotion actions are driven by these values allowing one action to turn
1904  */
1905  void set_animation_angular_velocity(float vel_rz, float ramp_time = .25f);
1906 
1908  float get_animation_angular_velocity();
1909 
1910 
1911 /*****************************************************************************/
1921  /*l
1922  *b Description:
1923  **
1924  ** Sets the position of the character relative to the origin of the
1925  ** DI-Guy global coordinate system.
1926  **
1927  ** The new settings will take effect immediately, possibly causing
1928  ** the character to "teleport" if the new values are significantly
1929  ** different than the old.
1930  **
1931  ** The DI-Guy global coordinate system is right-handed, with
1932  ** X forward, Z up, and Y to the left. Rotation directions follow
1933  ** standard right-handed coordinate system conventions:
1934  **
1935  *- - positive rotations about X cause a counter-clockwise roll
1936  *- - position rotations about Y cause a forward pitch
1937  *- - positive rotations about Z cause a yaw to the left
1938  **
1939  ** Note that if the character has an altitude function (see
1940  ** set_altitude_function()), the tz argument will effectively be
1941  ** ignored as the altitude function will override it.
1942  **
1943  ** If the magnitude of the numbers is large (say 32000 or higher),
1944  ** the function set_position_double() should be used instead.
1945  **
1946  *b Mode Effects:
1947  **
1948  *- - This function will put the character into free position mode.
1949  *- - This function will put the character into free action mode.
1950  **
1951  *b Arguments:
1952  **
1953  *a tx, ty, tz - position in meters from the origin
1954  **
1955  *b Returns:
1956  **
1957  ** 0 on success, -1 on failure
1958  */
1959  int set_position(float tx, float ty, float tz);
1960 
1961  /*l
1962  *b Description:
1963  **
1964  ** Similar to set_position(), but using double-precision rather than
1965  ** single-precision numbers. If the magnitude of the numbers is large
1966  ** (say 32000 or higher), this function should be used.
1967  **
1968  *b Mode Effects:
1969  **
1970  *- - This function will put the character into free position mode.
1971  *- - This function will put the character into free action mode.
1972  **
1973  *b Arguments:
1974  **
1975  *a tx, ty, tz - position in meters from the origin
1976  **
1977  *b Returns:
1978  **
1979  ** 0 on success, -1 on failure
1980  */
1981  int set_position_double(double tx, double ty, double tz);
1982 
1983  /*l
1984  *b Description:
1985  **
1986  ** Retrieves the position of the character in the DI-Guy
1987  ** global coordinate system.
1988  **
1989  ** See set_position() for a description of the coordinate system.
1990  **
1991  *b Arguments:
1992  **
1993  *a tx, ty, tz - position in meters from the origin
1994  **
1995  ** Pass NULL for any values that are not needed.
1996  **
1997  *b Returns:
1998  **
1999  ** 0 on success, -1 on failure
2000  */
2001  int get_position(float* tx, float* ty, float* tz);
2002 
2003  /*l
2004  *b Description:
2005  **
2006  ** Retrieves the position of the character in the DI-Guy
2007  ** global coordinate system.
2008  **
2009  ** See set_position() for a description of the coordinate system.
2010  **
2011  ** Unlike get_position(), this function returns higher-precision
2012  ** values for the position, which is important when the character is
2013  ** far from the coordinate system origin.
2014  **
2015  *b Arguments:
2016  **
2017  *a tx, ty, tz - position in meters from the origin
2018  **
2019  ** Pass NULL for any values that are not needed.
2020  **
2021  *b Returns:
2022  **
2023  ** 0 on success, -1 on failure
2024  */
2025  int get_position_double(double* tx, double* ty, double* tz);
2026 
2027  /*l
2028  *b Description:
2029  **
2030  ** Sets the position of the character relative to its parent or the
2031  ** origin of the DI-Guy global coordinate system if this
2032  ** character is not parented.
2033  **
2034  ** See set_position() for a description of the coordinate system.
2035  **
2036  ** The new settings will take effect immediately, possibly causing the
2037  ** character to "teleport" if the new values are significantly
2038  ** different than the old.
2039  **
2040  *b Mode Effects:
2041  **
2042  *- - This function will put the character into free position mode.
2043  *- - This function will put the character into free action mode.
2044  **
2045  *b Arguments:
2046  **
2047  *a tx, ty, tz - position in meters from the origin
2048  **
2049  *b Returns:
2050  **
2051  ** 0 on success, -1 on failure
2052  */
2053  int set_position_relative_to_parent(float tx, float ty, float tz);
2054 
2055  /*l
2056  *b Description:
2057  **
2058  ** Retrieves the position of the character relative to its parent, or
2059  ** relative to the origin of the DI-Guy global coordinate
2060  ** system if this character is not parented.
2061  **
2062  ** See set_position() for a description of the coordinate system.
2063  **
2064  *b Arguments:
2065  **
2066  *a tx, ty, tz - position in meters from the origin
2067  **
2068  ** Pass NULL for any values that are not needed.
2069  **
2070  *b Returns:
2071  **
2072  ** 0 on success, -1 on failure
2073  */
2074  int get_position_relative_to_parent(float* tx, float* ty, float* tz);
2075 
2076  /*l
2077  *b Description:
2078  **
2079  ** Similar to set_position_relative_to_parent(), but the position is
2080  ** either from the other character's overall position (if
2081  ** other_link_name is NULL), or the position of the other character's
2082  ** link (if other_link_name specifies a link on the other character).
2083  **
2084  ** The position that is set is relative to this character's parent.
2085  **
2086  *b Mode Effects:
2087  **
2088  *- - This function will put the character into free position mode.
2089  *- - This function will put the character into free action mode.
2090  **
2091  *b Arguments:
2092  **
2093  *a other_character_name - other character from which to read
2094  *a position
2095  *a other_link_name - optional link on other character; if
2096  *a NULL, other character's base position is
2097  *a used
2098  *a offset_x, offset_y, offset_z - offset to apply to position
2099  *a read from other character
2100  *a also_set_orientation - pass 1 to also set this character's
2101  *a orientation from the other character's
2102  *a orientation
2103  **
2104  *b Returns:
2105  **
2106  ** 0 on success, -1 on failure
2107  */
2108  int set_position_to_other_character_position(const char* other_character_name,
2109  const char* other_link_name = NULL,
2110  float offset_x = 0.0f, float offset_y = 0.0f, float offset_z = 0.0f,
2111  int also_set_orientation = 1);
2112 
2113  /*l
2114  *b Description:
2115  **
2116  ** Sets the desired position of the character. How the character
2117  ** moves toward the desired position is determined by its current
2118  ** guides; see add_guide() and create_guide().
2119  **
2120  *b Mode Effects:
2121  **
2122  *- - This function will put the character into free position mode.
2123  *- - This function will put the character into free action mode.
2124  **
2125  *b Arguments:
2126  **
2127  *a tx, ty, tz - desired position in meters from the origin
2128  *a force_guide_unacquired - this optional argument will set any guides
2129  *a the character has to be unacquired
2130  *b Returns:
2131  **
2132  ** 0 on success, -1 on failure
2133  */
2134  int set_desired_position(float tx, float ty, float tz,
2135  int force_guide_unacquired = 0);
2136 
2137  int set_desired_position_double(double tx, double ty, double tz,
2138  int force_guide_unacquired = 0);
2139  /*l
2140  *b Description:
2141  **
2142  ** Like set_desired_position(), but uses the character's current
2143  ** position as the desired position.
2144  **
2145  *b Mode Effects:
2146  **
2147  *- - This function will put the character into free position mode.
2148  *- - This function will put the character into free action mode.
2149  **
2150  *b Arguments:
2151  **
2152  *a also_set_orientation - pass 1 to also set this character's
2153  *a orientation to its current orientation
2154  **
2155  *b Returns:
2156  **
2157  ** 0 on success, -1 on failure
2158  */
2159  int set_desired_position_to_current_position(int also_set_orientation = 1);
2160 
2161  /*l
2162  *b Description:
2163  **
2164  ** Like set_desired_position(), but sets the character's desired
2165  ** position to passed waypoint's position.
2166  **
2167  ** The passed waypoint can be one created by
2168  ** diguyScenario::create_waypoint, a waypoint from a character's
2169  ** diguyCharacterPath, or waypoint from a diguyPathShape.
2170  **
2171  *b Mode Effects:
2172  **
2173  *- - This function will put the character into free position mode.
2174  *- - This function will put the character into free action mode.
2175  **
2176  *b Arguments:
2177  **
2178  *a waypoint - pointer to diguyWaypoint object
2179  *a offset_x, offset_y, offset_z - offset to apply to waypoint
2180  *a position
2181  *a offset_in_world_coords - 1 if offset is to be in world
2182  *a coordinates, 0 if it is to be
2183  *a in waypoint-local coordinates
2184  **
2185  *b Returns:
2186  **
2187  ** 0 on success, -1 on failure
2188  */
2189  int set_desired_position_to_waypoint(diguyWaypoint* waypoint,
2190  float offset_x = 0.0f, float offset_y = 0.0f, float offset_z = 0.0f,
2191  int offset_in_world_coords = 0);
2192 
2193  /*l
2194  *b Description:
2195  **
2196  ** Like set_desired_position(), but finds the specified waypoint on
2197  ** the specified path and sets the character's desired position to the
2198  ** waypoint's position.
2199  **
2200  *b Mode Effects:
2201  **
2202  *- - This function will put the character into free position mode.
2203  *- - This function will put the character into free action mode.
2204  **
2205  *b Arguments:
2206  **
2207  *a path_name - name of path on which to find waypoint
2208  *a waypoint_name - name of waypoint
2209  **
2210  *b Returns:
2211  **
2212  ** 0 on success, -1 on failure
2213  */
2214  int set_desired_position_to_path_waypoint(const char* path_name,
2215  const char* waypoint_name);
2216 
2217  /*l
2218  *b Description:
2219  **
2220  ** Like set_desired_position(), but finds the specified waypoint on
2221  ** the specified path shape and sets the character's desired position
2222  ** to the waypoint's position.
2223  **
2224  *b Mode Effects:
2225  **
2226  *- - This function will put the character into free position mode.
2227  *- - This function will put the character into free action mode.
2228  **
2229  *b Arguments:
2230  **
2231  *a path_shape_name - name of path shape on which to find waypoint
2232  *a waypoint_name - name of waypoint
2233  **
2234  *b Returns:
2235  **
2236  ** 0 on success, -1 on failure
2237  */
2238  int set_desired_position_to_path_shape_waypoint(const char* path_shape_name,
2239  const char* waypoint_name);
2240 
2241  /*l
2242  *b Description:
2243  **
2244  ** Retrieves the desired position of the character.
2245  **
2246  *b Mode Restrictions:
2247  **
2248  *- - This function can only be called in free position mode.
2249  **
2250  *b Arguments:
2251  **
2252  *a tx, ty, tz - desired position in meters from the origin
2253  **
2254  ** Pass NULL for any values that are not needed.
2255  **
2256  *b Returns:
2257  **
2258  ** 0 on success, -1 on failure
2259  */
2260  int get_desired_position(float* tx, float* ty, float* tz);
2261  int get_desired_position_double(double* tx, double* ty, double* tz);
2262 
2263  /*l
2264  *b Description:
2265  **
2266  ** Retrieves the delta vector from current position to desired one.
2267  **
2268  *b Mode Restrictions:
2269  **
2270  *- - This function can only be called in free position mode.
2271  **
2272  *b Arguments:
2273  **
2274  *a tx, ty, tz - delta in meters
2275  **
2276  ** Pass NULL for any values that are not needed.
2277  **
2278  *b Returns:
2279  **
2280  ** 0 on success, -1 on failure
2281  */
2282  int get_delta_to_desired_position(float* tx, float* ty, float* tz);
2283 
2284  /*l
2285  *b Description:
2286  **
2287  ** Sets the initial position the character should move to on a call to
2288  ** diguyScenario::reset().
2289  **
2290  ** If the character has an initial path, that path, not this function
2291  ** call, will determine its initial position.
2292  **
2293  *b Arguments:
2294  **
2295  *a tx, ty, tz - initial position in meters from the origin
2296  **
2297  *b Returns:
2298  **
2299  ** 0 on success, -1 on failure
2300  */
2301  int set_initial_position(float tx, float ty, float tz);
2302 
2303  /*l
2304  *b Description:
2305  **
2306  ** Retrieves the initial position of the character.
2307  **
2308  ** If the character is in free position mode or has no initial path,
2309  ** this will be the position set by set_initial_position().
2310  **
2311  ** Otherwise this will be the position of the first waypoint of the
2312  ** initial path.
2313  **
2314  *b Arguments:
2315  **
2316  *a tx, ty, tz - initial position in meters from the origin
2317  **
2318  ** Pass NULL for any values that are not needed.
2319  **
2320  *b Returns:
2321  **
2322  ** 0 on success, -1 on failure
2323  */
2324  int get_initial_position(float* tx, float* ty, float* tz);
2325 
2326  /*l
2327  *b Description:
2328  **
2329  ** Sets the orientation of the character relative to the origin of the
2330  ** DI-Guy global coordinate system.
2331  **
2332  ** See set_position() for a description of the coordinate system.
2333  **
2334  ** The new settings will take effect immediately, possibly causing the
2335  ** character to "teleport" if the new values are significantly
2336  ** different than the old.
2337  **
2338  ** Note that if the character has an up vector type of 'z' or 'n' or even
2339  ** sometimes 'd' (as set by the set_up_vector_type() call) the rx and ry
2340  ** values will not have any effect. To be able to set rx and ry
2341  ** values, set the up vector type of the character to 'c', for "custom".
2342  **
2343  *b Mode Effects:
2344  **
2345  *- - This function will put the character into free position mode.
2346  *- - This function will put the character into free action mode.
2347  **
2348  *b Arguments:
2349  **
2350  *a rz, rx, ry - orientations in degrees
2351  **
2352  *b Returns:
2353  **
2354  ** 0 on success, -1 on failure
2355  */
2356  int set_orientation(float rz, float rx, float ry);
2357 
2358  /*l
2359  *b Description:
2360  **
2361  ** Retrieves the orientation of the character in the DI-Guy
2362  ** global coordinate system. See set_position() for a description of
2363  ** the coordinate system.
2364  **
2365  *i Note:
2366  **
2367  ** For vehicles, you may want to use the function
2368  ** get_vehicle_body_orientation(). See that function for more
2369  ** information.
2370  **
2371  *b Arguments:
2372  **
2373  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2374  *a positive X axis
2375  **
2376  ** Pass NULL for any values that are not needed.
2377  **
2378  *b Returns:
2379  **
2380  ** 0 on success, -1 on failure
2381  */
2382  int get_orientation(float* rz, float* rx, float* ry);
2383 
2384  /*l
2385  *b Description:
2386  **
2387  ** Sets the orientation of the character relative to its parent or the
2388  ** origin of the DI-Guy global coordinate system if this
2389  ** character is not parented.
2390  **
2391  ** See set_position() for a description of the coordinate system.
2392  **
2393  ** The new settings will take effect immediately, possibly causing the
2394  ** character to "teleport" if the new values are significantly
2395  ** different than the old.
2396  **
2397  *b Mode Effects:
2398  **
2399  *- - This function will put the character into free position mode.
2400  *- - This function will put the character into free action mode.
2401  **
2402  *b Arguments:
2403  **
2404  *a rz, rx, ry - orientations in degrees
2405  **
2406  *b Returns:
2407  **
2408  ** 0 on success, -1 on failure
2409  */
2410  int set_orientation_relative_to_parent(float rz, float rx, float ry);
2411 
2412  /*l
2413  *b Description:
2414  **
2415  ** Retrieves the orientation of the character relative to its parent,
2416  ** or the origin of the DI-Guy global coordinate system if
2417  ** this character does not have a parent.
2418  **
2419  ** See set_position() for a description of the coordinate system.
2420  **
2421  *b Arguments:
2422  **
2423  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2424  *a positive X axis
2425  **
2426  ** Pass NULL for any values that are not needed.
2427  **
2428  *b Returns:
2429  **
2430  ** 0 on success, -1 on failure
2431  */
2432  int get_orientation_relative_to_parent(float* rz, float* rx, float* ry);
2433 
2434  /*l
2435  *b Description:
2436  **
2437  ** This function sets how the character should be oriented relative
2438  ** to its surroundings.
2439  **
2440  ** This function changes the current up vector type, and the up vector type
2441  ** that will be set when the character is reset. To change only the
2442  ** current up vector type (a temporary change that goes away on reset),
2443  ** call set_up_vector_type()).
2444  **
2445  *b Arguments:
2446  **
2447  *a axis - the up vector type the character should use; legal
2448  *a values shown below:
2449  **
2450  *- - 'd' - use default settings; character will change
2451  *- up vector type depending on current action and
2452  *- path shape parameters
2453  *- - 'z' - Z axis is up; character will be oriented
2454  *- so that positive Z in character coordinates is
2455  *- always oriented along the positive world Z axis
2456  *- - 'n' - normal to path; character will be oriented
2457  *- so that positive Z in character coordinates is
2458  *- normal to the path shape the character is on
2459  *- - 'g' - ground-clamped; the vehicle will attempt to cling
2460  *- to the terrain, in an approximation of real rigid
2461  *- body physics
2462  *- - 'c' - custom; character's rx and ry orientation values
2463  *- will not be modified
2464  **
2465  ** Having an up vector type of 'z' effectively zeroes out the rx and ry
2466  ** values of the character's orientation.
2467  **
2468  ** Having an up vector type of 'n' may override rx and ry values of the
2469  ** character's orientation with values derived from the character's
2470  ** path shape.
2471  **
2472  ** Having an up vector type of 'c' allows the pitch and roll of the
2473  ** character to be changed without taking it off the path it in on by
2474  ** calling set_custom_orientation_rx_and_ry(). Calling
2475  ** set_orientation() has the side-effect of putting the character
2476  ** into free position mode, taking it off of any path it's on.
2477  **
2478  *b Returns:
2479  **
2480  ** 0 on success, -1 on failure
2481  */
2482  int set_initial_up_vector_type(char axis);
2483 
2484  /*l
2485  *b Description:
2486  **
2487  ** This function is being deprecated, but remains for backwards compatibility.
2488  ** It does the same thing as set_initial_up_vector_type()
2489  **
2490  */
2491  int set_initial_up_vector(char axis);
2492 
2493  /*l
2494  *b Returns:
2495  **
2496  ** current up vector type; see set_initial_up_vector_type()
2497  */
2498  char get_initial_up_vector_type();
2499 
2500  /*l
2501  *b Description:
2502  **
2503  ** This function is being deprecated, but remains for backwards compatibility.
2504  ** It does the same thing as get_initial_up_vector_type()
2505  **
2506  */
2507  char get_initial_up_vector();
2508 
2509  /*l
2510  *b Description:
2511  **
2512  ** This function sets how the character should be oriented relative
2513  ** to its surroundings.
2514  **
2515  ** This function changes only the current up vector type. To change the
2516  ** up vector type that will be used when the character is reset, call
2517  ** set_initial_up_vector_type().
2518  **
2519  *b Arguments:
2520  **
2521  *a axis - the up vector type the character should use; see
2522  *a set_initial_up_vector_type() for description
2523  **
2524  *b Returns:
2525  **
2526  ** 0 on success, -1 on failure
2527  **
2528  *b Available as Decision Bead/Event
2529  */
2530  int set_up_vector_type(char axis);
2531 
2532  /*l
2533  *b Description:
2534  **
2535  ** This function is being deprecated, but remains for backwards compatibility.
2536  ** It does the same thing as set_up_vector_type()
2537  **
2538  */
2539  int set_up_vector(char axis);
2540 
2541  /*l
2542  *b Returns:
2543  **
2544  ** current up vector type; see set_up_vector_type()
2545  */
2546  char get_up_vector_type();
2547 
2548  /*l
2549  *b Description:
2550  **
2551  ** This function is being deprecated, but remains for backwards compatibility.
2552  ** It does the same thing as get_up_vector_type()
2553  **
2554  */
2555  char get_up_vector();
2556 
2557  /*l
2558  *b Description:
2559  **
2560  ** This function sets the rx and ry components of the character's
2561  ** orientation. Unlike set_orientation(), this function does not
2562  ** put the character into free position mode if it is currently in
2563  ** path position mode.
2564  **
2565  ** Note that if the character has an up vector type of 'z' or 'n' or even
2566  ** sometimes 'd' (as set by the set_up_vector_type() call) this function
2567  ** will not have any effect. To be able to set rx and ry values,
2568  ** set the up vector type of the character to 'c', for "custom".
2569  **
2570  ** The passed rx and ry values are in character-local coordinates,
2571  ** not parent coordinates if the character has a parent.
2572  **
2573  *b Mode Effects:
2574  **
2575  *- - None.
2576  **
2577  *b Arguments:
2578  **
2579  *a rx, ry - orientations in degrees
2580  **
2581  *b Returns:
2582  **
2583  ** 0 on success, -1 on failure
2584  */
2585  int set_custom_orientation_rx_and_ry(float rx,
2586  float ry);
2587 
2588  /*l
2589  *b Description:
2590  **
2591  ** Sets the desired orientation of the character. See
2592  ** set_desired_position().
2593  **
2594  *b Mode Effects:
2595  **
2596  *- - This function will put the character into free position mode.
2597  *- - This function will put the character into free action mode.
2598  **
2599  *b Arguments:
2600  **
2601  *a rz, rx, ry - orientations in degrees counter-clockwise from
2602  *a the positive X axis
2603  **
2604  *b Returns:
2605  **
2606  ** 0 on success, -1 on failure
2607  */
2608  int set_desired_orientation(float rz, float rx, float ry,
2609  int force_guide_unacquired = 0);
2610 
2611  /*l
2612  *b Description:
2613  **
2614  ** Retrieves the desired orientation of the character.
2615  **
2616  *b Mode Restrictions:
2617  **
2618  *- - This function can only be called in free position mode.
2619  **
2620  *b Arguments:
2621  **
2622  *a rz, rx, ry - orientations in degrees counter-clockwise from
2623  *a the positive X axis
2624  **
2625  ** Pass NULL for any values that are not needed.
2626  **
2627  *b Returns:
2628  **
2629  ** 0 on success, -1 on failure
2630  */
2631  int get_desired_orientation(float* rz, float* rx, float* ry);
2632 
2633  /*l
2634  *b Description:
2635  **
2636  ** Retrieves the delta from current orientation of the character
2637  ** to the desired one.
2638  **
2639  *b Mode Restrictions:
2640  **
2641  *- - This function can only be called in free position mode.
2642  **
2643  *b Arguments:
2644  **
2645  *a rz, rx, ry - orientation deltas in degrees counter-clockwise from
2646  *a the positive X axis
2647  **
2648  ** Pass NULL for any values that are not needed.
2649  **
2650  *b Returns:
2651  **
2652  ** 0 on success, -1 on failure
2653  */
2654  int get_delta_to_desired_orientation(float* rz, float* rx, float* ry);
2655 
2656  /*l
2657  *b Description:
2658  **
2659  ** Like set_desired_orientation(), but uses the character's current
2660  ** orientation as the desired orientation.
2661  **
2662  *b Mode Effects:
2663  **
2664  *- - This function will put the character into free position mode.
2665  *- - This function will put the character into free action mode.
2666  **
2667  *b Returns:
2668  **
2669  ** 0 on success, -1 on failure
2670  */
2671  int set_desired_orientation_to_current_orientation();
2672 
2673  /*l
2674  *b Description:
2675  **
2676  ** Like set_desired_orientation(), but orients the character towards
2677  ** the position specified.
2678  **
2679  *b Mode Effects:
2680  **
2681  *- - This function will put the character into free position mode.
2682  *- - This function will put the character into free action mode.
2683  **
2684  *b Returns:
2685  **
2686  ** 0 on success, -1 on failure
2687  */
2688  int set_desired_orientation_towards_position(float x, float y, float z,
2689  int force_guide_unacquired = 0);
2690 
2691  /*l
2692  *b Description:
2693  **
2694  ** Sets the initial orientation the character should move
2695  ** to on a call to diguyScenario::reset().
2696  **
2697  ** If the character is on a path the path, not this function
2698  ** call, will determine its initial orientation.
2699  **
2700  *b Arguments:
2701  **
2702  *a rz, rx, ry - orientations in degrees counter-clockwise from
2703  *a the positive X axis
2704  **
2705  *b Returns:
2706  **
2707  ** 0 on success, -1 on failure
2708  */
2709  int set_initial_orientation(float rz, float rx, float ry);
2710 
2711  /*l
2712  *b Description:
2713  **
2714  ** Retrieves the initial orientation of the character.
2715  **
2716  ** If the character is in free position mode or has no
2717  ** initial path, this will be the orientation set by
2718  ** set_initial_orientation().
2719  **
2720  ** Otherwise this will be the orientation of the first
2721  ** waypoint of the initial path.
2722  **
2723  *b Arguments:
2724  **
2725  *a rz, rx, ry - orientations in degrees counter-clockwise from
2726  *a the positive X axis
2727  **
2728  ** Pass NULL for any values that are not needed.
2729  **
2730  *b Returns:
2731  **
2732  ** 0 on success, -1 on failure
2733  */
2734  int get_initial_orientation(float* rz, float* rx, float* ry);
2735 
2736  /*l
2737  *b Description:
2738  **
2739  ** Returns the location and orientation of a specific link of the
2740  ** character.
2741  **
2742  *b Arguments:
2743  **
2744  *a link_name - name of the link or connection point; links are named after their inbound
2745  *a joint name
2746  *a tx, ty, tz - position in meters from the origin of the world
2747  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2748  *a positive X axis
2749  **
2750  ** Pass NULL for any values that are not needed.
2751  **
2752  *b Returns:
2753  **
2754  ** 0 on success, -1 on failure
2755  */
2756  int get_link_position(const char* link_name,
2757  float* tx, float* ty, float* tz,
2758  float* rz, float* rx, float* ry);
2759 
2760  /*l
2761  *b Description:
2762  **
2763  ** Returns the location and orientation of a specific link
2764  ** of the character.
2765  **
2766  *b Arguments:
2767  **
2768  *a link_name - name of the link or connection point; links are named after their inbound
2769  *a joint name
2770  *a tx, ty, tz - position in meters from the origin of the world
2771  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2772  *a positive X axis
2773  **
2774  ** Pass NULL for any values that are not needed.
2775  **
2776  *b Returns:
2777  **
2778  ** 0 on success, -1 on failure
2779  */
2780  int get_link_position_double(const char* link_name,
2781  double* tx, double* ty, double* tz,
2782  double* rz, double* rx, double* ry);
2783 
2784  /*l
2785  *b Description:
2786  **
2787  ** Similar to get_link_position(), but allows specification
2788  ** of offset into ending link.
2789  **
2790  *b Arguments:
2791  **
2792  *a link_name - name of the link or connection point
2793  *a offset_tx, offset_ty, offset_tz - offset in link
2794  *a tx, ty, tz - position in meters from the origin
2795  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2796  *a positive X axis
2797  **
2798  ** Pass NULL for any values that are not needed.
2799  **
2800  *b Returns:
2801  **
2802  ** 0 on success, -1 on failure
2803  */
2804  int get_link_position_with_offset(const char* link_name,
2805  float offset_tx, float offset_ty, float offset_tz,
2806  float* tx, float* ty, float* tz,
2807  float* rz, float* rx, float* ry);
2808 
2809  /*l
2810  *b Description:
2811  **
2812  ** Similar to get_link_position(), but allows specification
2813  ** of offset into ending link.
2814  **
2815  *b Arguments:
2816  **
2817  *a link_name - name of the link or connection point
2818  *a offset_tx, offset_ty, offset_tz - offset in link
2819  *a tx, ty, tz - position in meters from the origin
2820  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2821  *a positive X axis
2822  **
2823  ** Pass NULL for any values that are not needed.
2824  **
2825  *b Returns:
2826  **
2827  ** 0 on success, -1 on failure
2828  */
2829  int get_link_position_with_offset_double(const char* link_name,
2830  double offset_tx, double offset_ty, double offset_tz,
2831  double* tx, double* ty, double* tz,
2832  double* rz, double* rx, double* ry);
2833 
2834  /*l
2835  *b Description:
2836  **
2837  ** Returns the location and orientation of a specific link
2838  ** of the character relative to the position of another link.
2839  **
2840  *b Arguments:
2841  **
2842  *a beginning_link_name - name of the first link; send NULL to
2843  *a to specify the position link
2844  *a ending_link_name - name of the last link; send NULL to
2845  *a to specify the position link
2846  *a tx, ty, tz - position in meters from the origin
2847  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2848  *a positive X axis
2849  **
2850  ** Pass NULL for any values that are not needed.
2851  **
2852  *b Returns:
2853  **
2854  ** 0 on success, -1 on failure
2855  */
2856  int get_link_relative_position(const char* beginning_link_name,
2857  const char* ending_link_name,
2858  float* tx, float* ty, float* tz,
2859  float* rz, float* rx, float* ry);
2860 
2861  /*l
2862  *b Description:
2863  **
2864  ** Similar to get_link_relative_position(), but allows specification
2865  ** of offset into ending link.
2866  **
2867  *b Arguments:
2868  **
2869  *a beginning_link_name - name of the first link; send NULL to
2870  *a to specify the position link
2871  *a ending_link_name - name of the last link; send NULL to
2872  *a to specify the position link
2873  *a offset_tx, offset_ty, offset_tz - offset in ending link
2874  *a tx, ty, tz - position in meters from the origin
2875  *a rz, rx, ry - orientations in degrees counter-clockwise from the
2876  *a positive X axis
2877  **
2878  ** Pass NULL for any values that are not needed.
2879  **
2880  *b Returns:
2881  **
2882  ** 0 on success, -1 on failure
2883  */
2884  int get_link_relative_position_with_offset(const char* beginning_link_name,
2885  const char* ending_link_name,
2886  float offset_tx, float offset_ty, float offset_tz,
2887  float* tx, float* ty, float* tz,
2888  float* rz, float* rx, float* ry);
2889 
2890  /*l
2891  *b Description:
2892  **
2893  ** By default characters on a path will scale their movement speed
2894  ** and velocity based on the scale of the actor the character is
2895  ** based on. For example, if a tall character and short character
2896  ** are both playing the exact same walk motion, the tall character
2897  ** will move further per motion repetition than the short character.
2898  **
2899  ** Scaling the travel in this way leads to more realistic looking
2900  ** motion, but can cause different characters using the same actions
2901  ** and underlying motions to move at different speeds. At times it
2902  ** is convenient to not scale the travel.
2903  **
2904  ** If actor scaling is disabled, characters of different sizes will
2905  ** all move the same distance, and at the same speed, if they have
2906  ** the same path shapes and action beads. Note that in cases of
2907  ** extreme differences between the actor the motion is based on
2908  ** and the actor the character's current appearance is based on,
2909  ** the characters feet may slip on the ground more than normal.
2910  **
2911  *b Arguments:
2912  **
2913  *a apply_scale_flag - pass 1 to apply actor scale to travel;
2914  *a 0 to not
2915  */
2916  void set_apply_actor_scale_to_action_bead_travel(int apply_scale_flag);
2917 
2918  /*l
2919  *b Returns:
2920  **
2921  ** 1 if actor scale is being applied to travel, 0 if not
2922  */
2923  int get_apply_actor_scale_to_action_bead_travel();
2924 
2925  /*l
2926  *b Description:
2927  **
2928  ** This function transforms a point that is in the local space of the
2929  ** character into a location in the world. Useful for things like
2930  ** navigating AIs to a location near a prop. Or moving to a spot
2931  ** in front of someone else.
2932  **
2933  ** This code presumes up_axis is 'z' and that there is only rotation
2934  ** about that axis.
2935  */
2936  int local_to_global(float x, float y, float z,
2937  float* res_x, float* res_y, float* res_z);
2938 
2939  /*l
2940  *b Description:
2941  **
2942  ** This function transforms a point that is in world space into the
2943  ** local space of a character. Useful for figuring out if something
2944  ** was seen.
2945  **
2946  ** This code presumes up_axis is 'z' and that there is only rotation
2947  ** about that axis.
2948  **
2949  */
2950  int global_to_local(float x, float y, float z,
2951  float* res_x, float* res_y, float* res_z);
2952 
2953  /*l
2954  *b Description:
2955  **
2956  ** Retrieves the current estimated velocity of the character. Note
2957  ** this value may not be valid in environments where characters are
2958  ** transformed independent of DI-Guy function calls. Teleporting
2959  ** characters can also temporarily make this calculation incorrect.
2960  **
2961  *b Arguments:
2962  **
2963  *a vel_x, vel_y, vel_z - meters/sec
2964  **
2965  ** Pass NULL for any values that are not needed.
2966  **
2967  */
2968  void get_velocity(float* vel_x, float* vel_y, float* vel_z);
2969 
2970  /*l
2971  *b Description:
2972  **
2973  ** Used by the Drift and Adaptive guide
2974  **
2975  *b Arguments:
2976  **
2977  *a vel_x, vel_y, vel_z - meters/sec
2978  */
2979  void set_desired_velocity(float vel_x, float vel_y, float vel_z, float ramp_time = 0.0);
2980  void get_desired_velocity(float *vel_x, float *vel_y, float *vel_z);
2981 
2982  /*l
2983  *b Description:
2984  **
2985  ** Retrieves the current estimated angular velocity of the character.
2986  ** As above, changes made to characters independent of DI-Guy
2987  ** function calls will temporarily make this value incorrect.
2988  **
2989  ** Currently only the angular velocity in yaw is measured.
2990  **
2991  *b Arguments:
2992  **
2993  *a vel_rz - degrees/sec
2994  **
2995  */
2996  void get_angular_velocity(float* vel_rz);
2997 
2998  /*l
2999  *b Description:
3000  **
3001  ** Used by the Drift and Adaptive guide
3002  **
3003  * Documentation Pending
3004  */
3005  void set_desired_angular_velocity(float vel_rz);
3006  void get_desired_angular_velocity(float* vel_rz);
3007 
3008 /*****************************************************************************/
3014  /*l
3015  *b Description:
3016  **
3017  ** Returns the base appearance of the character, as passed to
3018  ** the function diguyScenario::create_character(). This pointer will
3019  ** never be NULL.
3020  **
3021  ** Note that the current appearance (as returned by
3022  ** get_current_appearance()) may be different than the base
3023  ** appearance. This base appearance is the starting appearance
3024  ** of the character before any calls to set_current_appearance()
3025  ** have been made.
3026  **
3027  *b Returns:
3028  **
3029  ** name of base appearance of the character
3030  */
3031  const char* get_appearance();
3032 
3033  /*l
3034  *b Description:
3035  **
3036  ** This function sets the base appearance of the character.
3037  ** The base appearance is the appearance the character will take
3038  ** if the scenario is reset, undoing any appearance changes made
3039  ** be calls to set_current_appearance().
3040  **
3041  ** Calling this function also makes an implicit call to
3042  ** set_current_appearance().
3043  **
3044  *b Arguments:
3045  **
3046  *a appearance - name of new base appearance
3047  **
3048  *b Returns:
3049  **
3050  ** 0 on success, -1 on failure
3051  */
3052  int set_appearance(const char* appearance);
3053 
3054  /*l
3055  *b Description:
3056  **
3057  ** This function sets the current appearance of this character.
3058  **
3059  ** Note that different appearances may be based on different actors.
3060  ** Different actors represent people of different sizes, so
3061  ** changing to an appearance that has a different actor can
3062  ** cause a pronounced change in character size.
3063  **
3064  ** Also, changing actors can take some time, as more internal
3065  ** character state needs to be updated to support the new size
3066  ** of the character.
3067  **
3068  *b Arguments:
3069  **
3070  *a appearance - name of new desired appearance
3071  *a allow_actor_change - pass 1 to allow the appearance change
3072  *a even if the actor changes, 0 to not
3073  **
3074  *b See Also:
3075  **
3076  ** get_current_appearance(), set_current_head_appearance()
3077  **
3078  *b Returns:
3079  **
3080  ** 0 on success, -1 on failure
3081  **
3082  *b Available as Decision Bead/Event
3083  */
3084  int set_current_appearance(const char* appearance,
3085  int allow_actor_change = 1);
3086 
3087  /*l
3088  *b Returns:
3089  **
3090  ** current appearance; see set_current_appearance()
3091  */
3092  const char* get_current_appearance();
3093 
3094  /*l
3095  *b Description:
3096  **
3097  ** This function can be used to see if the current appearance
3098  ** has the passed name. This is primarily useful for decisions
3099  ** and other limited logic applications.
3100  **
3101  *b Returns:
3102  **
3103  ** 1 if current appearance has passed name; 0 if not
3104  **
3105  *b Available as Decision Bead/Event
3106  */
3107  int get_current_appearance_is(const char* appearance);
3108 
3109  /*l
3110  *b Description:
3111  **
3112  ** This function sets the current head appearance of this character.
3113  ** On failure head appearance will be set to "default".
3114  **
3115  *b Arguments:
3116  **
3117  *a head_appearance - name of the new desired head appearance
3118  **
3119  *b Returns:
3120  **
3121  ** 0 on success, -1 on failure
3122  **
3123  *b Available as Decision Bead/Event
3124  */
3125  int set_current_head_appearance(const char* head_appearance);
3126 
3127  /*l
3128  *b Description:
3129  **
3130  ** This function sets the head appearance of this character.
3131  */
3132  int set_head_appearance(const char* head_appearance);
3133 
3135  const char* get_current_head_appearance();
3136 
3137  /*l
3138  *b Description:
3139  **
3140  ** Similar to get_current_appearance_is(), but for head appearance.
3141  **
3142  *b Returns:
3143  **
3144  ** 1 if current head appearance has passed name; 0 if not
3145  **
3146  *b Available as Decision Bead/Event
3147  */
3148  int get_current_head_appearance_is(const char* head_appearance);
3149 
3150 
3151  /*b Description:
3152  **
3153  ** This function sets the both base and current hand item appearance
3154  ** of this character. The base hand item is the one it will have upon
3155  ** reset.
3156  **
3157  *b Arguments:
3158  **
3159  *a hand_item_appearance -- name of the desired hand item or "default"
3160  **
3161  *b Returns:
3162  **
3163  ** 0 on success, -1 on failure
3164  **
3165  *b Available as Decision Bead/Event
3166  */
3167  int set_hand_item(const char* hand_item_appearance);
3168 
3169  /*l
3170  *b Returns:
3171  **
3172  ** Hand item appearance; see set_hand_item()
3173  **
3174  ** Might return "default"
3175  */
3176  const char* get_hand_item();
3177 
3178  /*b Description:
3179  **
3180  ** This function sets the current hand item appearance of this character.
3181  ** The base hand item will remain unaffected.
3182  **
3183  *b Arguments:
3184  **
3185  *a hand_item_appearance -- name of the desired hand item or "default"
3186  **
3187  *b Returns:
3188  **
3189  ** 0 on success, -1 on failure
3190  **
3191  *b Available as Decision Bead/Event
3192  */
3193  int set_current_hand_item(const char* hand_item_appearance);
3194 
3195  /*l
3196  *b Returns:
3197  **
3198  ** Current hand item appearance. Will be the actual appearance
3199  ** displayed, not "default"
3200  */
3201  const char* get_current_hand_item();
3202 
3203  /*l
3204  *b Description:
3205  **
3206  **
3207  *b Arguments:
3208  **
3209  *a appearance_type - a value indicating the type of supplementary appearance of concern
3210  **
3211  *b Returns:
3212  **
3213  ** The number of available supplementary appearances of given type
3214  */
3215  int get_num_appearances_of_type(diguyCharacterAppearanceTypes appearance_type);
3216 
3217  /*l
3218  *b Description:
3219  **
3220  ** See description for get_num_supplementary_appearances_of_type()
3221  **
3222  *b Arguments:
3223  **
3224  *a appearance_type - a value indicating the type of appearance of concern
3225  *a index - a value indicating the type of supplementary appearance of concern
3226  **
3227  *b Returns:
3228  **
3229  ** The name of the appearance or NULL
3230  */
3231  const char* get_appearance_name_at_index(diguyCharacterAppearanceTypes appearance_type, int index);
3232 
3233  /*****************************************************************************/
3256  /*l
3257  *b Description:
3258  **
3259  ** Sets the graphics level of detail (LOD) ranges for this character.
3260  ** Compare with diguyScenario::set_default_lod_ranges(), which sets
3261  ** the LOD ranges for newly created characters of a particular type.
3262  ** In both cases, ranges must be a static array of 8 floats,
3263  ** each larger than the one before.
3264  **
3265  ** This function sets graphics LOD ranges only. Motion levels of
3266  ** detail can be set by calling set_motion_lod().
3267  **
3268  *b Arguments:
3269  **
3270  *a lod_ranges - new lod ranges for this character;
3271  **
3272  ** See diguyScenario::set_default_lod_ranges() for a description
3273  ** of what to pass in lod_ranges.
3274  **
3275  *b Returns:
3276  **
3277  ** 0 on success, -1 on failure
3278  **
3279  *b Callable From:
3280  **
3281  *- - C++
3282  */
3283  int set_lod_ranges(float* lod_ranges);
3284 
3285 #ifdef CPLUSPLUS_ONLY
3286  float* get_lod_ranges();
3288 #endif
3289  int get_num_lods();
3291 
3292  /*l
3293  *b Description:
3294  **
3295  ** Set the desired graphics level of detail (LOD) for this character.
3296  ** This may be overridden if this character uses automatic LOD
3297  ** switching. See
3298  ** diguyScenario::set_automatic_graphics_lod_switching().
3299  **
3300  ** DI-Guy graphics LODs are numbered 1 (most detail) through 7
3301  ** (least detail).
3302  **
3303  *b Arguments:
3304  **
3305  *a lod - an integer between 1 and 7
3306  **
3307  *b Returns:
3308  **
3309  ** 0 on success, -1 on failure
3310  */
3311  int set_graphics_lod(int lod);
3312 
3314  int get_graphics_lod();
3315 
3316  /*l
3317  *b Description:
3318  **
3319  ** Set the desired shader level of detail (LOD) for this character.
3320  ** By default this is -1 and the shader is automatically picked by distance.
3321  **
3322  ** DI-Guy shaders LODs are numbered 1 (most quality) through the number of shaders in the
3323  ** current technique.
3324  **
3325  *b Arguments:
3326  **
3327  *a lod - an integer between 1 and the number of shaders in the current technique
3328  **
3329  *b Returns:
3330  **
3331  ** 0 on success, -1 on failure
3332  */
3333  int set_shader_lod(int lod);
3334 
3336  int get_shader_lod();
3337 
3338  /*l
3339  *b Description:
3340  **
3341  *b Note: As of DI-Guy 12.5 we strongly recommend using the
3342  ** multi-threaded pipeline for increasing performance.
3343  **
3344  ** Sets the motion level of detail (LOD) for this character.
3345  ** LOD 1 animates all joints of a character. Higher LODs
3346  ** animate fewer joints.
3347  **
3348  ** For LOD 6, *nothing* in the pose is updated. The character's
3349  ** pose will remain whatever it was the last time pose data
3350  ** was changed.
3351  **
3352  *a LOD - Effect
3353  *a 1 - animate all joints
3354  *a 2 - stop animating wrists and ankles
3355  *a 3 - stop animating elbows and knees
3356  *a 4 - stop animating everything but pelvis and position
3357  *a 5 - stop animating everything but position
3358  *a 6 - stop animating everything but position
3359  **
3360  ** Note that characters that are load managed
3361  ** (get_is_load_managed() returns 1) have this parameter managed
3362  ** automatically. The corresponding function for load managed
3363  ** characters is diguyLoadManager::set_zone_motion_lod().
3364  **
3365  *b Arguments:
3366  **
3367  *a motion_lod - an integer between 1 and 6
3368  **
3369  *b Returns:
3370  **
3371  ** 0 on success, -1 on failure
3372  */
3373  int set_motion_lod(int motion_lod);
3374 
3376  int get_motion_lod();
3377 
3379  int get_current_motion_lod();
3380 
3381  /*l
3382  *b Description:
3383  **
3384  *b Note: As of DI-Guy 12.5 we strongly recommend using the
3385  ** multi-threaded pipeline for increasing performance.
3386  **
3387  ** This function sets the minimum CPL (character performance
3388  ** level) of the character.
3389  **
3390  ** A higher CPL will limit the types of operations that the character
3391  ** can perform, but will allow for more optimized update() calls.
3392  **
3393  ** The following CPL limitations are cumulative:
3394  **
3395  *- - CPL 1: all character function calls are available
3396  *- - CPL 2: the character cannot save history
3397  *- - CPL 3: no advanced pose operations that alter the basic pose
3398  *- of the character, including:
3399  *>
3400  *- - gazing
3401  *- - pointing
3402  *- - aiming
3403  *- - gestures
3404  *- - head nodding and shaking
3405  *- - pose overrides
3406  *- - features relying on link matrices
3407  *- - wheel rolling and turning on vehicles
3408  **
3409  ** Since link matrices are not computed, the DI-Guy Graphics API
3410  ** function diguyGraphicsLink::get_transformation_matrix() will
3411  ** not return valid results.
3412  *<
3413  *- - CPL 4: no blends between motions
3414  *- - CPL 5: (not currently implemented)
3415  **
3416  ** Note that characters that are load managed (get_is_load_managed()
3417  ** returns 1) have this parameter managed automatically. The
3418  ** corresponding function for load managed characters is
3419  ** diguyLoadManager::set_zone_minimum_cpl().
3420  **
3421  ** The passed minimum_cpl may not be achievable if the character
3422  ** is already in the process of doing something not allowed by the
3423  ** new CPL. For example, if the character is already gazing, trying
3424  ** to set the minimum CPL to 3 will fail, as CPL 3 would disable
3425  ** gazing. In this case the minimum CPL will be set to the current
3426  ** highest possible CPL based on what the character is already doing.
3427  ** In this example the minimum CPL would be set to 2, as gazing is
3428  ** allowed at that CPL.
3429  **
3430  ** Conversely, if the minimum CPL has been successfully been set to
3431  ** 3 or higher, any gaze calls such as diguyCharacter::gaze_at_point()
3432  ** will fail.
3433  **
3434  *b Arguments:
3435  **
3436  *a cpl - minimum CPL allowed for this character
3437  **
3438  *b Returns:
3439  **
3440  ** 0 on success, -1 on failure
3441  */
3442  int set_minimum_cpl(int minimum_cpl);
3443 
3445  int get_minimum_cpl();
3446 
3447  /*l
3448  *b Description:
3449  **
3450  ** This function returns that maximum possible CPL the character
3451  ** can attain based on what it is currently doing. Advanced pose
3452  ** operations like gazing and pose overrides will limit the maximum
3453  ** CPL that can be achieved.
3454  **
3455  ** See diguyCharacter::set_minimum_cpl() for a description of
3456  ** what is possible under the different CPL levels.
3457  **
3458  *b Returns:
3459  **
3460  ** maximum possible current CPL
3461  */
3462  int get_maximum_possible_current_cpl();
3463 
3464  /*l
3465  *b Description:
3466  **
3467  ** This function puts the character into the maximum possible CPL
3468  ** that can be achieved based on what the character is currently
3469  ** doing.
3470  **
3471  ** This current CPL does not prevent the character from starting
3472  ** operations that will potentially lower the CPL. e.g., if the
3473  ** character starts gazing, the CPL will potentially go down.
3474  ** Use set_minimum_cpl() to prevent that character from starting
3475  ** such operations.
3476  **
3477  ** See diguyCharacter::set_minimum_cpl() for a description of
3478  ** what is possible under the different CPL levels.
3479  **
3480  *b Returns:
3481  **
3482  ** 0 on success, -1 on failure
3483  */
3484  int maximize_current_cpl();
3485 
3486  /*l
3487  *b Description:
3488  **
3489  ** This function sets a flag that determines whether the character
3490  ** should raise and lower its CPL automatically. If automatic
3491  ** CPL switching is enabled then any time a potential CPL-changing
3492  ** operation is performed, the character will check the maximum
3493  ** possible current CPL (as per a call to maximize_current_cpl())
3494  ** and set its current CPL to the maximum possible.
3495  **
3496  *b Arguments:
3497  **
3498  *a enabled - pass 1 to enable automatic CPL switching, 0 to
3499  *a disable it
3500  **
3501  *b Returns:
3502  **
3503  ** 0 on success, -1 on failure
3504  */
3505  int set_automatic_cpl_switching_enabled(int enabled);
3506 
3508  int get_automatic_cpl_switching_enabled();
3509 
3510  /*l
3511  *b Description:
3512  **
3513  ** This function sets the current CPL of the character. Trying
3514  ** to set the CPL lower than the minimum (as set by
3515  ** set_minimum_cpl()) of higher than the maximum (as returned by
3516  ** get_maximum_possible_current_cpl()) will fail.
3517  **
3518  ** Note that characters that have automatic CPL switching enabled
3519  ** (get_automatic_cpl_switching_enabled() returns 1) will override
3520  ** this value.
3521  **
3522  ** See diguyCharacter::set_minimum_cpl() for a description of
3523  ** what is possible under the different CPL levels.
3524  **
3525  *b Arguments:
3526  **
3527  *a cpl - new current CPL
3528  **
3529  *b Returns:
3530  **
3531  ** 0 on success, -1 on failure
3532  */
3533  int set_current_cpl(int current_cpl);
3534 
3536  int get_current_cpl();
3537 
3538  /*l
3539  *b Description:
3540  **
3541  ** This function sets the position update rate of the character. If
3542  ** the character's position is not updated on a particular update
3543  ** tick, its position will not change for that tick. This can
3544  ** result is a modest performance increase.
3545  **
3546  ** The default value for new characters is 100.
3547  **
3548  ** This value may be overridden by the minimum full update period, as
3549  ** set by set_minimum_full_update_period().
3550  **
3551  ** Note that if the character's pose is updated, (see
3552  ** diguyCharacter::set_pose_update_rate()) its position will be
3553  ** updated as well.
3554  **
3555  ** Note that characters that are load managed
3556  ** (get_is_load_managed() returns 1) have this parameter managed
3557  ** automatically. The corresponding function for load managed
3558  ** characters is diguyLoadManager::set_zone_position_update_rate().
3559  **
3560  *b Arguments:
3561  **
3562  *a update_rate - percentage of scenario ticks for which
3563  *a position should update; can be between
3564  *a 1 and 100
3565  **
3566  ** Passing 100 means position will update every tick.
3567  ** Passing 50 means position will update every other tick.
3568  **
3569  *b Returns:
3570  **
3571  ** 0 on success, -1 on failure
3572  */
3573  int set_position_update_rate(int update_rate);
3574 
3576  int get_position_update_rate();
3577 
3578  /*l
3579  *b Description:
3580  **
3581  ** This function is very similar to set_position_update_rate(), but
3582  ** sets the percentage of ticks for which the character's pose is
3583  ** updated.
3584  **
3585  ** The default value for new characters is 100.
3586  **
3587  ** This value may be overridden by the minimum full update period,
3588  ** as set by set_minimum_full_update_period().
3589  **
3590  ** Note that if the character's pose is updated, its position will
3591  ** be updated as well.
3592  **
3593  ** Note that characters that are load managed (get_is_load_managed()
3594  ** returns 1) have this parameter managed automatically. The
3595  ** corresponding function for load managed characters is
3596  ** diguyLoadManager::set_zone_pose_update_rate().
3597  **
3598  *b Arguments:
3599  **
3600  *a update_rate - percentage of scenario ticks for which
3601  *a pose should update; can be between
3602  *a 1 and 100
3603  **
3604  ** Passing 100 means pose will update every tick.
3605  ** Passing 50 means pose will update every other tick.
3606  **
3607  *b Returns:
3608  **
3609  ** 0 on success, -1 on failure
3610  */
3611  int set_pose_update_rate(int update_rate);
3612 
3614  int get_pose_update_rate();
3615 
3616  /*l
3617  *b Description:
3618  **
3619  ** This function sets the minimum period for position or pose
3620  ** updates. If the passed amount of time passes with no position or
3621  ** pose update (see set_position_update_rate() and
3622  ** set_pose_update_rate()), the character's position and potentially
3623  ** pose will be updated.
3624  **
3625  ** Note that characters that are load managed (get_is_load_managed()
3626  ** returns 1) have this parameter managed automatically. The
3627  ** corresponding function for load managed characters is
3628  ** diguyLoadManager::set_minimum_full_update_period().
3629  **
3630  ** The default for new characters is 1.0 seconds.
3631  **
3632  *b Arguments:
3633  **
3634  *a min_period - in seconds
3635  **
3636  *b Returns:
3637  **
3638  ** 0 on success, -1 on failure
3639  */
3640  int set_minimum_full_update_period(float min_period);
3641 
3643  float get_minimum_full_update_period();
3644 
3645  /*l
3646  *b Description:
3647  **
3648  ** This function disables position accumulation due to played
3649  ** actions. The character will stay in whatever position has most
3650  ** recently been set by set_position(), regardless of action.
3651  ** Because of this the character will, for example, walk in place.
3652  ** It is up to the user application to correctly set and update the
3653  ** character's position.
3654  **
3655  ** This function can be used when a host application provides
3656  ** absolute control over character positions.
3657  **
3658  ** Disabling position accumulation will result in a modest
3659  ** performance increase.
3660  **
3661  *b Arguments:
3662  **
3663  *a disabled_flag - pass 1 to disable position accumulation, 0
3664  *a to enable it
3665  **
3666  *b Returns:
3667  **
3668  ** 0 on success, -1 on failure
3669  */
3670  int set_position_accumulation_disabled(int disabled_flag);
3671 
3673  int get_position_accumulation_disabled();
3674 
3675  /*l
3676  *b Description:
3677  **
3678  ** This function disables all blends between motions of the
3679  ** character. This will speed up performance at the expense of
3680  ** visual quality of the motions. If the character is far from the
3681  ** current camera position, however, the lack of blends may be
3682  ** visually acceptable.
3683  **
3684  ** Note that characters that are load managed (get_is_load_managed()
3685  ** returns 1) have this parameter managed automatically.
3686  **
3687  *b Arguments:
3688  **
3689  *a disabled_flag - pass 1 to disable all blends, 0
3690  *a to enable them
3691  **
3692  *b Returns:
3693  **
3694  ** 0 on success, -1 on failure
3695  */
3696  int set_all_blends_disabled(int disabled_flag);
3697 
3699  int get_all_blends_disabled();
3700 
3701  /*l
3702  *b Description:
3703  **
3704  *b Note: This function is not recommended. There is minimal perf gain.
3705  ** This function disables all update calls for shape switches.
3706  **
3707  ** Switches currently control:
3708  **
3709  *- - muzzle flashes
3710  *- - hand switching for selected characters
3711  **
3712  ** For DI-Guy Graphics API users this means that most calls to
3713  ** diguyGraphicsShape::show() and diguyGraphicsShape::hide() will not
3714  ** be made.
3715  **
3716  ** Note that characters that are load managed (get_is_load_managed()
3717  ** returns 1) have this parameter managed automatically.
3718  **
3719  *b Arguments:
3720  **
3721  *a disabled_flag - pass 1 to disable shape switches, 0
3722  *a to enable them
3723  **
3724  *b Returns:
3725  **
3726  ** 0 on success, -1 on failure
3727  */
3728  int set_shape_switches_disabled(int disabled_flag);
3729 
3731  int get_shape_switches_disabled();
3732 
3733  /*l
3734  *b Description:
3735  **
3736  *b Note: This function is not recommended. There is minimal perf gain.
3737  ** This function disables all shape callbacks. Shape callbacks are
3738  ** used internally for updating some advanced visual effects.
3739  **
3740  ** Shape callbacks currently control:
3741  **
3742  *- - expressive faces
3743  *- - particle systems
3744  **
3745  ** Disabling shape callbacks will make these visual effects work
3746  ** incorrectly but will result in a performance increase for
3747  ** characters that do not use them.
3748  **
3749  ** Note that characters that are load managed (get_is_load_managed()
3750  ** returns 1) have this parameter managed automatically.
3751  **
3752  *b Arguments:
3753  **
3754  *a disabled_flag - pass 1 to disable shape callbacks, 0
3755  *a to enable them
3756  **
3757  *b Returns:
3758  **
3759  ** 0 on success, -1 on failure
3760  */
3761  int set_shape_callbacks_disabled(int disabled_flag);
3762 
3764  int get_shape_callbacks_disabled();
3765 
3766  /*l
3767  *b Description:
3768  **
3769  *b Note: This function is not recommend. There is minimal perf gain.
3770  ** This function disables all calls to the virtual diguyGraphicsShape::update()
3771  ** function.
3772  **
3773  ** Note that characters that are load managed (get_is_load_managed()
3774  ** returns 1) have this parameter managed automatically.
3775  **
3776  *b Arguments:
3777  **
3778  *a disabled_flag - pass 1 to disable update calls, 0
3779  *a to enable them
3780  **
3781  *b Returns:
3782  **
3783  ** 0 on success, -1 on failure
3784  */
3785  int set_graphics_api_shape_update_disabled(int disabled_flag);
3786 
3788  int get_graphics_api_shape_update_disabled();
3789 
3790  /*l
3791  *b Description:
3792  **
3793  ** This function is a stripped-down version of the normal update()
3794  ** function. This function is for high performance applications that
3795  ** are willing to sacrifice advanced character functionality in
3796  ** exchange for faster performance.
3797  **
3798  ** Characters using optimized_update() must not do any of the
3799  ** following:
3800  **
3801  *- - change character types (e.g., set_character_type())
3802  *- - play sounds (e.g., play_sound())
3803  *- - use history (e.g., set_history_type())
3804  *- - use paths (e.g., push_path())
3805  *- - weapon firing (e.g., fire_weapon())
3806  *- - advanced pose operations (as per CPL 3)
3807  *- - be a DI-Guy Network Module character
3808  *- - need to use character callbacks
3809  *- - use advanced visual effects, such as expressive faces and particle systems
3810  **
3811  ** Like update(), the scenario must not call the character's update()
3812  ** function (return value of get_t_controlled_by_scenario_t() is 0)
3813  ** for this function to work properly.
3814  **
3815  ** In some cases the regular update() call can be used for a time in
3816  ** place of optimized_update() if one of the above operations is
3817  ** desired.
3818  **
3819  *b Arguments:
3820  **
3821  *a t - new time for the character
3822  **
3823  *b Returns:
3824  **
3825  ** 0 on success, -1 on failure
3826  */
3827  int optimized_update(float t);
3828 
3829  /*l
3830  *b Description:
3831  **
3832  ** This function sets whether many of the performance tuning
3833  ** functions above are automatically managed by a diguyLoadManager
3834  ** object, which can be obtained by calling
3835  ** diguyApp::create_load_manager().
3836  **
3837  ** Note that this function will have no effect if a load manager has
3838  ** not been enabled.
3839  **
3840  ** The default for new characters is to be load managed if the load
3841  ** manager has been enabled.
3842  **
3843  *b Arguments:
3844  **
3845  *a is_load_managed - pass 1 to have character automatically
3846  *a load managed, 0 for manual management
3847  **
3848  *b Returns:
3849  **
3850  ** 0 on success, -1 on failure
3851  */
3852  int set_is_load_managed(int is_load_managed);
3853 
3855  int get_is_load_managed();
3856 
3857 
3858 /*****************************************************************************/
3864  /*l
3865  *b Description:
3866  **
3867  ** This is an enumeration of the different callbacks that can be
3868  ** registered with add_callback() and add_callback_script().
3869  **
3870  ** Callbacks return a value of type diguyCallbackReturn, which will
3871  ** be DIGUY_CALLBACK_STOP or DIGUY_CALLBACK_CONTINUE. If the
3872  ** callback returns DIGUY_CALLBACK_STOP, in some cases the default
3873  ** handler of the function will not be called; the callback is
3874  ** asserting that it has done everything necessary for the function
3875  ** call. If the callback returns DIGUY_CALLBACK_CONTINUE, the default
3876  ** handler for the function will be called after the callback.
3877  **
3878  *b Usable From:
3879  **
3880  *- - C++
3881  *- - Script
3882  **
3883  *************************************************************************
3884  *4 Callback Enums:
3885  **
3886  *i CALLBACK_ID_CREATE
3887  **
3888  ** This callback will be called when a new character is created,
3889  ** *after* the character is fully initialized.
3890  **
3891  ** Note that this callback can only be added by calling
3892  ** diguyScenario::add_default_character_callback(); adding it with
3893  ** diguyCharacter::add_callback() will have no effect, as by that
3894  ** time the character has already been created.
3895  **
3896  *i CALLBACK_ID_DESTROY
3897  **
3898  ** This callback will be called when a character is
3899  ** destroyed.
3900  **
3901  *i CALLBACK_ID_PRE_CREATE
3902  **
3903  ** Like CALLBACK_ID_CREATE, this callback will be called when a
3904  ** new character is created; however, it is called *before* the
3905  ** character is fully initialized.
3906  **
3907  *b NOTE: Care must be taken when using this callback!
3908  ** As mentioned above, the character is not fully initialized,
3909  ** meaning that most member functions of the diguyCharacter object
3910  ** should not be called. Those member functions that are safe
3911  ** to call will be mentioned in the documentation for the function;
3912  ** e.g., set_graphics_api_node_ptr().
3913  **
3914  ** Note that this callback can only be added by calling
3915  ** diguyScenario::add_default_character_callback(); adding it
3916  ** with diguyCharacter::add_callback() will have no effect, as
3917  ** by that time the character has already been created.
3918  **
3919  *i CALLBACK_ID_CURRENT_APPEARANCE_CHANGED
3920  **
3921  ** This callback will be called when a character's current
3922  ** appearance is changed.
3923  **
3924  *i CALLBACK_ID_CURRENT_HEAD_APPEARANCE_CHANGED
3925  **
3926  ** This callback will be called when a character's current head
3927  ** appearance is changed.
3928  **
3929  *i CALLBACK_ID_PRE_UPDATE
3930  **
3931  ** This callback will be called before the character is updated as
3932  ** a result of the diguyScenario::update() function.
3933  **
3934  *i CALLBACK_ID_POST_UPDATE
3935  **
3936  ** This callback will be called after the character is updated as a
3937  ** result of the diguyScenario::update() function.
3938  **
3939  *i CALLBACK_ID_DONE_SPEAKING
3940  **
3941  ** This callback will be called when the character has finished
3942  ** speaking the contents of a speak() function call.
3943  **
3944  *i CALLBACK_ID_GAZE_STATUS
3945  **
3946  ** This callback will be called after the character's gaze has
3947  ** experienced a status change.
3948  **
3949  *i CALLBACK_ID_LPOINT_STATUS
3950  **
3951  ** This callback will be called after the character's lpoint (left
3952  ** arm pointing) has experienced a status change.
3953  **
3954  *i CALLBACK_ID_SHOW
3955  **
3956  ** This callback will be called when the character is being shown
3957  ** for any reason.
3958  **
3959  *i CALLBACK_ID_HIDE
3960  **
3961  ** This callback will be called when the character is being hidden
3962  ** for any reason.
3963  **
3964  *i CALLBACK_ID_PRE_DIE
3965  **
3966  ** This callback will be called when the character has been told to
3967  ** die, before a die action has been selected and initiated.
3968  **
3969  ** If the returned diguyCallbackReturn value is
3970  ** DIGUY_CALLBACK_STOP, the character will not die.
3971  **
3972  *i CALLBACK_ID_POST_DIE
3973  **
3974  ** This callback will be called when the character has been told to
3975  ** die, after a die action has been selected and initiated.
3976  **
3977  *i CALLBACK_ID_PRE_FIRE_WEAPON
3978  **
3979  ** This callback will be called when the character has been told to
3980  ** fire its weapon, before a final decision has been made to fire.
3981  **
3982  ** If the returned diguyCallbackReturn value is
3983  ** DIGUY_CALLBACK_STOP, the character will not fire.
3984  **
3985  *i CALLBACK_ID_IMPACT
3986  **
3987  ** This callback will be called when the character has been hit.
3988  ** diguyCharacter::get_last_impact_record() contains a pointer to
3989  ** the impact information. If a character has this callback the
3990  ** standard behavior (killing the character) is skipped and the
3991  ** system assumes the end user has handled the impact.
3992  **
3993  ** Similar behavior results if
3994  ** diguyCrowd::CALLBACK_ID_CROWD_MEMBER_IMPACT is registered.
3995  **
3996  *i CALLBACK_ID_POST_FIRE_WEAPON
3997  **
3998  ** This callback will be called when the character has been told to
3999  ** fire its weapon, after a final decision has been made to fire.
4000  **
4001  *i CALLBACK_ID_CURRENT_ACTION_CHANGED
4002  **
4003  ** This callback will be called whenever the character's current
4004  ** action changes, typically after a call to set_desired_action()
4005  ** or force_action().
4006  **
4007  *i CALLBACK_ID_DESIRED_ACTION_CHANGED
4008  **
4009  ** This callback will be called whenever the character's desired
4010  ** action changes, typically after a call to set_desired_action().
4011  **
4012  *i CALLBACK_ID_DESIRED_ACTION_REACHED
4013  **
4014  ** This callback will be called when the character reaches its
4015  ** desired action as set by a call to set_desired_action().
4016  **
4017  *i CALLBACK_ID_MANUALLY_INVOKED
4018  **
4019  ** This callback id will be supplied to event handlers invoked by a
4020  ** call to manually_invoke_event_handler().
4021  **
4022  *i CALLBACK_ID_USER_SELECTED
4023  **
4024  ** This callback will be called when the character is selected in DI-Guy Scenario.
4025  **
4026  *i CALLBACK_ID_USER_UNSELECTED
4027  **
4028  ** This callback will be called on a currently selected character when a different
4029  ** character is selected in DI-Guy Scenario.
4030  **
4031  *i CALLBACK_ID_IGUY_INTERACT
4032  **
4033  ** This callback will be called when the character has been clicked
4034  ** on while DI-Guy Scenario is in I-Guy Input Mode. Note that this
4035  ** is called on the character clicked, not the I-Guy character.
4036  **
4037  *i CALLBACK_ID_IGUY_INTERACT_WITH_SUBJECT
4038  **
4039  ** This callback will be called when the character, as the I-Guy
4040  ** character, has clicked another character in I-Guy Input Mode.
4041  ** Note that this is called for the I-Guy character, not the
4042  ** clicked character.
4043  **
4044  *i CALLBACK_ID_GUIDE_POSITION_ACQUIRED
4045  **
4046  ** This callback will be called when the character has reached its
4047  ** desired position as set by set_desired_position(). The
4048  ** diguyCharacterGuide is responsible for moving the character towards
4049  ** this position.
4050  **
4051  *i CALLBACK_ID_GUIDE_POSITION_UNACQUIRED
4052  **
4053  ** This callback will be called if the character moves too far away
4054  ** from its desired position after it has been previously reached.
4055  **
4056  *i CALLBACK_ID_GUIDE_ORIENTATION_ACQUIRED
4057  **
4058  ** This callback will be called when the character has reached its
4059  ** desired orientation as set by set_desired_orientation(). The
4060  ** diguyCharacterGuide is responsible for moving the character towards
4061  ** this orientation.
4062  **
4063  *i CALLBACK_ID_GUIDE_ORIENTATION_UNACQUIRED
4064  **
4065  ** This callback will be called if the character turns too far away
4066  ** from its desired orientation after it has been previously
4067  ** reached.
4068  **
4069  *i CALLBACK_ID_GUIDE_ALTITUDE_ACQUIRED
4070  **
4071  ** This callback will be called when the character has reached its
4072  ** desired altitude as set by set_desired_orientation() or other functions.
4073  ** The callback is most meaningful for vehicles that need to achieve
4074  ** some sort "cruising altitude" while moving to a destination.
4075  **
4076  *i CALLBACK_ID_GUIDE_ALTITUDE_UNACQUIRED
4077  **
4078  ** This callback will be called if the character turns too far away
4079  ** from its desired orientation after it has been previously
4080  ** reached.
4081  **
4082  *i CALLBACK_ID_GUIDE_TARGET_LOST
4083  **
4084  ** This callback will be called when the character guide has determined
4085  ** that the character can't reach its desired position/orientation. An
4086  ** example would be a missile that has flown past its target
4087  **
4088  *i CALLBACK_ID_CURRENT_TOUT_REACHED
4089  **
4090  ** This callback will be called when scenario time reaches this
4091  ** character's tout time as set by set_current_tout().
4092  **
4093  *i CALLBACK_ID_POST_CREATE_GEOMETRY
4094  **
4095  ** This callback will be called just after the character's geometry
4096  ** has been created.
4097  **
4098  *i CALLBACK_ID_PRE_DESTROY_GEOMETRY
4099  **
4100  ** This callback will be called just before the character's
4101  ** geometry is broken down and destroyed.
4102  **
4103  *i CALLBACK_ID_END_OF_PATH_REACHED
4104  **
4105  ** This callback will be called when a character reaches the end of
4106  ** their current path. Note the path must finish, forcing to other
4107  ** paths will not trigger this callback.
4108  **
4109  **
4110  *************************************************************************
4111  *4 DI-Guy Scenario UI Callback enums:
4112  **
4113  *i CALLBACK_ID_UI_PRE_TRANSLATION
4114  **
4115  ** This callback will be called when the user interface starts
4116  ** moving a character.
4117  **
4118  *i CALLBACK_ID_UI_POST_TRANSLATION
4119  **
4120  ** This callback will be called when the user interface finishes
4121  ** moving a character.
4122  **
4123  *i CALLBACK_ID_UI_MOUSE_DOWN
4124  **
4125  ** This callback will be called when the user interface gets a
4126  ** mouse click in the DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT input
4127  ** mode.
4128  **
4129  *i CALLBACK_ID_UI_MOUSE_UP
4130  **
4131  ** This callback will be called when the user interface gets a
4132  ** mouse release in the DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT
4133  ** input mode.
4134  **
4135  *************************************************************************
4136  *4 DI-Guy AI Agent Callback enums:
4137  **
4138  *i CALLBACK_ID_AGENT_NEW_BEHAVIOR
4139  **
4140  ** This callback will be called when an agent changes its current
4141  ** behavior.
4142  **
4143  *i CALLBACK_ID_AGENT_NEW_FOCUS_CHARACTER
4144  **
4145  ** This callback will be called when an agent changes its current
4146  ** focus character; this happens most frequently when it is focused
4147  ** on a group.
4148  **
4149  *i CALLBACK_ID_AGENT_ATTACK_OUT_OF_TARGETS
4150  **
4151  ** This callback will be called when an agent in attack behavior
4152  ** evaluates the group it's focused on and cannot find an
4153  ** appropriate target. This can happen if all group members are
4154  ** dead.
4155  **
4156  *i CALLBACK_ID_AGENT_ATTACK_NO_VISIBLE_TARGETS
4157  **
4158  ** This callback will be called when an agent in attack behavior
4159  ** can't see any potential members of the group it's focused on.
4160  **
4161  *i CALLBACK_ID_AGENT_PURSUE_TARGET_REACHED
4162  **
4163  ** This callback will be called when an agent in pursue behavior
4164  ** has come within the pursuit distance of its pursuit target.
4165  **
4166  *i CALLBACK_ID_AGENT_PURSUE_TARGET_LOST
4167  **
4168  ** This callback will be called when an agent in pursue behavior
4169  ** is no longer within the pursuit distance of its pursuit target.
4170  **
4171  *i CALLBACK_ID_AGENT_MINGLE_TARGET_REACHED
4172  **
4173  ** This callback will be called when an agent in mingle behavior
4174  ** has reached its mingle target.
4175  **
4176  *i CALLBACK_ID_AGENT_MINGLE_TARGET_LOST
4177  **
4178  ** This callback will be called when an agent in mingle behavior
4179  ** is no longer is range of its mingle target.
4180  **
4181  *i CALLBACK_ID_AGENT_WANDER_TARGET_REACHED
4182  **
4183  ** This callback will be called when an agent in wander behavior
4184  ** has reached its wander target.
4185  **
4186  *i CALLBACK_ID_AGENT_WANDER_TARGET_LOST
4187  **
4188  ** This callback will be called when an agent in wander behavior
4189  ** is no longer is range of its wander target.
4190  **
4191  *i CALLBACK_ID_AGENT_FLEE_AREA_LEFT
4192  **
4193  ** This callback will be called when an agent in flee behavior has
4194  ** successfully moved out range of all fled characters or
4195  ** locations. This will only be called when the agent is
4196  ** transitioning from inside the flee area to outside of it.
4197  **
4198  *i CALLBACK_ID_AGENT_FLEE_AREA_ENTERED
4199  **
4200  ** This callback will be called when an agent in flee behavior has
4201  ** moved inside of the range of any fled characters or locations.
4202  ** This will only be called when the agent is transitioning from
4203  ** outside the flee area to inside of it.
4204  **
4205  *i CALLBACK_ID_AGENT_TRAVEL_WAYPOINT_REACHED
4206  **
4207  ** This callback will be called when an agent in travel behavior
4208  ** has reached in intermediate waypoint and is about to move
4209  ** on to the next.
4210  **
4211  *i CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED
4212  **
4213  ** This callback will be called when an agent in travel behavior
4214  ** has reached the end of its travel path when moving forward
4215  ** along the path.
4216  **
4217  *i CALLBACK_ID_AGENT_TRAVEL_BACKWARD_DEST_REACHED
4218  **
4219  ** This callback will be called when an agent in travel behavior
4220  ** has reached the beginning of its travel path when moving
4221  ** backward along the path.
4222  **
4223  *i CALLBACK_ID_AGENT_TRAVEL_NEAR_FORWARD_DEST
4224  **
4225  ** This callback will be called when an agent gets within a specified
4226  ** distance of the end of the travel path
4227  **
4228  *i CALLBACK_ID_AGENT_CROWD_MEMBER_KILLED
4229  **
4230  ** This callback will be called when fellow member of the crowd is
4231  ** killed.
4232  **
4233  *- - This is the character version of
4234  *- diguyCrowd::CALLBACK_ID_CROWD_MEMBER_KILLED
4235  *- - The crowd's callback character is the crowd member that was
4236  *- killed.
4237  *- - The crowd's callback impact contains the impact information.
4238  **
4239  *i CALLBACK_ID_AGENT_CROWD_MEMBER_IMPACT
4240  **
4241  ** This callback will be called when a fellow member of the crowd
4242  ** is hit by a detonation. This callback does not replace
4243  ** diguyCharacter::CALLBACK_ID_IMPACT, which still needs to be
4244  ** handled to implement damage models.
4245  **
4246  *- - The crowd's callback character is the crowd member that was
4247  *- hit.
4248  *- - The crowd's callback impact contains the impact information.
4249  **
4250  *i CALLBACK_ID_AGENT_NEARBY_SCENE_OBJECT_IMPACT
4251  **
4252  ** This callback will be called when a detonation occurs within the
4253  ** awareness radius (as set by set_awareness_radius()) of the
4254  ** crowd's current bounds.
4255  **
4256  *- - This is the character version of
4257  *- diguyCrowd::CALLBACK_ID_NEARBY_SCENE_OBJECT_IMPACT
4258  *- - The crowd's callback character is the character that caused
4259  *- the detonation.
4260  *- - The crowd's callback impact contains the impact information.
4261  **
4262  *i CALLBACK_ID_AGENT_NEARBY_WEAPON_FIRED
4263  **
4264  ** This callback will be called when a weapon is fired within the
4265  ** awareness radius (as set by set_awareness_radius()) of the
4266  ** crowd's current bounds.
4267  **
4268  *- - The crowd's callback character is the character that fired the
4269  *- weapon.
4270  **
4271  *i CALLBACK_ID_AGENT_VEHICLE_COLLISION
4272  **
4273  ** This callback will be called on a vehicle agent when it hits a
4274  ** member of a companion crowd.
4275  **
4276  *i CALLBACK_ID_AGENT_VEHICLE_NEAR_COLLISION
4277  **
4278  ** This callback will be called on a vehicle agent when it
4279  ** approaches another vehicle.
4280  **
4281  *i CALLBACK_ID_AGENT_NON_ZERO_REPULSION
4282  **
4283  ** This callback will be called when an agent character's repulsion
4284  ** forces become non-zero.
4285  **
4286  *i CALLBACK_ID_AGENT_ZERO_REPULSION
4287  **
4288  ** This callback will be called when an agent character's repulsion
4289  ** forces become zero.
4290  **
4291  *i CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED
4292  **
4293  ** This callback will be called when a character who's requested a
4294  ** path plan via the background path planner
4295  ** (agent_move_to_point_bg) gets a path result. Call
4296  ** diguyCharacter::get_path_planning_result() to get the status of
4297  ** the result.
4298  **
4299  *i CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED
4300  **
4301  ** This callback will be called when the current state the agent's
4302  ** mind, if it has one, has changed. Call
4303  ** diguyCharacter::get_mind_current_state_name() to get the new
4304  ** state name.
4305  */
4306  enum {
4307  CALLBACK_ID_CREATE = 1,
4308  CALLBACK_ID_DESTROY,
4309  CALLBACK_ID_PRE_CREATE,
4310  CALLBACK_ID_CURRENT_APPEARANCE_CHANGED,
4311  CALLBACK_ID_CURRENT_HEAD_APPEARANCE_CHANGED,
4312  CALLBACK_ID_CURRENT_HAND_ITEM_APPEARANCE_CHANGED,
4313  CALLBACK_ID_SHAPE_VISIBILITY_CHANGED,
4314  CALLBACK_ID_PRE_UPDATE,
4315  CALLBACK_ID_POST_UPDATE,
4316  CALLBACK_ID_DONE_SPEAKING,
4317  CALLBACK_ID_GAZE_STATUS,
4318  CALLBACK_ID_LPOINT_STATUS,
4319  CALLBACK_ID_SHOW,
4320  CALLBACK_ID_HIDE,
4321  CALLBACK_ID_PRE_DIE,
4322  CALLBACK_ID_POST_DIE,
4323  CALLBACK_ID_PRE_FIRE_WEAPON,
4324  CALLBACK_ID_POST_FIRE_WEAPON,
4325  CALLBACK_ID_IMPACT,
4326  CALLBACK_ID_FIRE_WEAPON_SUCCESS,
4327  CALLBACK_ID_CURRENT_ACTION_CHANGED,
4328  CALLBACK_ID_DESIRED_ACTION_CHANGED,
4329  CALLBACK_ID_DESIRED_ACTION_REACHED,
4330  CALLBACK_ID_MANUALLY_INVOKED,
4331  CALLBACK_ID_USER_SELECTED,
4332  CALLBACK_ID_USER_UNSELECTED,
4333  CALLBACK_ID_IGUY_INTERACT,
4334  CALLBACK_ID_IGUY_INTERACT_WITH_SUBJECT,
4335  CALLBACK_ID_GUIDE_POSITION_ACQUIRED,
4336  CALLBACK_ID_GUIDE_POSITION_UNACQUIRED,
4337  CALLBACK_ID_GUIDE_ORIENTATION_ACQUIRED,
4338  CALLBACK_ID_GUIDE_ORIENTATION_UNACQUIRED,
4339  CALLBACK_ID_GUIDE_ALTITUDE_ACQUIRED,
4340  CALLBACK_ID_GUIDE_ALTITUDE_UNACQUIRED,
4341  CALLBACK_ID_GUIDE_TARGET_LOST,
4342  CALLBACK_ID_CURRENT_TOUT_REACHED,
4343  CALLBACK_ID_POST_CREATE_GEOMETRY,
4344  CALLBACK_ID_PRE_DESTROY_GEOMETRY,
4345  CALLBACK_ID_END_OF_PATH_REACHED,
4346  CALLBACK_ID_CHARACTER_CLICKED,
4347 
4348  // DI-Guy Scenario UI callbacks:
4349  CALLBACK_ID_UI_PRE_TRANSLATION,
4350  CALLBACK_ID_UI_POST_TRANSLATION,
4351  CALLBACK_ID_UI_MOUSE_DOWN,
4352  CALLBACK_ID_UI_MOUSE_UP,
4353  CALLBACK_ID_UI_RIGHT_MOUSE_DOWN,
4354  CALLBACK_ID_UI_RIGHT_MOUSE_UP,
4355  CALLBACK_ID_UI_LEFT_CLICK,
4356  CALLBACK_ID_UI_RIGHT_CLICK,
4357  CALLBACK_ID_UI_DOUBLE_CLICK,
4358  CALLBACK_ID_UI_MIDDLE_CLICK,
4359  CALLBACK_ID_UI_SCROLL_UP,
4360  CALLBACK_ID_UI_SCROLL_DOWN,
4361  //CALLBACK_ID_UI_DRAG,
4362 
4363  // DI-Guy AI agent callbacks:
4364  CALLBACK_ID_AGENT_NEW_BEHAVIOR,
4365  CALLBACK_ID_AGENT_NEW_PATH_SHAPE,
4366  CALLBACK_ID_AGENT_NEW_FOCUS_CHARACTER,
4367  CALLBACK_ID_AGENT_ATTACK_OUT_OF_TARGETS,
4368  CALLBACK_ID_AGENT_ATTACK_NO_VISIBLE_TARGETS,
4369  CALLBACK_ID_AGENT_PURSUE_TARGET_REACHED,
4370  CALLBACK_ID_AGENT_PURSUE_TARGET_LOST,
4371  CALLBACK_ID_AGENT_MINGLE_TARGET_REACHED,
4372  CALLBACK_ID_AGENT_MINGLE_TARGET_LOST,
4373  CALLBACK_ID_AGENT_WANDER_TARGET_REACHED,
4374  CALLBACK_ID_AGENT_WANDER_TARGET_LOST,
4375  CALLBACK_ID_AGENT_FLEE_AREA_LEFT,
4376  CALLBACK_ID_AGENT_FLEE_AREA_ENTERED,
4377  CALLBACK_ID_AGENT_TRAVEL_WAYPOINT_REACHED,
4378  CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED,
4379  CALLBACK_ID_AGENT_TRAVEL_BACKWARD_DEST_REACHED,
4380  CALLBACK_ID_AGENT_TRAVEL_NEAR_FORWARD_DEST,
4381  CALLBACK_ID_AGENT_CROWD_MEMBER_KILLED,
4382  CALLBACK_ID_AGENT_CROWD_MEMBER_IMPACT,
4383  CALLBACK_ID_AGENT_NEARBY_SCENE_OBJECT_IMPACT,
4384  CALLBACK_ID_AGENT_NEARBY_WEAPON_FIRED,
4385  CALLBACK_ID_AGENT_VEHICLE_COLLISION,
4386  CALLBACK_ID_AGENT_VEHICLE_NEAR_COLLISION,
4387  CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED,
4388  CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED,
4389  CALLBACK_ID_AGENT_NON_ZERO_REPULSION,
4390  CALLBACK_ID_AGENT_ZERO_REPULSION
4391  };
4392 
4393 #ifdef CPLUSPLUS_ONLY
4394 /*****************************************************************************/
4400  /*l
4401  *b Description:
4402  **
4403  ** This function adds a user callback. Callbacks can be removed
4404  ** with remove_callback() or remove_callback_with_user_data().
4405  **
4406  *b Arguments:
4407  **
4408  *a callback - pointer to function with prototype
4409  *a diguyCharacterCallback (typedefed above)
4410  *a callback_id - integer id of when this callback is to be called
4411  *a callback_params - not currently used; pass NULL
4412  *a callback_user_data - pointer for user's own use; DI-Guy will
4413  *a do nothing to the contents of this pointer
4414  *a beyond passing it back when the callback is
4415  *a invoked
4416  **
4417  *b Returns:
4418  **
4419  ** 0 on success, -1 on failure
4420  */
4421  int add_callback(int callback_id,
4422  diguyCharacterCallback* callback,
4423  void* callback_params = 0,
4424  void* callback_user_data = 0);
4425 
4426  /*l
4427  *b Description:
4428  **
4429  ** This function removes a user callback. All callbacks matching
4430  ** the specified callback_id and callback function will be removed.
4431  **
4432  *b Arguments:
4433  **
4434  *a callback_id - integer id of when this callback is to be called
4435  *a callback - pointer to function with prototype
4436  *a diguyCharacterCallback (typedefed above)
4437  **
4438  *b Returns:
4439  **
4440  ** 0 on success, -1 on failure
4441  */
4442  int remove_callback(int callback_id,
4443  diguyCharacterCallback* callback);
4444 
4445  /*l
4446  *b Description:
4447  **
4448  ** This function removes a user callback. All callbacks matching
4449  ** the specified callback_id and callback_user_data pointer will
4450  ** be removed.
4451  **
4452  *b Arguments:
4453  **
4454  *a callback_id - integer id of when this callback is to be
4455  *a called
4456  *a callback_user_data - pointer for user's own use
4457  **
4458  *b Returns:
4459  **
4460  ** 0 on success, -1 on failure
4461  */
4462  int remove_callback_with_user_data(int callback_id,
4463  void* callback_user_data);
4464 
4465 #endif
4466 /*****************************************************************************/
4472  /*l
4473  *b Description:
4474  **
4475  ** This function adds a user callback script. Callback scripts can
4476  ** be removed with remove_callback_script().
4477  **
4478  *b Arguments:
4479  **
4480  *a callback_id - integer id of the callback
4481  *a callback_script - script text of callback to be added
4482  *a callback_script_type - the type of script contained in
4483  *a callback_script
4484  **
4485  ** If NULL is passed for callback_script_type, a default script type
4486  ** will be derived based on the default script interpreter of the
4487  ** scenario.
4488  **
4489  *i lua specific:
4490  **
4491  ** When the script is called, the object for which it is being called
4492  ** will be in the callback_object global.
4493  **
4494  ** To pass NULL when calling from a lua script, use nil.
4495  **
4496  *b Returns:
4497  **
4498  ** 0 on success, -1 on failure
4499  **
4500  *b Lua Example:
4501  **
4502  *e -------------------------------------------------------------------
4503  *e local pre_fire_weapon_callback = [[
4504  *e
4505  *e local ch_name = callback_object:get_name();
4506  *e bdi_log_print(BDI_LOG_WARN, "Calling pre_fire_weapon_callback for character ".. ch_name .. ".\n");
4507  *e
4508  *e ]]
4509  *e -------------------------------------------------------------------
4510  *e
4511  *e character:add_callback_script(diguyCharacter_CALLBACK_ID_PRE_FIRE_WEAPON,
4512  *e pre_fire_weapon_callback,
4513  *e "lua");
4514  */
4515  int add_callback_script(int callback_id,
4516  const char* callback_script,
4517  const char* callback_script_type = NULL);
4518 
4519  /*l
4520  *b Description:
4521  **
4522  ** This function removes a user callback script previously added with
4523  ** add_callback_script().
4524  **
4525  *b Arguments:
4526  **
4527  *a callback_id - integer id of the callback
4528  *a callback_script - script text of callback previously added
4529  *a callback_script_type - the type of script contained in
4530  *a callback_script
4531  **
4532  ** If NULL is passed for callback_script, all callback
4533  ** scripts whose ids match callback_id and whose types match
4534  ** callback_script_type will be removed.
4535  **
4536  ** If NULL is passed for callback_script_type, a default script type
4537  ** will be derived based on the default script interpreter of the
4538  ** scenario.
4539  **
4540  *i lua specific:
4541  **
4542  ** To pass NULL when calling from a lua script, use nil.
4543  **
4544  *b Returns:
4545  **
4546  ** 0 on success, -1 on failure
4547  **
4548  *b lua Example:
4549  **
4550  *e #
4551  *e # Remove all callback scripts with id
4552  *e # diguyCharacter_CALLBACK_ID_PRE_FIRE_WEAPON
4553  *e #
4554  *e character:remove_callback_script(diguyCharacter_CALLBACK_ID_PRE_FIRE_WEAPON,
4555  *e nil,
4556  *e "lua");
4557  */
4558  int remove_callback_script(int callback_id,
4559  const char* callback_script,
4560  const char* callback_script_type = NULL);
4561 
4562 
4563 /*****************************************************************************/
4573  /*l
4574  *b Description:
4575  **
4576  ** This function maps the event handler with the given name
4577  ** to a callback id. This mapping will be saved in the .dss
4578  ** file and restored when the .dss file is loaded.
4579  **
4580  ** Mappings can also be made via the DI-Guy Scenario UI.
4581  **
4582  ** The event handler is one of the following:
4583  **
4584  *- - a character callback function registered by
4585  *- diguyScenario::register_character_event_handler() or
4586  *- diguyScenario::register_character_event_handler_from_library()
4587  *- - a script registered by
4588  *- diguyScenario::register_character_event_handler_script()
4589  *- - a Script, Decision, or Library Function in the scenario
4590  *- whose "Event Type" is "Character"
4591  **
4592  *b Arguments:
4593  **
4594  *a callback_id - integer id of callback
4595  *a handler_name - name of the event handler to map
4596  **
4597  *b Returns:
4598  **
4599  ** 0 on success, -1 on failure
4600  */
4601  int map_event_handler_to_callback_id(int callback_id,
4602  const char* handler_name);
4603 
4604  /*l
4605  *b Description:
4606  **
4607  ** This function unmaps the event handler with the given name
4608  ** from a callback id.
4609  **
4610  *b Arguments:
4611  **
4612  *a callback_id - integer id of callback
4613  *a handler_name - name of the event handler to unmap
4614  *a unmap_all_matches - pass 0 to unmap only the first match,
4615  *a pass 1 to unmap all matches
4616  **
4617  *b Returns:
4618  **
4619  ** 0 on success, -1 on failure
4620  */
4621  int unmap_event_handler_from_callback_id(int callback_id,
4622  const char* handler_name,
4623  int unmap_all_matches = 0);
4624 
4625  /*l
4626  *b Description:
4627  **
4628  ** This function manually invokes the named character event
4629  ** handler. The callback_id that will be passed to the event
4630  ** handler will be CALLBACK_ID_MANUALLY_INVOKED.
4631  **
4632  ** See diguyCharacter::map_event_handler_to_callback_id() for
4633  ** a description of what comprises a character event handler.
4634  **
4635  ** Note that care should be taken not to end up in an
4636  ** infinite loop of event calls. In general an event handler
4637  ** should not end up directly or indirectly invoking itself.
4638  **
4639  *b Arguments:
4640  **
4641  *a handler_name - name of the event handler to invoke
4642  **
4643  *b Returns:
4644  **
4645  ** DIGUY_CALLBACK_CONTINUE or DIGUY_CALLBACK_STOP
4646  **
4647  *b Available as Decision Bead/Event
4648  */
4649  diguyCallbackReturn manually_invoke_event_handler(const char* handler_name);
4650 
4651 
4652 /*****************************************************************************/
4658  /*l
4659  *b Description:
4660  **
4661  ** This function creates a new path. The created path has no
4662  ** waypoints and no actions. Waypoints can be added using
4663  ** diguyCharacterPath::create_waypoint() or
4664  ** diguyCharacterPath::add_waypoint(). Action beads should be added
4665  ** using diguyCharacterPath::create_action_bead().
4666  **
4667  ** To create a simple path that has a few waypoints and actions, use
4668  ** create_simple_path().
4669  **
4670  ** The waypoints for the path should be created using the function
4671  ** diguyScenario::create_waypoint(). They should be deleted using the
4672  ** function diguyScenario::destroy_waypoint(). Copies of the
4673  ** waypoints are made during the function call, so it is safe to
4674  ** destroy them immediately after this function call returns, or use
4675  ** the waypoints again for another path.
4676  **
4677  ** The returned diguyCharacterPath pointer should be destroyed using
4678  ** destroy_path().
4679  **
4680  *b Arguments:
4681  **
4682  ** The path makes internal copies of all arguments.
4683  **
4684  *a name - name of the new path
4685  **
4686  *b Returns:
4687  **
4688  ** pointer to type diguyCharacterPath
4689  **
4690  */
4691  diguyCharacterPath* create_path(const char* name);
4692 
4693  /*l
4694  *b Description:
4695  **
4696  ** This function creates a new simple path. The path is simple
4697  ** because it has only two waypoints and three specified actions.
4698  **
4699  ** The waypoints for the path should be created using the function
4700  ** diguyScenario::create_waypoint(). They should be deleted using the
4701  ** function diguyScenario::destroy_waypoint(). Copies of the
4702  ** waypoints are made during the function call, so it is safe to
4703  ** destroy them immediately after this function call returns, or use
4704  ** the waypoints again for another path.
4705  **
4706  ** The returned diguyCharacterPath pointer should be destroyed using
4707  ** destroy_path().
4708  **
4709  *b Arguments:
4710  **
4711  ** The path makes internal copies of all arguments.
4712  **
4713  *a name - name of the new path
4714  *a waypoint0 - beginning waypoint
4715  *a waypoint1 - ending waypoint
4716  *a transition_from_action_name - name of the action the character
4717  *a should be transitioning from at the
4718  *a beginning of the path; can be NULL
4719  *a fill_action_name - name of the action that should fill
4720  *a the majority of the path; can be
4721  *a NULL, but see below
4722  *a transition_to_action_name - name of the action the character
4723  *a should transition into at the end of
4724  *a the path
4725  **
4726  ** If transition_from_action_name is NULL, an initial action bead that
4727  ** transitions to the fill action will not be created.
4728  **
4729  ** If fill_action_name is NULL, no action beads will be created for
4730  ** the path, even if transition_from_action_name and/or
4731  ** transition_to_action_name are non-NULL.
4732  **
4733  ** If transition_to_action_name is NULL, a final action bead that
4734  ** transitions from the fill action will not be created.
4735  **
4736  *b Returns:
4737  **
4738  ** pointer to type diguyCharacterPath
4739  */
4740  diguyCharacterPath* create_simple_path(const char* name,
4741  diguyWaypoint* waypoint0,
4742  diguyWaypoint* waypoint1,
4743  const char* transition_from_action_name,
4744  const char* fill_action_name,
4745  const char* transition_to_action_name);
4746 
4747  /*l
4748  *b Description:
4749  **
4750  ** This function is similar to create_simple_path(), but creates its
4751  ** waypoints based on waypoints from the passed path shape.
4752  **
4753  *b Arguments:
4754  **
4755  ** The path makes internal copies of all arguments.
4756  **
4757  *a name - name of the new path
4758  *a source_path_shape - path shape whose waypoints are used
4759  *a to define shape of new path
4760  *a transition_from_action_name - same as for create_simple_path()
4761  *a fill_action_name - same as for create_simple_path()
4762  *a transition_to_action_name - same as for create_simple_path()
4763  **
4764  *b Returns:
4765  **
4766  ** pointer to type diguyCharacterPath
4767  */
4768  diguyCharacterPath* create_path_from_path_shape(const char* name,
4769  diguyPathShape* source_path_shape,
4770  const char* transition_from_action_name,
4771  const char* fill_action_name,
4772  const char* transition_to_action_name);
4773 
4774  /*l
4775  *b Description:
4776  **
4777  ** This function creates a temporary path and immediately forces it as
4778  ** the character's current path. Once it has been traversed it will
4779  ** be automatically deleted.
4780  **
4781  ** The beginning waypoint of this path is at the character's current
4782  ** position; the ending waypoint is at the specified action bead on
4783  ** the specified path (or the first action bead of the specified path
4784  ** if no action bead is specified). The character will use the
4785  ** specified action to move from the beginning waypoint to the ending
4786  ** waypoint.
4787  **
4788  ** This function is useful for getting a free position mode character
4789  ** back onto a path.
4790  **
4791  ** This function will have no effect on a dead character (see
4792  ** die_now() and get_dead()).
4793  **
4794  *b Mode Effects:
4795  **
4796  *- - This function will put the character into path position mode.
4797  *- - This function will put the character into path action mode.
4798  **
4799  *b Arguments:
4800  **
4801  *a destination_path_name - the path the character is trying to
4802  *a reach
4803  *a via_action_name - the action used over the majority of
4804  *a the bridge path
4805  *a destination_path_action_bead_name - the target action bead on the
4806  *a destination path; pass NULL
4807  *a to start at the beginning
4808  *a of the path
4809  **
4810  *b Returns:
4811  **
4812  ** 0 on success, -1 on failure
4813  */
4814  int create_and_force_bridge_path(const char* destination_path_name,
4815  const char* destination_path_action_bead_name,
4816  const char* via_action_name);
4817 
4818  /*l
4819  *b Description:
4820  **
4821  ** This function creates a temporary path and immediately forces it as
4822  ** the character's current path. Once the path has been traversed it
4823  ** will be automatically deleted. The character then begins the local
4824  ** path specified by path_to_push.
4825  **
4826  ** The beginning waypoint of this path is at the character's current
4827  ** position; the ending waypoint is at the specified x, y, z. A
4828  ** path_offset is available to shorten the distance to the end point
4829  ** along the vector to the destination. The character will use the
4830  ** specified action to move from the beginning waypoint to the ending
4831  ** waypoint.
4832  **
4833  ** An optional follow-on path can be specified that the character will
4834  ** move onto once the end position is reached. This must be the name
4835  ** of an existing path for the character. A local path copy of the
4836  ** specified path will be created, and will be pushed to occur after
4837  ** this bridge path completes.
4838  **
4839  ** This function is useful for branching from one location to another
4840  ** in the world.
4841  **
4842  ** This function will have no effect on a dead character (see
4843  ** die_now() and get_dead()).
4844  **
4845  *b Mode Effects:
4846  **
4847  *- - This function will put the character into path position mode.
4848  *- - This function will put the character into path action mode.
4849  **
4850  *b Arguments:
4851  **
4852  *a x, y, z - location in world space the bridge path
4853  *a should aim for
4854  *a path_offset - the amount to shorten the bridge path
4855  *a via_action_name - the action used over the majority of the
4856  *a bridge path
4857  *a next_local_path - local path to push when the character
4858  *a arrives at it's destination; pass NULL
4859  *a to not push a local path
4860  *a orientation - amount to rotate the local path
4861  **
4862  *b Returns:
4863  **
4864  ** 0 on success, -1 on failure
4865  */
4866  int create_and_force_bridge_path_to_point(float x, float y, float z,
4867  float path_offset,
4868  const char* via_action_name,
4869  const char* next_local_path = NULL,
4870  float orientation = 0.0f);
4871 
4872  /*l
4873  *b Description:
4874  **
4875  ** This function destroys a path created by create_path(),
4876  ** create_simple_path(), or a path from a loaded scenario.
4877  **
4878  ** The path the character is currently traveling, as returned by
4879  ** get_current_traveled_path(), cannot be destroyed. Attempting to
4880  ** destroy it will result in an error.
4881  **
4882  *b Arguments:
4883  **
4884  *a path - path to be destroyed
4885  **
4886  *b Returns:
4887  **
4888  ** 0 on success, -1 on failure
4889  */
4890  int destroy_path(diguyCharacterPath* path);
4891 
4892  /*l
4893  *b Returns:
4894  **
4895  ** the number of paths belonging to this character
4896  */
4897  int get_num_paths();
4898 
4899  /*l
4900  *b Returns:
4901  **
4902  ** pointer of type diguyCharacterPath; NULL if no
4903  ** path at the specified index
4904  **
4905  *b Arguments:
4906  **
4907  *a index - index of the path; indices start at 0
4908  */
4909  diguyCharacterPath* get_path_at_index(int index);
4910 
4911  /*l
4912  *b Returns:
4913  **
4914  ** the name of the path at the given index; NULL if no
4915  ** path at the specified index
4916  */
4917  const char* get_path_name_at_index(int index);
4918 
4919  /*l
4920  *b Description:
4921  **
4922  ** This function returns the index of the path the character
4923  ** is currently following. If the character is not following
4924  ** a path the returned index will be -1. (i.e., the character
4925  ** must be in path action mode *and* path position mode.)
4926  **
4927  *b Mode Restrictions:
4928  **
4929  *- - This function will only return a 0 or greater index if the
4930  ** character is in path action mode *and* path position mode.
4931  **
4932  *b Returns:
4933  **
4934  ** the index of the current path; -1 if not on a path
4935  */
4936  int get_current_path_index();
4937 
4938  /*l
4939  *b Description:
4940  **
4941  ** This function returns the path the character is currently
4942  ** traveling.
4943  **
4944  *b Mode Restrictions:
4945  **
4946  *- - This function can only be called in path position mode.
4947  **
4948  *b Returns:
4949  **
4950  ** pointer of type diguyCharacterPath; NULL if no path is currently
4951  ** being traveled
4952  */
4953  diguyCharacterPath* get_current_traveled_path();
4954 
4955  /*l
4956  *b Description:
4957  **
4958  ** This function can be used to see if the current traveled has the
4959  ** passed name. This is primarily useful for decisions and other
4960  ** limited logic applications.
4961  **
4962  *b Returns:
4963  **
4964  ** 1 if currently traveled path has the passed name; 0 if the name
4965  ** doesn't match, or no path is currently being traveled
4966  **
4967  *b Available as Decision Bead/Event
4968  */
4969  int get_current_traveled_path_is(const char* path_name);
4970 
4971  /*l
4972  *b Description:
4973  **
4974  ** This function pushes the path with the specified name
4975  ** onto the queue of paths this character will follow.
4976  **
4977  ** This function will have no effect on a dead character (see
4978  ** die_now() and get_dead()).
4979  **
4980  *b Arguments:
4981  **
4982  *a name - name of the path to be pushed
4983  **
4984  *b Returns:
4985  **
4986  ** 0 on success, -1 on failure
4987  **
4988  *b Available as Decision Bead/Event
4989  */
4990  int push_path(const char* path_name);
4991 
4992  /*l
4993  *b Description:
4994  **
4995  ** This function clears the queue of paths the character will follow
4996  ** and then pushes the path with the specified name.
4997  **
4998  ** This function will have no effect on a dead character (see
4999  ** die_now() and get_dead()).
5000  **
5001  *b Arguments:
5002  **
5003  *a name - name of the path to be pushed
5004  *a max_rampdown_interval - max amount of time spent trying to
5005  *a smooth over any motion seams; set
5006  *a to 0.5 for a smooth transition, set
5007  *a to 0 for a potentially rough transition
5008  **
5009  *b Returns:
5010  **
5011  ** 0 on success, -1 on failure
5012  **
5013  *b Available as Decision Bead/Event
5014  */
5015  int force_path(const char* path_name,
5016  float max_rampdown_interval = 0.5f);
5017 
5018  /*l
5019  *b Description:
5020  **
5021  ** Same as force_path(), but only motions at or after the specified
5022  ** action bead are added.
5023  **
5024  ** This function will have no effect on a dead character (see
5025  ** die_now() and get_dead()).
5026  **
5027  *b Available as Decision Bead/Event
5028  */
5029  int force_partial_path(const char* path_name,
5030  const char* beginning_action_bead_name,
5031  float max_rampdown_interval = 0.5f);
5032 
5033  /*l
5034  *b Description:
5035  **
5036  ** Resumes a path that was interrupted with a call such as
5037  ** set_desired_action() or force_action(). Note that the
5038  ** retain_path_shape argument to these functions must have been 1 for
5039  ** the path to be resumable.
5040  **
5041  ** This function will have no effect on a dead character (see
5042  ** die_now() and get_dead()).
5043  **
5044  *b Mode Restrictions:
5045  **
5046  *- - This function can only be called if the character is in
5047  *- free action mode *and* path position mode.
5048  **
5049  *b Mode Effects:
5050  **
5051  *- - This function will put the character into path position mode.
5052  *- - This function will put the character into path action mode.
5053  **
5054  *b Arguments:
5055  **
5056  *a max_rampdown_interval - max amount of time spent trying to
5057  *a smooth over any motion seams; set
5058  *a to 0.5 for a smooth transition, set
5059  *a to 0 for a potentially rough transition
5060  **
5061  *b Returns:
5062  **
5063  ** 0 on success, -1 on failure
5064  **
5065  *b Available as Decision Bead/Event
5066  */
5067  int resume_interrupted_path(float max_rampdown_interval = 0.5f);
5068 
5069  /*l
5070  *b Description:
5071  **
5072  ** This function creates a temporary path that is a copy of path_name
5073  ** but transformed so that the starting point is the same as where
5074  ** the character currently is. It then forces it as the character's
5075  ** current path.
5076  **
5077  *b Arguments:
5078  **
5079  *a path_name - path to copy
5080  *a use_character_orientation - whether the character's orientation be
5081  *a incorporated into the transform of the
5082  *a path
5083  *a rotation - additional amount to rotate the path,
5084  *a in degrees
5085  *a clamp_path - whether the path be ground clamped
5086  **
5087  *b Returns:
5088  **
5089  ** pointer to type diguyCharacterPath
5090  */
5091  diguyCharacterPath* force_local_path(const char* path_name,
5092  int use_character_orientation,
5093  float rotation = 0.0f,
5094  int clamp_path = 1);
5095 
5096  /*l
5097  *b Description:
5098  **
5099  ** This function sets which path the character will start on when the
5100  ** scenario is reset.
5101  **
5102  *b Arguments:
5103  **
5104  *a name - name of the path that will be the initial path
5105  **
5106  *b Returns:
5107  **
5108  ** 0 on success, -1 on failure
5109  */
5110  int set_initial_path(const char* name);
5111 
5112  /*l
5113  *b Description:
5114  **
5115  ** This function returns the name of the path the character will start
5116  ** on when the scenario is reset.
5117  **
5118  ** See set_initial_path().
5119  **
5120  *b Returns:
5121  **
5122  ** name of initial path; NULL if there is none
5123  */
5124  const char* get_initial_path();
5125 
5126  /*l
5127  *b Description:
5128  **
5129  ** This function translates all of the paths of this character.
5130  **
5131  *b Arguments:
5132  **
5133  *a tx, ty, tz - distance in meters to move all waypoints
5134  *a reclamp_waypoints - pass 1 to reclamp waypoints to ground
5135  */
5136  void translate_all_paths(float tx, float ty, float tz,
5137  int reclamp_waypoints = 1);
5138 
5139  /*l
5140  *b Description:
5141  **
5142  ** This function rotates all of the paths of this character.
5143  ** The rotation will occur about the specified point.
5144  **
5145  ** *Note:* It is currently recommended that only rotations
5146  ** about the Z axis be done. (i.e., only rz should be non-zero.)
5147  **
5148  *b Arguments:
5149  **
5150  *a rz, rx, ry - amount of rotation, in degrees
5151  *a rotation_pt_x, rotation_pt_y, rotation_pt_z - point around
5152  *a which rotation should occur
5153  *a reclamp_waypoints - pass 1 to reclamp waypoints to ground
5154  */
5155  int rotate_all_paths_about_point(float rz, float rx, float ry,
5156  float rotation_pt_x, float rotation_pt_y, float rotation_pt_z,
5157  int reclamp_waypoints = 1);
5158 
5159  /*l
5160  *b Description:
5161  **
5162  ** This function is similar to rotate_all_paths_about_point(),
5163  ** but rotates around the character's current waypoint instead
5164  ** of an explicitly specified point.
5165  **
5166  ** *Note:* It is currently recommended that only rotations
5167  ** about the Z axis be done. (i.e., only rz should be non-zero.)
5168  **
5169  *b Arguments:
5170  **
5171  *a rz, rx, ry - amount of rotation, in degrees
5172  *a reclamp_waypoints - pass 1 to reclamp waypoints to ground
5173  */
5174  int rotate_all_paths_about_current_waypoint(float rz, float rx, float ry,
5175  int reclamp_waypoints = 1);
5176 
5177  /*l
5178  *b Description:
5179  **
5180  ** This function causes the character to jump forward along
5181  ** its current path to the specified action bead. Motions
5182  ** and beads that would have otherwise been played or processed
5183  ** will be skipped.
5184  **
5185  *b Arguments:
5186  **
5187  *a bead_name - name of the bead to jump to
5188  *a max_rampdown_interval - max amount of time spent trying to
5189  *a smooth over any motion seams; set
5190  *a to 0.5 for a smooth transition, set
5191  *a to 0 for a potentially rough transition
5192  **
5193  *b Returns:
5194  **
5195  ** 0 on success, -1 on failure
5196  */
5197  int jump_to_action_bead(const char* bead_name,
5198  float max_rampdown_interval = 0.5f);
5199 
5200  /*l
5201  *b Description:
5202  **
5203  ** This function finds and returns a pointer to the specified path.
5204  **
5205  *b Arguments:
5206  **
5207  *a name - name of the path to be found
5208  **
5209  *b Returns:
5210  **
5211  ** Pointer to object of type diguyCharacterPath;
5212  ** NULL if path not found.
5213  */
5214  diguyCharacterPath* find_path(const char* path_name);
5215 
5216  /*l
5217  *b Description:
5218  **
5219  ** This function causes the effects of the given aim bead to be
5220  ** applied to this character, regardless of whether the
5221  ** bead belongs to the character or whether character is within
5222  ** the bead's time interval.
5223  **
5224  *b Arguments:
5225  **
5226  *a how_far - how far into the bead the call should be; should
5227  *a be between 0 (beginning of bead time interval) and
5228  *a 1 (end of bead time interval)
5229  **
5230  *b Returns:
5231  **
5232  ** 0 on success, -1 on failure
5233  */
5234  int apply_aim_bead(diguyCharacterPathAimBead* bead,
5235  float how_far = 0.0f);
5236 
5237  /*l
5238  *b Description:
5239  **
5240  ** This function causes the effects of the given decision bead to be
5241  ** applied to this character, regardless of whether the
5242  ** bead belongs to the character or whether character is within
5243  ** the bead's time interval.
5244  **
5245  *b Arguments:
5246  **
5247  *a how_far - how far into the bead the call should be; should
5248  *a be between 0 (beginning of bead time interval) and
5249  *a 1 (end of bead time interval)
5250  **
5251  *b Returns:
5252  **
5253  ** 0 on success, -1 on failure
5254  */
5255  int apply_decision_bead(diguyCharacterPathDecisionBead* bead,
5256  float how_far = 0.0f);
5257 
5258  /*l
5259  *b Description:
5260  **
5261  ** This function causes the effects of the given gaze bead to be
5262  ** applied to this character, regardless of whether the
5263  ** bead belongs to the character or whether character is within
5264  ** the bead's time interval.
5265  **
5266  *b Arguments:
5267  **
5268  *a how_far - how far into the bead the call should be; should
5269  *a be between 0 (beginning of bead time interval) and
5270  *a 1 (end of bead time interval)
5271  **
5272  *b Returns:
5273  **
5274  ** 0 on success, -1 on failure
5275  */
5276  int apply_gaze_bead(diguyCharacterPathGazeBead* bead,
5277  float how_far = 0.0f);
5278 
5279  /*l
5280  *b Description:
5281  **
5282  ** This function causes the effects of the given script bead to be
5283  ** applied to this character, regardless of whether the
5284  ** bead belongs to the character or whether character is within
5285  ** the bead's time interval.
5286  **
5287  *b Arguments:
5288  **
5289  *a how_far - how far into the bead the call should be; should
5290  *a be between 0 (beginning of bead time interval) and
5291  *a 1 (end of bead time interval)
5292  **
5293  *b Returns:
5294  **
5295  ** 0 on success, -1 on failure
5296  */
5297  int apply_script_bead(diguyCharacterPathScriptBead* bead,
5298  float how_far = 0.0f);
5299 
5300  /*l
5301  *b Description:
5302  **
5303  ** This function sets how far along the current path shape
5304  ** the character will be.
5305  **
5306  *b Mode Restrictions:
5307  **
5308  *- - This function can only be called if the character is in
5309  *- free action mode *and* path position mode. i.e., the
5310  *- character is following a path shape, and is not on a
5311  *- diguyCharacterPath.
5312  **
5313  *b Arguments:
5314  **
5315  *a distance - distance in meters; 0.0 is the beginning of the
5316  *a path shape
5317  **
5318  *b Returns:
5319  **
5320  ** 0 on success, -1 on failure
5321  */
5322  int set_distance_along_path(float distance);
5323 
5324  /*l
5325  *b Returns:
5326  **
5327  ** the distance in meters along the path shape; see
5328  ** set_distance_along_path()
5329  **
5330  *b Mode Restrictions:
5331  **
5332  *- - This function can only be called in path position mode.
5333  */
5334  float get_distance_along_path();
5335 
5336  /*l
5337  *b Description:
5338  **
5339  ** This function takes the character off of its current path
5340  ** or path shape.
5341  **
5342  *b Mode Restrictions:
5343  **
5344  *- - This function can only be called in path position mode.
5345  **
5346  *b Mode Effects:
5347  **
5348  *- - This function will put the character into free position mode.
5349  *- - This function will put the character into free action mode.
5350  **
5351  *b Returns:
5352  **
5353  ** 0 on success, -1 on failure
5354  */
5355  int leave_path();
5356 
5357  /*l
5358  *b Description:
5359  **
5360  ** This function returns the index of the nearest waypoint in a path,
5361  ** the path argument is looked up in both the character's path list
5362  ** and the scenario's paths.
5363  **
5364  *b Returns:
5365  **
5366  ** waypoint index
5367  */
5368  int get_nearest_waypoint_index_in_path(const char* path_name);
5369 
5370  /*l
5371  *b Returns:
5372  **
5373  ** Distance to action bead or first waypoint, 100000000.0 on failure
5374  */
5375  float get_distance_to_path(const char* path_name,
5376  const char* action_bead_name = NULL);
5377 
5378 
5379 /*****************************************************************************/
5387  /*l
5388  *b Description:
5389  **
5390  ** This function gets the position link of the character skeleton.
5391  ** The rest of the skeleton can then be traversed by recursively
5392  ** calling the diguyGraphicsLink::get_num_child_links() and
5393  ** diguyGraphicsLink::get_child_link_at_index() functions.
5394  **
5395  ** Alternatively, the links of the character can be traversed
5396  ** by calling the get_num_links() and get_link_at_index()
5397  ** functions below.
5398  **
5399  *b Returns:
5400  **
5401  ** pointer of type diguyGraphicsLink; NULL if there is no
5402  ** position link
5403  */
5404  diguyGraphicsLink* get_position_link();
5405 
5406  /*l
5407  *b Returns:
5408  **
5409  ** number of links on this character
5410  */
5411  int get_num_links();
5412 
5413  /*l
5414  *b Returns:
5415  **
5416  ** pointer of type diguyGraphicsLink; NULL if no
5417  ** link at the specified index
5418  **
5419  *b Arguments:
5420  **
5421  *a index - index of the link; indices start at 0
5422  */
5423  diguyGraphicsLink* get_link_at_index(int index);
5424 
5425  /*l
5426  *b Description:
5427  **
5428  ** This function returns a pointer to the specified link.
5429  **
5430  *b Arguments:
5431  **
5432  *a name - name of link to be found
5433  **
5434  *b Returns:
5435  **
5436  ** pointer of type diguyGraphicsLink; NULL if not found
5437  */
5438  diguyGraphicsLink* find_link(const char* name);
5439 
5440  /*l
5441  *b Returns:
5442  **
5443  ** the string identifying the link at the given index
5444  **
5445  *b Arguments:
5446  **
5447  *a link_index - index of the link; indices start at 0
5448  */
5449  const char* get_link_name_at_index(int link_index);
5450 
5451  /*l
5452  *b Returns:
5453  **
5454  ** the number of shapes on the specified link
5455  **
5456  *b Arguments:
5457  **
5458  *a link_name - name of the link
5459  */
5460  int get_num_link_shapes(const char* link_name);
5461 
5462  /*l
5463  *b Returns:
5464  **
5465  ** the name of the shape at the specified index on the link
5466  **
5467  *b Arguments:
5468  **
5469  *a link_name - name of the link
5470  *a shape_index - index of the shape on the link; indices start at 0
5471  */
5472  const char* get_link_shape_name_at_index(const char* link_name,
5473  int shape_index);
5474 
5476  int get_num_connection_points();
5477 
5480  const char * get_connection_point_name_at_index(int index);
5481 
5484  int get_num_connection_points_with_type(diguyConnectionPointType type);
5485 
5488  const char * get_connection_point_name_with_type(diguyConnectionPointType type, int index);
5489 
5491  void set_link_visibility(const char* link_or_connection_name, int visible, int shape_index = -1);
5492 
5493 /*****************************************************************************/
5515 #ifdef CPLUSPLUS_ONLY
5516 
5517  /*l
5518  *b Description:
5519  **
5520  ** The following prototype should be used for the altitude
5521  ** function:
5522  **
5523  *e float altitude_func(diguyCharacter* character,
5524  *e float x,
5525  *e float y,
5526  *e float old_z);
5527  **
5528  ** When a character needs new altitude info, DI-Guy calls this
5529  ** function with a pointer to the diguyCharacter in question,
5530  ** the character's current (x, y) coordinates, and its previous
5531  ** altitude in old_z.
5532  **
5533  ** The altitude function should then compute and return the new
5534  ** altitude based on this information. This can be done in a
5535  ** number of ways; a typical approach is to do an intersection
5536  ** test with the visual scene. Some users might want to implement
5537  ** fairly complex behavior, such as attempting to make all four
5538  ** wheels of a vehicle touch the terrain, or causing a character
5539  ** to drift slowly towards the ground.
5540  **
5541  ** A default altitude function that should be set for all
5542  ** characters can be set by calling
5543  ** diguyScenario::set_default_character_altitude_function().
5544  **
5545  ** This function is normally called for all characters if the flags
5546  ** for enabling it in free movement or path-following mode are
5547  ** set (see below). Some character systems, such as certain kinds
5548  ** of vehicle control code, will also use the scenario altitude
5549  ** function.
5550  **
5551  *b Callable From:
5552  **
5553  *- - C++
5554  */
5555  int set_altitude_function(diguyAltitudeFunction* altitude_function);
5556 
5557  /*l
5558  *b Returns:
5559  **
5560  ** current altitude function; see set_altitude_function()
5561  **
5562  *b Callable From:
5563  **
5564  *- - C++
5565  */
5566  diguyAltitudeFunction* get_altitude_function();
5567 
5568 #endif
5569 
5570  /*l
5571  *b Description:
5572  **
5573  ** This function sets whether the character's altitude function is
5574  ** enabled in free position mode. Altitude functions are set by the
5575  ** functions set_altitude_function() or
5576  ** diguyScenario::set_default_character_altitude_function().
5577  **
5578  *b Arguments:
5579  **
5580  *a enabled - pass 1 to enable, 0 to disable
5581  **
5582  *b Mode Effects:
5583  **
5584  *- - This function will not change the position mode.
5585  **
5586  *b Mode Restrictions:
5587  **
5588  *- - This function will only affect characters in free position mode.
5589  **
5590  *b Returns:
5591  **
5592  ** 0 on success, -1 on failure
5593  */
5594  int set_altitude_function_enabled_in_free_position_mode(int enabled);
5595 
5596  /*l
5597  *b Returns:
5598  **
5599  ** whether the character's altitude function is enabled in free
5600  ** position mode; see
5601  ** set_altitude_function_enabled_in_free_position_mode()
5602  */
5603  int get_altitude_function_enabled_in_free_position_mode();
5604 
5605  /*l
5606  *b Description:
5607  **
5608  ** This function sets whether the character's altitude function is
5609  ** enabled in path position mode. Altitude functions are set by
5610  ** the functions set_altitude_function() or
5611  ** diguyScenario::set_default_character_altitude_function().
5612  **
5613  *b Arguments:
5614  **
5615  *a enabled - pass 1 to enable, 0 to disable
5616  **
5617  *b Mode Effects:
5618  **
5619  *- - This function will not change the position mode.
5620  **
5621  *b Mode Restrictions:
5622  **
5623  *- - This function will only affect characters in path position mode.
5624  **
5625  *b Returns:
5626  **
5627  ** 0 on success, -1 on failure
5628  */
5629  int set_altitude_function_enabled_in_path_position_mode(int value);
5630 
5631  /*l
5632  *b Returns:
5633  **
5634  ** whether the character's altitude function is enabled in path
5635  ** position mode;
5636  ** see set_altitude_function_enabled_in_path_position_mode()
5637  */
5638  int get_altitude_function_enabled_in_path_position_mode();
5639 
5640  /*l
5641  *b Description
5642  **
5643  ** This function sets the altitude update rate of the character.
5644  **
5645  ** The default value for new characters is 100.
5646  **
5647  ** Note that characters that are load managed (get_is_load_managed()
5648  ** returns 1) have this parameter managed automatically. The
5649  ** corresponding function for load managed characters is
5650  ** diguyLoadManager::set_zone_altitude_update_rate().
5651  **
5652  *b Arguments:
5653  **
5654  *a update_rate - percentage of scenario ticks for which altitude
5655  *a should update; can be between 1 and 100
5656  **
5657  ** Passing 100 means altitude will update every tick.
5658  ** Passing 50 means altitude will update every other tick.
5659  **
5660  *b Returns:
5661  **
5662  ** 0 on success, -1 on failure
5663  */
5664  int set_altitude_update_rate(int update_rate);
5665 
5667  int get_altitude_update_rate();
5668 
5669  /*l
5670  *b Description
5671  **
5672  ** This function sets the altitude interpolation rate of the
5673  ** character. This function only has an effect if the character's
5674  ** altitude function is enabled.
5675  **
5676  ** When the altitude function determines that the character's Z
5677  ** position should be updated to bring it closer to the ground, the
5678  ** altitude interpolation rate determines how quickly the Z height
5679  ** is adjusted.
5680  **
5681  ** The default value is 10.
5682  **
5683  *b Arguments:
5684  **
5685  *a interpolation_rate - how much of the error will be made up
5686  *a each second
5687  **
5688  ** An interpolation_rate of 100 means that all error will be made
5689  ** up each frame.
5690  */
5691  void set_altitude_interpolation_rate(float interpolation_rate);
5692 
5694  float get_altitude_interpolation_rate();
5695 
5696 /*****************************************************************************/
5808  /*l
5809  *b Description:
5810  **
5811  ** Returns the number of variables in this character's pose array.
5812  ** See get_pose_in_radians() for an example of use.
5813  **
5814  *b Returns:
5815  **
5816  ** size of this character's pose array
5817  */
5818  int get_pose_array_size();
5819 
5820 #ifdef CPLUSPLUS_ONLY
5821 
5822  /*l
5823  *b Description:
5824  **
5825  ** Fills an array of floats with the character's current joint angles.
5826  ** Angles are expressed in radians. The size of the float array must
5827  ** be at least as large as that returned by get_pose_array_size().
5828  **
5829  *b Arguments:
5830  **
5831  *a pose_array - an array of floats
5832  **
5833  *b Returns:
5834  **
5835  ** 0 on success, -1 on failure
5836  **
5837  *b Callable From:
5838  **
5839  *- - C++
5840  **
5841  *b C++ Example:
5842  **
5843  *e diguyCharacter* ch = scenario->get_character_at_index(0);
5844  *e float* pose_array;
5845  *e
5846  *e // allocate a float array of the proper size
5847  *e int n = ch->get_pose_array_size();
5848  *e pose_array = new float[n];
5849  *e
5850  *e // get the pose array
5851  *e ch->get_pose_in_radians(pose_array);
5852  */
5853  int get_pose_in_radians(float* pose_array);
5854 
5855 #endif
5856 
5857  /*l
5858  *b Description:
5859  **
5860  ** Creates and returns a pose override object. The newly created
5861  ** pose override object is added to the character's previously
5862  ** created override objects, if any.
5863  **
5864  ** How the pose override interacts with other effects that affect
5865  ** the pose of the character depends on the override stage. See
5866  ** the section "Pose Override Stages" for a discussion of pose
5867  ** override stages.
5868  **
5869  *b Arguments:
5870  **
5871  *a override_stage - the stage in the DI-Guy motion engine at
5872  *a which the override should be applied
5873  **
5874  *b Returns:
5875  **
5876  ** object of type diguyCharacterPoseOverride
5877  */
5878  diguyCharacterPoseOverride* create_pose_override(int override_stage = 3);
5879 
5880  /*l
5881  *b Description:
5882  **
5883  ** Destroys a pose override object, ending its influence on the
5884  ** character.
5885  **
5886  *b Arguments:
5887  **
5888  *a po - pose override object to be destroyed
5889  **
5890  *b Returns:
5891  **
5892  ** 0 on success, -1 on failure
5893  */
5894  int destroy_pose_override(diguyCharacterPoseOverride* po);
5895 
5896  /*l
5897  *b Returns:
5898  **
5899  ** the number of pose overrides belonging to this character
5900  */
5901  int get_num_pose_overrides();
5902 
5903  /*l
5904  *b Returns:
5905  **
5906  ** pointer of type diguyCharacterPoseOverride; NULL if no
5907  ** pose override at the specified index
5908  **
5909  *b Arguments:
5910  **
5911  *a index - index of the pose override; indices start at 0
5912  */
5913  diguyCharacterPoseOverride* get_pose_override_at_index(int index);
5914 
5915  /*l
5916  *b Description:
5917  **
5918  ** Creates and returns a pose override object that completely
5919  ** overrides all other character pose operations, including motions,
5920  ** aiming, gazing, gestures, other pose overrides, etc. The values
5921  ** set in the complete pose override object will be the values used
5922  ** to animate the character.
5923  **
5924  ** Having only one thing that affects a character's pose allows for
5925  ** much faster updating of the character.
5926  **
5927  ** There can only be one complete pose override object per character.
5928  **
5929  ** To remove the complete pose override, call
5930  ** destroy_complete_pose_override().
5931  **
5932  *b Returns:
5933  **
5934  ** object of type diguyCharacterPoseOverride
5935  */
5936  diguyCharacterPoseOverride* create_complete_pose_override();
5937 
5938  /*l
5939  *b Description:
5940  **
5941  ** Removes and destroys the complete pose override created by
5942  ** create_complete_pose_override().
5943  */
5944  void destroy_complete_pose_override();
5945 
5946 
5947 /*****************************************************************************/
5953  /*l
5954  *b Description:
5955  **
5956  ** This function sets the current azimuth, elevation, and
5957  ** distance of the character's gaze. A fixed point in 3D space
5958  ** is then found using the two angles and the given distance
5959  ** from the DI-Guy coordinate system origin. Angles are
5960  ** given with respect to the DI-Guy coordinate system.
5961  **
5962  ** See set_position() for a description of the coordinate
5963  ** system.
5964  **
5965  ** Gazing will continue until end_gaze() is called.
5966  **
5967  ** This function will have no effect on a dead character (see
5968  ** die_now() and get_dead()).
5969  **
5970  *b Arguments:
5971  **
5972  *a azimuth - rotation in degrees about up (vertical) axis;
5973  *a positive rotates to character's left
5974  *a elevation - rotation in degrees about forward (horizontal) axis;
5975  *a positive rotates down
5976  *a distance - distance in meters from the position of the character
5977  *a to the gaze target; positive values only,
5978  *a typically this is a large value (e.g. 10,000 meters)
5979  *a is_new_gaze - set to 1 if this is a new gaze;
5980  *a set to 0 if this is continuing an already started
5981  *a gaze
5982  **
5983  *b Returns:
5984  **
5985  ** 0 on success, -1 on failure
5986  */
5987  int gaze_at_angle(float azimuth,
5988  float elevation,
5989  float distance,
5990  int is_new_gaze = 1);
5991 
5992  /*l
5993  *b Description:
5994  **
5995  ** This function is identical to gaze_at_angle() except that it uses
5996  ** body local coordinates for the character. The angles
5997  ** are given with respect to the idealized position of the
5998  ** character. Use get_position() to learn the idealized position.
5999  ** The distance is between the idealized position of the character
6000  ** and the fixation point.
6001  **
6002  ** This function will have no effect on a dead character (see
6003  ** die_now() and get_dead()).
6004  */
6005  int gaze_at_angle_local(float azimuth,
6006  float elevation,
6007  float distance = 10000.0f,
6008  int is_new_gaze = 1);
6009 
6010  /*l
6011  *b Description:
6012  **
6013  ** This function sets the current fixation point of the character's
6014  ** gaze. Point coordinates are given in meters in the DI-Guy
6015  ** global coordinate system. The function uses default gaze behavior
6016  ** settings. Gazing will continue until end_gaze() is called.
6017  **
6018  ** This function will have no effect on a dead character (see
6019  ** die_now() and get_dead()).
6020  **
6021  *b Arguments:
6022  **
6023  *a tx, ty, tz - position in meters from the DI-Guy global
6024  *a origin
6025  *a is_new_gaze - set to 1 if this is a new gaze;
6026  *a set to 0 if this is continuing an already started
6027  *a gaze
6028  **
6029  *b Returns:
6030  **
6031  ** 0 on success, -1 on failure
6032  */
6033  int gaze_at_point(float tx,
6034  float ty,
6035  float tz,
6036  int is_new_gaze = 1);
6037 
6038  /*l
6039  *b Description:
6040  **
6041  ** This function is identical to gaze_at_point() except that it uses
6042  ** body local coordinates for the character. Use get_position()
6043  ** to learn the idealized position of the character if necessary.
6044  **
6045  ** This function will have no effect on a dead character (see
6046  ** die_now() and get_dead()).
6047  */
6048  int gaze_at_point_local(float tx,
6049  float ty,
6050  float tz,
6051  int is_new_gaze = 1);
6052 
6053  /*l
6054  *b Description:
6055  **
6056  ** This function effectively does a gaze_at_point() each tick.
6057  ** The point to be gazed at is updated each tick to be the position
6058  ** of the specified link on the specified character.
6059  **
6060  ** This function will have no effect on a dead character (see
6061  ** die_now() and get_dead()).
6062  **
6063  *b Arguments:
6064  **
6065  *a target_character_name - name of the character to be
6066  *a gazed at
6067  *a target_character_link_name - link on the character that should
6068  *a be gazed at; pass NULL to gaze at
6069  *a the position link of the character
6070  *a offset_tx, offset_ty, offset_tz - offset onto the link, in meters
6071  **
6072  *b Returns:
6073  **
6074  ** 0 on success, -1 on failure
6075  **
6076  *b Available as Decision Bead/Event
6077  **
6078  *b C++ Example:
6079  **
6080  *e // gaze at the head of character "soldier-1".
6081  *e ch->gaze_at_character("soldier-1",
6082  *e "cervical",
6083  *e 0.0,
6084  *e 0.0,
6085  *e 0.0);
6086  */
6087  int gaze_at_character(const char* target_character_name,
6088  const char* target_character_link_name = NULL,
6089  float offset_tx = 0.0f,
6090  float offset_ty = 0.0f,
6091  float offset_tz = 0.0f);
6092 
6093  /*l
6094  *b Returns:
6095  **
6096  ** 1 if the character is actively gazing, 0 if not
6097  */
6098  int get_gaze_is_active();
6099 
6100  /*l
6101  *b Returns:
6102  **
6103  ** the current gaze point relative to the DI-Guy
6104  ** global coordinate system
6105  */
6106  int get_gaze_point(float* x, float* y, float* z);
6107 
6108  /*l
6109  *b Description:
6110  **
6111  ** A gaze is acquired if the final link in the gaze link chain
6112  ** has fully oriented toward the gaze target, even if other
6113  ** links in the gaze chain are still moving.
6114  **
6115  ** If the gaze is acquired, but any links in the gaze chain
6116  ** are still moving, the gaze is considered acquired but not
6117  ** steady (see get_gaze_is_steady().) If all links have reached
6118  ** a relatively steady state, the gaze is considered acquired
6119  ** and steady.
6120  **
6121  ** If either the acquired or steady status of a gaze has changed
6122  ** (e.g., was acquired but now is not, or was steady but now
6123  ** a link is moving), the diguyCharacter callback with callback_id
6124  ** CALLBACK_ID_GAZE_STATUS will be called.
6125  **
6126  *b Returns:
6127  **
6128  *- - 1 if the final link in the gaze can and has become oriented
6129  *- toward the gaze target
6130  *- - 0 if not
6131  *- - -1 on error
6132  */
6133  int get_gaze_is_acquired();
6134 
6135  /*l
6136  *b Description:
6137  **
6138  ** A gaze is steady if it is acquired, and if all links involved
6139  ** in the gaze have reached a steady state.
6140  **
6141  ** For example, since the eyes move faster than the neck, which
6142  ** moves faster than the back, it's possible for the gaze to
6143  ** be acquired (see get_gaze_is_acquired()) by the eyes as the
6144  ** neck and back are still moving. As the neck and back move into
6145  ** a more natural position, the eyes will not need to be turned
6146  ** as far to keep the gaze acquired.
6147  **
6148  ** If either the acquired or steady status of a gaze has changed
6149  ** (e.g., was acquired but now is not, or was steady but now
6150  ** a link is moving), the diguyCharacter callback with callback_id
6151  ** CALLBACK_ID_GAZE_STATUS will be called.
6152  **
6153  *b Returns:
6154  **
6155  *- - 1 if all links participating in the gaze have reached a
6156  *- relatively steady state
6157  *- - 0 if not
6158  *- - -1 on error
6159  */
6160  int get_gaze_is_steady();
6161 
6162  /*l
6163  *b Description:
6164  **
6165  ** This function removes the fixation target of an ongoing gaze,
6166  ** allowing the character to return to a non-gaze posture and
6167  ** behavior. This effectively frees the character's posture to
6168  ** other influences.
6169  */
6170  int end_gaze();
6171 
6172  /*l
6173  *b Description:
6174  **
6175  ** This function is similar to gaze_at_angle(), but sets the target
6176  ** of left pointing rather than gaze.
6177  **
6178  ** This function will have no effect on a dead character (see
6179  ** die_now() and get_dead()).
6180  **
6181  *b Arguments:
6182  **
6183  *a azimuth - rotation in degrees about up (vertical) axis;
6184  *a positive rotates to character's left
6185  *a elevation - rotation in degrees about forward (horizontal) axis;
6186  *a positive rotates down
6187  *a distance - distance in meters from the position of the character
6188  *a to the lpoint target; positive values only
6189  *a is_new_lpoint - set to 1 if this is a new lpoint;
6190  *a set to 0 if this is continuing an already started
6191  *a lpoint
6192  *a base_gesture_name - the underlying gesture that should be used for
6193  *a motion of the arm; this is a placeholder
6194  *a argument for future functionality and should
6195  *a be set to NULL
6196  */
6197  int lpoint_at_angle(float azimuth,
6198  float elevation,
6199  float distance,
6200  int is_new_lpoint = 1,
6201  const char* base_gesture_name = 0);
6202 
6203  /*l
6204  *b Description:
6205  **
6206  ** This function is identical to gaze_at_local() except that it uses
6207  ** body local coordinates for the character. Use get_position()
6208  ** to learn the idealized position of the character if necessary.
6209  **
6210  ** This function will have no effect on a dead character (see
6211  ** die_now() and get_dead()).
6212  */
6213  int lpoint_at_angle_local(float azimuth,
6214  float elevation,
6215  float distance = 10000.0f,
6216  int is_new_lpoint = 1,
6217  const char* base_gesture_name = 0);
6218 
6219  /*l
6220  *b Description:
6221  **
6222  ** This function sets the current fixation point for the character's
6223  ** left pointing. Point coordinates are given in meters in the
6224  ** DI-Guy global coordinate system.
6225  **
6226  ** See set_position() for a description of the coordinate
6227  ** system.
6228  **
6229  ** Pointing will continue until end_lpoint() is called.
6230  **
6231  ** This function will have no effect on a dead character (see
6232  ** die_now() and get_dead()).
6233  **
6234  *b Arguments:
6235  **
6236  *a tx, ty, tz - position in meters from the DI-Guy global
6237  *a origin of the lpoint target
6238  *a is_new_gaze - set to 1 if this is a new lpoint;
6239  *a set to 0 if this is continuing an already started
6240  *a lpoint
6241  *a base_gesture_name - the underlying gesture that should be used for
6242  *a motion of the arm; this is a placeholder
6243  *a argument for future functionality and should
6244  *a be set to NULL
6245  **
6246  *b Returns:
6247  **
6248  ** 0 on success, -1 on failure
6249  */
6250  int lpoint_at_point(float tx,
6251  float ty,
6252  float tz,
6253  int is_new_lpoint = 1,
6254  const char* base_gesture_name = 0);
6255 
6256  /*l
6257  *b Description:
6258  **
6259  ** This function is identical to lpoint_at_local() except that it uses
6260  ** body local coordinates for the character. Use get_position()
6261  ** to learn the idealized position of the character if necessary.
6262  **
6263  ** This function will have no effect on a dead character (see
6264  ** die_now() and get_dead()).
6265  */
6266  int lpoint_at_point_local(float tx,
6267  float ty,
6268  float tz,
6269  int is_new_lpoint = 1,
6270  const char* base_gesture_name = 0);
6271 
6272  /*l
6273  *b Description:
6274  **
6275  ** This function is identical to gaze_at_character(), but sets the
6276  ** target of left pointing rather than gaze.
6277  **
6278  ** This function will have no effect on a dead character (see
6279  ** die_now() and get_dead()).
6280  */
6281  int lpoint_at_character(const char* target_character_name,
6282  const char* target_character_link_name = NULL,
6283  float offset_tx = 0.0f,
6284  float offset_ty = 0.0f,
6285  float offset_tz = 0.0f);
6286 
6287  /*l
6288  *b Returns:
6289  **
6290  ** the current lpoint target point relative to the DI-Guy
6291  ** global coordinate system
6292  */
6293  int get_lpoint_point(float* x, float* y, float* z);
6294 
6295  /*l
6296  *b Returns:
6297  **
6298  ** the current base gesture of the lpoint
6299  */
6300  const char* get_lpoint_base_gesture_name();
6301 
6302  /*l
6303  *b Returns:
6304  **
6305  ** 1 if the character is actively lpointing, 0 if not
6306  */
6307  int get_lpoint_is_active();
6308 
6309  /*l
6310  *b Returns:
6311  **
6312  ** 1 if the final link in the lpoint can and has become oriented
6313  ** toward the lpoint target;
6314  ** 0 if not;
6315  ** -1 on error
6316  */
6317  int get_lpoint_is_acquired();
6318 
6319  /*l
6320  *b Returns:
6321  **
6322  ** 1 if all links participating in the lpoint have reached a
6323  ** relatively steady state;
6324  ** 0 if not;
6325  ** -1 on error
6326  */
6327  int get_lpoint_is_steady();
6328 
6329  /*l
6330  *b Description:
6331  **
6332  ** This function removes the fixation target of an ongoing lpoint,
6333  ** allowing the character to return to a non-point posture and
6334  ** behavior. This effectively frees the character's posture to
6335  ** other influences.
6336  */
6337  int end_lpoint();
6338 
6339  /*l
6340  *b Description:
6341  **
6342  ** This function sets all gaze control parameters back to their
6343  ** default settings. This undoes modifications to gaze control
6344  ** parameters made by the following calls:
6345  **
6346  *- - set_gaze_param_desired_locate_time()
6347  *- - set_gaze_link_uses_desired_locate_time()
6348  *- - set_gaze_link_azimuth_limits()
6349  *- - set_gaze_link_elevation_limits()
6350  *- - set_gaze_link_azimuth_tolerance()
6351  *- - set_gaze_link_elevation_tolerance()
6352  *- - set_gaze_link_max_angular_vel()
6353  *- - set_gaze_link_scale_factor()
6354  **
6355  *b Returns:
6356  **
6357  ** 0 on success, -1 on failure
6358  */
6359  int set_gaze_params_to_defaults();
6360 
6361  /*l
6362  *b Description:
6363  **
6364  ** This function sets the desired amount of time in seconds it
6365  ** will take for the gaze or point target to be acquired.
6366  **
6367  ** Having a desired locate time effectively limits how fast links
6368  ** in the gaze chain can turn; they will turn as fast as it
6369  ** takes for them to arrive at their proper values, or as fast
6370  ** as their maximum angular velocity, whichever is longer.
6371  **
6372  ** The use of desired locate time can be turned on and off on a
6373  ** link by link bases using the function
6374  ** set_gaze_link_uses_desired_locate_time().
6375  **
6376  ** This value is only a guideline and may be overridden on a link
6377  ** by link basis during the actual gaze, as links try not to
6378  ** exceed their maximum angular velocities.
6379  **
6380  ** The default locate time is 1.0 seconds.
6381  **
6382  *b Arguments:
6383  **
6384  *a t - lower value results in faster turning rate
6385  **
6386  *b Returns:
6387  **
6388  ** 0 on success, -1 on failure
6389  */
6390  int set_gaze_param_desired_locate_time(float t);
6391 
6392  /*l
6393  *b Returns:
6394  **
6395  ** the most recent setting of set_gaze_param_desired_locate_time()
6396  */
6397  float get_gaze_param_desired_locate_time();
6398 
6399  /*l
6400  *b Description:
6401  **
6402  ** This function sets whether the specified link will pay attention
6403  ** to the desired locate time (as set by
6404  ** set_gaze_param_desired_locate_time()), or whether the link turns
6405  ** as fast as its maximum angular velocity allows (as set by
6406  ** set_gaze_link_max_angular_vel()).
6407  **
6408  ** Note that if this value is set to 1, the link still pays attention
6409  ** to its maximum angular velocity as an upper limit on how fast
6410  ** it can turn.
6411  **
6412  ** Valid link names and defaults:
6413  **
6414  *a orientation - 1
6415  *a back - 1
6416  *a cervical - 1
6417  *a eye_l - 0
6418  *a shoulder_l - 1
6419  *a elbow_l - 1
6420  **
6421  *b Arguments:
6422  **
6423  *a link_name - name of the link
6424  *a uses_desired_locate_time - 1 to use desired locate time, 0
6425  *a to disregard
6426  **
6427  *b Returns:
6428  **
6429  ** 0 on success, -1 on failure
6430  */
6431  int set_gaze_link_uses_desired_locate_time(const char* link_name,
6432  int uses_desired_locate_time);
6433 
6434  /*l
6435  *b Returns:
6436  **
6437  ** the most recent setting of set_gaze_link_uses_desired_locate_time()
6438  */
6439  int get_gaze_link_uses_desired_locate_time(const char* link_name);
6440 
6441  /*l
6442  *b Description:
6443  **
6444  ** This function sets the maximum amount the character can turn
6445  ** the specified link horizontally in pursuit of a gaze or point
6446  ** target.
6447  **
6448  ** Valid link names and defaults:
6449  **
6450  *a back - -45 to 45
6451  *a cervical - -80 to 80
6452  *a eye_l - -50 to 50
6453  *a shoulder_l - -30 to 135
6454  *a elbow_l - -30 to 10
6455  **
6456  *b Arguments:
6457  **
6458  *a link_name - name of the link
6459  *a min - value <= 0; in degrees
6460  *a max - value >= 0; in degrees
6461  **
6462  *b Returns:
6463  **
6464  ** 0 on success, -1 on failure
6465  */
6466  int set_gaze_link_azimuth_limits(const char* link_name, float min, float max);
6467 
6468  /*l
6469  *b Returns:
6470  **
6471  ** the most recent setting of set_gaze_link_azimuth_max()
6472  */
6473  int get_gaze_link_azimuth_limits(const char* link_name,
6474  float* min,
6475  float* max);
6476 
6477  /*l
6478  *b Description:
6479  **
6480  ** This function sets the maximum amount the character can turn
6481  ** the specified link vertically in pursuit of a gaze or point
6482  ** target.
6483  **
6484  ** Valid link names and defaults:
6485  **
6486  *a back - -15 to 45
6487  *a cervical - -80 to 45
6488  *a eye_l - -40 to 40
6489  *a shoulder_l - -80 to 80
6490  *a elbow_l - -170 to 0
6491  **
6492  *b Arguments:
6493  **
6494  *a link_name - name of the link
6495  *a min - value <= 0; in degrees
6496  *a max - value >= 0; in degrees
6497  **
6498  *b Returns:
6499  **
6500  ** 0 on success, -1 on failure
6501  */
6502  int set_gaze_link_elevation_limits(const char* link_name,
6503  float min,
6504  float max);
6505 
6507  int get_gaze_link_elevation_limits(const char* link_name,
6508  float* min,
6509  float* max);
6510 
6511  /*l
6512  *b Description:
6513  **
6514  ** This function sets how much difference there can be between
6515  ** the link's current horizontal orientation and the gaze or point
6516  ** target before the link begins to turn to acquire the gaze or
6517  ** point target.
6518  **
6519  ** The combination of this function and
6520  ** set_gaze_link_scale_factor() determine how close the link will
6521  ** turn toward the gaze or point target.
6522  **
6523  ** With a looser (higher) tolerance the link will not turn as much
6524  ** toward the target. With a tighter (lower) tolerance the link
6525  ** will turn more toward the target.
6526  **
6527  ** Valid link names and defaults:
6528  **
6529  *a orientation - -30 to 30
6530  *a back - -45 to 45
6531  *a cervical - -5 to 5
6532  *a eye_l - -1 to 1
6533  *a shoulder_l - -5 to 5
6534  *a elbow_l - -5 to 5
6535  **
6536  *b Arguments:
6537  **
6538  *a link_name - name of the link
6539  *a min - value <= 0; in degrees
6540  *a max - value >= 0; in degrees
6541  **
6542  *b Returns:
6543  **
6544  ** 0 on success, -1 on failure
6545  */
6546  int set_gaze_link_azimuth_tolerance(const char* link_name,
6547  float min,
6548  float max);
6549 
6551  int get_gaze_link_azimuth_tolerance(const char* link_name,
6552  float* min,
6553  float* max);
6554 
6555  /*l
6556  *b Description:
6557  **
6558  ** The elevation equivalent of set_gaze_link_azimuth_tolerance(),
6559  **
6560  ** Valid link names and defaults:
6561  **
6562  *a orientation - -90 to 90
6563  *a back - -45 to 45
6564  *a cervical - -5 to 5
6565  *a eye_l - -1 to 1
6566  *a shoulder_l - -5 to 5
6567  *a elbow_l - -5 to 5
6568  **
6569  *b Arguments:
6570  **
6571  *a link_name - name of the link
6572  *a min - value <= 0; in degrees
6573  *a max - value >= 0; in degrees
6574  **
6575  *b Returns:
6576  **
6577  ** 0 on success, -1 on failure
6578  */
6579  int set_gaze_link_elevation_tolerance(const char* link_name,
6580  float min,
6581  float max);
6582 
6584  int get_gaze_link_elevation_tolerance(const char* link_name,
6585  float* min,
6586  float* max);
6587 
6588  /*l
6589  *b Description:
6590  **
6591  ** This function sets the maximum angular velocity that the
6592  ** back link angles may attain in pursuit of a gaze or point target.
6593  **
6594  ** Valid link names and defaults:
6595  **
6596  *a back - 30 deg/s
6597  *a cervical - 60 deg/s
6598  *a eye_l - 180 deg/s
6599  *a shoulder_l - 180 deg/s
6600  *a elbow_l - 180 deg/s
6601  **
6602  *b Arguments:
6603  **
6604  *a link_name - name of the link
6605  *a angular_vel - angular velocity in degrees per second
6606  **
6607  *b Returns:
6608  **
6609  ** 0 on success, -1 on failure
6610  */
6611  int set_gaze_link_max_angular_vel(const char* link_name, float angular_vel);
6612 
6614  int get_gaze_link_max_angular_vel(const char* link_name, float* angular_vel);
6615 
6616  /*l
6617  *b Description:
6618  **
6619  ** This function sets how much the link will make up the difference
6620  ** toward the gaze or point target.
6621  **
6622  ** The combination of this function and
6623  ** the tolerances determine how close the
6624  ** link will turn toward the gaze or point target.
6625  **
6626  ** With a smaller scale factor the link will not turn as much toward
6627  ** the target. With a higher scale factor the link will turn more
6628  ** toward the target.
6629  **
6630  ** For example, if the gaze or point target is at 60 degrees yaw in
6631  ** back coordinates and the scale factor is 0.5, the back will turn
6632  ** 30 degrees in pursuit of the target.
6633  **
6634  ** Valid link names and defaults:
6635  **
6636  *a back - 0.75
6637  *a cervical - 0.5
6638  *a eye_l - 1.0
6639  *a shoulder_l - 0.9
6640  *a elbow_l - 1.0
6641  **
6642  *b Arguments:
6643  **
6644  *a link_name - name of the link
6645  *a scale_factor - scale factor between 0 and 1
6646  **
6647  *b Returns:
6648  **
6649  ** 0 on success, -1 on failure
6650  */
6651  int set_gaze_link_scale_factor(const char* link_name, float scale_factor);
6652 
6654  int get_gaze_link_scale_factor(const char* link_name, float* scale_factor);
6655 
6656  /*l
6657  *b Description:
6658  **
6659  ** This function sets whether the character can turn the specified
6660  ** link in pursuit of the gaze target.
6661  **
6662  ** Valid link names and defaults:
6663  **
6664  *a orientation - 0
6665  *a back - 1
6666  *a cervical - 1
6667  *a eye_l - 1 if character has movable eyes, else 0
6668  *a shoulder_l - 0
6669  *a elbow_l - 0
6670  **
6671  *b Arguments:
6672  **
6673  *a link_name - name of the link
6674  *a enabled - 1 to enable, 0 to disable
6675  **
6676  *b Returns:
6677  **
6678  ** 0 on success, -1 on failure
6679  */
6680  int set_link_enabled_for_gaze(const char* link_name, int enabled);
6681 
6683  int get_link_enabled_for_gaze(const char* link_name);
6684 
6685  /*l
6686  *b Description:
6687  **
6688  ** This function sets whether the character can change its current
6689  ** posture in pursuit of the gaze target.
6690  **
6691  ** Gaze can change current posture by default.
6692  **
6693  *b Arguments:
6694  **
6695  *a enabled - 1 to enable, 0 to disable
6696  **
6697  *b Returns:
6698  **
6699  ** 0 on success, -1 on failure
6700  */
6701  int set_gaze_can_change_posture(int enabled);
6702 
6704  int get_gaze_can_change_posture();
6705 
6706  /*l
6707  *b Description:
6708  **
6709  ** This function sets whether the character can change its current
6710  ** variant in pursuit of the gaze target.
6711  **
6712  ** Gaze can change current variant by default.
6713  **
6714  *b Arguments:
6715  **
6716  *a enabled - 1 to enable, 0 to disable
6717  **
6718  *b Returns:
6719  **
6720  ** 0 on success, -1 on failure
6721  */
6722  int set_gaze_can_change_variant(int enabled);
6723 
6725  int get_gaze_can_change_variant();
6726 
6727  /*l
6728  *b Description:
6729  **
6730  ** This function sets whether the character can move the specified
6731  ** link in pursuit of the lpoint target.
6732  **
6733  ** Valid link names and defaults:
6734  **
6735  *a orientation - 0
6736  *a back - 1
6737  *a cervical - 0
6738  *a eye_l - 0
6739  *a shoulder_l - 1
6740  *a elbow_l - 1
6741  **
6742  *b Arguments:
6743  **
6744  *a link_name - name of the link
6745  *a enabled - 1 to enable, 0 to disable
6746  **
6747  *b Returns:
6748  **
6749  ** 0 on success, -1 on failure
6750  */
6751  int set_link_enabled_for_lpoint(const char* link_name, int enabled);
6752 
6754  int get_link_enabled_for_lpoint(const char* link_name);
6755 
6756  /*l
6757  *b Description:
6758  **
6759  ** This function adjusts the current azimuth and elevation offsets
6760  ** of the character's head. If a gaze is ongoing, then the nod will
6761  ** be supplemented to the gazing, and the character will attempt to
6762  ** maintain its gaze.
6763  **
6764  ** This function will have no effect on a dead character (see
6765  ** die_now() and get_dead()).
6766  **
6767  *b Arguments:
6768  **
6769  *a azimuth - rotation offset about z (vertical) axis, in degrees;
6770  *a positive rotates to character's left
6771  *a elevation - rotation offset about y (horizontal) axis, in degrees;
6772  *a positive rotates down
6773  *a duration - how long it should take to attain the new azimuth
6774  *a and elevation
6775  **
6776  *b Returns:
6777  **
6778  ** 0 on success, -1 on failure
6779  */
6780  int set_nod(float azimuth,
6781  float elevation,
6782  float duration = 0.5f);
6783 
6784  /*l
6785  *b Description:
6786  **
6787  ** This function causes the character to nod its head for the
6788  ** specified number of times over the specified duration.
6789  **
6790  ** If nod_count is 0.5, the elevation of the head will move from its
6791  ** current elevation straight to nod_elevation_out. The arguments
6792  ** nod_elevation0 and nod_elevation1 will be ignored.
6793  **
6794  ** If nod_count is 1.0, the elevation of the head will move from
6795  ** its current elevation to nod_elevation0, then to
6796  ** nod_elevation_out. The argument nod_elevation1 will be ignored.
6797  **
6798  ** If nod_count is 1.5 or greater, the nod elevation will begin at
6799  ** its current elevation, move to nod_elevation0, then alternate
6800  ** between nod_elevation0 and nod_elevation1, before finally ending
6801  ** at nod_elevation_out.
6802  **
6803  ** The head will maintain an elevation offset of nod_elevation_out
6804  ** until a new call to nod_head() or set_nod() is made.
6805  **
6806  ** This function overrides any nod settings made by the set_nod()
6807  ** function.
6808  **
6809  ** This function will have no effect on a dead character (see
6810  ** die_now() and get_dead()).
6811  **
6812  *b Arguments:
6813  **
6814  *a duration - for how long the nod should be executed
6815  *a nod_count - how many nods the character should perform;
6816  *a this will be rounded to the nearest multiple
6817  *a of 0.5
6818  *a nod_elevation0 - elevation of initial nod in degrees
6819  *a nod_elevation1 - elevation of return nod in degrees
6820  *a nod_elevation_out - ending elevation when nod is complete
6821  **
6822  *b Returns:
6823  **
6824  ** 0 on success, -1 on failure
6825  **
6826  *b Available as Decision Bead/Event
6827  */
6828  int nod_head(float duration,
6829  float nod_count,
6830  float nod_elevation0 = 15.0f,
6831  float nod_elevation1 = 0.0f,
6832  float nod_elevation_out = 0.0f);
6833 
6834  /*l
6835  *b Description:
6836  **
6837  ** This function is similar to nod_head(), except the direction
6838  ** of head movement is side to side rather than up and down.
6839  ** See the nod_head() function for a detailed description of usage.
6840  **
6841  ** This function will have no effect on a dead character (see
6842  ** die_now() and get_dead()).
6843  **
6844  *b Arguments:
6845  **
6846  *a duration - for how long the shake should be executed
6847  *a shake_count - how shakes the character should perform; this
6848  *a will be rounded to the nearest multiple of
6849  *a 0.5
6850  *a shake_azimuth0 - azimuth of initial shake in degrees
6851  *a shake_azimuth1 - azimuth of return shake in degrees
6852  *a shake_azimuth_out - ending azimuth when shake is complete
6853  **
6854  *b Returns:
6855  **
6856  ** 0 on success, -1 on failure
6857  **
6858  *b Available as Decision Bead/Event
6859  */
6860  int shake_head(float duration,
6861  float shake_count,
6862  float shake_azimuth0 = -20.0f,
6863  float shake_azimuth1 = 20.0f,
6864  float shake_azimuth_out = 0.0f);
6865 
6866  /*l
6867  *b Returns:
6868  **
6869  ** current nod azimuth setting; see set_nod(), nod_head(), and
6870  ** shake_head()
6871  */
6872  float get_nod_azimuth();
6873 
6874  /*l
6875  *b Returns:
6876  **
6877  ** current nod elevation setting; see set_nod(), nod_head(), and
6878  ** shake_head()
6879  */
6880  float get_nod_elevation();
6881 
6882 
6883 /*****************************************************************************/
6904  /*l
6905  *b Description:
6906  **
6907  ** This function sets the current desired azimuth and elevation of
6908  ** the character's aim. The angles are in character-local
6909  ** coordinates. Zero values mean straight ahead and level.
6910  ** Aiming will continue until end_aim() is called.
6911  **
6912  ** This function effectively calls aim_at_angle_local(), with a
6913  ** distance of 10000 meters, and is_new_aim set to 1.
6914  **
6915  ** This function will have no effect on a dead character (see
6916  ** die_now() and get_dead()).
6917  **
6918  *b Arguments:
6919  **
6920  *a azimuth - rotation about z (vertical) axis, in degrees;
6921  *a positive rotates to character's left
6922  *a elevation - rotation about y (horizontal) axis, in degrees;
6923  *a positive rotates down
6924  **
6925  *b Returns:
6926  **
6927  ** 0 on success, -1 on failure
6928  */
6929  int set_aim(float azimuth, float elevation);
6930 
6931  /*l
6932  *b Description:
6933  **
6934  ** This function sets the current azimuth, elevation, and
6935  ** distance of the character's aim. A fixed point in 3D space is
6936  ** then found using the two angles and the given distance from
6937  ** the character's idealized position. Angles are given with
6938  ** respect to the DI-Guy global coordinate system.
6939  **
6940  ** See set_position() for a description of the coordinate
6941  ** system.
6942  **
6943  ** Aiming will continue until end_aim() is called.
6944  **
6945  ** This function will have no effect on a dead character (see
6946  ** die_now() and get_dead()).
6947  **
6948  *b Arguments:
6949  **
6950  *a azimuth - rotation in degrees about up (vertical) axis;
6951  *a positive rotates to the character's left; zero means
6952  *a in the direction of the positive X axis of the Boston
6953  *a Dynamics coordinate system
6954  *a elevation - rotation in degrees about horizontal axis; positive
6955  *a rotates down
6956  *a distance - distance in meters from the idealized position of the
6957  *a character to the aim target; positive values only,
6958  *a typically this is a large value (e.g. 10,000 meters)
6959  *a is_new_aim - set to 1 if this is a new aim, for jumping to a
6960  *a new target;
6961  *a set to 0 if this is continuing an already
6962  *a started aim, for tracking an existing target
6963  **
6964  *b Returns:
6965  **
6966  ** 0 on success, -1 on failure
6967  */
6968  int aim_at_angle(float azimuth,
6969  float elevation,
6970  float distance,
6971  int is_new_aim = 1);
6972 
6973  /*l
6974  *b Description:
6975  **
6976  ** This function is identical to aim_at_angle() except that it
6977  ** uses body local coordinates for the character. The angles are
6978  ** given with respect to the idealized position of the character.
6979  ** Use get_position() to learn the idealized position. The
6980  ** distance is between the idealized position of the character
6981  ** and the fixation point. Aiming will continue until end_aim()
6982  ** is called.
6983  **
6984  ** This function will have no effect on a dead character (see
6985  ** die_now() and get_dead()).
6986  */
6987  int aim_at_angle_local(float azimuth,
6988  float elevation,
6989  float distance,
6990  int is_new_aim = 1);
6991 
6992  /*l
6993  *b Description:
6994  **
6995  ** This function sets the current fixation point of the
6996  ** character's aim. Point coordinates are given in meters in the
6997  ** DI-Guy global coordinate system.
6998  **
6999  ** The function uses default aim behavior settings. Aiming will
7000  ** continue until end_aim() is called.
7001  **
7002  ** This function will have no effect on a dead character (see
7003  ** die_now() and get_dead()).
7004  **
7005  *b Arguments:
7006  **
7007  *a tx, ty, tz - position in meters from the DI-Guy global
7008  *a origin
7009  *a is_new_aim - set to 1 if this is a new aim;
7010  *a set to 0 if this is continuing an already started aim
7011  **
7012  *b Returns:
7013  **
7014  ** 0 on success, -1 on failure
7015  */
7016  int aim_at_point(float x, float y, float z, int is_new_aim = 1);
7017 
7018  /*l
7019  *b Description:
7020  **
7021  ** This function is identical to aim_at_point() except that it
7022  ** uses body local coordinates for the character. Use
7023  ** get_position() to learn the idealized position of the
7024  ** character if necessary.
7025  **
7026  ** This function will have no effect on a dead character (see
7027  ** die_now() and get_dead()).
7028  */
7029  int aim_at_point_local(float x, float y, float z, int is_new_aim = 1);
7030 
7031  /*l
7032  *b Description:
7033  **
7034  ** This function effectively does an aim_at_point() each tick.
7035  ** The point to be aimed at is updated each tick to be the position
7036  ** of the specified link on the specified character.
7037  **
7038  ** This function will have no effect on a dead character (see
7039  ** die_now() and get_dead()).
7040  **
7041  *b Arguments:
7042  **
7043  *a target_character_name - name of the character to be
7044  *a aimed at
7045  *a target_character_link_name - link on the character that should
7046  *a be aimed at; pass NULL or "" to
7047  *a aim at the position link of the
7048  *a character. If NULL is passed,
7049  *a function will make best effort to
7050  *a choose a character-appropriate link
7051  *a to target.
7052  *a offset_tx, offset_ty, offset_tz - offset onto the link, in meters
7053  **
7054  *b Returns:
7055  **
7056  ** 0 on success, -1 on failure
7057  **
7058  *b Available as Decision Bead/Event
7059  **
7060  *b C++ Example:
7061  **
7062  *e // aim at the head of character "soldier-1".
7063  *e ch->aim_at_character("soldier-1",
7064  *e "cervical",
7065  *e 0.0,
7066  *e 0.0,
7067  *e 0.0);
7068  */
7069  int aim_at_character(const char* target_character_name,
7070  const char* target_character_link_name = NULL,
7071  float offset_tx = 0.0f,
7072  float offset_ty = 0.0f,
7073  float offset_tz = 0.0f);
7074 
7075  /*l
7076  *b Description:
7077  **
7078  ** This function terminates aiming started by the set_aim(),
7079  ** aim_at_point(), aim_at_point_local(), aim_at_angle(),
7080  ** aim_at_angle_local(), and aim_at_character() functions.
7081  */
7082  void end_aim();
7083 
7085  const char * get_aim_at_character();
7086 
7088  float get_aim_azimuth();
7089 
7091  float get_aim_elevation();
7092 
7093  /*l
7094  *b Returns:
7095  **
7096  ** 1 if the character is aiming 0 if not
7097  **
7098  *b Arguments:
7099  **
7100  *a muzzle_x, muzzle_y, muzzle_z - position of muzzle in meters from
7101  *a the origin
7102  *a far_x, far_y, far_z - position of end target in meters from the
7103  *a origin
7104  **
7105  ** Pass NULL for any values that are not needed.
7106  ** Note: values will be zero if the character isn't currently aiming
7107  */
7108  int get_aim_trajectory(float* muzzle_x, float* muzzle_y, float* muzzle_z,
7109  float* far_x, float* far_y, float* far_z);
7110 
7111  /*l
7112  *b Description:
7113  **
7114  ** Not all actions of a character will be affected by aim
7115  ** commands. This function returns 1 if this character
7116  ** is currently in an aim-able action.
7117  **
7118  *b Returns:
7119  **
7120  ** 1 if current action is aim-able; 0 if not
7121  */
7122  int get_aim_is_possible();
7123 
7124  /*l
7125  *b Returns:
7126  **
7127  ** 1 if the aim is acquired, 0 if not
7128  */
7129  int get_aim_is_acquired();
7130 
7131  /*l
7132  *b Returns:
7133  **
7134  ** 1 if all links participating in the aim have reached a
7135  ** relatively steady state, 0 if not, -1 on error
7136  */
7137  int get_aim_is_steady();
7138 
7139 
7140  /*l
7141  *b Returns:
7142  **
7143  ** 1 if character is currently aiming, 0 if not
7144  */
7145  int get_is_aiming();
7146 
7147 
7148  /******************************************************
7149  **
7150  *3 Aim Algorithm 8 Parameters
7151  **
7152  ** This aim algorithm works by adjusting the aiming character's pose
7153  ** such that the difference between the current aim angles and the
7154  ** desired aim angles is decreased each scenario tick.
7155  **
7156  ** How much of that difference that is made up each frame is
7157  ** determined by the factor parameters. The difference between the
7158  ** desired aim angles and the current aim angles, multiplied by a
7159  ** calculated factor, is added to the current aim angles each frame.
7160  ** This causes the aim to "home in" on the desired aim angles.
7161  **
7162  ** For example, if for each frame the calculated factor is 0.5, half
7163  ** of the difference between the desired and current aim angles is
7164  ** made up.
7165  **
7166  ** Unless otherwise specified, all functions callable from:
7167  **
7168  *- - C++
7169  *- - Script
7170  */
7171 
7172  /*l
7173  *b Description:
7174  **
7175  ** This function sets the steady-state factor that is used once
7176  ** an aim is no longer considered "new".
7177  **
7178  ** See the function set_aim_param_new_aim_duration() for information
7179  ** on when an aim is considered new, and how the effective acquire
7180  ** is calculated from this steady-state acquire factor and the
7181  ** new aim factor.
7182  **
7183  *b Arguments:
7184  **
7185  *a factor - unitless value between 0 and 1; default is 0.6
7186  */
7187  void set_aim_param_acquire_factor(float factor);
7188 
7189  /*l
7190  *b Returns:
7191  **
7192  ** the current aim acquire factor parameter
7193  */
7194  float get_aim_param_acquire_factor();
7195 
7196  /*l
7197  *b Description:
7198  **
7199  ** This function sets the factor that is used when an aim is
7200  ** considered new.
7201  **
7202  ** See the function set_aim_param_new_aim_duration() for information
7203  ** on when an aim is considered new, and how the effective acquire
7204  ** is calculated from this new aim factor and the steady-state acquire
7205  ** factor.
7206  **
7207  *b Arguments:
7208  **
7209  *a factor - unitless value between 0 and 1; default is 0.05
7210  */
7211  void set_aim_param_new_aim_factor(float factor);
7212 
7214  float get_aim_param_new_aim_factor();
7215 
7216  /*l
7217  *b Description:
7218  **
7219  ** This function sets how long an aim is considered "new".
7220  **
7221  ** When an aim is brand-new, the effective acquire factor is equal
7222  ** to the new aim factor as set by set_aim_param_new_aim_factor().
7223  ** When the new aim duration has expired, the effective acquire factor
7224  ** is equal to the steady-state acquire factor as set by
7225  ** set_aim_param_acquire_factor(). In between, the effective acquire
7226  ** factor moves smoothly between the two.
7227  **
7228  ** For example, say that the new aim factor is 0.1, the acquire factor
7229  ** is 0.5, and the new aim duration is 0.2 seconds.
7230  ** If a new aim is started, say by a call to aim_at_angle_local(),
7231  ** the effective acquire factor of the first frame will be 0.1. Over
7232  ** the next 0.2 seconds, the effective acquire factor will smoothly
7233  ** ramp up to 0.5, where it will stay until the aim is acquired.
7234  **
7235  *b Arguments:
7236  **
7237  *a duration - how long, in seconds, a new aim should be considered
7238  *a new; default is 1 second
7239  */
7240  void set_aim_param_new_aim_duration(float duration);
7241 
7243  float get_aim_param_new_aim_duration();
7244 
7245  /*l
7246  *b Description:
7247  **
7248  ** This function sets the maximum factor that can be used for any
7249  ** single frame for aim convergence attempts.
7250  **
7251  ** See set_aim_param_acquire_factor() for a discussion of why setting
7252  ** this too close to 1 is not recommended.
7253  **
7254  *b Arguments:
7255  **
7256  *a factor - unitless value between 0 and 1; default is 0.95
7257  */
7258  void set_aim_param_max_per_frame_adj_factor(float factor);
7259 
7261  float get_aim_param_max_per_frame_adj_factor();
7262 
7263  /*l
7264  *b Description:
7265  **
7266  ** This function sets how close the current aim azimuth must be to
7267  ** the desired aim azimuth in order for the aim to be considered
7268  ** acquired.
7269  **
7270  ** Note that the aim isn't fully acquired until both azimuth and
7271  ** elevation are acquired.
7272  **
7273  ** Setting this value too close to 0 will result in the aim never
7274  ** being acquired.
7275  **
7276  *b Arguments:
7277  **
7278  *a range - how close, in degrees, the azimuth must be for the
7279  *a aim to be acquired; default is 0.5 degrees
7280  */
7281  void set_aim_param_azimuth_acquired_range(float range);
7282 
7284  float get_aim_param_azimuth_acquired_range();
7285 
7286  /*l
7287  *b Description:
7288  **
7289  ** This function sets how close the current aim elevation must be to
7290  ** the desired aim elevation in order for the aim to be considered
7291  ** acquired.
7292  **
7293  ** Note that the aim isn't fully acquired until both azimuth and
7294  ** elevation are acquired.
7295  **
7296  ** Setting this value too close to 0 will result in the aim never
7297  ** being acquired.
7298  **
7299  *b Arguments:
7300  **
7301  *a range - how close, in degrees, the elevation must be for the
7302  *a aim to be acquired; default is 1.0 degrees
7303  */
7304  void set_aim_param_elevation_acquired_range(float range);
7305 
7307  float get_aim_param_elevation_acquired_range();
7308 
7309  /*l
7310  *b Description:
7311  **
7312  ** This function attempts to have the character reach its desired
7313  ** aim angles instantly, every frame.
7314  **
7315  ** Set enabled to 0 to disable instant aim convergence.
7316  **
7317  */
7318  void set_aim_converge_every_frame( int enabled );
7319 
7321  int get_aim_converge_every_frame();
7322 
7323 
7324 /*****************************************************************************/
7328  const char* get_aim_at_link();
7330 
7332  int get_aim_at_link_offset(float* offset_x, float* offset_y, float* offset_z);
7333 
7335  const char* get_gaze_at_link();
7336 
7338  int get_gaze_at_link_offset(float* offset_x, float* offset_y, float* offset_z);
7339 
7340 /*****************************************************************************/
7350  /*l
7351  *b Description:
7352  **
7353  ** This function causes a character to fire his weapon.
7354  **
7355  ** Different weapons have different "munition types", which specify,
7356  ** among other things, the sound to be played, the network info to be
7357  ** sent, and muzzle flash effect. See
7358  ** get_weapon_muzzle_munition_type() for more information on munition
7359  ** types.
7360  **
7361  ** If the weapon fires live rounds (as set by
7362  ** set_weapon_fires_live_rounds()) this function also computes a
7363  ** bullet trajectory, perhaps hitting and killing another character.
7364  **
7365  ** This function will have no effect on a dead character (see
7366  ** die_now() and get_dead()).
7367  **
7368  *b Returns:
7369  **
7370  ** 0 on success, -1 on failure
7371  **
7372  *b Available as Decision Bead/Event
7373  */
7374  int fire_weapon(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
7375 
7376  /*l
7377  *b Description:
7378  **
7379  ** This function causes a character to fire his weapon the
7380  ** specified number of times. This causes a muzzle flash and
7381  ** the weapon's sound (if any) to be played.
7382  **
7383  ** The sound played will be one of, in order:
7384  **
7385  *- - the passed override_sound_name, or
7386  *- - the sound set by set_weapon_sound_override(), or
7387  *- - the default weapon sound based on the character's appearance
7388  **
7389  ** If the weapon fires live rounds (as set by
7390  ** set_weapon_fires_live_rounds()), this function also computes a
7391  ** trajectory for each round, perhaps hitting and killing
7392  ** another character.
7393  **
7394  ** This function will have no effect on a dead character (see
7395  ** die_now() and get_dead()).
7396  **
7397  *b Arguments:
7398  **
7399  *a count - number of times weapon should be fired
7400  *a override_sound_name - override sound to be played
7401  *a dt - time between firings if count > 1
7402  *a muzzle - muzzle on which flash should appear
7403  **
7404  *b Returns:
7405  **
7406  ** 0 on success, -1 on failure
7407  **
7408  *b Available as Decision Bead/Event
7409  */
7410  int fire_weapon_n_times(int count,
7411  float dt = 0.2f,
7412  const char* override_sound_name = NULL,
7414 
7415  /*l
7416  *b Description:
7417  **
7418  ** Fires a bullet at point (x, y) from the camera, using this
7419  ** character as the attacker.
7420  **
7421  *i Currently OpenGL only.
7422  **
7423  ** This function will have no effect on a dead character (see
7424  ** die_now() and get_dead()).
7425  **
7426  *b Returns:
7427  **
7428  ** number of hits
7429  */
7430  int fire_screen_space_bullet(diguyView* view, float x, float y);
7431 
7432  /*l
7433  *b Returns:
7434  **
7435  ** number of times weapon has been fired from specified muzzle
7436  **
7437  *b Available as Decision Bead/Event
7438  */
7439  int get_weapon_fire_count(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
7440 
7441  /*l
7442  *b Description:
7443  **
7444  ** This function sets the default muzzle that will flash when
7445  ** the character fires its weapon due to a call to fire_weapon()
7446  ** or fire_weapon_n_times().
7447  **
7448  ** The default value is DIGUY_MUZZLE_DEFAULT.
7449  **
7450  *b Arguments:
7451  **
7452  *a muzzle - the muzzle that will flash; muzzle 1 is common
7453  **
7454  *b Returns:
7455  **
7456  ** 0 on success, -1 on failure
7457  */
7458  int set_default_weapon_muzzle(diguyMuzzle muzzle);
7459 
7460  /*l
7461  *b Returns:
7462  **
7463  ** current default weapon muzzle that flashes when the character's
7464  ** weapon is fired; see set_default_weapon_muzzle()
7465  */
7466  diguyMuzzle get_default_weapon_muzzle();
7467 
7468  /*l
7469  *b Description:
7470  **
7471  ** When the character fires its weapon, the results depend on the
7472  ** munition type of the muzzle fired from. Munition types specify,
7473  ** among other things:
7474  **
7475  *- - sound played
7476  *- - muzzle flash effect
7477  *- - network data sent (DIS septet)
7478  *- - detonation effect
7479  *- - detonation radius
7480  *- - etc.
7481  **
7482  ** Default munition types for the each muzzle are set automatically
7483  ** when the character's appearance is set. The munition type of the
7484  ** weapon can be overridden by calling
7485  ** set_weapon_munition_type_override().
7486  **
7487  ** Current munition types include:
7488  **
7489  *- - m16
7490  *- - m4
7491  *- - m60
7492  *- - m240
7493  *- - m249
7494  *- - m9
7495  *- - hand_gun
7496  *- - 50cal
7497  *- - m256
7498  *- - ak47
7499  *- - pk74
7500  *- - dragunov
7501  *- - sa80
7502  *- - rpg
7503  *- - m203
7504  *- - 40mm_hedp
7505  *- - javelin
7506  *- - stinger
7507  *- - at4
7508  *- - sa7
7509  *- - molotov_cocktail
7510  *- - 60mm_mortar
7511  *- - 82mm_mortar
7512  *- - 155mm_artillery
7513  *- - IED_mortar
7514  *- - VBIED
7515  *- - m242
7516  *- - 120mm
7517  *- - 125mm
7518  *- - ced
7519  *- - pepper_spray
7520  **
7521  *b Returns:
7522  **
7523  ** munition type of specified muzzle
7524  */
7525  const char* get_weapon_muzzle_munition_type(diguyMuzzle muzzle);
7526 
7528  const char* get_default_muzzle_munition_type();
7529 
7530  /*l
7531  *b Description:
7532  **
7533  ** This function allows the default munition type to be overridden.
7534  ** The default value is NULL (don't override default munition type).
7535  **
7536  *b Arguments:
7537  **
7538  *a munition_type - name of a munition type
7539  **
7540  *b Returns:
7541  **
7542  ** 0 on success, -1 on failure
7543  */
7544  int set_weapon_munition_type_override(const char* munition_type);
7545 
7547  const char* get_weapon_munition_type_override();
7548 
7549  /*l
7550  *b Description:
7551  **
7552  ** This function sets whether the character's weapons fire live
7553  ** rounds. If so, when fire_weapon() and fire_weapon_n_times() are
7554  ** called the trajectory of the bullet will be calculated and checked
7555  ** against characters in the scenario.
7556  **
7557  ** The default value is 1.
7558  **
7559  *b Arguments:
7560  **
7561  *a weapon_fires_live_rounds - set to 1 for live rounds; set to 0
7562  *a for "blanks"
7563  **
7564  *b Returns:
7565  **
7566  ** 0 on success, -1 on failure
7567  **
7568  *b Available as Decision Bead/Event
7569  */
7570  int set_weapon_fires_live_rounds(int weapon_fires_live_rounds);
7571 
7572  /*l
7573  *b Returns:
7574  **
7575  ** current setting of whether weapon fires live rounds or blanks; see
7576  ** set_weapon_fires_live_rounds()
7577  **
7578  *b Available as Decision Bead/Event
7579  */
7580  int get_weapon_fires_live_rounds();
7581 
7582  /*l
7583  *b Description:
7584  **
7585  ** A weapon sound is played when the character fires its weapon
7586  ** due to a call to fire_weapon() or fire_weapon_n_times().
7587  ** The sound that is played is generally derived from the weapon's
7588  ** munition type, which can be different for each muzzle.
7589  **
7590  ** This function overrides the default sound that will be played.
7591  ** Note that this overrides the sound for all muzzles.
7592  **
7593  ** The default value is NULL (don't override default sound).
7594  **
7595  ** To *not* play a sound at all, set the weapon sound gain override
7596  ** to 0.
7597  **
7598  *b Arguments:
7599  **
7600  *a sound - name of a sound defined in the scenario;
7601  *a pass NULL to specify that default should be played
7602  **
7603  *b Returns:
7604  **
7605  ** 0 on success, -1 on failure
7606  */
7607  int set_weapon_sound_override(const char* sound_name);
7608 
7609  /*l
7610  *b Description:
7611  **
7612  ** The function returns the current weapon sound override, if one
7613  ** is set; see set_weapon_sound_override().
7614  **
7615  ** This function will not return NULL. The empty string ("") is
7616  ** returned if a weapon sound override is not set.
7617  **
7618  *b Returns:
7619  **
7620  ** name of weapon sound override
7621  */
7622  const char* get_weapon_sound_override();
7623 
7624  /*l
7625  *b Description:
7626  **
7627  ** This function overrides the default gain on the sound played
7628  ** due to a call to fire_weapon() or fire_weapon_n_times().
7629  **
7630  ** Pass 1.0 to use the sound's default amplitude. Lower numbers
7631  ** decrease volume, higher numbers increase volume.
7632  **
7633  ** Pass 0.0 to completely disable playing of weapon sound.
7634  **
7635  ** The default value is 3.0.
7636  **
7637  ** See set_weapon_sound_override().
7638  **
7639  *b Arguments:
7640  **
7641  *a sound_gain - amount by which to change sound volume
7642  **
7643  *b Returns:
7644  **
7645  ** 0 on success, -1 on failure
7646  */
7647  int set_weapon_sound_gain_override(float gain);
7648 
7650  float get_weapon_sound_gain_override();
7651 
7652  /*l
7653  *b Description:
7654  **
7655  ** This function provides aiming assistance by making it possible for
7656  ** roughly-aimed weapons to hit targets. When spread is nonzero,
7657  ** fire_weapon searches for a target within a conical space centered
7658  ** on the muzzle. Within this cone, the live character within weapon
7659  ** range, and with the smallest angular deviation from the weapon, is
7660  ** chosen, by default, as the target. Other function calls may alter
7661  ** this aiming behavior, making it aim only at enemy targets, for
7662  ** example, or making it prefer close targets to far ones.
7663  **
7664  *b Arguments:
7665  **
7666  *a spread - angular deviation from weapon muzzle within which a
7667  *a target will be found
7668  **
7669  ** Spread values above 145 are suicidal (character can shoot himself).
7670  ** 90 is the highest sensible value, which covers everything ahead
7671  ** of the weapon muzzle. A value of 0 is the default, meaning that
7672  ** only targets in line with the muzzle are hit.
7673  */
7674  void set_weapon_spread(float spread);
7675 
7676  /*l
7677  *b Description:
7678  **
7679  ** This function affects how targets are chosen when
7680  ** the character's weapon_spread is nonzero. Only
7681  ** characters more than near_range meters away from the muzzle
7682  ** will be fired upon. Characters which are closer than
7683  ** near_range meters will not be fired upon.
7684  **
7685  ** This value does not affect weapon behavior when weapon_spread
7686  ** is zero.
7687  **
7688  ** If this function is never called for a character, it is as if
7689  ** the function had been called with a value of zero.
7690  **
7691  *b Arguments:
7692  **
7693  *a near_range - distance closer than which no character will be
7694  *a targeted
7695  */
7696  void set_weapon_near_range(float near_range);
7697 
7698  /*l
7699  *b Description:
7700  **
7701  ** This function sets the range of the character's
7702  ** weapon.
7703  **
7704  ** If this function is never called for a character, it is as if
7705  ** the function had been called with a value of 500.0.
7706  **
7707  *b Arguments:
7708  **
7709  *a far_range - range of the weapon in meters
7710  */
7711  void set_weapon_far_range(float far_range);
7712 
7713  /*l
7714  *b Description:
7715  **
7716  ** This function sets a weapon's ratio of hits to fired rounds. A
7717  ** value of 1.0 (the default) means the weapon will hit everything it
7718  ** is aimed at. Values less than 1.0 cause the weapon to
7719  ** probabilistically miss targets, even when perfectly aimed at them.
7720  ** A value of zero means the weapon doesn't hit anything, even if it
7721  ** is perfectly aimed. A value of 0.5 will hit half of the time.
7722  */
7723  void set_weapon_hit_ratio(float hit_ratio);
7724 
7725  /*l
7726  *b Description:
7727  **
7728  ** This function sets the number of potential impacts a fired round
7729  ** can have. The default is 1. Specifying more than 1 means the
7730  ** round will completely go through objects, triggering a
7731  ** CALLBACK_ID_IMPACT callback each time, until the maximum number of
7732  ** impacts has been reached.
7733  */
7734  void set_weapon_max_impacts(int val);
7735 
7736  /*l
7737  *b Returns:
7738  **
7739  ** state of accessory1
7740  */
7741  int get_accessory1_state();
7742 
7743  /*l
7744  *b Returns:
7745  **
7746  ** state of the character's rifle
7747  */
7748  int get_rifle_state();
7749 
7750  /*l
7751  *b Description
7752  **
7753  ** This function sets whether the projectiles of certain appearances'
7754  ** weapons (such as rocket launchers and RPGs) are visible. Note that
7755  ** most weapons do not have visible projectiles and this function will
7756  ** therefore have no effect.
7757  **
7758  *b Arguments:
7759  **
7760  *a muzzle - which muzzle's projectile should be shown/hidden
7761  *a is_visible - pass 1 to show, pass 0 to hide
7762  **
7763  *b Returns:
7764  **
7765  ** 0 on success, -1 on failure
7766  */
7767  int set_weapon_projectile_is_visible(diguyMuzzle muzzle, int is_visible);
7768 
7769  /*l
7770  *b Description
7771  **
7772  ** This function returns the most recent setting of
7773  ** set_weapon_projectile_is_visible().
7774  **
7775  *b Arguments:
7776  **
7777  *a muzzle - which muzzle's projectile should be queried
7778  **
7779  *b Returns:
7780  **
7781  ** 1 if visible, 0 if not
7782  */
7783  int get_weapon_projectile_is_visible(diguyMuzzle muzzle);
7784 
7785  /*l
7786  *b Description:
7787  **
7788  ** Retrieves the position and direction of the character's weapon.
7789  **
7790  *b Arguments:
7791  **
7792  *a muzzle_tx, muzzle_ty, muzzle_tz - muzzle position, and beginning
7793  *a of aim vector
7794  *a end_pt_tx, end_pt_ty, end_pt_tz - end point of aim vector
7795  *a muzzle_rz, muzzle_rx, muzzle_ry - orientation of muzzle in degrees
7796  *a muzzle - the muzzle for which the aim vector is needed
7797  *a in_character_local_coordinates - pass 0 for values in world
7798  *a coordinates (the default), 1 for values in character-local
7799  *a coordinates
7800  **
7801  ** The muzzle position and end point are in meters from the origin
7802  ** (if using world coordinates) or in meters from the character's
7803  ** position (if using character-local coordinates).
7804  **
7805  ** The distance of the end point from the muzzle position should
7806  ** be the weapon's far range, set by set_weapon_far_range().
7807  **
7808  ** Pass NULL for any values that are not needed.
7809  **
7810  ** *Note:* The muzzle argument is currently not used, and is present
7811  ** for future implementation.
7812  **
7813  *b Returns:
7814  **
7815  ** 0 on success, -1 on failure
7816  */
7817  int get_weapon_aim_vector(float* muzzle_tx, float* muzzle_ty, float* muzzle_tz,
7818  float* end_pt_tx = NULL, float* end_pt_ty = NULL, float* end_pt_tz = NULL,
7819  float* muzzle_rz = NULL, float* muzzle_rx = NULL, float* muzzle_ry = NULL,
7820  int in_character_local_coordinates = 0,
7822 
7823  /*l
7824  *b Description
7825  **
7826  ** This function returns the link the passed muzzle is associated
7827  ** with. For example, soldier rifle muzzles are attached to the
7828  ** "rifle_joint" link.
7829  **
7830  ** Call get_muzzle_offset() to get the offset of the muzzle on this
7831  ** link.
7832  **
7833  *b Arguments:
7834  **
7835  *a muzzle - muzzle of interest
7836  **
7837  *b Returns:
7838  **
7839  ** name of link, or NULL if the character doesn't have the specified
7840  ** muzzle
7841  */
7842  const char* get_muzzle_link(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT);
7843 
7844  /*l
7845  *b Description
7846  **
7847  ** This function returns the offset of the muzzle from the link it
7848  ** is attached to as returned by get_muzzle_link().
7849  **
7850  *b Arguments:
7851  **
7852  *a muzzle - muzzle of interest
7853  *a offset_x, offset_y, offset_z - variables in which to return results
7854  **
7855  *b Returns:
7856  **
7857  ** 0 on success, -1 on failure
7858  */
7859  int get_muzzle_offset(diguyMuzzle muzzle = DIGUY_MUZZLE_DEFAULT,
7860  float* offset_x = NULL,
7861  float* offset_y = NULL,
7862  float* offset_z = NULL);
7863 
7864  /*l
7865  *b Description
7866  **
7867  ** This function sets the highest horizontal error possible when the
7868  ** weapon is fired. If non-0, a random horizontal error angle will
7869  ** be computed and added to the weapon's horizontal aim angle.
7870  **
7871  *b Arguments:
7872  **
7873  *a h_error - highest possible horizontal error
7874  **
7875  *b Returns:
7876  **
7877  ** 0 on success, -1 on failure
7878  */
7879  int set_weapon_max_azimuth_error(float h_error);
7880 
7882  float get_weapon_max_azimuth_error();
7883 
7884  /*l
7885  *b Description:
7886  **
7887  ** Similar to set_weapon_max_azimuth_error(), but for vertical aim.
7888  */
7889  int set_weapon_max_elevation_error(float v_error);
7890 
7892  float get_weapon_max_elevation_error();
7893 
7894  /*l
7895  *b Description
7896  **
7897  ** This function sets whether tracer effects will be shown when
7898  ** the weapon is fired. Not all weapons will support this effect.
7899  **
7900  *b Arguments:
7901  **
7902  *a enabled - pass 1 to enable, 0 to disable
7903  **
7904  *b Returns:
7905  **
7906  ** 0 on success, -1 on failure
7907  */
7908  int set_weapon_tracers_enabled(int enabled);
7909 
7911  int get_weapon_tracers_enabled();
7912 
7913  /*l
7914  *b Returns:
7915  **
7916  ** number of rounds until next tracer
7917  */
7918  int get_weapon_rounds_until_tracer(diguyMuzzle muzzle);
7919 
7920  /*l
7921  *b Description
7922  **
7923  ** This function sets whether a shell eject effect will be shown when
7924  ** the weapon is fired. Not all weapons will support this effect.
7925  **
7926  *b Arguments:
7927  **
7928  *a enabled - pass 1 to enable, 0 to disable
7929  **
7930  *b Returns:
7931  **
7932  ** 0 on success, -1 on failure
7933  */
7934  int set_weapon_shell_eject_enabled(int enabled);
7935 
7937  int get_weapon_shell_eject_enabled();
7938 
7939  /*l
7940  *b Description
7941  **
7942  ** This function sets whether a smoke effect will be shown when the
7943  ** weapon is fired. Not all weapons will support this effect.
7944  **
7945  *b Arguments:
7946  **
7947  *a enabled - pass 1 to enable, 0 to disable
7948  **
7949  *b Returns:
7950  **
7951  ** 0 on success, -1 on failure
7952  */
7953  int set_weapon_smoke_enabled(int enabled);
7954 
7956  int get_weapon_smoke_enabled();
7957 
7958  /*l
7959  *b Description:
7960  **
7961  ** Similar to diguyScenario::trigger_detonation(), but detonation
7962  ** occurs at character's position.
7963  **
7964  *b Arguments:
7965  **
7966  *a munition_name - name of the munition to detonate
7967  *a attacker_name - this MUST be specified if the detonation is being
7968  *a broadcast over the network
7969  *a radius_override - defaults to the data in the munition config file
7970  *a broadcast_on_network - pass 0 to not broadcast detonation on DIS
7971  *a network
7972  **
7973  ** Note: Overriding the detonation radius will NOT work on broadcast
7974  ** detonations since the override value is not transmitted.
7975  */
7976  int trigger_detonation_on_character(const char* munition_name,
7977  const char* attacker_name = NULL,
7978  float radius_override = -1.0f,
7979  int broadcast_on_network = 1);
7980 
7981 
7982 /*****************************************************************************/
7993  /*l
7994  *b Description:
7995  **
7996  ** This function changes the face of the character to reflect the
7997  ** specified user-defined named facial expression.
7998  **
7999  ** Currently affects only "facefx" appearances.
8000  **
8001  *b Arguments:
8002  **
8003  *a facex_name - name of face expression to be applied
8004  *a blend_duration - how long (in seconds) to take to change the face
8005  *a strength - a multiplier between 0 and 1 on the expression
8006  **
8007  ** Face expressions available by default in new scenarios are:
8008  **
8009  *- - Neutral
8010  *- - Smile_cl
8011  *- - Trust
8012  *- - Sad
8013  *- - Mad
8014  *- - Distrust
8015  *- - Conniving
8016  *- - Smile
8017  *- - BrowsDown
8018  *- - BrowsUp
8019  **
8020  ** New face expressions can be added using the
8021  ** diguyScenario::create_face_expression() function.
8022  **
8023  *b Returns:
8024  **
8025  ** 0 on success, -1 on failure
8026  **
8027  *b Available as Decision Bead/Event
8028  **
8029  *b C++ Example:
8030  **
8031  *e diguyCharacter* ch = scenario->get_character_at_index(0);
8032  *e
8033  *e // take one second to get mad
8034  *e ch->set_face_expression("Mad", 1.0);
8035  */
8036  int set_face_expression(const char* facex_name, float blend_duration, float strength = 1.0f);
8037 
8038  /*l
8039  *b Description:
8040  **
8041  ** This function sets the current azimuth and elevation of the
8042  ** character's eyes.
8043  **
8044  ** Currently affects only "facefx" appearances.
8045  **
8046  *b Arguments:
8047  **
8048  *a azimuth - rotation about up (vertical) axis, in degrees;
8049  *a positive rotates to character's left
8050  *a elevation - rotation about forward (horizontal) axis, in degrees;
8051  *a positive rotates down
8052  *a blend_time - how long to take to reach new orientation
8053  **
8054  *b Returns:
8055  **
8056  ** 0 on success, -1 on failure
8057  **
8058  */
8059  int set_orientation_eyes(float azimuth,
8060  float elevation,
8061  float blend_time = 0.0f);
8062 
8063  /*l
8064  *b Description:
8065  **
8066  ** This function gets the current azimuth and elevation of the
8067  ** character's eyes. It currently doesn't take blending into account.
8068  **
8069  ** Currently affects only "facefx" appearances.
8070  **/
8071  int get_orientation_eyes(float* azimuth, float* elevation);
8072 
8073  /*l
8074  *b Description:
8075  **
8076  ** Sets how open the eyes are. The eyes will stay at this level
8077  ** indefinitely. To get automatic blinking behavior, call blink().
8078  **
8079  *b Arguments:
8080  **
8081  *a droop_amount - 1 = eyes closed, 0 = eyes open, 0.5 = half open
8082  **
8083  *b Returns:
8084  **
8085  ** 0 on success, -1 on failure
8086  **
8087  *b Available as Decision Bead/Event
8088  */
8089  int set_eye_droop(float droop_amount, float blend_time = 0.0f);
8090 
8092  float get_eye_droop();
8093 
8094  /*l
8095  *b Description:
8096  **
8097  ** This function blinks the eyes. To have the eyes close to a
8098  ** specific amount and stay there, call set_eye_droop().
8099  **
8100  ** Only characters with expressive face appearances can blink.
8101  **
8102  *b Arguments:
8103  **
8104  *a duration_in - how long in seconds the first part of the blink
8105  *a (typically eyes closing) should take
8106  *a duration_out - how long in seconds the second part of the blink
8107  *a (typically eyes opening) should take
8108  *a target_in - how closed the eyes should be at duration_in
8109  *a target_out - how open the eyes should be at duration_out and
8110  *a thereafter
8111  *a tin - time at which blink should occur; default is now
8112  **
8113  *b Returns:
8114  **
8115  ** 0 on success, -1 on failure
8116  **
8117  *b Available as Decision Bead/Event
8118  */
8119  int blink(float duration_in = 0.1f,
8120  float duration_out = 0.2f,
8121  float target_in = 1.0f,
8122  float target_out = 0.0f,
8123  float tin = DIGUY_DEFAULT_FLOAT);
8124 
8125  /*l
8126  *b Description:
8127  **
8128  ** This function enables automatic eye blinking, so that blinks
8129  ** will happen without further function calls. The various
8130  ** controlling factors of blinks are set by the following functions:
8131  **
8132  *- - set_automatic_blink_duration_in()
8133  *- - set_automatic_blink_duration_out()
8134  *- - set_automatic_blink_target_in()
8135  *- - set_automatic_blink_target_out()
8136  **
8137  ** See blink() for information on what these factors mean.
8138  **
8139  ** Only characters with expressive face appearances can blink.
8140  **
8141  *b Arguments:
8142  **
8143  *a enabled - pass 1 to enable automatic blinks; 0 to disable
8144  *a period - how many seconds between each blink
8145  *a period_variation - variation on how many seconds between
8146  *a each blink
8147  **
8148  ** If blinks are enabled, the first blink will happen immediately.
8149  ** Successive blinks will happen between times (period -
8150  ** period_variation) and (period + period_variation) after the
8151  ** previous blink ends.
8152  **
8153  *b Returns:
8154  **
8155  ** 0 on success, -1 on failure
8156  **
8157  *b Available as Decision Bead/Event
8158  */
8159  int set_automatic_blinks_enabled(int enabled,
8160  float period = 6.0f,
8161  float period_variation = 3.0f);
8162 
8164  int get_automatic_blinks_enabled();
8165 
8166  /*l
8167  *b Description:
8168  **
8169  ** This function sets how long it will take the eye to close during
8170  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8171  ** blink().
8172  **
8173  *b Arguments:
8174  **
8175  *a duration_in - time in seconds for eye droop to go from droop
8176  *a target in to target out
8177  **
8178  *b Available as Decision Bead/Event
8179  */
8180  void set_automatic_blink_duration_in(float duration_in);
8181 
8183  float get_automatic_blink_duration_in();
8184 
8185  /*l
8186  *b Description:
8187  **
8188  ** This function sets how long it will take the eye to open during
8189  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8190  ** blink().
8191  **
8192  *b Arguments:
8193  **
8194  *a duration_out - time in seconds for eye droop to go from droop
8195  *a target out to target in
8196  **
8197  *b Available as Decision Bead/Event
8198  */
8199  void set_automatic_blink_duration_out(float duration_out);
8200 
8202  float get_automatic_blink_duration_out();
8203 
8204  /*l
8205  *b Description:
8206  **
8207  ** This function sets how much the eye will close during
8208  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8209  ** blink().
8210  **
8211  *b Arguments:
8212  **
8213  *a target_in - how far to close eye; 1.0 is all closed, 0.0 is
8214  *a all open
8215  **
8216  *b Available as Decision Bead/Event
8217  */
8218  void set_automatic_blink_target_in(float target_in);
8219 
8221  float get_automatic_blink_target_in();
8222 
8223  /*l
8224  *b Description:
8225  **
8226  ** This function sets how much the eye will open during
8227  ** automatic eye blinks. See set_automatic_blinks_enabled() and
8228  ** blink().
8229  **
8230  *b Arguments:
8231  **
8232  *a target_out - how far to open eye; 1.0 is all closed, 0.0 is
8233  *a all open
8234  **
8235  *b Available as Decision Bead/Event
8236  */
8237  void set_automatic_blink_target_out(float target_out);
8238 
8240  float get_automatic_blink_target_out();
8241 
8242  /*l
8243  *b Returns:
8244  **
8245  ** 1 if the character is speaking, 0 if not. With a FaceFX character
8246  ** this is true if a character is actively playing a FaceFX animation
8247  */
8248  int is_speaking();
8249 
8250  /*l
8251  *b Description:
8252  **
8253  ** FaceFX animations are referred to as a group/animation name.
8254  ** This function allows you to set the current group once.
8255  ** See diguyScenario::facefx_mount_animset() for how to load a new
8256  ** animset on an actor.
8257  */
8258  int set_current_facefx_animation_group(const char* anim_group);
8259 
8260  /*l
8261  *b Returns:
8262  **
8263  ** the current FaceFX animation group set for this character
8264  */
8265  const char* get_current_facefx_animation_group();
8266 
8267  /*l
8268  *b Returns:
8269  **
8270  ** the name of the FaceFX actor that goes with the current head
8271  ** appearance; returns NULL if there's no FaceFX actor
8272  */
8273  const char* get_facefx_actor();
8274 
8275  /*l
8276  *b Description:
8277  **
8278  ** Mounts an animset on the current FaceFX actor. See also
8279  ** diguyScenario::facefx_mount_animset()
8280  */
8281  int facefx_mount_animset(const char* file_name);
8282 
8283  /*l
8284  *b Description:
8285  **
8286  ** Plays a FaceFX animation. This is the main way a facial animation
8287  ** sequence is triggered. The animation can be named
8288  ** "group_name/animation" or just "animation" if the proper group has
8289  ** been set with set_current_facefx_animation_group().
8290  */
8291  int play_facefx_animation(const char* animation,
8292  float magnitude_scale = 1.0f,
8293  float duration_scale = 1.0f,
8294  float blendin_time = 0.1f,
8295  float blendout_time = 0.1f,
8296  int loop = 0);
8297 
8298  /*l
8299  *b Description:
8300  **
8301  ** Stops all active FaceFX animations.
8302  */
8303  int stop_facefx_animations(float blend_time = 0.25f, int stop_sounds = 1);
8304 
8305  /*****************************************************************************/
8310  /*l
8311  *b Returns:
8312  **
8313  ** the number of nodes in the FaceFX actor's face graph
8314  */
8315  int get_num_facefx_nodes();
8316 
8317  /*l
8318  *b Returns:
8319  **
8320  ** the name of the node with index 'index' in the FaceFX actor's face
8321  ** graph
8322  */
8323  const char* get_facefx_node_name(int index);
8324 
8325  /*l
8326  *b Returns:
8327  **
8328  ** the index of the node with name 'node_name'
8329  */
8330  int find_facefx_node_index(const char* node_name);
8331 
8332  /*l
8333  *b Description:
8334  **
8335  ** Allows low level control of individual nodes of the characters face
8336  ** graph. End users can use this function to get finer grained
8337  ** control over eye direction and emotional state.
8338  */
8339  int set_facefx_node_value(int node_index,
8340  float value,
8341  float blend_time = 0.25f);
8342 
8343  /*l
8344  *b Description:
8345  **
8346  ** Retrieves the current final value of a node
8347  **/
8348  float get_facefx_node_value(int node_index);
8349 
8350 /*****************************************************************************/
8394  /*l
8395  *b Description:
8396  **
8397  ** This function creates (but does not begin) the specified gesture.
8398  ** Exact control over the gesture, such as number of repetitions,
8399  ** when the gesture should begin, when it should end, when it
8400  ** should reach specific points within the gestures, etc., is then
8401  ** possible by making calls through the returned
8402  ** diguyCharacterGesture object.
8403  **
8404  ** To begin execution of the gesture, call the begin_now() function
8405  ** of the diguyCharacterGesture object.
8406  **
8407  ** *Do not* call delete on the returned object. It should be
8408  ** destroyed either by calling destroy_gesture(), or by calling
8409  ** set_automatic_destroy_flag(1) on the diguyCharacterGesture
8410  ** object.
8411  **
8412  *b Arguments:
8413  **
8414  *a gesture_name - name of the gesture of create
8415  **
8416  *b Returns:
8417  **
8418  ** pointer to object of type diguyCharacterGesture
8419  */
8420  diguyCharacterGesture* create_gesture(const char* gesture_name);
8421 
8422  /*l
8423  *b Description:
8424  **
8425  ** This function destroys a gesture object created by
8426  ** create_gesture().
8427  **
8428  *b Arguments:
8429  **
8430  *a gesture - gesture to destroy
8431  **
8432  *b Returns:
8433  **
8434  ** 0 on success, -1 on failure
8435  */
8436  int destroy_gesture(diguyCharacterGesture* gesture);
8437 
8438  /*l
8439  *b Description:
8440  **
8441  ** This function executes the specified gesture.
8442  **
8443  ** The gesture will automatically begin and end. The only control
8444  ** over the executed gesture is whether is should be ended or aborted
8445  ** early. See end_executing_gesture() and abort_executing_gesture().
8446  ** For full control of gesture attributes, use create_gesture()
8447  ** instead.
8448  **
8449  ** A gesture takes over control of a subset of a character's pose
8450  ** variables and can be overlaid on top of most base actions of the
8451  ** character.
8452  **
8453  ** Note that gestures should be preloaded at the beginning of a
8454  ** scenario to avoid a hitch in frame rate. See the function
8455  ** diguyScenario::preload_gesture().
8456  **
8457  ** This function will have no effect on a dead character (see
8458  ** die_now() and get_dead()).
8459  **
8460  *b Arguments:
8461  **
8462  *a gesture_name - name of the gesture of execute
8463  *a reps - how many times the gesture should be
8464  *a repeated; default is 1 if no duration
8465  *a is specified, or best fit if there is
8466  *a a duration specified
8467  *a overall_duration - for how long the gesture should be executed;
8468  *a default is such that no time scaling occurs
8469  *a channel_A_weight - the weight given to channel A of the
8470  *a gesture; ignored if the gesture does not
8471  *a have multiple channels
8472  **
8473  ** If the gesture is a multi-stage gesture, the overall duration
8474  ** will be spread proportionately over each stage.
8475  **
8476  *b Returns:
8477  **
8478  ** 0 on success, -1 on failure
8479  **
8480  *b Available as Decision Bead/Event
8481  */
8482  int execute_gesture(const char* gesture_name,
8483  int reps = DIGUY_DEFAULT_INT,
8484  float overall_duration = DIGUY_DEFAULT_FLOAT,
8485  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8486 
8487  /*l
8488  *b Description:
8489  **
8490  ** The gesture will automatically begin and end. The only control
8491  ** over the executed gesture is whether is should be ended or aborted
8492  ** early. See end_executing_gesture() and abort_executing_gesture().
8493  ** For full control of gesture attributes, use create_gesture()
8494  ** instead.
8495  **
8496  ** If the specified gesture is not a 1 stage gesture, no gesture
8497  ** is executed and an error value is returned.
8498  **
8499  ** The specified gesture can be a one or two channel 1 stage gesture,
8500  ** in which case the specified channel weight will be used over the
8501  ** course of the entire gesture.
8502  **
8503  ** A 1 stage gesture is a comprised of a single motion that begins
8504  ** and ends the gesture.
8505  **
8506  ** n repetitions of a 1 stage gesture will repeat the stage 1
8507  ** motion n times.
8508  **
8509  ** This function will have no effect on a dead character (see
8510  ** die_now() and get_dead()).
8511  **
8512  *b Arguments:
8513  **
8514  *a gesture_name - name of the gesture of execute
8515  *a reps - how many times the gesture should be
8516  *a repeated; default is 1 if no duration
8517  *a is specified, or best fit if there is
8518  *a a duration specified
8519  *a stage1_duration - how long stage 1 of the gesture should take;
8520  *a default is such that no time scaling occurs
8521  *a channel_A_weight - the weight given to channel A of the
8522  *a gesture; ignored if the gesture does not
8523  *a have multiple channels
8524  **
8525  *b Returns:
8526  **
8527  ** 0 on success, -1 on failure
8528  */
8529  int execute_1stage_gesture(const char* gesture_name,
8530  int reps = DIGUY_DEFAULT_INT,
8531  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8532  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8533 
8534  /*l
8535  *b Description:
8536  **
8537  ** This function is similar to execute_1stage_gesture().
8538  **
8539  ** Stage 1 of a 2 stage gesture is a motion that begins the gesture
8540  ** and leads to the "peak" of the gesture.
8541  **
8542  ** Stage 2 of a 2 stage gesture is the motion that returns the
8543  ** gesture from the "peak" to the starting position.
8544  **
8545  ** n repetitions of a 2 stage gesture will repeat the stage 1 motion
8546  ** followed by the stage 2 motion n times.
8547  **
8548  ** This function will have no effect on a dead character (see
8549  ** die_now() and get_dead()).
8550  **
8551  *b Arguments:
8552  **
8553  *a gesture_name - name of the gesture of execute
8554  *a reps - how many times the gesture should be
8555  *a repeated; default is 1 if no duration
8556  *a is specified, or best fit if there is
8557  *a a duration specified
8558  *a stage1_duration - how long stage 1 of the gesture should take,
8559  *a i.e., how far into the gesture the "peak"
8560  *a will occur;
8561  *a default is such that no time scaling occurs
8562  *a stage2_duration - how long stage 2 of the gesture should take;
8563  *a default is such that no time scaling occurs
8564  *a channel_A_weight - the weight given to channel A of the
8565  *a gesture; ignored if the gesture does not
8566  *a have multiple channels
8567  **
8568  *b Returns:
8569  **
8570  ** 0 on success, -1 on failure
8571  */
8572  int execute_2stage_gesture(const char* gesture_name,
8573  int reps = DIGUY_DEFAULT_INT,
8574  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8575  float stage2_duration = DIGUY_DEFAULT_FLOAT,
8576  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8577 
8578  /*l
8579  *b Description:
8580  **
8581  ** This function is similar to execute_1stage_gesture().
8582  **
8583  ** Stage 1 of a 3 stage gesture is a motion that begins the gesture
8584  ** and leads to stage 2; e.g., raising the right arm in preparation
8585  ** for waving.
8586  **
8587  ** Stage 2 of a 3 stage gesture is a motion that can loop
8588  ** indefinitely; e.g., waving the right arm back and forth.
8589  **
8590  ** Stage 3 of a 3 stage gesture is the motion that ends the gesture;
8591  ** e.g., returning the right arm to the side of the body to complete
8592  ** the wave.
8593  **
8594  ** n repetitions of a 3 stage gesture will play the stage 1 motion
8595  ** once, followed by n reps of the stage 2 motion, followed by 1
8596  ** stage 3 motion.
8597  **
8598  ** This function will have no effect on a dead character (see
8599  ** die_now() and get_dead()).
8600  **
8601  *b Arguments:
8602  **
8603  *a gesture_name - name of the gesture of execute
8604  *a reps - how many times the gesture should be
8605  *a repeated; default is 1 if no duration
8606  *a is specified, or best fit if there is
8607  *a a duration specified
8608  *a stage1_duration - how long stage 1 of the gesture should take;
8609  *a default is such that no time scaling occurs
8610  *a stage2_duration - how long each repetition of stage 2 of the
8611  *a gesture should take;
8612  *a default is such that no time scaling occurs
8613  *a stage3_duration - how long stage 3 of the gesture should take;
8614  *a default is such that no time scaling occurs
8615  *a channel_A_weight - the weight given to channel A of the
8616  *a gesture; ignored if the gesture does not
8617  *a have multiple channels
8618  **
8619  *b Returns:
8620  **
8621  ** 0 on success, -1 on failure
8622  */
8623  int execute_3stage_gesture(const char* gesture_name,
8624  int reps = DIGUY_DEFAULT_INT,
8625  float stage1_duration = DIGUY_DEFAULT_FLOAT,
8626  float stage2_duration = DIGUY_DEFAULT_FLOAT,
8627  float stage3_duration = DIGUY_DEFAULT_FLOAT,
8628  float channel_A_weight = DIGUY_DEFAULT_FLOAT);
8629 
8630  /*l
8631  *b Description:
8632  **
8633  ** The gesture will automatically begin and end. The only control
8634  ** over the executed gesture is whether is should be ended or aborted
8635  ** early. See end_executing_gesture() and abort_executing_gesture().
8636  ** For full control of gesture attributes, use create_gesture()
8637  ** instead.
8638  **
8639  ** This function serves as a quick way of executing a table gesture.
8640  ** There are many capabilities of table gestures that are accessible
8641  ** only through the full diguyCharacterGesture object.
8642  **
8643  ** If the specified gesture is not a table gesture, no gesture is
8644  ** executed and an error value is returned.
8645  **
8646  ** A table stage gesture is a comprised of a table of gesture actions
8647  ** that can be transitioned between without going through a neutral
8648  ** position.
8649  **
8650  ** n repetitions of a table gesture will repeat the loop action
8651  ** n times.
8652  **
8653  ** This function will have no effect on a dead character (see
8654  ** die_now() and get_dead()).
8655  **
8656  *b Arguments:
8657  **
8658  *a gesture_name - name of the gesture of execute
8659  *a reps - how many times the gesture should be repeated;
8660  *a default is 1
8661  *a loop_action - which action in the gesture should be looped;
8662  *a default is action at index 1 of table
8663  *a begin_action - which action the gesture should begin from;
8664  *a default is action at index 0
8665  *a end_action - which action the gesture should end at;
8666  *a default is action at index 0
8667  **
8668  *b Returns:
8669  **
8670  ** 0 on success, -1 on failure
8671  */
8672  int execute_table_gesture(const char* gesture_name,
8673  int reps = DIGUY_DEFAULT_INT,
8674  const char* loop_action = NULL,
8675  const char* begin_action = NULL,
8676  const char* end_action = NULL);
8677 
8678  /*l
8679  *b Description:
8680  **
8681  ** Documentation Pending
8682  **/
8683  int set_executing_table_gesture_desired_action(const char* gesture_name,
8684  const char* desired_action);
8685 
8686  /*l
8687  *b Description:
8688  **
8689  ** This function alerts the specified gesture that it should end.
8690  ** The gesture will stop repeating and play its "out" motions as
8691  ** soon as possible.
8692  **
8693  ** In order to immediately stop the gesture, use the
8694  ** abort_executing_gesture() function.
8695  **
8696  *b Arguments:
8697  **
8698  *a gesture_name - name of executing gesture to end
8699  **
8700  *b Returns:
8701  **
8702  ** 0 on success, -1 on failure
8703  **
8704  *b See Also:
8705  **
8706  ** abort_executing_gesture()
8707  */
8708  int end_executing_gesture(const char* gesture_name);
8709 
8710  /*l
8711  *b Description:
8712  **
8713  ** This function aborts a gesture previously executed by one of
8714  ** the execute_*_gesture() calls, if it is currently executing.
8715  ** If a gesture with the given name is not executing, this function
8716  ** will have no effect.
8717  **
8718  ** This call won't cause the gesture to switch to its "out" motion;
8719  ** it is a straight-forward blend out of whatever the gesture is
8720  ** currently doing. Use the end_executing_gesture() call to make
8721  ** the gesture play its "out" motion as soon as possible,
8722  ** therefore ending the gesture in a smoother way.
8723  **
8724  *b Arguments:
8725  **
8726  *a gesture_name - name of executing gesture to abort
8727  *a max_rampdown_interval - max amount of time spent trying to
8728  *a smooth over any motion seams; set
8729  *a to 0.5 for a smooth transition, set
8730  *a to 0 for an immediate abort
8731  **
8732  *b Returns:
8733  **
8734  ** 0 on success, -1 on failure
8735  **
8736  *b See Also:
8737  **
8738  ** end_executing_gesture(), abort_all_gestures()
8739  */
8740  int abort_executing_gesture(const char* gesture_name,
8741  float max_rampdown_interval);
8742 
8743  /*l
8744  *b Description:
8745  **
8746  ** This function alerts all active gestures that they should end.
8747  ** The gestures will stop repeating and play their "out" motions as
8748  ** soon as possible.
8749  **
8750  ** In order to immediately stop all gestures, use the
8751  ** abort_all_gestures() function.
8752  **
8753  *b Returns:
8754  **
8755  ** 0 on success, -1 on failure
8756  **
8757  *b See Also:
8758  **
8759  ** abort_all_gestures(), diguyCharacterGesture::end_gesture()
8760  */
8761  int end_all_gestures();
8762 
8763  /*l
8764  *b Description:
8765  **
8766  ** This function aborts all active gestures. All gestures will
8767  ** immediately begin to lose their effect on the
8768  ** character's pose.
8769  **
8770  ** This won't cause the gestures to switch to their "out" motions;
8771  ** it is a straight-forward blend out of whatever the gesture is
8772  ** currently doing. Use the end_all_gestures() call to make all
8773  ** active gestures play their "out" motions as soon as possible,
8774  ** therefore ending the gestures in a smoother way.
8775  **
8776  *b Arguments:
8777  **
8778  *a max_rampdown_interval - max amount of time spent trying to
8779  *a smooth over any motion seams; set
8780  *a to 0.5 for a smooth transition, set
8781  *a to 0 for an immediate abort
8782  **
8783  *b Returns:
8784  **
8785  ** 0 on success, -1 on failure
8786  **
8787  *b See Also:
8788  **
8789  ** end_all_gestures(), diguyCharacterGesture::abort_now()
8790  */
8791  int abort_all_gestures(float max_rampdown_interval);
8792 
8793 
8794 /*****************************************************************************/
8826  /*l
8827  *b Description:
8828  **
8829  ** This function will play the specified sound. The sound will be
8830  ** "ambient"; i.e., it will be equally audible from everywhere within
8831  ** the world. Use the function play_3d_sound() to play a sound that
8832  ** moves with the character.
8833  **
8834  ** This function will have no effect on a dead character (see
8835  ** die_now() and get_dead()).
8836  **
8837  ** Unless the sound loops, the sound will play to completion and then
8838  ** stop. To stop the sound early or stop a looping sound call
8839  ** diguyCharacter::stop_all_sounds() or diguyCharacter::stop_sound().
8840  **
8841  *b Arguments
8842  **
8843  *a sound_name - name of sound to play
8844  *a sound_gain - by how much sound's amplitude should be multiplied
8845  *a sound_loop - indicates that sound should loop indefinitely
8846  **
8847  ** There must be a diguySound in the scenario with the passed
8848  ** sound_name. See diguyScenario::create_sound().
8849  **
8850  ** See set_current_voice_actor() for information on how a voice actor
8851  ** can change which sound in the scenario is selected.
8852  **
8853  *b Returns:
8854  **
8855  ** 0 on success, -1 on failure
8856  **
8857  *b Available as Decision Bead/Event
8858  */
8859  int play_sound(const char* sound_name,
8860  float sound_gain = 1.0f,
8861  int sound_loops = 0);
8862 
8863  /*l
8864  *b Description:
8865  **
8866  ** This function will play the specified sound at the character's
8867  ** location. As the character moves, the sound will move with it.
8868  ** Use the function play_sound() to play a sound that is ambient and
8869  ** does not move with the character.
8870  **
8871  ** Note that not all sound modules support 3D sounds.
8872  **
8873  ** This function will have no effect on a dead character (see
8874  ** die_now() and get_dead()).
8875  **
8876  ** Unless the sound loops, the sound will play to completion and then
8877  ** stop. To stop the sound early or stop a looping sound call
8878  ** diguyCharacter::stop_all_sounds() or diguyCharacter::stop_sound().
8879  **
8880  *b Arguments
8881  **
8882  *a sound_name - the name of the sound to play
8883  *a sound_gain - by how much the sound's amplitude
8884  *a should be multiplied
8885  *a sound_loop - indicates that the sound should loop
8886  *a indefinitely
8887  **
8888  ** There must be a diguySound in the scenario with the passed
8889  ** sound_name. See diguyScenario::create_sound().
8890  **
8891  ** See set_current_voice_actor() for information on how a voice actor
8892  ** can change which sound in the scenario is selected.
8893  **
8894  *b Returns:
8895  **
8896  ** 0 on success, -1 on failure
8897  **
8898  *b Available as Decision Bead/Event
8899  */
8900  int play_3d_sound(const char* sound_name,
8901  float sound_gain = 1.0f,
8902  int sound_loops = 0);
8903 
8904  /*l
8905  *b Description:
8906  **
8907  ** This function creates (but does not start playing) an instance of
8908  ** the specified sound.
8909  **
8910  ** Exact control over the sound instance is possible by making calls
8911  ** through the returned diguySoundInstance object.
8912  **
8913  ** To begin playing the sound, call diguySoundInstance::begin_now().
8914  **
8915  ** *Do not* call delete on the returned object. It should be
8916  ** destroyed either by calling diguyCharacter::destroy_sound_instance()
8917  ** or by calling diguySoundInstance::set_automatic_destroy_flag(1) on
8918  ** the returned object.
8919  **
8920  *b Arguments:
8921  **
8922  *a sound_name - name of the sound for which to create an instance
8923  **
8924  ** There must be a diguySound in the scenario with the passed
8925  ** sound_name. See diguyScenario::create_sound().
8926  **
8927  *b Returns:
8928  **
8929  ** pointer to object of type diguySoundInstance
8930  */
8931  diguySoundInstance* create_sound_instance(const char* sound_name);
8932 
8933  /*l
8934  *b Description:
8935  **
8936  ** This function destroys a sound instance object created by
8937  ** create_sound_instance().
8938  **
8939  ** Do not destroy a sound for which the
8940  ** diguySoundInstance::set_automatic_destroy_flag(1) has been called.
8941  **
8942  *b Arguments:
8943  **
8944  *a sound_instance - sound instance to destroy
8945  **
8946  *b Returns:
8947  **
8948  ** 0 on success, -1 on failure
8949  */
8950  int destroy_sound_instance(diguySoundInstance* sound_instance);
8951 
8952  /*l
8953  *b Description:
8954  **
8955  ** This function stops all active sound instances from this character.
8956  ** All sounds being played by this character will fade out and stop
8957  ** after rampdown_time, by default fade out is instant.
8958  **
8959  ** Sound instances that are automatically managed will be destroyed.
8960  ** This includes sound started by a call to
8961  ** diguyCharacter::play_sound() or a sound instance whose
8962  ** set_automatic_destroy_flag() function has been called.
8963  **
8964  ** diguySoundInstance pointers returned by a call to
8965  ** diguyCharacter::create_sound_instance(), which have not been set to
8966  ** be automatically destroyed, will still be valid.
8967  **
8968  *b Arguments:
8969  **
8970  *a rampdown_time - how long to fade out the sound
8971  **
8972  *b Returns:
8973  **
8974  ** 0 on success, -1 on failure
8975  **
8976  *b Available as Decision Bead/Event
8977  */
8978  int stop_all_sounds(float rampdown_time = 0.0f);
8979 
8980  /*l
8981  *b Description:
8982  **
8983  ** This function stops a named sound instance from this character.
8984  **
8985  ** Sound instances that are automatically managed will be destroyed.
8986  ** This includes sound started by a call to
8987  ** diguyCharacter::play_sound() or a sound instance whose
8988  ** set_automatic_destroy_flag() function has been called.
8989  **
8990  ** diguySoundInstance pointers returned by a call to
8991  ** diguyCharacter::create_sound_instance(), which have not been set to
8992  ** be automatically destroyed, will still be valid.
8993  **
8994  *b Arguments:
8995  **
8996  *a sound_name - the name of the sound to stop
8997  *a rampdown_time - how long to fade out the sound
8998  **
8999  *b Returns:
9000  **
9001  ** 0 on success, -1 on failure
9002  **
9003  *b Available as Decision Bead/Event
9004  */
9005  int stop_sound(const char* sound_name, float rampdown_time = 0.0f);
9006 
9007  /*l
9008  *b Returns:
9009  **
9010  ** 1 if the character is playing a the sound specified, 0 if not
9011  */
9012  int is_playing_sound(const char* sound_name);
9013 
9014  /*l
9015  *b Description:
9016  **
9017  ** Sets the "voice actor" for the character.
9018  **
9019  ** Having a voice actor can change which sounds from the scenario a
9020  ** character selects when the diguyCharacter::play_sound() or
9021  ** diguyCharacter::play_3d_sound().
9022  **
9023  ** When play_sound() is called the character asks the scenario for
9024  ** the sound with the specified name. If a voice actor has been set
9025  ** the character will first ask the scenario for the sound name
9026  ** prepended with the voice actor and a slash ("/"). If there isn't
9027  ** a sound with that modified name, it will ask the scenario for a
9028  ** sound with the exact specified name.
9029  **
9030  ** For example, if the character has the voice actor "carl" and is
9031  ** told to play the sound "run_away", the character will first look
9032  ** for a sound named "carl/run_away". If that isn't found, it will
9033  ** look for a sound named "run_away". (If that isn't found no sound
9034  ** is played.)
9035  **
9036  *b Lua Example:
9037  **
9038  ** A more specific example: say that various characters in the
9039  ** scenario need to say "hello". Some of the characters are male,
9040  ** some are female. There are two ways this can be set up.
9041  **
9042  ** The first way, not using a voice actor, is to have two sounds
9043  ** specified in the scenario: "male_hello" and "female_hello". These
9044  ** sounds specify the sound files "male_hello.wav" and
9045  ** "female_hello.wav", respectively. A male character would then do
9046  ** the following to say hello:
9047  **
9048  *e male_character:play_sound("male_hello")
9049  **
9050  ** A female character would do:
9051  **
9052  *e female_character:play_sound("female_hello")
9053  **
9054  ** This is fine, except when one script or character mind needs to be
9055  ** shared by a range of characters, some male and some female.
9056  **
9057  ** In this case it's better to use a voice actor. Say that the sounds
9058  ** specified above have the names "male/hello" and "female/hello";
9059  ** they still have the separate sound files specified. If the
9060  ** character has its voice actor specified as "male" and is told to
9061  ** play the sound "hello", it will select the sound "male/hello" as
9062  ** the sound to play. If its voice actor is "female" and is told to
9063  ** play the sound "hello", it will select the sound "female/hello".
9064  **
9065  *e -- called earlier: character:set_voice_actor("male")
9066  *e character:play_sound("hello") -- plays sound "male/hello"
9067  **
9068  *e -- called earlier: character:set_voice_actor("female")
9069  *e character:play_sound("hello") -- plays sound "female/hello"
9070  **
9071  *b Arguments:
9072  **
9073  *a voice_actor - name of voice actor
9074  **
9075  ** voice_actor can be an arbitrary string. It doesn't need to match
9076  ** any character name, but should have matching sounds specified in
9077  ** the scenario.
9078  **
9079  *b Returns:
9080  **
9081  ** 0 on success, -1 on failure
9082  */
9083  int set_current_voice_actor(const char* voice_actor);
9084 
9086  const char* get_current_voice_actor();
9087 
9088 
9089 /*****************************************************************************/
9125  /*l
9126  *b Description:
9127  **
9128  ** This function returns the state of the character in the form
9129  ** required by DIS.
9130  **
9131  ** Note that there is no corresponding set_DIS_lifeform_state()
9132  ** function. The lifeform state is derived from the character's
9133  ** action, posture, and variant information.
9134  **
9135  *b Returns:
9136  **
9137  ** one of the following values defined in diguy_dis_constants.h:
9138  **
9139  *- DIGUY_DIS_LIFEFORM_UNUSED (0)
9140  *- DIGUY_DIS_LIFEFORM_UPRIGHT_STANDING_STILL (1)
9141  *- DIGUY_DIS_LIFEFORM_UPRIGHT_WALKING (2)
9142  *- DIGUY_DIS_LIFEFORM_UPRIGHT_RUNNING (3)
9143  *- DIGUY_DIS_LIFEFORM_KNEELING (4)
9144  *- DIGUY_DIS_LIFEFORM_PRONE (5)
9145  *- DIGUY_DIS_LIFEFORM_CRAWLING (6)
9146  *- DIGUY_DIS_LIFEFORM_SWIMMING (7)
9147  *- DIGUY_DIS_LIFEFORM_PARACHUTING (8)
9148  *- DIGUY_DIS_LIFEFORM_JUMPING (9)
9149  *- DIGUY_DIS_LIFEFORM_SITTING (10)
9150  *- DIGUY_DIS_LIFEFORM_SQUATTING (11)
9151  *- DIGUY_DIS_LIFEFORM_CROUCHING (12)
9152  *- DIGUY_DIS_LIFEFORM_WADING (13)
9153  **
9154  *b Callable For Networked Entities That Are:
9155  **
9156  *- - DIS published and reflected
9157  */
9158  int get_DIS_lifeform_state();
9159 
9160  /*l
9161  *b Description:
9162  **
9163  ** This function returns the position of the character's
9164  ** primary weapon, in the form required by DIS.
9165  **
9166  *b Returns:
9167  **
9168  ** one of the following values defined in diguy_dis_constants.h:
9169  **
9170  *- DIGUY_DIS_PRIMARY_WEAPON_NOT_PRESENT (0)
9171  *- DIGUY_DIS_PRIMARY_WEAPON_STOWED (1)
9172  *- DIGUY_DIS_PRIMARY_WEAPON_DEPLOYED (2)
9173  *- DIGUY_DIS_PRIMARY_WEAPON_IN_FIRING_POSITION (3)
9174  **
9175  *b Callable For Networked Entities That Are:
9176  **
9177  *- - DIS published
9178  */
9179  int get_DIS_primary_weapon_position();
9180 
9181  /*l
9182  *b Description:
9183  **
9184  ** This function returns the position of the character's
9185  ** secondary weapon, in the form required by DIS.
9186  **
9187  *b Returns:
9188  **
9189  ** one of the following values defined in diguy_dis_constants.h:
9190  **
9191  *- DIGUY_DIS_SECONDARY_WEAPON_NOT_PRESENT (0)
9192  *- DIGUY_DIS_SECONDARY_WEAPON_STOWED (1)
9193  *- DIGUY_DIS_SECONDARY_WEAPON_DEPLOYED (2)
9194  *- DIGUY_DIS_SECONDARY_WEAPON_IN_FIRING_POSITION (3)
9195  **
9196  *b Callable For Networked Entities That Are:
9197  **
9198  *- - DIS published
9199  */
9200  int get_DIS_secondary_weapon_position();
9201 
9202  /*l
9203  *b Description:
9204  **
9205  ** This function sets the Marking Text for characters that are
9206  ** published to the network by DI-Guy Networking. The default
9207  ** network marking is the empty string "".
9208  **
9209  ** This function should only be called for published characters.
9210  ** The Marking Text is set internally for reflected characters.
9211  **
9212  *b Returns:
9213  **
9214  ** 0 on success, -1 on failure
9215  **
9216  *b Callable For Networked Entities That Are:
9217  **
9218  *- - DIS published
9219  *- - HLA published
9220  */
9221  int set_network_marking(const char* network_marking);
9222 
9223  /*l
9224  *b Description:
9225  **
9226  ** This function gets the Marking Text for characters.
9227  **
9228  ** For published characters this value will be what was most
9229  ** recently set by set_network_marking().
9230  **
9231  ** For reflected characters this value will be read from the
9232  ** reflected characters' entity state information.
9233  **
9234  *b Returns:
9235  **
9236  ** character's Marking Text; will never be NULL
9237  **
9238  *b Callable For Networked Entities That Are:
9239  **
9240  *- - DIS published and reflected
9241  *- - HLA published and reflected
9242  */
9243  const char* get_network_marking();
9244 
9245  /*l
9246  *b Description:
9247  **
9248  ** This function sets whether this character will be published
9249  ** by DI-Guy Networking. This value is persistent, and does
9250  ** not depend on whether there actually *is* currently a
9251  ** network connection.
9252  **
9253  ** The default is 1, the character is published.
9254  **
9255  ** This function should *not* be called for reflected characters.
9256  ** It affects to both DIS and HLA networking.
9257  **
9258  *b Returns:
9259  **
9260  ** 0 on success, -1 on failure
9261  **
9262  *b Callable For Networked Entities That Are:
9263  **
9264  *- - DIS published
9265  *- - HLA published
9266  */
9267  int set_is_network_published(int is_network_published);
9268 
9269  /*l
9270  *b Description:
9271  **
9272  ** This function returns whether the character is published
9273  ** by DI-Guy Networking. It will always return 0 for reflected
9274  ** characters.
9275  **
9276  ** This function can be called for any character.
9277  **
9278  *b Returns:
9279  **
9280  ** 1 if published, 0 if not
9281  **
9282  *b Available as Decision Bead/Event
9283  **
9284  *b Callable For Networked Entities That Are:
9285  **
9286  *- - DIS published and reflected
9287  *- - HLA published and reflected
9288  */
9289  int get_is_network_published();
9290 
9291  /*l
9292  *b Description:
9293  **
9294  ** Experimental function that returns a vrlink entity state repository,
9295  ** useful for adding additional information to a diguy that we don't usually
9296  ** model.
9297  */
9298  DtEntityStateRepository * get_vrlink_entity_state_repository();
9299 
9300  /*l
9301  *b Description:
9302  **
9303  ** This function returns whether the character is a
9304  ** reflected character created by DI-Guy Networking.
9305  **
9306  ** This function can be called for any character.
9307  **
9308  *b Returns:
9309  **
9310  ** 1 if reflected, 0 if not
9311  **
9312  *b Available as Decision Bead/Event
9313  **
9314  *b Callable For Networked Entities That Are:
9315  **
9316  *- - DIS published and reflected
9317  *- - HLA published and reflected
9318  */
9319  int get_is_network_reflected();
9320 
9321  /*l
9322  *b Description:
9323  **
9324  ** This function returns whether this character is in a
9325  ** "paused" state. This will only be true for reflected
9326  ** characters.
9327  **
9328  ** A reflected character will be paused if the network
9329  ** entity it is representing is paused; i.e., its personal
9330  ** timeline is not advancing. The most common case of this
9331  ** is when this character is reflecting a published character
9332  ** of a DI-Guy Scenario application that is in a paused or
9333  ** stopped state.
9334  **
9335  ** If DI-Guy Scenario, paused characters will remain frozen
9336  ** in their current postures.
9337  **
9338  *b Returns:
9339  **
9340  ** 1 if paused, 0 if not
9341  **
9342  *b Available as Decision Bead/Event
9343  */
9344  int get_is_network_paused();
9345 
9346  /*l
9347  *b Description:
9348  **
9349  ** Overrides built-in logic for network pausing, becomes end user's responsibility
9350  ** to manage
9351  */
9352  int set_is_network_paused(int paused);
9353 
9354  /*l
9355  *b Description:
9356  **
9357  ** This function returns the character's "network entity number".
9358  ** This number is valid and persistent regardless of whether the
9359  ** character is currently published.
9360  **
9361  ** This number is primarily used internally by DI-Guy Networking
9362  ** for creating entity IDs.
9363  **
9364  *b Returns:
9365  **
9366  ** character's network entity number
9367  **
9368  *b Callable For Networked Entities That Are:
9369  **
9370  *- - DIS published and reflected
9371  *- - HLA published and reflected
9372  */
9373  int get_network_entity_number();
9374 
9375  /*l
9376  *b Description:
9377  **
9378  ** This function returns the name of an action for a character,
9379  ** given the DIS damage state, lifeform state, primary weapon
9380  ** state, speed of the character, and direction of travel.
9381  ** Constants are all defined in diguy_dis_constants.h:
9382  **
9383  *b Arguments:
9384  **
9385  *a damage_state - one of the values listed below
9386  *a life_form_state - one of the values listed below
9387  *a primary_weapon_state - one of the values listed below
9388  *a speed - in meters/second
9389  *a forward - whether the action should move
9390  *a forward (pass 1), or backward (pass 0)
9391  **
9392  ** Valid values for damage_state:
9393  **
9394  *- - DIGUY_DIS_DAMAGE_NONE (0)
9395  *- - DIGUY_DIS_DAMAGE_SLIGHT (1)
9396  *- - DIGUY_DIS_DAMAGE_MODERATE (2)
9397  *- - DIGUY_DIS_DAMAGE_DESTROYED (3)
9398  **
9399  ** Valid values for life_form_state:
9400  **
9401  *- - DIGUY_DIS_LIFEFORM_UNUSED (0)
9402  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_STANDING_STILL (1)
9403  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_WALKING (2)
9404  *- - DIGUY_DIS_LIFEFORM_UPRIGHT_RUNNING (3)
9405  *- - DIGUY_DIS_LIFEFORM_KNEELING (4)
9406  *- - DIGUY_DIS_LIFEFORM_PRONE (5)
9407  *- - DIGUY_DIS_LIFEFORM_CRAWLING (6)
9408  *- - DIGUY_DIS_LIFEFORM_SWIMMING (7)
9409  *- - DIGUY_DIS_LIFEFORM_PARACHUTING (8)
9410  *- - DIGUY_DIS_LIFEFORM_JUMPING (9)
9411  *- - DIGUY_DIS_LIFEFORM_SITTING (10)
9412  *- - DIGUY_DIS_LIFEFORM_SQUATTING (11)
9413  *- - DIGUY_DIS_LIFEFORM_CROUCHING (12)
9414  *- - DIGUY_DIS_LIFEFORM_WADING (13)
9415  **
9416  ** Valid values for primary_weapon_state:
9417  **
9418  *- - DIGUY_DIS_PRIMARY_WEAPON_NOT_PRESENT (0)
9419  *- - DIGUY_DIS_PRIMARY_WEAPON_STOWED (1)
9420  *- - DIGUY_DIS_PRIMARY_WEAPON_DEPLOYED (2)
9421  *- - DIGUY_DIS_PRIMARY_WEAPON_IN_FIRING_POSITION (3)
9422  **
9423  ** Note that a backward motion can be requested in a couple of
9424  ** ways: either by passing a negative speed, or by passing
9425  ** 0 for the forward argument, or both.
9426  **
9427  *b Returns:
9428  **
9429  ** name of an action if a match is found, NULL if not
9430  **
9431  *b Callable For Networked Entities That Are:
9432  **
9433  *- - DIS published
9434  */
9435  const char* get_action_from_entity_state(int damage_state,
9436  int life_form_state,
9437  int primary_weapon_state,
9438  float speed,
9439  int forward);
9440 
9441  /*l
9442  *b Description:
9443  **
9444  ** Sets the damage state for the network published character.
9445  ** Depending on the appearance configuration info the character may automatically switch to a new appearance.
9446  **
9447  *b Arguments:
9448  **
9449  *a state - one of the values listed below
9450  **
9451  ** Valid values for state (defined in diguy_dis_constants.h):
9452  **
9453  *- - DIGUY_DIS_DAMAGE_NONE (0)
9454  *- - DIGUY_DIS_DAMAGE_SLIGHT (1)
9455  *- - DIGUY_DIS_DAMAGE_MODERATE (2)
9456  *- - DIGUY_DIS_DAMAGE_DESTROYED (3)
9457  **
9458  *b Callable For Networked Entities That Are:
9459  **
9460  *- - DIS published
9461  */
9462  void set_DIS_damage_state(int state);
9463 
9464  /*l
9465  *b Description:
9466  **
9467  ** Returns the damage state of a network published character.
9468  **
9469  *b Returns:
9470  **
9471  *a one of the values shown in set_DIS_damage_state()
9472  */
9473  int get_DIS_damage_state();
9474 
9475  /*l
9476  *b Description:
9477  **
9478  ** Returns the name of damage state appearances based on the base appearance of the character.
9479  ** NULL if the state isn't available.
9480  */
9481  const char * get_damage_state_appearance_name(int state);
9482 
9483  /*l
9484  *b Description:
9485  **
9486  ** Sets the smoke state for a network published character.
9487  ** Starts or stops the "smoke" and "engine_smoke" appearance
9488  ** effects as appropriate.
9489  **
9490  *b Arguments:
9491  **
9492  *a state - one of the values listed below
9493  **
9494  ** Valid values for state (defined in diguy_dis_constants.h):
9495  **
9496  *- - DIGUY_DIS_SMOKE_NOT_SMOKING (0)
9497  *- - DIGUY_DIS_SMOKE_SMOKE_PLUME (1)
9498  *- - DIGUY_DIS_SMOKE_ENGINE_SMOKE (2)
9499  *- - DIGUY_DIS_SMOKE_ENGINE_SMOKE_AND_SMOKE_PLUME (3)
9500  **
9501  *b Callable For Networked Entities That Are:
9502  **
9503  *- - DIS published
9504  */
9505  void set_DIS_smoke_state(int state);
9506 
9507  /*l
9508  *b Description:
9509  **
9510  ** Returns the smoke state of a network published character.
9511  **
9512  *b Returns:
9513  **
9514  *a one of the values shown in set_DIS_smoke_state()
9515  */
9516  int get_DIS_smoke_state();
9517 
9518  /*l
9519  *b Description:
9520  **
9521  ** Sets the flames state for a network published character.
9522  ** Starts or stops the "flames" appearance effect as appropriate.
9523  **
9524  *b Arguments:
9525  **
9526  ** state - one of the values listed below
9527  **
9528  ** Valid values for state (defined in diguy_dis_constants.h):
9529  **
9530  *- - DIGUY_DIS_FLAMES_NONE (0)
9531  *- - DIGUY_DIS_FLAMES_PRESENT (1)
9532  **
9533  *b Callable For Networked Entities That Are:
9534  **
9535  *- - DIS published
9536  */
9537  void set_DIS_flames_state(int state);
9538 
9539  /*l
9540  *b Description:
9541  **
9542  ** Returns the flames state of a network published character.
9543  **
9544  *b Returns:
9545  **
9546  *a one of the values shown in set_DIS_flames_state()
9547  */
9548  int get_DIS_flames_state();
9549 
9550  /*l
9551  *b Description:
9552  **
9553  ** Sets the power plant state for a network published character.
9554  ** Vehicle power plants default to being on.
9555  **
9556  *b Arguments:
9557  **
9558  ** state - one of the values listed below
9559  **
9560  ** Valid values for state (defined in diguy_dis_constants.h):
9561  **
9562  *- - DIGUY_DIS_POWER_PLANT_OFF (0)
9563  *- - DIGUY_DIS_POWER_PLANT_ON (1)
9564  **
9565  *b Callable For Networked Entities That Are:
9566  **
9567  *- - DIS published
9568  */
9569  void set_DIS_power_plant_state(int state);
9570 
9571  /*l
9572  *b Description:
9573  **
9574  ** Returns the power plant state of a network published character.
9575  **
9576  *b Returns:
9577  **
9578  *a one of the values shown in set_DIS_power_plant_state()
9579  */
9580  int get_DIS_power_plant_state();
9581 
9584  void set_emissivity(float r, float g, float b, float lerp_time = .25);
9585 
9588  void get_emissivity(float *r, float *g, float *b);
9589 
9590  /*l
9591  *b Description:
9592  **
9593  ** Sets the trailing effect state for a network published character.
9594  **
9595  *b Arguments:
9596  **
9597  ** state - one of the values listed below
9598  **
9599  ** Valid values for state (defined in diguy_dis_constants.h):
9600  **
9601  *- - DIGUY_DIS_TRAILING_EFFECT_NONE (0)
9602  *- - DIGUY_DIS_TRAILING_EFFECT_SMALL (1)
9603  *- - DIGUY_DIS_TRAILING_EFFECT_MEDIUM (2)
9604  *- - DIGUY_DIS_TRAILING_EFFECT_LARGE (3)
9605  **
9606  *b Callable For Networked Entities That Are:
9607  **
9608  *- - DIS published
9609  */
9610  void set_DIS_trailing_effect_state(int state);
9611 
9612  /*l
9613  *b Description:
9614  **
9615  ** Returns the trailing effect state of a network published
9616  ** character.
9617  **
9618  *b Returns:
9619  **
9620  *a one of the values shown in set_DIS_smoke_trail_state()
9621  */
9622  int get_DIS_trailing_effect_state();
9623 
9625  void set_head_lights_state(int state);
9626 
9628  int get_head_lights_state() const;
9629 
9631  void set_tail_lights_state(int state);
9632 
9634  int get_tail_lights_state() const;
9635 
9636 /*****************************************************************************/
9646  /*l
9647  *b Description:
9648  **
9649  ** This function will create a new active formation with this
9650  ** character as its leader. The formation followers will fall
9651  ** into the formation given by the formation name.
9652  **
9653  ** The formation is broken up, or disbanded, by calling
9654  ** break_formation().
9655  **
9656  *b Arguments:
9657  **
9658  *a formation_name - the name of the formation
9659  *a snap_to_position_flag - if 1, following characters will
9660  *a immediately snap to their assigned
9661  *a positions; otherwise following characters
9662  *a will move toward their assigned
9663  *a positions from their current positions
9664  *a break_existing_formations_flag - if 1, any formations this
9665  *a character is leading with be broken
9666  *a as if the break_formation() call were
9667  *a made
9668  **
9669  *b Returns:
9670  **
9671  ** 0 on success, -1 on failure
9672  **
9673  *b Available as Decision Bead/Event
9674  */
9675  int call_formation(const char* formation_name,
9676  int snap_to_position_flag = 0,
9677  int break_existing_formations_flag = 1);
9678 
9679  /*l
9680  *b Description:
9681  **
9682  ** This function breaks up a formation initiated by call_formation().
9683  **
9684  *b Arguments:
9685  **
9686  *a formation_name - the name of the formation to break;
9687  *a passing NULL or "(all)" will break all formations
9688  *a this character is leading
9689  **
9690  *b Returns:
9691  **
9692  ** 0 on success, -1 on failure
9693  **
9694  *b Available as Decision Bead/Event
9695  */
9696  int break_formation(const char* formation_name = NULL);
9697 
9698 
9699 /*****************************************************************************/
9707  /*l
9708  *b Description:
9709  **
9710  ** This function adds a copy of the specified scenario guide
9711  ** to the character. Any changes that are subsequently made
9712  ** to the added guide -- for example by a call to
9713  ** diguyCharacterGuide::set_algorithm_float_parameter() -- are
9714  ** private to this copy of the guide and will not affect others.
9715  **
9716  ** The guide will be enabled by default. Guides can be disabled
9717  ** by calling diguyCharacterGuide::set_guide_enabled(0), or by
9718  ** passing 1 for the argument automatically_disable_when_acquired.
9719  **
9720  ** Note that disabling a guide is not the same as removing it.
9721  ** Disabled guides are still a part of the character and can
9722  ** later be re-enabled by calling diguyCharacterGuide::set_enabled().
9723  **
9724  *b Arguments:
9725  **
9726  *a guide_name - name of guide to find and copy
9727  *a automatically_disable_when_acquired - set to 1 to have the guide
9728  *a be automatically disabled when it has acquired
9729  *a its target
9730  **
9731  *b Returns:
9732  **
9733  ** object of type diguyCharacterGuide; if a guide with guide_name
9734  ** is not found, returns NULL
9735  */
9736  diguyCharacterGuide* add_guide(const char* guide_name,
9737  int automatically_disable_when_acquired = 0);
9738 
9739  /*l
9740  *b Description:
9741  **
9742  ** This function creates a new guide and adds it to the character.
9743  **
9744  ** The guide will be enabled by default. Guides can be disabled
9745  ** by calling diguyCharacterGuide::set_guide_enabled(), or by
9746  ** passing 1 for the argument automatically_disable_when_acquired.
9747  **
9748  ** Important note: a new guide will always be created, even if one with
9749  ** the same name already exists
9750  **
9751  *b Arguments:
9752  **
9753  *a guide_name - name of guide to find and copy
9754  *a guide_algorithm - name of guide algorithm to be used
9755  *a automatically_disable_when_acquired - set to 1 to have the guide
9756  *a be automatically disabled when it has
9757  *a acquired its target
9758  **
9759  *b Returns:
9760  **
9761  ** object of type diguyCharacterGuide; if a guide with guide_name
9762  ** is not found, returns NULL
9763  */
9764  diguyCharacterGuide* create_guide(const char* guide_name,
9765  const char* guide_algorithm,
9766  int automatically_disable_when_acquired = 0);
9767 
9768  /*l
9769  *b Description:
9770  **
9771  ** Like create_guide(), but returns guide if it already exists
9772  **
9773  *b Arguments:
9774  **
9775  *a guide_name - name of guide to find and copy
9776  *a guide_algorithm - name of guide algorithm to be used
9777  *a automatically_disable_when_acquired - set to 1 to have the guide
9778  *a be automatically disabled when it has
9779  *a acquired its target
9780  **
9781  *b Returns:
9782  **
9783  ** object of type diguyCharacterGuide; if a guide with guide_name
9784  ** is not found, returns NULL
9785  */
9786  diguyCharacterGuide* find_or_create_guide(const char* guide_name,
9787  const char* guide_algorithm,
9788  int automatically_disable_when_acquired = 0);
9789 
9790  /*l
9791  *b Description:
9792  **
9793  ** This function returns a pointer to the specified guide
9794  ** of the character, if is exists.
9795  **
9796  *b Arguments:
9797  **
9798  *a guide_name - name of guide to find
9799  **
9800  *b Returns:
9801  **
9802  ** object of type diguyCharacterGuide; if a guide with guide_name
9803  ** is not found, returns NULL
9804  */
9805  diguyCharacterGuide* find_guide(const char* guide_name);
9806 
9807  /*l
9808  *b Description:
9809  **
9810  ** This function removes the specified guide from the
9811  ** character.
9812  **
9813  *b Arguments:
9814  **
9815  *a guide_name - name of the guide to remove; must match name
9816  *a used by add_guide() or create_guide() call
9817  **
9818  *b Returns:
9819  **
9820  ** 0 on success, -1 on failure
9821  */
9822  int remove_guide_with_name(const char* guide_name);
9823 
9824  /*l
9825  *b Description:
9826  **
9827  ** This function removes the specified guide from the
9828  ** character.
9829  **
9830  *b Arguments:
9831  **
9832  *a guide - object returned by add_guide() call
9833  **
9834  *b Returns:
9835  **
9836  ** 0 on success, -1 on failure
9837  */
9838  int remove_guide(diguyCharacterGuide* guide);
9839 
9840  /*l
9841  *b Description:
9842  **
9843  ** This function removes all guides from the character.
9844  **
9845  *b Returns:
9846  **
9847  ** 0 on success, -1 on failure
9848  */
9849  int remove_all_guides();
9850 
9851  /*l
9852  *b Description:
9853  **
9854  ** This function removes all guides that are disabled.
9855  **
9856  *b Returns:
9857  **
9858  ** 0 on success, -1 on failure
9859  */
9860  int remove_all_disabled_guides();
9861 
9862 
9863 /*****************************************************************************/
9873  /*l
9874  *b Description:
9875  **
9876  ** This function adds a "motion texture" to the character. A
9877  ** motion texture is a relatively long (usually 10 seconds or
9878  ** more) loop that will add natural-looking, low amplitude
9879  ** joint angle adjustments.
9880  **
9881  ** This function will have no effect on a dead character (see
9882  ** die_now() and get_dead()).
9883  **
9884  *b Arguments:
9885  **
9886  *a motex_name - name of the motion texture to add; see below
9887  *a texture_gain - the relative amplitude of the motion texture;
9888  *a higher numbers result in more pronounced
9889  *a movements
9890  *a end_previous_motex - flag denoting whether this motion texture
9891  *a replaces all previously added motion
9892  *a textures; pass 1 to end existing textures
9893  *a rampup_interval - how long, in seconds, to take ramping up
9894  *a into the motion texture
9895  **
9896  ** List of currently available motion textures:
9897  **
9898  *- - "default"
9899  *- - "motex_stand_casual"
9900  **
9901  ** If 1 is passed for the argument end_previous_motex, the
9902  ** rampup_interval argument will be used as the interval for
9903  ** ending existing motion textures.
9904  **
9905  *b Returns:
9906  **
9907  ** 0 on success, -1 on failure
9908  **
9909  */
9910  int add_motion_texture(const char* motex_name = "default",
9911  float texture_gain = 1.0f,
9912  int end_previous_motex = 1,
9913  float rampup_interval = 0.2f);
9914 
9915  /*l
9916  *b Description:
9917  **
9918  ** This function gradually ends any active motion textures added by
9919  ** add_motion_texture().
9920  **
9921  *b Arguments:
9922  **
9923  *a rampdown_interval - how long, in seconds, to take ending the
9924  *a motion texture
9925  **
9926  *b Returns:
9927  **
9928  ** 0 on success, -1 on failure
9929  */
9930  int end_motion_texture(float rampdown_interval = 0.2f);
9931 
9932  /*l
9933  *b Description:
9934  **
9935  ** This function sets an initial motion texture that should be
9936  ** used by the character whenever the character is loaded from
9937  ** a scenario or the character's scenario is reset.
9938  **
9939  ** The gain of the motion texture can be set by calling
9940  ** set_initial_motion_texture_gain(). The initial motion
9941  ** texture gain is 1.0 by default.
9942  **
9943  *b See Also:
9944  **
9945  ** add_motion_texture(), set_initial_motion_texture_gain()
9946  **
9947  *b Arguments:
9948  **
9949  *a motex_name - name of the motion texture
9950  **
9951  *b Returns:
9952  **
9953  ** 0 on success, -1 on failure
9954  */
9955  int set_initial_motion_texture(const char* motex_name);
9956 
9957  /*l
9958  *b Description:
9959  **
9960  ** This function returns the initial motion texture as set
9961  ** by a call to set_initial_motion_texture().
9962  **
9963  *b Returns:
9964  **
9965  ** name of initial motion texture
9966  */
9967  const char* get_initial_motion_texture();
9968 
9969  /*l
9970  *b Description:
9971  **
9972  ** This function sets the gain of the initial motion texture
9973  ** of the character. The initial motion texture can be set
9974  ** by calling set_initial_motion_texture().
9975  **
9976  *b Arguments:
9977  **
9978  *a motex_gain - gain of the motion texture; higher gains
9979  *a result in more pronounced motion
9980  **
9981  *b Returns:
9982  **
9983  ** 0 on success, -1 on failure
9984  */
9985  int set_initial_motion_texture_gain(float motex_gain);
9986 
9987  /*l
9988  *b Description:
9989  **
9990  ** This function returns the initial motion texture gain as set
9991  ** by a call to set_initial_motion_texture_gain().
9992  **
9993  *b Returns:
9994  **
9995  ** gain of initial motion texture
9996  */
9997  float get_initial_motion_texture_gain();
9998 
9999 
10000 /*****************************************************************************/
10010  /*l
10011  *b Description:
10012  **
10013  ** This function sets what type of "history" will be kept for the
10014  ** character.
10015  **
10016  ** If time is run backwards in a scenario, characters
10017  ** with history will replay the motions they performed at that
10018  ** time. Characters without history will stay frozen in place
10019  ** until time advances past the point from which it was run
10020  ** backwards.
10021  **
10022  ** The default is DIGUY_HISTORY_TYPE_NONE for characters created
10023  ** using the diguyScenario::create_character() function.
10024  ** Characters loaded from a .dss file will retain their history
10025  ** settings from the DI-Guy Scenario editing session.
10026  **
10027  *b Arguments:
10028  **
10029  *a history_type - history type to be used for the character
10030  **
10031  ** history_type should be one of the following values:
10032  **
10033  *i DIGUY_HISTORY_TYPE_NONE
10034  **
10035  ** This history type saves no history.
10036  **
10037  *i DIGUY_HISTORY_TYPE_COMPLETE
10038  **
10039  ** This history type saves all of a character's history.
10040  **
10041  ** The initial amount of history to be saved, before memory buffers
10042  ** need to be resized, can be set by the function
10043  ** set_history_size_t(). The size by which memory buffers grow each
10044  ** time they do need to get resized by be set by
10045  ** set_history_size_increment_t().
10046  **
10047  *i DIGUY_HISTORY_TYPE_FIRST
10048  **
10049  ** This history type is no longer supported. Characters from
10050  ** a .dss that have this history type will have their history
10051  ** type set to DIGUY_HISTORY_TYPE_COMPLETE.
10052  **
10053  *i DIGUY_HISTORY_TYPE_LAST
10054  **
10055  ** This history type is no longer supported. Characters from
10056  ** a .dss that have this history type will have their history
10057  ** type set to DIGUY_HISTORY_TYPE_COMPLETE.
10058  **
10059  *b Returns:
10060  **
10061  ** 0 on success, -1 on failure
10062  */
10063  int set_history_type(diguyHistoryType history_type);
10064 
10065  /*l
10066  *b Returns:
10067  **
10068  ** the current history type of the character; see
10069  ** set_history_type()
10070  */
10071  diguyHistoryType get_history_type();
10072 
10073  /*l
10074  *b Description:
10075  **
10076  ** This function sets the size of the character's history
10077  ** buffer, in seconds.
10078  **
10079  *b Arguments:
10080  **
10081  *a t - length of history buffer, in seconds
10082  **
10083  *b Returns:
10084  **
10085  ** 0 on success, -1 on failure
10086  */
10087  int set_history_size_t(float t);
10088 
10089  /*l
10090  *b Description:
10091  **
10092  ** This function returns the current history buffer size.
10093  ** See set_history_size_t().
10094  **
10095  *b Returns:
10096  **
10097  ** current history size
10098  */
10099  float get_history_size_t();
10100 
10101  /*l
10102  *b Description:
10103  **
10104  ** This function sets the size of the character's history
10105  ** buffer increment, in seconds.
10106  **
10107  *b Arguments:
10108  **
10109  *a t - length of history buffer increment, in seconds
10110  **
10111  *b Returns:
10112  **
10113  ** 0 on success, -1 on failure
10114  */
10115  int set_history_size_increment_t(float t);
10116 
10117  /*l
10118  *b Description:
10119  **
10120  ** This function returns the current history buffer size increment.
10121  ** See set_history_size_increment_t().
10122  **
10123  *b Returns:
10124  **
10125  ** current history size increment
10126  */
10127  float get_history_size_increment_t();
10128 
10129 
10130 /*****************************************************************************/
10140  /*l
10141  *b Description:
10142  **
10143  ** This function sets the desired posture of the character. This,
10144  ** along with the desired variant, is used primarily by some guides.
10145  ** Specifically, to help choose which actions are used to reach the
10146  ** desired position and orientation of the character.
10147  **
10148  ** Pass DIGUY_MOTION_POSTURE_ANY for there to be no desired posture.
10149  **
10150  *b Arguments:
10151  **
10152  *a posture - new desired posture
10153  */
10154  void set_desired_posture(diguyMotionPosture desired_posture);
10155 
10156  /*l
10157  *b Returns:
10158  **
10159  ** current desired posture of the character
10160  */
10161  diguyMotionPosture get_desired_posture();
10162 
10163  /*l
10164  *b Description:
10165  **
10166  ** This function sets the desired variant of the character. This,
10167  ** along with the desired posture, is used primarily by some guides.
10168  ** Specifically, to help choose which actions are used to reach the
10169  ** desired position and orientation of the character.
10170  **
10171  ** Pass DIGUY_MOTION_VARIANT_ANY for there to be no desired variant.
10172  **
10173  *b Arguments:
10174  **
10175  *a variant - new desired variant
10176  */
10177  void set_desired_variant(diguyMotionVariant desired_variant);
10178 
10180  diguyMotionVariant get_desired_variant();
10181 
10182  /*l
10183  *b Description:
10184  **
10185  ** This function looks up the character action that most closely
10186  ** matches the given criteria.
10187  **
10188  *b Arguments:
10189  **
10190  *a direction - the direction of travel relative to
10191  *a the character's facing direction
10192  *a posture - overall desired posture; pass
10193  *a DIGUY_MOTION_POSTURE_ANY
10194  *a to specify that any posture will do
10195  *a variant - overall desired variant; pass
10196  *a DIGUY_MOTION_VARIANT_ANY
10197  *a to specify that any variant will do
10198  *a speed - speed in meters per second
10199  *a comparison - how the passed speed should compare
10200  *a to the action's speed
10201  *a comparison_tolerance - tolerance of comparison
10202  *a match_posture_before_variant - pass 1 if posture should be matched
10203  *a before variant if an exact match is
10204  *a not found; pass 0 if variant should
10205  *a be matched before posture
10206  *a posture_alternate1 - if an exact match is not found, use this
10207  *a as the first alternate posture; pass
10208  *a DIGUY_MOTION_POSTURE_UNKNOWN
10209  *a to specify that no alternate should be used
10210  *a posture_alternate2 - if an exact match is not found, use this
10211  *a as the second alternate posture; pass
10212  *a DIGUY_MOTION_POSTURE_UNKNOWN
10213  *a to specify that no alternate should be used
10214  *a variant_alternate1 - if an exact match is not found, use this
10215  *a as the first alternate variant; pass
10216  *a DIGUY_MOTION_VARIANT_UNKNOWN
10217  *a to specify that no alternate should be used
10218  *a variant_alternate2 - if an exact match is not found, use this
10219  *a as the second alternate variant; pass
10220  *a DIGUY_MOTION_VARIANT_UNKNOWN
10221  *a to specify that no alternate should be used
10222  *a return_random_match - (Experimental) if multiple actions match the
10223  *a specified criteria randomly return one of
10224  *a them. Typically only used for still motions
10225  *a and restricted to EQUAL and NEAREST
10226  *a comparisons
10227  **
10228  ** The direction argument should be one of the following:
10229  **
10230  *- - DIGUY_MOTION_DIRECTION_NONE - does not move character
10231  *- - DIGUY_MOTION_DIRECTION_FORWARD - moves character forward
10232  *- - DIGUY_MOTION_DIRECTION_BACKWARD - moves character backward
10233  *- - DIGUY_MOTION_DIRECTION_LEFT - moves character left
10234  *- - DIGUY_MOTION_DIRECTION_RIGHT - moves character right
10235  *- - DIGUY_MOTION_DIRECTION_UP - moves character up
10236  *- - DIGUY_MOTION_DIRECTION_DOWN - moves character down
10237  *- - DIGUY_MOTION_DIRECTION_TURN_LEFT - turns character left
10238  *- - DIGUY_MOTION_DIRECTION_TURN_RIGHT - turns character right
10239  *- - DIGUY_MOTION_DIRECTION_NONLINEAR - moves character in
10240  *- multiple directions
10241  *- - DIGUY_MOTION_DIRECTION_LINEAR_OFFAXIS - moves character in a
10242  *- line, but not on any
10243  *- of the principle axes
10244  **
10245  ** Not every direction is supported by every character. If the
10246  ** character does not have any actions that move in the specified
10247  ** direction, the returned action will be NULL.
10248  **
10249  ** Use the calls diguyScenario::get_character_type_num_directions()
10250  ** and diguyScenario::get_character_type_direction_at_index() to
10251  ** enumerate which directions a character can travel.
10252  **
10253  ** The posture arguments should be one of the following:
10254  **
10255  *- - DIGUY_MOTION_POSTURE_UNKNOWN - unknown posture
10256  *- - DIGUY_MOTION_POSTURE_ANY - any posture; a wildcard
10257  *- - DIGUY_MOTION_POSTURE_UPRIGHT - upright posture; e.g., standing
10258  *- or walking
10259  *- - DIGUY_MOTION_POSTURE_CROUCHED - crouched posture; e.g., kneeling
10260  *- or walking low
10261  *- - DIGUY_MOTION_POSTURE_PRONE - prone posture; e.g., lying prone
10262  *- or crawling
10263  *- - DIGUY_MOTION_POSTURE_SITTING - sitting posture
10264  **
10265  ** The posture arguments specify the overall posture the action
10266  ** should have. Most characters have an upright posture.
10267  ** The other postures a character has is dependent on character type.
10268  ** Passing DIGUY_MOTION_POSTURE_ANY for the arguments posture,
10269  ** posture_alternate1, or posture_alternate2 means that the posture of
10270  ** the action should not be used to determine a match.
10271  **
10272  ** Use the calls diguyScenario::get_character_type_num_postures()
10273  ** and diguyScenario::get_character_type_posture_at_index() to
10274  ** enumerate which postures a specific character type has.
10275  **
10276  ** The variant arguments specify the overall mood the action should
10277  ** convey. Most characters have a "normal" variant. The other
10278  ** variants a character has is dependent on character type. Passing
10279  ** DIGUY_MOTION_VARIANT_ANY for the arguments variant,
10280  ** variant_alternate1, or variant_alternate2 means that the variant of
10281  ** the action should not be used to determine a match.
10282  **
10283  ** Use the calls diguyScenario::get_character_type_num_variants()
10284  ** and diguyScenario::get_character_type_variant_at_index() to
10285  ** enumerate which variants a specific character type has.
10286  **
10287  ** The comparison argument should be one of the following:
10288  **
10289  *- - DIGUY_PARAMETER_COMPARISON_EQUAL - matched action's speed
10290  *- must be within
10291  *- comparison_tolerance of
10292  *- passed speed
10293  *- - DIGUY_PARAMETER_COMPARISON_NEAREST - matched action's speed
10294  *- is closer than any other
10295  *- potential match's, but
10296  *- still within
10297  *- comparison_tolerance
10298  *- - DIGUY_PARAMETER_COMPARISON_GREATER - matched action's speed
10299  *- faster than passed speed,
10300  *- but still within
10301  *- comparison_tolerance
10302  *- - DIGUY_PARAMETER_COMPARISON_LESS - matched action's speed
10303  *- slower than passed speed,
10304  *- but still within
10305  *- comparison_tolerance
10306  *-
10307  ** The difference between DIGUY_PARAMETER_COMPARISON_EQUAL and
10308  ** DIGUY_PARAMETER_COMPARISON_NEAREST is largely in the
10309  ** value used for comparison_tolerance if DIGUY_DEFAULT_FLOAT is
10310  ** passed; the comparison_tolerance argument defaults to 0.001 for
10311  ** DIGUY_PARAMETER_COMPARISON_EQUAL, and 16384.0 for all
10312  ** other comparison types. Otherwise these two comparison types
10313  ** operate the same.
10314  **
10315  *b Returns:
10316  **
10317  ** name of an action if a match is found, NULL if not
10318  **
10319  *b C++ Example:
10320  **
10321  *e diguyCharacter* ch = scenario->get_character_at_index(0);
10322  *e const char* new_action;
10323  *e
10324  *e //
10325  *e // Get an action that moves forward in an upright posture,
10326  *e // whose speed move at least 2.0 meters per second:
10327  *e //
10328  *e new_action = ch->get_action_from_description(
10329  *e DIGUY_MOTION_DIRECTION_FORWARD,
10330  *e DIGUY_MOTION_POSTURE_UPRIGHT,
10331  *e DIGUY_MOTION_VARIANT_ANY,
10332  *e 2.0,
10333  *e DIGUY_PARAMETER_COMPARISON_GREATER, DIGUY_DEFAULT_FLOAT);
10334  *e
10335  *e //
10336  *e // Get an action that is standing still, with the variant
10337  *e // DIGUY_MOTION_VARIANT_READY. If no action has that variant,
10338  *e // try DIGUY_MOTION_VARIANT_AIM as variant_alternate1,
10339  *e // and DIGUY_MOTION_VARIANT_ANY as variant_alternate2:
10340  *e //
10341  *e new_action = ch->get_action_from_description(
10342  *e DIGUY_MOTION_DIRECTION_NONE,
10343  *e DIGUY_MOTION_POSTURE_ANY,
10344  *e DIGUY_MOTION_VARIANT_READY,
10345  *e 0.0,
10346  *e DIGUY_PARAMETER_COMPARISON_NEAREST, DIGUY_DEFAULT_FLOAT,
10347  *e 0,
10348  *e DIGUY_MOTION_POSTURE_UNKNOWN,
10349  *e DIGUY_MOTION_POSTURE_UNKNOWN,
10350  *e DIGUY_MOTION_VARIANT_AIM,
10351  *e DIGUY_MOTION_VARIANT_ANY);
10352  **
10353  */
10354  const char* get_action_from_description(diguyMotionDirection direction,
10355  diguyMotionPosture posture,
10356  diguyMotionVariant variant,
10357  float speed,
10359  float comparison_tolerance = DIGUY_DEFAULT_FLOAT,
10360  int match_posture_before_variant = 1,
10361  diguyMotionPosture posture_alternate1 = DIGUY_MOTION_POSTURE_UNKNOWN,
10362  diguyMotionPosture posture_alternate2 = DIGUY_MOTION_POSTURE_UNKNOWN,
10363  diguyMotionVariant variant_alternate1 = DIGUY_MOTION_VARIANT_UNKNOWN,
10364  diguyMotionVariant variant_alternate2 = DIGUY_MOTION_VARIANT_UNKNOWN,
10365  int return_random_match = 0);
10366 
10367  /*l
10368  *b Description:
10369  **
10370  ** This function is very similar to get_action_from_description(),
10371  ** but substitutes turn amount per action iteration for speed.
10372  **
10373  *b Arguments:
10374  **
10375  *a direction - the direction of travel relative to
10376  *a the character's facing direction
10377  *a posture - overall desired posture; pass
10378  *a DIGUY_MOTION_POSTURE_ANY
10379  *a to specify that any posture will do
10380  *a variant - overall desired variant; pass
10381  *a DIGUY_MOTION_VARIANT_ANY
10382  *a to specify that any variant will do
10383  *a turn_amount - how many degrees each iteration of the
10384  *a action should turn the character
10385  *a comparison - how the passed turn amount should compare
10386  *a to the action's turn amount
10387  *a comparison_tolerance - tolerance of comparison
10388  *a match_posture_before_variant - pass 1 if posture should be matched
10389  *a before variant if an exact match is
10390  *a not found; pass 0 if variant should
10391  *a be matched before posture
10392  *a posture_alternate1 - if an exact match is not found, use this
10393  *a as the first alternate posture; pass
10394  *a DIGUY_MOTION_POSTURE_UNKNOWN
10395  *a to specify that no alternate should be used
10396  *a posture_alternate2 - if an exact match is not found, use this
10397  *a as the second alternate posture; pass
10398  *a DIGUY_MOTION_POSTURE_UNKNOWN
10399  *a to specify that no alternate should be used
10400  *a variant_alternate1 - if an exact match is not found, use this
10401  *a as the first alternate variant; pass
10402  *a DIGUY_MOTION_VARIANT_UNKNOWN
10403  *a to specify that no alternate should be used
10404  *a variant_alternate2 - if an exact match is not found, use this
10405  *a as the second alternate variant; pass
10406  *a DIGUY_MOTION_VARIANT_UNKNOWN
10407  *a to specify that no alternate should be used
10408  **
10409  ** The direction argument should be one of the following:
10410  **
10411  *- - DIGUY_MOTION_DIRECTION_TURN_LEFT - turns character left
10412  *- - DIGUY_MOTION_DIRECTION_TURN_RIGHT - turns character right
10413  **
10414  ** Not every direction is supported by every character. If the
10415  ** character does not have any actions that move in the specified
10416  ** direction, the returned action will be NULL.
10417  **
10418  ** The turn amount argument should be a positive number.
10419  **
10420  ** Refer to get_action_from_description() for more information on
10421  ** other arguments.
10422  **
10423  *b Returns:
10424  **
10425  ** name of an action if a match is found, NULL if not
10426  **
10427  */
10428  const char* get_turning_action_from_description(diguyMotionDirection direction,
10429  diguyMotionPosture posture,
10430  diguyMotionVariant variant,
10431  float turn_amount,
10433  float comparison_tolerance = DIGUY_DEFAULT_FLOAT,
10434  int match_posture_before_variant = 1,
10435  diguyMotionPosture posture_alternate1 = DIGUY_MOTION_POSTURE_UNKNOWN,
10436  diguyMotionPosture posture_alternate2 = DIGUY_MOTION_POSTURE_UNKNOWN,
10437  diguyMotionVariant variant_alternate1 = DIGUY_MOTION_VARIANT_UNKNOWN,
10438  diguyMotionVariant variant_alternate2 = DIGUY_MOTION_VARIANT_UNKNOWN);
10439 
10440 
10441 /*****************************************************************************/
10451  /*l
10452  *b Returns:
10453  **
10454  ** number of variables the character has
10455  */
10456  int get_num_variables();
10457 
10458  /*l
10459  *b Returns:
10460  **
10461  ** pointer of type diguyVariable; NULL if no
10462  ** variable at the specified index
10463  **
10464  *b Arguments:
10465  **
10466  *a index - index of the variable; indices start at 0
10467  */
10468  diguyVariable* get_variable_at_index(int index);
10469 
10470  /*l
10471  *b Description:
10472  **
10473  ** This function returns a pointer to the specified variable.
10474  **
10475  *b Arguments:
10476  **
10477  *a name - name of variable to be found
10478  **
10479  *b Returns:
10480  **
10481  ** pointer of type diguyVariable; NULL if not found
10482  */
10483  diguyVariable* find_variable(const char* name);
10484 
10485  /*l
10486  *b Description:
10487  **
10488  ** This function finds the variable with the given name or
10489  ** creates it if it doesn't exist.
10490  **
10491  *b Arguments:
10492  **
10493  *a name - name of the variable to find or create
10494  **
10495  *b Returns:
10496  **
10497  ** pointer of type diguyVariable; should never be NULL
10498  */
10499  diguyVariable* find_or_create_variable(const char* name);
10500 
10501  /*l
10502  *b Description:
10503  **
10504  ** This function destroys the passed variable.
10505  **
10506  *b Arguments:
10507  **
10508  *a variable - pointer to a diguyVariable
10509  **
10510  *b Returns:
10511  **
10512  ** 0 on success, -1 on failure
10513  */
10514  int destroy_variable(diguyVariable* variable);
10515 
10516  /*l
10517  *b Returns:
10518  **
10519  ** 1 if variable is equal to passed value,
10520  ** 0 if not
10521  **
10522  *b Arguments:
10523  **
10524  *a varname - name of variable to compare
10525  *a value - value to compare against
10526  **
10527  *b Available as Decision Bead/Event
10528  */
10529  int variable_equal_to_int(const char* varname, int value);
10530 
10531  /*l
10532  *b Returns:
10533  **
10534  ** 1 if variable is greater than passed value,
10535  ** 0 if not
10536  **
10537  *b Arguments:
10538  **
10539  *a varname - name of variable to compare
10540  *a value - value to compare against
10541  **
10542  *b Available as Decision Bead/Event
10543  */
10544  int variable_greater_than_int(const char* varname, int value);
10545 
10546  /*l
10547  *b Returns:
10548  **
10549  ** 1 if variable is less than passed value,
10550  ** 0 if not
10551  **
10552  *b Arguments:
10553  **
10554  *a varname - name of variable to compare
10555  *a value - value to compare against
10556  **
10557  *b Available as Decision Bead/Event
10558  */
10559  int variable_less_than_int(const char* varname, int value);
10560 
10561  /*l
10562  *b Returns:
10563  **
10564  ** 1 if variable is equal to passed value,
10565  ** 0 if not
10566  **
10567  *b Arguments:
10568  **
10569  *a varname - name of variable to compare
10570  *a value - value to compare against
10571  **
10572  *b Available as Decision Bead/Event
10573  */
10574  int variable_equal_to_float(const char* varname, float value);
10575 
10576  /*l
10577  *b Returns:
10578  **
10579  ** 1 if variable is greater than passed value,
10580  ** 0 if not
10581  **
10582  *b Arguments:
10583  **
10584  *a varname - name of variable to compare
10585  *a value - value to compare against
10586  **
10587  *b Available as Decision Bead/Event
10588  */
10589  int variable_greater_than_float(const char* varname, float value);
10590 
10591  /*l
10592  *b Returns:
10593  **
10594  ** 1 if variable is less than passed value,
10595  ** 0 if not
10596  **
10597  *b Arguments:
10598  **
10599  *a varname - name of variable to compare
10600  *a value - value to compare against
10601  **
10602  *b Available as Decision Bead/Event
10603  */
10604  int variable_less_than_float(const char* varname, float value);
10605 
10606  /*l
10607  *b Returns:
10608  **
10609  ** 1 if variable is equal than passed value,
10610  ** 0 if not
10611  **
10612  *b Arguments:
10613  **
10614  *a varname - name of variable to compare
10615  *a value - value to compare against
10616  **
10617  *b Available as Decision Bead/Event
10618  */
10619  int variable_equal_to_string(const char* varname, const char* value);
10620 
10621  /*l
10622  *b Returns:
10623  **
10624  ** 1 if variable is greater than passed value (comes
10625  ** later alphabetically), 0 if not
10626  **
10627  *b Arguments:
10628  **
10629  *a varname - name of variable to compare
10630  *a value - value to compare against
10631  **
10632  *b Available as Decision Bead/Event
10633  */
10634  int variable_greater_than_string(const char* varname, const char* value);
10635 
10636  /*l
10637  *b Returns:
10638  **
10639  ** 1 if variable is less than passed value (comes
10640  ** sooner alphabetically), 0 if not
10641  **
10642  *b Arguments:
10643  **
10644  *a varname - name of variable to compare
10645  *a value - value to compare against
10646  **
10647  *b Available as Decision Bead/Event
10648  */
10649  int variable_less_than_string(const char* varname, const char* value);
10650 
10651  /*l
10652  *b Description:
10653  **
10654  ** This function decrements the variable by the passed amount.
10655  **
10656  *b Arguments:
10657  **
10658  *a varname - name of variable to modify
10659  *a value - amount to decrement
10660  **
10661  *b Returns:
10662  **
10663  ** 0 on success, -1 on failure
10664  **
10665  *b Available as Decision Bead/Event
10666  */
10667  int variable_decrement_value_as_int(const char* varname, int value = 1);
10668 
10669  /*l
10670  *b Description:
10671  **
10672  ** This function increments the variable by the passed amount.
10673  **
10674  *b Arguments:
10675  **
10676  *a varname - name of variable to modify
10677  *a value - amount to increment
10678  **
10679  *b Returns:
10680  **
10681  ** 0 on success, -1 on failure
10682  **
10683  *b Available as Decision Bead/Event
10684  */
10685  int variable_increment_value_as_int(const char* varname, int value = 1);
10686 
10687  /*l
10688  *b Description:
10689  **
10690  ** This function is a convenience function for setting the variable
10691  ** to a new integer value without retrieving the diguyVariable
10692  ** object.
10693  **
10694  *b Arguments:
10695  **
10696  *a varname - name of variable to modify
10697  *a value - new value
10698  *a create_if_doesnt_exist - pass 1 to create the variable if it
10699  *a doesn't exist
10700  **
10701  *b Returns:
10702  **
10703  ** 0 on success, -1 on failure
10704  **
10705  *b Available as Decision Bead/Event
10706  */
10707  int variable_set_value_as_int(const char* varname,
10708  int value,
10709  int create_if_doesnt_exist = 1);
10710 
10711  /*l
10712  *b Description:
10713  **
10714  ** Short form of variable_set_value_as_int().
10715  */
10716  int set_ivar(const char* varname,
10717  int value,
10718  int create_if_doesnt_exist = 1);
10719 
10720  /*l
10721  *b Description:
10722  **
10723  ** This function is a convenience function for retrieving the
10724  ** value of a variable without retrieving the diguyVariable
10725  ** object.
10726  **
10727  ** If the variable doesn't exist and create_if_doesnt_exist is
10728  ** 0, the returned value will be 0.
10729  **
10730  *b Arguments:
10731  **
10732  *a varname - name of variable to query
10733  *a create_if_doesnt_exist - pass 1 to create the variable if it
10734  *a doesn't exist
10735  **
10736  *b Returns:
10737  **
10738  ** value of variable as int
10739  */
10740  int get_ivar(const char* varname,
10741  int create_if_doesnt_exist = 1);
10742 
10743  /*l
10744  *b Description:
10745  **
10746  ** Similar to variable_set_value_as_int(), for sets a
10747  ** floating point value instead.
10748  */
10749  int variable_set_value_as_float(const char* varname,
10750  float value,
10751  int create_if_doesnt_exist = 1);
10752 
10753  /*l
10754  *b Description:
10755  **
10756  ** Short form of variable_set_value_as_float().
10757  */
10758  int set_fvar(const char* varname,
10759  float value,
10760  int create_if_doesnt_exist = 1);
10761 
10762  /*l
10763  *b Description:
10764  **
10765  ** Similar to variable_get_value_as_int(), for returns a
10766  ** floating point value instead.
10767  **
10768  ** If the variable doesn't exist and create_if_doesnt_exist is
10769  ** 0, the returned value will be 0.0.
10770  */
10771  float get_fvar(const char* varname,
10772  int create_if_doesnt_exist = 1);
10773 
10774  /*l
10775  *b Description:
10776  **
10777  ** Similar to variable_set_value_as_int(), for sets a
10778  ** string value instead.
10779  */
10780  int variable_set_value_as_string(const char* varname,
10781  const char* value,
10782  int create_if_doesnt_exist = 1);
10783 
10784  /*l
10785  *b Description:
10786  **
10787  ** Short form of variable_set_value_as_string().
10788  */
10789  int set_svar(const char* varname,
10790  const char* value,
10791  int create_if_doesnt_exist = 1);
10792 
10793  /*l
10794  *b Description:
10795  **
10796  ** Similar to variable_get_value_as_int(), for returns a
10797  ** string value instead.
10798  **
10799  ** If the variable doesn't exist and create_if_doesnt_exist is
10800  ** 0, the returned value will be "".
10801  */
10802  const char* get_svar(const char* varname,
10803  int create_if_doesnt_exist = 1);
10804 
10805 
10806 /*****************************************************************************/
10821  /*l
10822  *b Description:
10823  **
10824  ** This function returns a pointer to the label object of
10825  ** the character.
10826  **
10827  ** Currently character labels are only enabled in DI-Guy Scenario.
10828  **
10829  *b Returns:
10830  **
10831  ** pointer to the character's label
10832  */
10833  diguyViewLabel* get_name_label();
10834 
10835  /*l
10836  *b Description:
10837  **
10838  ** This function sets the text of the character's label.
10839  ** By default the label text matches the character's name.
10840  **
10841  ** Currently character labels are only enabled in DI-Guy Scenario.
10842  **
10843  *b Arguments:
10844  **
10845  *a label_text - new text for the label
10846  **
10847  *b Returns:
10848  **
10849  ** 0 on success, -1 on failure
10850  */
10851  int set_label_text(const char* label_text);
10852 
10853  /*l
10854  *b Description:
10855  **
10856  ** This function returns the character's label text.
10857  ** See set_label_text().
10858  **
10859  *b Returns:
10860  **
10861  ** current label text; the returned pointer will never be NULL
10862  */
10863  const char* get_label_text();
10864 
10865  /*l
10866  *b Description:
10867  **
10868  ** This function sets whether the label of this character
10869  ** is visible. This setting will only be taken into account
10870  ** if the visibility flag for Character Labels is set to
10871  ** "Per Object".
10872  **
10873  ** Currently character labels are only enabled in DI-Guy Scenario.
10874  **
10875  *b Arguments:
10876  **
10877  *a is_visible - pass 1 to show, pass 0 to hide
10878  **
10879  *b Returns:
10880  **
10881  ** 0 on success, -1 on failure
10882  */
10883  int set_label_is_visible(int is_visible);
10884 
10885  /*l
10886  *b Description:
10887  **
10888  ** This function returns the most recent setting of
10889  ** set_label_is_visible().
10890  **
10891  *b Returns:
10892  **
10893  ** 1 if visible, 0 if not
10894  */
10895  int get_label_is_visible();
10896 
10897  /*l
10898  *b Description:
10899  **
10900  ** This function sets the text color of the character's label. By
10901  ** default the label text color is opaque white.
10902  **
10903  ** Currently character labels are only enabled in DI-Guy Scenario.
10904  **
10905  *b Arguments:
10906  **
10907  *a r, g, b, a - the red, green, blue, and alpha
10908  *a components of the text color
10909  **
10910  ** An alpha component of 0 makes the text completely transparent.
10911  ** An alpha component of 1 makes the text completely opaque.
10912  ** Values in between result in varying levels of transparency.
10913  **
10914  *b Returns:
10915  **
10916  ** 0 on success, -1 on failure
10917  */
10918  int set_label_text_color(float r, float g, float b, float a);
10919 
10920  /*l
10921  *b Description:
10922  **
10923  ** Alternate version of set_label_text_color().
10924  */
10925  int set_label_text_color_vec4(const diguyVec4f & color);
10926 
10927  /*l
10928  *b Description:
10929  **
10930  ** This function returns, in the passed variable pointers, the
10931  ** most recent setting of set_label_text_color().
10932  **
10933  *b Returns:
10934  **
10935  ** 0 on success, -1 on failure
10936  */
10937  int get_label_text_color(float* r, float* g, float* b, float* a);
10938 
10939  /*l
10940  *b Description:
10941  **
10942  ** Alternate version of get_label_text_color().
10943  */
10944  diguyVec4f get_label_text_color_vec4();
10945 
10946  /*l
10947  *b Description:
10948  **
10949  ** This function sets the text shadow color of the character's label.
10950  ** By default the label text shadow color is gray.
10951  **
10952  ** Currently character labels are only enabled in DI-Guy Scenario.
10953  **
10954  *b Arguments:
10955  **
10956  *a r, g, b, a - the red, green, blue, and alpha
10957  *a components of the text shadow color
10958  **
10959  ** An alpha component of 0 makes the text completely transparent.
10960  ** An alpha component of 1 makes the text completely opaque.
10961  ** Values in between result in varying levels of transparency.
10962  **
10963  *b Returns:
10964  **
10965  ** 0 on success, -1 on failure
10966  */
10967  int set_label_text_shadow_color(float r, float g, float b, float a);
10968 
10969  /*l
10970  *b Description:
10971  **
10972  ** Alternate version of set_label_text_shadow_color().
10973  */
10974  int set_label_text_shadow_color_vec4(const diguyVec4f & color);
10975 
10976  /*l
10977  *b Description:
10978  **
10979  ** This function returns, in the passed variable pointers, the
10980  ** most recent setting of set_label_text_shadow_color().
10981  **
10982  *b Returns:
10983  **
10984  ** 0 on success, -1 on failure
10985  */
10986  int get_label_text_shadow_color(float* r, float* g, float* b, float* a);
10987 
10988  /*l
10989  *b Description:
10990  **
10991  ** Alternate version of get_label_text_shadow_color().
10992  */
10993  diguyVec4f get_label_text_shadow_color_vec4();
10994 
10995  /*l
10996  *b Description:
10997  **
10998  ** This function sets the whether the text shadow is visible.
10999  **
11000  *b Arguments:
11001  **
11002  *a visible - pass 1 to make shadow visible, 0 to make it invisible
11003  **
11004  *b Returns:
11005  **
11006  ** 0 on success, -1 on failure
11007  */
11008  int set_label_text_shadow_is_visible(int is_visible);
11009 
11010  /*l
11011  *b Returns:
11012  **
11013  ** 1 if text shadow is visible, 0 if not
11014  */
11015  int get_label_text_shadow_is_visible();
11016 
11017  /*l
11018  *b Description:
11019  **
11020  ** This function sets the background color of the character's
11021  ** label. By default the label background color is transparent
11022  ** blue.
11023  **
11024  ** Currently character labels are only enabled in DI-Guy Scenario.
11025  **
11026  *b Arguments:
11027  **
11028  *a r, g, b, a - the red, green, blue, and alpha
11029  *a components of the text color
11030  **
11031  ** An alpha component of 0 makes the text completely transparent.
11032  ** An alpha component of 1 makes the text completely opaque.
11033  ** Values in between result in varying levels of transparency.
11034  **
11035  *b Returns:
11036  **
11037  ** 0 on success, -1 on failure
11038  */
11039  int set_label_background_color(float r, float g, float b, float a);
11040 
11041  /*l
11042  *b Description:
11043  **
11044  ** Alternate version of set_label_background_color().
11045  */
11046  int set_label_background_color_vec4(const diguyVec4f & color);
11047 
11048  /*l
11049  *b Description:
11050  **
11051  ** This function returns, in the passed variable pointers, the
11052  ** most recent setting of set_label_background_color().
11053  **
11054  *b Returns:
11055  **
11056  ** 0 on success, -1 on failure
11057  */
11058  int get_label_background_color(float* r, float* g, float* b, float* a);
11059 
11060  /*l
11061  *b Description:
11062  **
11063  ** Alternate version of get_label_background_color().
11064  */
11065  diguyVec4f get_label_background_color_vec4();
11066 
11067  /*l
11068  *b Description:
11069  **
11070  ** This function sets how high the label of the character will float
11071  ** above the character.
11072  **
11073  *b Arguments:
11074  **
11075  *a offset - offset, in meters, of label above character
11076  */
11077  void set_label_link_offset_override(float offset);
11078 
11079  /*l
11080  *b Returns:
11081  **
11082  ** how high the label of the character will float above the character
11083  */
11084  float get_label_link_offset_override();
11085 
11086  /*l
11087  *b Description:
11088  **
11089  ** This function sets whether the label text should show some basic
11090  ** state information about the character instead of its name or
11091  ** the text set by set_label_text().
11092  **
11093  ** The state shown is: Character name, current path, current action.
11094  ** The current path and current action will change as the character
11095  ** moves through paths and actions.
11096  **
11097  *b Arguments:
11098  **
11099  *a show_state - pass 1 to show state, 0 to show original text
11100  */
11101  int set_label_shows_character_state(int show_state);
11102 
11103  /*l
11104  *b Returns:
11105  **
11106  ** whether character state information is shown instead of the
11107  ** character's name or other label text
11108  */
11109  int get_label_shows_character_state();
11110 
11111 
11112 /*****************************************************************************/
11125  /*l
11126  *b Returns:
11127  **
11128  ** pointer of type diguyImpact; NULL if there has been no recent
11129  ** impact recorded; useful for finding out who or what was hit
11130  */
11131  diguyImpact* get_last_impact_record();
11132 
11133  /*l
11134  *b Returns:
11135  **
11136  ** the last impact number
11137  */
11138  int get_last_impact_number();
11139 
11140  /*l
11141  *b Returns:
11142  **
11143  ** the processed flag on the diguyImpact class
11144  */
11145  int get_last_impact_been_processed();
11146 
11147  /*l
11148  *b Description:
11149  **
11150  ** Sets the processed flag on the diguyImpact object.
11151  */
11152  void set_last_impact_been_processed();
11153 
11154  /*l
11155  *b Description:
11156  **
11157  ** Sets the maximum number of unprocessed impacts there can be.
11158  **
11159  ** The unprocessed impact array is a first-in-first-out queue. If an
11160  ** impact occurs that pushes the number of unprocessed impacts past
11161  ** this maximum number, earlier impacts will be dropped from the
11162  ** array.
11163  **
11164  ** The initial value is 10.
11165  */
11166  void set_max_unprocessed_impacts(int max_unprocessed_impacts);
11167 
11168  /*l
11169  *b Returns:
11170  **
11171  ** maximum number of unprocessed impacts
11172  */
11173  int get_max_unprocessed_impacts();
11174 
11175  /*l
11176  *b Returns:
11177  **
11178  ** the last impact link
11179  */
11180  const char* get_last_impact_link();
11181 
11182  /*l
11183  *b Returns:
11184  **
11185  ** 1 if the last impact link is the link named
11186  */
11187  int get_last_impact_link_is(const char* link_name);
11188 
11189  /*l
11190  *b Returns:
11191  **
11192  ** 1 if the last impact resulted from an impact with a vehicle,
11193  ** 0 if not
11194  */
11195  int get_last_impact_is_from_vehicle();
11196 
11197  /*l
11198  *b Returns:
11199  **
11200  ** 1 if the last impact speed is greater than the passed speed,
11201  ** 0 if not
11202  */
11203  int get_last_impact_speed_is_greater_than(float impact_speed);
11204 
11205  /*l
11206  *b Description:
11207  **
11208  ** Sets if impacts are ever processed on this character.
11209  ** Useful for temporary effects and the like.
11210  */
11211  void set_is_immune_to_impacts(int immune);
11212 
11213  /*l
11214  *b Returns:
11215  **
11216  ** 1 if the character is immune to impacts
11217  ** 0 if not
11218  */
11219  int get_is_immune_to_impacts();
11220 
11221 
11222 /*****************************************************************************/
11244  /*l
11245  *b Description:
11246  **
11247  ** This function starts the specified appearance effect on
11248  ** the character.
11249  **
11250  ** The following appearance effects are available:
11251  **
11252  *- - "brake_lights"
11253  *- - "debris"
11254  *- - "debris_dark"
11255  *- - "dust"
11256  *- - "engine_smoke"
11257  *- - "explosion"
11258  *- - "explosion_dark"
11259  *- - "flames"
11260  *- - "flashing_lights"
11261  *- - "ground_dust_burst"
11262  *- - "headlights"
11263  *- - "rotor_wash"
11264  *- - "smoke"
11265  *- - "smoke_dark"
11266  *- - "smoke_trail"
11267  **
11268  *b Arguments:
11269  **
11270  *a effect - name of appearance effect to be started
11271  *a override_link - link to attach to; overrides default
11272  *a override_scale - scale to use for effect; overrides default
11273  *a override_offset_x - x offset to use for effect; overrides default
11274  *a override_offset_y - y offset to use for effect; overrides default
11275  *a override_offset_z - z offset to use for effect; overrides default
11276  *a override_duration - overrides how long the effect should show
11277  *a before automatically ending
11278  **
11279  *b Returns:
11280  **
11281  ** 0 on success, -1 on failure
11282  **
11283  *b Available as Decision Bead/Event
11284  */
11285  int begin_appearance_effect(const char* effect,
11286  const char* override_link = NULL,
11287  float override_scale = DIGUY_DEFAULT_FLOAT,
11288  float override_offset_x = DIGUY_DEFAULT_FLOAT,
11289  float override_offset_y = DIGUY_DEFAULT_FLOAT,
11290  float override_offset_z = DIGUY_DEFAULT_FLOAT,
11291  float override_duration = DIGUY_DEFAULT_FLOAT);
11292 
11293  /*l
11294  *b Description:
11295  **
11296  ** This function ends the specified appearance effect on the
11297  ** character.
11298  **
11299  ** The active particles of the effect will go to completion. Use
11300  ** stop_all_appearance_effects() to immediately stop effects,
11301  ** including their active particles.
11302  **
11303  ** If the effect hasn't been started, nothing happens.
11304  **
11305  *b Arguments:
11306  **
11307  *a effect - name of appearance effect to be ended
11308  *a override_link - optional override link effect is attached to
11309  **
11310  ** Pass "all" for the effect argument to end all of this character's
11311  ** appearance effects.
11312  **
11313  *b Returns:
11314  **
11315  ** 0 on success, -1 on failure
11316  **
11317  *b Available as Decision Bead/Event
11318  */
11319  int end_appearance_effect(const char* effect,
11320  const char* override_link = NULL);
11321 
11322  /*l
11323  *b Description:
11324  **
11325  ** This function stops the specified appearance effect on the
11326  ** character.
11327  **
11328  ** The active particle systems of the effect will immediately be
11329  ** removed. Use end_appearance_effect() to gradually stop effects;
11330  ** that function lets active particles move to completion.
11331  **
11332  ** If the effect hasn't been started, nothing happens.
11333  **
11334  *b Arguments:
11335  **
11336  *a effect - name of appearance effect to be ended
11337  *a override_link - optional override link effect is attached to
11338  **
11339  ** Pass "all" for the effect argument to stop all of this character's
11340  ** appearance effects.
11341  **
11342  *b Returns:
11343  **
11344  ** 0 on success, -1 on failure
11345  **
11346  *b Available as Decision Bead/Event
11347  */
11348  int stop_appearance_effect(const char* effect,
11349  const char* override_link = NULL);
11350 
11351  /*l
11352  *b Description:
11353  **
11354  ** Equivalent to stop_appearance_effect("all");
11355  */
11356  int stop_all_appearance_effects();
11357 
11358  /*l
11359  *b Description:
11360  **
11361  ** This function checks to see if the specified appearance effect
11362  ** has been started with begin_appearance_effect().
11363  **
11364  *b Arguments:
11365  **
11366  *a effect - name of appearance effect to check
11367  *a override_link - optional override link effect is attached to
11368  **
11369  *b Returns:
11370  **
11371  ** 1 if appearance is active, 0 if not
11372  */
11373  int appearance_effect_is_active(const char* effect,
11374  const char* override_link = NULL);
11375 
11376 
11377 /*****************************************************************************/
11390  /*l
11391  *b Description:
11392  **
11393  ** This function returns a pointer to a diguyChainSimulation if the
11394  ** character is a chain_simulation type of character.
11395  **
11396  *b Returns:
11397  **
11398  ** pointer to a diguyChainSimulation
11399  */
11400  diguyChainSimulation* get_chain_simulation();
11401 
11402 
11403 /*****************************************************************************/
11416  /*l
11417  *b Description:
11418  **
11419  ** This function returns a pointer to a diguyVehicleController if the
11420  ** character has one.
11421  **
11422  *b Returns:
11423  **
11424  ** pointer to a diguyVehicleController; may return NULL if character
11425  ** does not have a vehicle controller object
11426  */
11427  diguyVehicleController* get_vehicle_controller();
11428 
11429  /*l
11430  *b Description:
11431  **
11432  ** For most characters playing a travel forward action, the
11433  ** character's facing direction matches the direction of travel. For
11434  ** example, when humans walk forward their pelvis is generally
11435  ** aligned in the direction of travel.
11436  **
11437  ** Some vehicle characters behave differently. For vehicles whose
11438  ** front wheels steer, when turning the vehicle body will pivot around
11439  ** the rear axle. Only gradually will the rear of the vehicle swing
11440  ** in behind the direction of travel. Think of a car making a very
11441  ** sharp turn, and how the rear of the car swings in behind the front
11442  ** as the turn is completed.
11443  **
11444  ** This function will return the orientation of the body of the
11445  ** vehicle; i.e., the orientation of the forward vector along the
11446  ** vehicle's long axis. As mentioned above this may be different
11447  ** than the orientation of the direction of travel.
11448  **
11449  ** This function will return valid results for all characters, though
11450  ** the returned values from this function and that of
11451  ** get_orientation() will be the same for non-vehicle characters.
11452  **
11453  *b Returns:
11454  **
11455  ** 0 on success, -1 on failure
11456  */
11457  int get_vehicle_body_orientation(float* rz, float* rx, float* ry);
11458 
11459 
11460 /*****************************************************************************/
11477  /*l
11478  *b Description:
11479  **
11480  ** This function sets the name of the shader program that will be
11481  ** used by the character when the scenario is using the specified
11482  ** render mode. See diguyScenario::set_current_render_mode().
11483  **
11484  ** Note that care should be taken when changing the shader of
11485  ** characters with skinned appearances. A shader capable of properly
11486  ** transforming vertices must be used for such characters.
11487  **
11488  ** The shader with the given name should be loaded first. If the
11489  ** shader program is not one of DI-Guy's stock shaders, a custom
11490  ** shader program can be loaded explicitly by calling
11491  ** the diguyApp::load_shader_program() function.
11492  **
11493  *b NOTE:
11494  **
11495  ** The specified shader program may not take effect immediately,
11496  ** if the scenario's current render mode is different than the
11497  ** passed render mode. See
11498  ** diguyScenario::set_current_render_mode().
11499  **
11500  *b Arguments:
11501  **
11502  *a shader_name - shader program name; can be NULL
11503  *a render_mode - render mode to modify; passing NULL will
11504  *a modify shader "normal" render mode
11505  **
11506  *b Returns:
11507  **
11508  ** 0 on success, -1 on failure
11509  */
11510  int set_render_mode_shader(const char* shader_name,
11511  const char* render_mode = NULL);
11512 
11513  /*l
11514  *b Description:
11515  **
11516  ** This function resets the shader program for the specified render
11517  ** mode to its default. This will be the shader program name
11518  ** returned by
11519  ** diguyScenario::get_default_character_shader_program_name().
11520  **
11521  ** If the specified render mode is the current scenario render mode,
11522  ** the current shader will change immediately. If not, the change
11523  ** will not take effect until the specified render mode becomes the
11524  ** current scenario render mode. See
11525  ** diguyScenario::set_current_render_mode().
11526  **
11527  *b Arguments:
11528  **
11529  *a render_mode - render mode to modify; passing NULL will
11530  *a modify shader of "normal" render mode
11531  */
11532  void reset_render_mode_shader_to_default(const char* render_mode = NULL);
11533 
11534  /*l
11535  *b Description:
11536  **
11537  ** This function returns the name of the shader that will be used by
11538  ** the character when the scenario is using the specified render
11539  ** mode.
11540  **
11541  *b Arguments:
11542  **
11543  *a render_mode - render mode for which to get program name;
11544  *a pass NULL for "normal" render mode
11545  **
11546  *b Returns:
11547  **
11548  ** name of shader program; NULL if none or error
11549  */
11550  const char* get_render_mode_shader(const char* render_mode = NULL);
11551 
11552  /*l
11553  *b Description:
11554  **
11555  ** This function returns the shader program that is in use by the
11556  ** character. Shader programs are shared objects that can be used
11557  ** by multiple characters.
11558  **
11559  *b Returns:
11560  **
11561  ** object of type diguyGraphicsShaderProgram; NULL if none
11562  */
11563  diguyGraphicsShaderProgram* get_shader_program();
11564 
11565  /*l
11566  *b Description:
11567  **
11568  ** This function overrides the current shader with the specified
11569  ** temporary shader. This temporary shader will remain in effect
11570  ** until:
11571  **
11572  *- - the scenario is reset
11573  *- - reset_current_shader_to_default() is called
11574  *- - set_temporary_current_shader() is called with NULL
11575  **
11576  *b Arguments:
11577  **
11578  *a shader_name - shader name; can be NULL
11579  **
11580  ** Passing NULL for the shader name will un-set the temporary shader,
11581  ** resetting the render mode shader to its default.
11582  **
11583  *b Returns:
11584  **
11585  ** 0 on success, -1 on failure
11586  */
11587  int set_temporary_current_shader(const char* shader_name);
11588 
11589  /*l
11590  *b Description:
11591  **
11592  ** This is a convenience function for resetting the current render
11593  ** mode shader to its default.
11594  **
11595  ** It is equivalent to retrieving the current render mode using
11596  ** diguyScenario::get_current_render_mode(), and calling
11597  ** reset_render_mode_shader_to_default() with that render mode.
11598  */
11599  void reset_current_shader_to_default();
11600 
11601  /*l
11602  *b Description:
11603  **
11604  ** This is a convenience function for refreshing the shader
11605  ** of a character. Usually used in conjunction with logic
11606  ** provided by the user with the graphics API.
11607  */
11608  void trigger_shader_refresh();
11609 
11610  /*l
11611  *b Description:
11612  **
11613  ** This function returns the shader instance that is in use by the
11614  ** character. Each character has its own shader instance.
11615  **
11616  ** Note that the shader instance of a character can change over the
11617  ** lifetime of the character. For example, it will change if the
11618  ** appearance of the character changes. Therefore the returned
11619  ** pointer should not be stored, but should be re-read each time
11620  ** it is needed.
11621  **
11622  *b Returns:
11623  **
11624  ** object of type diguyGraphicsShaderInstance; NULL if none
11625  */
11626  diguyGraphicsShaderInstance* get_shader_instance();
11627 
11628  /*l
11629  *b Description:
11630  **
11631  ** This function resets current values of the variables of the shader
11632  ** back to their initial reset values.
11633  */
11634  void reset_shader_instance_variables_to_initial_values();
11635 
11636  /*l
11637  *b Description:
11638  **
11639  ** This function resets the current and initial values of variables
11640  ** of the shader to the built-in DI-Guy configuration defaults.
11641  */
11642  void reset_shader_instance_variables_to_program_defaults();
11643 
11644 
11645 /*****************************************************************************/
11669  /*l
11670  *b Description:
11671  **
11672  ** This function sets the named character as the attack
11673  ** target of this agent. This agent will pursue the
11674  ** target until it is within range, and then will fire its
11675  ** weapon in an attempt to kill the target.
11676  **
11677  ** This function will implicitly put this agent into the
11678  ** attack behavior.
11679  **
11680  ** The current focus character will be set the specified character.
11681  ** Pass NULL or the empty string ("") to not change the focus
11682  ** character, but still change to the pursue behavior.
11683  **
11684  ** The current focus group will be un-set.
11685  **
11686  *b Arguments:
11687  **
11688  *a character_name - character to attack
11689  **
11690  *b Returns:
11691  **
11692  ** 0 on success, -1 on failure
11693  **
11694  *b Available as Decision Bead/Event
11695  */
11696  int agent_attack_character(const char* character_name);
11697 
11698  /*l
11699  *b Description:
11700  **
11701  ** This function is similar to agent_attack_character(), but instead
11702  ** will choose attack targets from the characters in the specified
11703  ** group.
11704  **
11705  ** This function will implicitly put this agent into the attack
11706  ** behavior.
11707  **
11708  ** The current focus group will be set to the specified group. Pass
11709  ** NULL or the empty string ("") to not change the focus group, but
11710  ** still change to the attack behavior.
11711  **
11712  ** The current focus character will be un-set.
11713  **
11714  *b Arguments:
11715  **
11716  *a group_name - name of group from which attack targets should
11717  *a be chosen
11718  **
11719  *b Returns:
11720  **
11721  ** 0 on success, -1 on failure
11722  **
11723  *b Available as Decision Bead/Event
11724  */
11725  int agent_attack_group(const char* group_name);
11726 
11727  /*l
11728  *b Description:
11729  **
11730  ** See diguyAgentParams::set_attack_zone_enabled().
11731  */
11732  int agent_set_attack_zone_enabled(int use_attack_zone);
11733 
11734  /*l
11735  *b Description:
11736  **
11737  ** See diguyAgentParams::get_attack_zone_enabled().
11738  */
11739  int agent_get_attack_zone_enabled();
11740 
11741  /*l
11742  *b Description:
11743  **
11744  ** See diguyAgentParams::set_attack_zone().
11745  */
11746  int agent_set_attack_zone(float x, float y, float z, float radius);
11747 
11748  /*l
11749  *b Description:
11750  **
11751  ** See diguyAgentParams::get_attack_zone().
11752  */
11753  int agent_get_attack_zone(float* x, float* y, float* z, float* radius);
11754 
11761  /*l
11762  *b Description:
11763  **
11764  ** This function adds a flee object to this agent.
11765  ** This agent will attempt to move away from the specified
11766  ** character until it is beyond the specified flee distance.
11767  **
11768  ** Note: Currently there can only be one flee object. This
11769  ** restriction will be lifted in a future version.
11770  **
11771  ** This function will implicitly put this agent into the
11772  ** flee behavior.
11773  **
11774  ** Neither the current focus character nor group will be
11775  ** changed by this function.
11776  **
11777  *b Arguments:
11778  **
11779  *a character_name - character from which to flee
11780  *a distance - minimum distance to move away from character
11781  *a danger_level - how "strong" the flee should be; set from
11782  *a 0 to 100
11783  **
11784  ** The danger_level argument is not currently used, but will be in
11785  ** a future version.
11786  **
11787  *b Returns:
11788  **
11789  ** 0 on success, -1 on failure
11790  **
11791  *b Available as Decision Bead/Event
11792  */
11793  int agent_flee_character(const char* character_name,
11794  float distance,
11795  int danger_level = 50);
11796 
11797  /*l
11798  *b Description:
11799  **
11800  ** This function adds a flee object to this agent. This agent
11801  ** will attempt to move away from the specified group until it is
11802  ** beyond the specified flee distance.
11803  **
11804  ** This function will implicitly put this agent into the flee
11805  ** behavior.
11806  **
11807  ** Neither the current focus character nor group will be changed
11808  ** by this function.
11809  **
11810  *b Arguments:
11811  **
11812  *a group_name - group from which to flee
11813  *a distance - minimum distance to move away from character
11814  *a danger_level - how "strong" the flee should be; set from
11815  *a 0 to 100
11816  **
11817  ** The danger_level argument is not currently used, but will be in
11818  ** a future version.
11819  **
11820  *b Returns:
11821  **
11822  ** 0 on success, -1 on failure
11823  **
11824  *b Available as Decision Bead/Event
11825  */
11826  int agent_flee_group(const char* group_name,
11827  float distance,
11828  int danger_level = 50);
11829 
11830  /*l
11831  *b Description:
11832  **
11833  ** This function is similar to agent_flee_group(), but the
11834  ** agent will instead flee the members of the specified
11835  ** crowd.
11836  */
11837  int agent_flee_crowd(const char* crowd_name,
11838  float distance,
11839  int danger_level = 50);
11840 
11841  /*l
11842  *b Description:
11843  **
11844  ** This function adds a flee object to this agent.
11845  ** This agent will attempt to move away from the specified
11846  ** location until it is beyond the specified flee distance.
11847  **
11848  ** Note: Currently there can only be one flee object. This
11849  ** restriction will be lifted in a future version.
11850  **
11851  ** This function will implicitly put this agent into the
11852  ** flee behavior.
11853  **
11854  ** Neither the current focus character nor group will be
11855  ** changed by this function.
11856  **
11857  *b Arguments:
11858  **
11859  *a x, y, z - location from which to flee
11860  *a distance - minimum distance to move away from character
11861  *a danger_level - how "strong" the flee should be; set from
11862  *a 0 to 100
11863  **
11864  ** The danger_level argument is not currently used, but will be in
11865  ** a future version.
11866  **
11867  *b Returns:
11868  **
11869  ** 0 on success, -1 on failure
11870  */
11871  int agent_flee_location(float x, float y, float z,
11872  float distance,
11873  int danger_level = 50);
11874 
11875  /*l
11876  *b Description:
11877  **
11878  ** This function removes all flee objects.
11879  **
11880  ** This function has no effect on current behavior.
11881  **
11882  *b Returns:
11883  **
11884  ** 0 on success, -1 on failure
11885  **
11886  *b Available as Decision Bead/Event
11887  */
11888  void agent_remove_all_flee_objects();
11889 
11900  /*l
11901  *b Description:
11902  **
11903  ** This function puts this agent into the mingle behavior, in which
11904  ** it will choose semi-random points in the specified region and
11905  ** subregion to move to. The agent will remain at the selected
11906  ** points for some amount of time, and the select a new point.
11907  **
11908  ** If all members of a crowd have this behavior they will tend to get
11909  ** together in small groups.
11910  **
11911  ** Use diguyAgentParams::set_move_on_t_min() and
11912  ** diguyAgentParams::set_move_on_t_max() for setting how long the
11913  ** agent will remain at the selected mingle points.
11914  **
11915  *b Arguments:
11916  **
11917  *a region_name - region in which to mingle
11918  *a subregion_name - subregion in which to mingle
11919  **
11920  ** The behavior region will be set the specified region. Pass NULL
11921  ** or "(current)" to not change the current behavior region.
11922  **
11923  *b Returns:
11924  **
11925  ** 0 on success, -1 on failure
11926  **
11927  *b Available as Decision Bead/Event
11928  */
11929  int agent_mingle_in_region(const char* region_name = "(current)",
11930  const char* subregion_name = "base");
11931 
11942  /*l
11943  *b Description:
11944  **
11945  ** This function is similar to agent_mingle_in_region(), but agents
11946  ** will pick completely random points and not try to clump together
11947  ** in small groups.
11948  **
11949  *b Returns:
11950  **
11951  ** 0 on success, -1 on failure
11952  **
11953  *b Available as Decision Bead/Event
11954  */
11955  int agent_wander_region(const char* region_name = "(current)",
11956  const char* subregion_name = "base");
11957 
11968  /*l
11969  *b Description:
11970  **
11971  ** This function will cause this agent to pursue the specified
11972  ** character. This agent will attempt to move toward the specified
11973  ** character until it is within its still distance as specified in
11974  ** its agent params.
11975  **
11976  ** This function will implicitly put this agent into the pursue
11977  ** behavior.
11978  **
11979  ** The current focus group will be set to the specified group. Pass
11980  ** NULL or the empty string ("") to not change the focus group, but
11981  ** still change to the attack behavior.
11982  **
11983  ** The current focus character will be un-set.
11984  **
11985  *b Arguments:
11986  **
11987  *a character_name - character to pursue
11988  **
11989  *b Returns:
11990  **
11991  ** 0 on success, -1 on failure
11992  **
11993  *b Available as Decision Bead/Event
11994  */
11995  int agent_pursue_character(const char* character_name);
11996 
11997  /*l
11998  *b Description:
11999  **
12000  ** This function is similar to agent_pursue_character(), but the
12001  ** point toward the agent will move will be offset from the pursued
12002  ** character by the passed offset.
12003  */
12004  int agent_pursue_character_with_offset(const char* character_name,
12005  float offset_x,
12006  float offset_y);
12007 
12008  /*l
12009  *b Description:
12010  **
12011  ** This function is similar to agent_pursue_character(), but instead
12012  ** will choose pursue characters from the characters in the specified
12013  ** group.
12014  **
12015  ** This function will implicitly put this agent into the pursue
12016  ** behavior.
12017  **
12018  ** The current focus group will be set to the specified group. Pass
12019  ** NULL or the empty string ("") to not change the focus group, but
12020  ** still change to the pursue behavior.
12021  **
12022  ** The current focus character will be un-set.
12023  **
12024  *b Arguments:
12025  **
12026  *a group_name - name of group from which pursue characters should
12027  *a be chosen
12028  **
12029  *b Returns:
12030  **
12031  ** 0 on success, -1 on failure
12032  **
12033  *b Available as Decision Bead/Event
12034  */
12035  int agent_pursue_group(const char* group_name);
12036 
12037  /*l
12038  *b Description:
12039  **
12040  ** Calls a formation with this character as a leader, oriented towards
12041  ** (target_x, target_y).
12042  **
12043  *b Returns:
12044  **
12045  ** 0 on success, -1 on failure
12046  */
12047  int agent_call_formation(const char* formation_name,
12048  float target_x,
12049  float target_y);
12050 
12061  /*l
12062  *b Description:
12063  **
12064  ** This function has the character travel along its behavior path
12065  ** shape, typically to the end and then back to the beginning. It
12066  ** will put the agent into the travel behavior.
12067  **
12068  *b Arguments:
12069  **
12070  *a direction - should be either "forward" or "backward"; pass NULL
12071  *a for default forward
12072  *a at_end - what to do when end of path reached
12073  *a waypoint_index - index of waypoint to start at; -1 for nearest,
12074  *a -2 for random
12075  *a offset_y - sideways offset from behavior path
12076  **
12077  ** Valid values for at_end are:
12078  **
12079  *- - "reverse"
12080  *- - "loop"
12081  *- - "stop"
12082  *- - "teleport"
12083  **
12084  ** See the documentation for diguyNavPathAtEnd for information on
12085  ** what each value means.
12086  */
12087  int agent_travel_behavior_path(const char* direction = NULL,
12088  const char* at_end = NULL,
12089  int waypoint_index = -1,
12090  float offset_y = 0.5f);
12091 
12092  /*l
12093  *b Description:
12094  **
12095  ** Similar to agent_travel_behavior_path(), but specific path can be
12096  ** set rather than using behavior path.
12097  */
12098  int agent_travel_path_shape(const char* path_shape_name,
12099  const char* direction = NULL,
12100  const char* at_end = NULL,
12101  int waypoint_index = -1,
12102  float offset_y = 0.5f);
12103 
12104  /*l
12105  *b Description:
12106  **
12107  ** The agent will create a travel path around the border of the
12108  ** region specified. A CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED
12109  ** callback will be triggered every time a character completes a loop
12110  ** around the border.
12111  **
12112  *b Arguments:
12113  **
12114  *a region_name - the name of the region to patrol; leaving blank or
12115  *a passing NULL will use the agent's current region
12116  *a subregion - name of the subregion to use; defaults to the base
12117  *a subregion
12118  **
12119  *b Returns:
12120  **
12121  ** 0 on success, -1 on failure
12122  */
12123  int agent_travel_region_border(const char* region_name = NULL,
12124  const char* subregion_name = "base");
12125 
12126  /*l
12127  *b Description:
12128  **
12129  ** Agent will attempt to create a navigation path on the via_region
12130  ** and then travel it. An A* path planning algorithm is used to find
12131  ** the path, cost preferences from the character's current
12132  ** diguyAgentParams are used in the search.
12133  **
12134  *b Note: as of DI-Guy 12 there is a version of this function
12135  ** agent_move_to_point_bg() that uses a multi-threaded infrastructure.
12136  ** We strongly recommend using it for future developments.
12137  **
12138  *b Arguments:
12139  **
12140  *a x, y, z - the target location
12141  *a via_region - the name of the region to run A* on (pass in "*"
12142  *a to have the code attempt to find the nearest
12143  *a region automatically.)
12144  *a subregion_name - the name of the subregion to restrict search to
12145  **
12146  *b Returns:
12147  **
12148  ** 0 on success, -1 on failure
12149  */
12150  int agent_move_to_point(float x, float y, float z,
12151  const char* via_region = NULL,
12152  const char* subregion_name = "base");
12153 
12154  /*l
12155  *b Description:
12156  **
12157  ** A multi-threaded version of agent_move_to_point(). See that
12158  ** function for more information.
12159  **
12160  ** We recommend switching to using this over the single threaded
12161  ** version. When the path result has been computed a callback with id
12162  ** CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED is triggered and the result is
12163  ** stored in get_path_planning_result(). You can also poll for
12164  ** completion via get_is_path_planning().
12165  **
12166  *b Returns:
12167  **
12168  ** diguyNavPathSearchResults enum value
12169  **
12170  ** The return value is typically DIGUY_NAV_PATH_ERROR_NONE (0) on
12171  ** success, DIGUY_NAV_PATH_ERROR_SEARCH_QUEUED if this has been queued
12172  ** for multi-threading, or a negative value on failure.
12173  */
12174  int agent_move_to_point_bg(float x, float y, float z,
12175  const char* via_region = NULL,
12176  const char* subregion_name = "base");
12177 
12178  /*l
12179  *b Description:
12180  **
12181  ** Agent will attempt to create a navigation path on the region
12182  ** via_region and then travel it. An A* path planning algorithm is
12183  ** used to find the path.
12184  **
12185  ** The subregion masks are used to specify which subregions to use or
12186  ** avoid. Cost bias values can be used to make tweak how strong the
12187  ** repulsion values are.
12188  **
12189  *b Note:
12190  **
12191  ** As of DI-Guy 12 there is a version of this function
12192  ** agent_move_to_point_via_subregions_bg that uses a multi-threaded
12193  ** infrastructure. We strongly recommend using it for future
12194  ** developments.
12195  **
12196  ** This function will fail and return -1 if a path cannot be found.
12197  **
12198  *b Arguments:
12199  **
12200  *a x, y, z - the target location
12201  *a via_region - the name of the region to run A* on (pass in "*"
12202  *a to have the code attempt to find the nearest
12203  *a region automatically)
12204  *a preferred_subregions_mask - diguySubregionMask value of regions
12205  *a preferred for travel
12206  *a cost_bias_for_preferred_regions - how much cheaper it will be
12207  *a to cross spaces that are part of desired subregion;
12208  *a should be < 1.0
12209  *a cost_bias_for_neutral_regions - how much more expensive it will be
12210  *a to cross spaces that are not part of desired subregion; see
12211  *a below for more information
12212  *a repulsed_regions_mask - diguySubregionMask value of regions *not*
12213  *a preferred for travel
12214  *a cost_bias_for_repulsed_regions - how much more expensive it will be
12215  *a to cross regions that are marked as repulsive; pass
12216  *a DIGUY_DEFAULT_FLOAT to avoid completely
12217  **
12218  ** Pass DIGUY_DEFAULT_FLOAT for cost_bias_for_neutral_regions and
12219  ** cost_bias_for_repulsed_regions to specify that they should be
12220  ** avoided completely.
12221  **
12222  ** The preferred_subregions_mask and repulsed_regions_mask use
12223  ** DI-Guy subregion mask values combined together. For example,
12224  ** DIGUY_SUBREGION_MASK_SIDEWALK | DIGUY_SUBREGION_MASK_CROSSWALK.
12225  **
12226  ** For cost_bias_for_neutral_regions, specifying a non-zero value for
12227  ** this lowers the likelihood that searches fail on disjointed
12228  ** subregions. A value < 1 will cause the planner to run faster but
12229  ** explore fewer points, possibly missing preferred regions. Values
12230  ** greater then 1 will explore more points but will be slower.
12231  **
12232  *b NOTE:
12233  **
12234  *b THIS API has changed for DI-GUY 11.
12235  **
12236  ** cost_bias_for_preferred_regions has been added and the neutral and
12237  ** repulsed default values have changed.
12238  **
12239  *b Returns:
12240  **
12241  ** 0 on success, -1 on failure
12242  */
12243  int agent_move_to_point_via_subregions(float x, float y, float z,
12244  const char* via_region = NULL,
12245  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12246  float cost_bias_for_preferred_regions = 0.25f,
12247  float cost_bias_for_neutral_regions = 1.1f,
12248  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12249  float cost_bias_for_repulsed_regions = 10.0f,
12250  int cost_rule = 0);
12251 
12252  /*l
12253  *b Description:
12254  **
12255  ** A multi-threaded version of agent_move_to_point_via_subregions().
12256  ** We recommend switching to using this over the single threaded
12257  ** version. When the result is found a
12258  ** CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED is triggered and the result is
12259  ** stored in get_path_planning_result(), you can also poll for
12260  ** completion via get_is_path_planning().
12261  **
12262  *b Returns:
12263  **
12264  ** diguyNavPathSearchResults enum value
12265  **
12266  ** The return value is typically DIGUY_NAV_PATH_ERROR_NONE (0) on
12267  ** success, DIGUY_NAV_PATH_ERROR_SEARCH_QUEUED if this has been queued
12268  ** for multi-threading, or a negative value on failure.
12269  */
12270  int agent_move_to_point_via_subregions_bg(float x, float y, float z,
12271  const char* via_region = NULL,
12272  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12273  float cost_bias_for_preferred_regions = 0.25f,
12274  float cost_bias_for_neutral_regions = 1.1f,
12275  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12276  float cost_bias_for_repulsed_regions = 10.0f,
12277  int cost_rule = 0);
12278 
12279  /*l
12280  *b Returns:
12281  **
12282  ** diguyNavPathSearchResults value after agent_move_to_point_bg()
12283  ** or agent_move_to_point_via_subregions_bg() has been called when
12284  ** the multi-threaded path planner has completed.
12285  */
12286  int get_path_planning_result();
12287 
12288  /*l
12289  *b Returns:
12290  **
12291  ** 1 if character is currently waiting for a result from the
12292  ** multi-threaded path planner, else 0
12293  */
12294  int get_is_path_planning();
12295 
12296  /*l
12297  *b Description:
12298  **
12299  ** Agent will attempt to create a navigation path on the via_region
12300  ** to a point in the target region, and then travel it. An A* path
12301  ** planning algorithm is used to find the path. Cost preferences from
12302  ** the character's current diguyAgentParams are used in the search.
12303  **
12304  *b Arguments:
12305  **
12306  *a region - target region
12307  *a subregion_name - target subregion
12308  *a via_region - name of the region travel in
12309  **
12310  *b Returns:
12311  **
12312  ** 0 on success, -1 on failure
12313  **
12314  *b Available as Decision Bead/Event
12315  */
12316  int agent_move_to_region(const char* region,
12317  const char* subregion_name = "base",
12318  const char* via_region = NULL);
12319 
12320  /*l
12321  *b Description:
12322  **
12323  ** Similar to agent_move_to_point_via_subregions(), but for moving to
12324  ** another region.
12325  **
12326  *b NOTE:
12327  **
12328  *b THIS API has changed for DI-GUY 11.
12329  **
12330  ** cost_bias_for_preferred_regions has been added and the neutral and
12331  ** repulsed default values have changed.
12332  **
12333  *b See Also:
12334  **
12335  ** diguyScenario::set_max_distance_planning_multiplier();
12336  ** diguyScenario::get_time_spent_path_planning_this_frame();
12337  **
12338  *b Returns:
12339  **
12340  ** 0 on success, -1 on failure
12341  */
12342  int agent_move_to_region_via_subregions(const char* region_name,
12343  const char* subregion_name = "base",
12344  const char* via_region = NULL,
12345  float cost_bias_for_preferred_regions = 0.25f,
12346  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
12347  float cost_bias_for_neutral_regions = 1.1f,
12348  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
12349  float cost_bias_for_repulsed_regions = 10.0f);
12350 
12361  /*l
12362  *b Description:
12363  **
12364  ** The agent will begin following the specified path, using the path
12365  ** follow behavior (DIGUY_AGENT_BEHAVIOR_PATH_FOLLOW).
12366  **
12367  ** The path follow behavior allows an agent to approximately follow a
12368  ** diguyCharacterPath without being in path position mode. The agent
12369  ** can respond to external stimuli (e.g., run away from gunfire), and
12370  ** later return to and resume the path.
12371  **
12372  ** Currently the path must be a path previously defined for the
12373  ** character, through either DI-Guy Scenario or via path API calls.
12374  **
12375  *b Arguments:
12376  **
12377  *a path_name - name of a path of this character
12378  **
12379  *b Returns:
12380  **
12381  ** 0 on success, -1 on failure
12382  **
12383  *b Available as Decision Bead/Event
12384  */
12385  int agent_path_follow(const char* path_name);
12386 
12387  /*l
12388  *b Description:
12389  **
12390  ** The agent will resume following the path specified by a previous
12391  ** call to agent_path_follow(). This will put the agent back into
12392  ** the path follow behavior.
12393  **
12394  *b Returns:
12395  **
12396  ** 0 on success, -1 on failure
12397  **
12398  *b Available as Decision Bead/Event
12399  */
12400  int agent_resume_path_follow();
12401 
12402  /*l
12403  *b Returns:
12404  **
12405  ** the path being followed in path behavior mode
12406  */
12407  diguyCharacterPath* agent_get_path_follow_path();
12408 
12409  /*l
12410  *b Description:
12411  **
12412  ** In path follow behavior the agent moves along the path specified
12413  ** in agent_path_follow(). How far along the agent is on the path is
12414  ** specified in seconds. This function returns that time.
12415  **
12416  ** Note that advancing along the path may be paused for some reason,
12417  ** typically because the agent is resuming path follow behavior
12418  ** after being in a different behavior, or the agent is too far away
12419  ** from the current desired position on the path. In this case the
12420  ** returned time may not advance for awhile until the agent is close
12421  ** enough to the path to resume advancing along it.
12422  **
12423  ** Call diguyAgentParams::set_path_follow_pause_t_when_off_path()
12424  ** to set whether time will be paused when off of the path.
12425  **
12426  ** Call diguyAgentParams::set_path_follow_unpause_t_at_radius() to
12427  ** set how close the agent must be to the last point on the path
12428  ** before time will resume.
12429  **
12430  *b Returns:
12431  **
12432  ** how far, in seconds, the agent is along its path follow path
12433  */
12434  float agent_get_path_follow_path_t();
12435 
12436  /*l
12437  *b Returns:
12438  **
12439  ** 1 if time along the path is not advancing, else 0
12440  */
12441  int agent_get_path_follow_path_t_paused();
12442 
12453  /*l
12454  *b Returns:
12455  **
12456  ** the crowd this agent is a part of, if any; returns NULL if not in
12457  ** a crowd
12458  */
12459  diguyCrowd* agent_get_crowd();
12460 
12461  /*l
12462  *b Description:
12463  **
12464  ** This function allows the end user to directly change an agent's
12465  ** current behavior. This function currently the only way to start
12466  ** an agent "idling".
12467  */
12468  int agent_begin_behavior(const char* behavior_name);
12469 
12470  /*l
12471  *b Description:
12472  **
12473  ** This function sets the behavior of the agent to "none".
12474  */
12475  int agent_stop_behavior();
12476 
12477  /*l
12478  *b Description:
12479  **
12480  ** This function is a convenience function that changes the focus
12481  ** character of this agent's current crowd params.
12482  **
12483  ** This can also be done by getting the character's current params
12484  ** using get_agent_current_params(), and then calling
12485  ** set_focus_character() on that object. This function
12486  ** call, however, is available in decisions.
12487  **
12488  ** The agent currently need not be part of a crowd for this function
12489  ** to work.
12490  **
12491  *b Arguments:
12492  **
12493  *a character_name - name of character to become new focus
12494  *a character; pass NULL or "" to un-set
12495  *a the focus character
12496  **
12497  *b Returns:
12498  **
12499  ** 0 on success, -1 on failure
12500  **
12501  *b Available as Decision Bead/Event
12502  */
12503  int agent_set_current_focus_character(const char* character_name);
12504 
12505  /*l
12506  *b Description:
12507  **
12508  ** This function returns the current character this agent
12509  ** is focused on. This will either be the character named
12510  ** by the focus character, or the character chosen from the
12511  ** focus group to be the current focus character.
12512  **
12513  ** The agent currently need not be part of a crowd for this function
12514  ** to work.
12515  **
12516  *b Returns:
12517  **
12518  *a pointer to type diguyCharacter
12519  */
12520  diguyCharacter* agent_get_current_focus_character();
12521 
12522  /*l
12523  *b Description:
12524  **
12525  ** Similar to set_current_focus_character(), but sets
12526  ** the current focus group instead of character.
12527  **
12528  ** The agent currently need not be part of a crowd for this function
12529  ** to work.
12530  **
12531  *b Arguments:
12532  **
12533  *a group_name - name of group to become new focus
12534  *a group; pass NULL or "" to un-set
12535  *a the focus group
12536  **
12537  *b Returns:
12538  **
12539  ** 0 on success, -1 on failure
12540  **
12541  *b Available as Decision Bead/Event
12542  */
12543  int agent_set_current_focus_group(const char* group_name);
12544 
12545  /*l
12546  *b Description:
12547  **
12548  ** This function returns the initial agent parameters of
12549  ** this agent. The initial parameters of this agent
12550  ** can then be edited through this object.
12551  **
12552  ** Changes to the initial parameters will have no effect until
12553  ** the scenario is reset.
12554  **
12555  ** The current agent parameters will be set to these
12556  ** initial parameters whenever the scenario is reset.
12557  **
12558  ** The agent currently need not be part of a crowd for this function
12559  ** to work.
12560  **
12561  *b Returns:
12562  **
12563  *a pointer to type diguyAgentParams
12564  */
12565  diguyAgentParams* agent_get_initial_params();
12566 
12567  /*l
12568  *b Description:
12569  **
12570  ** This function returns the current agent parameters of
12571  ** this agent. The current parameters of this agent
12572  ** can then be edited through this object.
12573  **
12574  ** Changes to the current parameters should take effect immediately.
12575  **
12576  ** The current agent parameters will be reset to the
12577  ** initial parameters whenever the scenario is reset.
12578  **
12579  ** The agent currently need not be part of a crowd for this function
12580  ** to work.
12581  **
12582  *b Returns:
12583  **
12584  *a pointer to type diguyAgentParams
12585  */
12586  diguyAgentParams* agent_get_current_params();
12587 
12588  /*l
12589  *b Description:
12590  **
12591  ** This function gets the name of the agent's current profile.
12592  **
12593  *b Returns:
12594  **
12595  ** the name of the agent's current profile
12596  */
12597  const char* agent_get_current_params_profile_name();
12598 
12599  /*l
12600  *b Description:
12601  **
12602  ** This function sets this agent's current agent parameters from the
12603  ** specified crowd profile.
12604  **
12605  ** The agent currently need not be part of a crowd for this function
12606  ** to work.
12607  **
12608  *b Arguments:
12609  **
12610  *a profile_name - name of existing crowd profile
12611  *a retain_focus_objects - pass 1 to not change focus object from
12612  *a current focus
12613  *a retain_navigation_values - pass 1 to not change current navigation
12614  *a parameters
12615  *a retain_behavior - pass 1 to not change current behavior
12616  **
12617  ** Navigation values are things like:
12618  **
12619  *- - behavior path
12620  *- - behavior region and subregion
12621  *- - region masks
12622  *- - cost biases
12623  *- - path planner settings
12624  **
12625  *b Returns:
12626  **
12627  ** 0 on success, -1 on failure
12628  **
12629  *b Available as Decision Bead/Event
12630  */
12631  int agent_set_current_params_from_profile(const char* profile_name,
12632  int retain_focus_objects = 1,
12633  int retain_navigation_values = 1,
12634  int retain_behavior = 0);
12635 
12636  /*l
12637  *b Description:
12638  **
12639  ** Similar to agent_set_current_params_from_profile(), but initial
12640  ** parameters are changed.
12641  */
12642  int agent_set_initial_params_from_profile(const char* profile_name);
12643 
12644  /*l
12645  *b Description:
12646  **
12647  ** This function sets the current parameters from the agent's
12648  ** initial parameters.
12649  */
12650  void agent_set_current_params_from_initial_params();
12651 
12652  /*l
12653  *b Description:
12654  **
12655  ** This function sets whether the borders of the current behavior
12656  ** region of the agent is solid.
12657  **
12658  ** If they are, the agent will treat the walls as if they are
12659  ** solid walls in the environment. If not, the agent is free to
12660  ** walk through them.
12661  **
12662  ** The agent currently need not be part of a crowd for this function
12663  ** to work.
12664  **
12665  *b Arguments:
12666  **
12667  *a is_solid - 1 if region border should be solid, 0 if not
12668  **
12669  *b Available as Decision Bead/Event
12670  */
12671  void agent_set_current_behavior_region_border_is_solid(int is_solid);
12672 
12673  /*l
12674  *b Description:
12675  **
12676  ** If the agent is in a behavior that stays in one place before moving
12677  ** to another, such as wander or mingle, this function will request
12678  ** that the agent move on to the next location.
12679  **
12680  *b Available as Decision Bead/Event
12681  */
12682  void agent_move_on();
12683 
12684 
12685  /*l
12686  *b Description:
12687  **
12688  ** This function controls if the AI will attempt to automatically change variants
12689  ** depending on the behavior. This should only change how still motions are performed
12690  ** when the default variant is Normal. Characters in wander and idle will automatically
12691  ** shift to ambient still motions, mingle will alternate between socialize and ambient
12692  ** motions. Attack should automatically switch from aiming to ambient.
12693  ** defaults to being on.
12694  */
12695  int agent_set_auto_variant_selection(int selection_enabled);
12696 
12697  /*l
12698  *b Description:
12699  **
12700  ** Returns if automatic variant selection is enabled, defaults to being on.
12701  */
12702  int agent_get_auto_variant_selection();
12703 
12704  /*l
12705  *b Description:
12706  **
12707  ** Returns current travel path or nav path.
12708  */
12709  diguyPathShape * agent_get_current_traveled_path();
12710 
12711  /*l
12712  *b Description:
12713  **
12714  ** Allows agent to determine speed zone based on distance to endpoint of current
12715  ** path. With this off, speed zones are determined by "desired position", which
12716  ** when following a path is not the endpoint, but a point on the path a short
12717  ** distance ahead of the current position.
12718  **
12719  ** The default value is false.
12720  **
12721  ** Enable this if you want the character to automatically run when following a
12722  ** long path.
12723  */
12724  void agent_set_use_speed_zones_on_paths(int enabled);
12725 
12726  /*l
12727  *b Description:
12728  **
12729  ** Returns the current value set by agent_set_use_speed_zones_on_paths().
12730  */
12731  int agent_get_use_speed_zones_on_paths();
12732 
12733 #ifdef CPLUSPLUS_ONLY
12734 
12790  /*l
12791  *b Description:
12792  **
12793  ** This function sets a feeler function that will be used by this
12794  ** character for environment collision detection. The feeler will
12795  ** replace any existing feeler function (including the default
12796  ** function used in DI-Guy Scenario).
12797  **
12798  ** See the "User-Defined Feelers" information for more information.
12799  **
12800  *b Arguments:
12801  **
12802  *a feeler_function - pointer to user-defined feeler function
12803  **
12804  *b Returns:
12805  **
12806  ** 0 on success, -1 on failure
12807  **
12808  *b Callable From:
12809  **
12810  *- - C++
12811  */
12812  int agent_set_feeler_function(diguyFeelerFunction* feeler_function);
12813 
12814  /*l
12815  *b Returns:
12816  **
12817  ** current feeler function; see set_feeler_function()
12818  **
12819  *b Callable From:
12820  **
12821  *- - C++
12822  */
12823  diguyFeelerFunction* agent_get_feeler_function();
12824 
12825 #endif
12826 
12827 
12828 /*****************************************************************************/
12834  /*l
12835  *b Description:
12836  **
12837  ** Creates a Lua mind object based off of the contents of base_class.
12838  **
12839  *b Arguments:
12840  **
12841  *a base_class - the class to use as the basis for the character's
12842  *a mind
12843  *a init_arg1-2 - experimental optional arguments passed to the init
12844  *a function; your lua init function will need to take
12845  *a arguments
12846  **
12847  */
12848  int create_lua_mind(const char* base_class, const char* init_arg1 = NULL,
12849  const char* init_arg2 = NULL);
12850 
12851  /*l
12852  *b Description:
12853  **
12854  ** Returns the name of the mind, e.g. "luaPedestrian". This is, in other
12855  ** words, the mind's base class
12856  */
12857  const char *get_mind_name();
12858 
12859  /*l
12860  *b Description:
12861  **
12862  ** Agent characters with minds will typically have the mind be in
12863  ** some state, such as "patrolling", "fleeing", "mobbing", etc. This
12864  ** function returns the name of that state.
12865  **
12866  ** Currently this is only applicable to characters with Lua minds.
12867  **
12868  *b Returns:
12869  **
12870  ** the name of the agent's current mind state
12871  */
12872  const char* get_mind_current_state_name();
12873 
12874  /*l
12875  *b Description:
12876  **
12877  ** This function causes callback functions with the callback id
12878  ** CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED to be called.
12879  ** It's intended use is for mind implementations that need to
12880  ** signal that the mind's current state has changed.
12881  **
12882  ** Currently this is only applicable to characters with Lua minds.
12883  */
12884  void do_mind_current_state_changed_callback();
12885 
12886  /*l
12887  *b Description:
12888  **
12889  ** How long until the character's main coroutine thread should be
12890  ** resumed. This function is typically used by various luaCharacter
12891  ** sleep functions.
12892  **
12893  *b Arguments:
12894  **
12895  *a sleep_length - how long relative to the current time the character
12896  *a should sleep
12897  */
12898  int set_sleep_timer(float sleep_length);
12899 
12900  /*l
12901  *b Returns:
12902  **
12903  ** How long until the character's main coroutine thread resumes,
12904  ** relative to the current time.
12905  */
12906  float get_sleep_timer();
12907 
12908  /*l
12909  *b Description:
12910  **
12911  ** The frequency at which the luaCharacter's heartbeat function
12912  ** should run. This defaults to once per second. The character
12913  ** must have a Lua function named heartbeat.
12914  **
12915  *b Arguments:
12916  **
12917  *a heartbeat_dt - frequency of heartbeat
12918  */
12919  int set_heartbeat_dt(float heartbeat_dt);
12920 
12921  /*l
12922  *b Description:
12923  **
12924  ** This function allows the addition of additional heartbeat
12925  ** functions.
12926  **
12927  *b Arguments:
12928  **
12929  *a function_name - the name of the Lua function to treat as a
12930  *a heartbeat; the function_name should not include
12931  *a the name of the character object
12932  *a heartbeat_dt - frequency of heartbeat
12933  **
12934  *b Returns:
12935  **
12936  ** 0 on success, -1 on failure
12937  */
12938  int add_secondary_heartbeat(const char* function_name,
12939  float heartbeat_dt);
12940 
12941  /*l
12942  *b Description:
12943  **
12944  ** This function removes an added heartbeat function.
12945  **
12946  *b Arguments:
12947  **
12948  *a function_name - the name of the Lua function to treat as a
12949  *a heartbeat; the function_name should not include
12950  *a the name of the character object
12951  **
12952  *b Returns:
12953  **
12954  ** 0 on success, -1 on failure
12955  */
12956  int remove_secondary_heartbeat(const char* function_name);
12957 
12958  /*l
12959  *b Description:
12960  **
12961  ** The frequency at which a luaCharacter's secondary heartbeat
12962  ** function should run. The character must have a Lua function named
12963  ** function_name.
12964  **
12965  *b Arguments:
12966  **
12967  *a function_name - heartbeat function to adjust
12968  *a heartbeat_dt - frequency of heartbeat
12969  **
12970  *b Returns:
12971  **
12972  ** 0 on success, -1 on failure
12973  */
12974  int set_secondary_heartbeat_dt(const char* function_name, float heartbeat_dt);
12975 
12976  /*l
12977  *b Description:
12978  **
12979  ** This function creates a request that whenever the specified
12980  ** callback is triggered, the character is woken up with a message.
12981  ** The message will be of the form:
12982  *>
12983  *- - message_type = "callback"
12984  *- - message = the string representation of the callback
12985  *<
12986  ** A good example of the use for this is a flexible "move to"
12987  ** command:
12988  **
12989  *b Lua Example:
12990  **
12991  *e self.character:add_wakeup_callback(diguyCharacter_CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED);
12992  *e -- begin to move to a location
12993  *e self.character:agent_move_to_region_via_subregions("navmesh", "green", "navmesh",
12994  *e DIGUY_SUBREGION_MASK_BASE, 12);
12995  *e -- sleep till arrived
12996  *e self:sleep(100);
12997  *e self.character:remove_wakeup_callback(diguyCharacter_CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED);
12998  **
12999  ** Effectively the character will wake up either after 100 seconds or
13000  ** when they arrive at their desired destination.
13001  **
13002  *b Arguments:
13003  **
13004  *a callback - the callback id that should wake up the character
13005  **
13006  *b Returns:
13007  **
13008  ** 0 on success, -1 on failure
13009  */
13010  int add_wakeup_callback(int callback);
13011 
13012  /*l
13013  *b Description:
13014  **
13015  ** This function removes a request to trigger a message when a
13016  ** callback is triggered.
13017  **
13018  *b Arguments:
13019  **
13020  *a callback - callback id that should no longer wake up the
13021  *a character
13022  **
13023  *b Returns:
13024  **
13025  ** 0 on success, -1 on failure
13026  */
13027  int remove_wakeup_callback(int callback);
13028 
13029  /*l
13030  *b Description:
13031  **
13032  ** This function removes all requests to trigger a message when
13033  ** callbacks are triggered.
13034  **
13035  *b Returns:
13036  **
13037  ** 0 on success, -1 on failure
13038  */
13039  int remove_all_wakeup_callbacks();
13040 
13041  /*l
13042  *b Description:
13043  **
13044  ** This function check for a requests to trigger a message when
13045  ** a given callback is triggered.
13046  **
13047  *b Returns:
13048  **
13049  ** 0 on false, 1 on true
13050  */
13051  int has_wakeup_callback(int callback);
13052 
13053  /*l
13054  *b Description:
13055  **
13056  ** This function wakes up a character and sends them a message.
13057  ** Currently this is only applicable to characters with Lua minds.
13058  **
13059  *b Arguments:
13060  **
13061  *a sender - who is sending the message
13062  *a message_type - what type of message is being sent
13063  *a message - the message string
13064  *a message_params - optional parameter string
13065  **
13066  *b Returns:
13067  **
13068  ** number of times message was successfully parsed
13069  */
13070  int agent_accept_message(const char* sender,
13071  const char* message_type,
13072  const char* message,
13073  const char* message_params = NULL);
13074 
13075  /*l
13076  **
13077  *b Description:
13078  **
13079  ** This function wakes up nearby characters and sends them a message.
13080  ** The sender of the message is implicitly set to the individual
13081  ** calling the broadcast function
13082  **
13083  ** Currently this is only applicable to characters with Lua minds.
13084  **
13085  *b Arguments:
13086  **
13087  *a radius - how far to broadcast the message
13088  *a message_type - what type of message is being sent
13089  *a message - the message string
13090  *a message_params - optional parameter string
13091  **
13092  *b Returns:
13093  **
13094  ** number of times message was successfully parsed
13095  */
13096  int agent_broadcast_message(float radius,
13097  const char* message_type,
13098  const char* message,
13099  const char* message_params = NULL);
13100 
13101  /*l
13102  *b Description:
13103  **
13104  ** This function wakes up nearby characters in the group specified
13105  ** and sends them a message. The sender of the message is implicitly
13106  ** set to the individual calling the broadcast function.
13107  **
13108  ** Currently this is only applicable to characters with Lua minds.
13109  **
13110  *b Arguments:
13111  **
13112  *a group_name - group to broadcast message to
13113  *a radius - how far to broadcast the message
13114  *a message_type - what type of message is being sent
13115  *a message - the message string
13116  *a message_params - optional parameter string
13117  **
13118  **
13119  *b Returns:
13120  **
13121  ** number of times message was successfully parsed,
13122  ** -1 on failure
13123  */
13124  int agent_broadcast_message_to_group(const char* group_name,
13125  float radius,
13126  const char* message_type,
13127  const char* message,
13128  const char* message_params = NULL);
13129 
13130  /*l
13131  **
13132  *b Returns:
13133  **
13134  ** name of character's lua mind object; typically this is the
13135  ** character's name with '-' replaced by '_'
13136  */
13137  const char* get_lua_object_name();
13138 
13139  /*l
13140  *b Description:
13141  **
13142  ** Sets the specified field of the mind to the string field_value.
13143  */
13144  void set_mind_field_as_string(const char* field_name,
13145  const char* field_value);
13146 
13147  /*l
13148  *b Description:
13149  **
13150  ** Queries the luaCharacter object for a specific field, and attempts
13151  ** to convert it into a string. This works for strings and
13152  ** numbers.
13153  **
13154  ** This returned pointer will stay valid until the next time this
13155  ** function is called, so if the results need to be saved they must
13156  ** be copied.
13157  **
13158  *b Returns:
13159  **
13160  ** field_name as string
13161  */
13162  const char* get_mind_field_as_string(const char* field_name,
13163  int warn_if_no_field = 1);
13164 
13165  /*l
13166  *b Description:
13167  **
13168  ** Sets the specified field of the mind to the floating point
13169  ** number field_value.
13170  */
13171  void set_mind_field_as_float(const char* field_name, float field_value);
13172 
13173  /*l
13174  *b Description:
13175  **
13176  ** Similar to get_mind_field_as_string(), but returns field as
13177  ** a float.
13178  **
13179  *b Returns:
13180  **
13181  ** field_name as double
13182  */
13183  float get_mind_field_as_float(const char* field_name,
13184  int warn_if_no_field = 1,
13185  int* found_field = NULL);
13186 
13187  /*l
13188  *b Description:
13189  **
13190  ** Sets the specified field of the mind to the integer number
13191  ** field_value.
13192  */
13193  void set_mind_field_as_int(const char* field_name, int field_value);
13194 
13195  /*l
13196  *b Description:
13197  **
13198  ** Similar to get_mind_field_as_int(), but returns field as
13199  ** an integer.
13200  **
13201  *b Returns:
13202  **
13203  ** field_name as int
13204  */
13205  int get_mind_field_as_int(const char* field_name,
13206  int warn_if_no_field = 1,
13207  int* found_field = NULL);
13208 
13209  /*l
13210  *b Description:
13211  **
13212  ** Attempts to run a luaCharacter member function, and can optionally
13213  ** return the function's result. Lua return values can be converted
13214  ** to strings and numbers -- other data types will cause an error.
13215  **
13216  ** This returned pointer will stay valid until the next time this
13217  ** function is called, so if the results need to be saved they must
13218  ** be copied.
13219  **
13220  *b *Note:* This function should be considered experimental, as the
13221  *b API may change.
13222  **
13223  *b Arguments:
13224  **
13225  *a function_name - luaCharacter function field to invoke
13226  *a argument - optional string argument to the function
13227  *a has_return_string - 0 or 1; determines if lua interface should
13228  *a attempt to retrieve a string value
13229  **
13230  *b Returns:
13231  **
13232  ** Lua function return value
13233  */
13234  const char* evaluate_mind_function(const char* function_name,
13235  const char* argument = NULL,
13236  int has_return_string = 0);
13237 
13238  /*l
13239  *b Description:
13240  **
13241  ** This function produces a string with a long list of character
13242  ** information, including: current path, crowd, behavior, lua state,
13243  ** lua call stack, wakeup callbacks and lua object fields. It is
13244  ** meant to help with debugging agents.
13245  **
13246  ** This returned pointer will stay valid until the next time this
13247  ** function is called, so if the results need to be saved they must
13248  ** be copied.
13249  **
13250  *b Arguments:
13251  **
13252  *a include_stack - pass 1 to include callstack info, 0 to not
13253  *a include_locals - pass 1 to include local variable info, 0 to not
13254  **
13255  *b Returns:
13256  **
13257  ** string containing character information
13258  */
13259  const char* get_ai_state_string(int include_stack = 1, int include_locals = 1);
13260 
13261 
13262 /*****************************************************************************/
13272 /*
13273  *3 Visibility Tests
13274  */
13275 
13276  /*l
13277  *b Description:
13278  **
13279  ** This function tests whether this character can see the passed
13280  ** character. Currently this tests if the cervical link of this
13281  ** character has a clear line of sight to either the cervical or the
13282  ** position links of the target. Currently the orientation of this
13283  ** character isn't factored in.
13284  **
13285  ** This function does not fail if other characters are between the
13286  ** two characters in question.
13287  **
13288  ** Checking visibility is only an option if an octtree is generated
13289  ** from scene objects; typically only DI-Guy Scenario does this.
13290  ** Outside of DI-Guy Scenario set_character_los_function() should be
13291  ** used if no octtree is present.
13292  **
13293  *b Arguments:
13294  **
13295  *a character - character to check
13296  *a los_check_type - currently unused but passed to callback function
13297  *a if end users wish to pass an additional parameter
13298  **
13299  *b Returns:
13300  **
13301  ** 1 if character is visible, 0 if not
13302  */
13303  int check_character_visibility(diguyCharacter* character,
13304  int los_check_type = 0);
13305 
13306  /*l
13307  *b Description:
13308  **
13309  ** This function tests whether this character can see the x, y, z
13310  ** location specified. Currently this tests if the cervical link of
13311  ** this character has a clear line of sight to the x, y, z location.
13312  ** Currently the orientation of this character isn't factored in.
13313  **
13314  ** This function does not fail if other characters are between the
13315  ** character and the location in question.
13316  **
13317  ** Checking visibility is only an option if an octtree is generated
13318  ** from scene objects; typically only DI-Guy Scenario does this.
13319  **
13320  *b Arguments:
13321  **
13322  *a x, y, z - location to check
13323  **
13324  *b Returns:
13325  **
13326  ** 1 if location is visible, 0 if not
13327  */
13328  int check_point_visibility(float x, float y, float z);
13329 
13330 
13331 
13332 /*****************************************************************************/
13349 #ifdef CPLUSPLUS_ONLY
13350 
13351  /*l
13352  *b Description:
13353  **
13354  ** When a character needs to check if it can see a location, DI-Guy
13355  ** calls this function with a pointer to the diguyCharacter in
13356  ** question, and the coordinates of the point that is being looked
13357  ** at. This currently happens when an agent is told to move to a new
13358  ** region.
13359  **
13360  ** The following prototype should be used for the point line-of-sight
13361  ** function:
13362  **
13363  *e int diguyPointLOSFunction(diguyCharacter* character,
13364  *e float x,
13365  *e float y,
13366  *e float z);
13367  **
13368  ** The function should then check if the desired location is visible.
13369  ** This can be done in a number of ways; a typical approach is to do
13370  ** an intersection test with the static scene.
13371  **
13372  ** The function should return 1 if the path to the target is clear, 0
13373  ** if there is an obstruction.
13374  **
13375  ** A default point line-of-sight function can be set for all
13376  ** subsequently created characters by calling
13377  ** diguyScenario::set_default_point_los_function().
13378  **
13379  *b Callable From:
13380  **
13381  *- - C++
13382  */
13383  int set_point_los_function(diguyPointLOSFunction* point_los_function);
13384 
13385  /*l
13386  *b Returns:
13387  **
13388  ** current point line-of-sight function; see set_point_los_function()
13389  **
13390  *b Callable From:
13391  **
13392  *- - C++
13393  */
13394  diguyPointLOSFunction* get_point_los_function();
13395 
13396  /*l
13397  *b Description:
13398  **
13399  ** When a character needs to check if it can see another character,
13400  ** DI-Guy calls this function with a pointer to the diguyCharacter in
13401  ** question. This can happen when check_character_visibility() is
13402  ** invoked or when AI attack code assesses if it should take a shot.
13403  **
13404  ** The following prototype should be used for the character
13405  ** line-of-sight function:
13406  **
13407  *e int diguyCharacterLOSFunction(diguyCharacter* character,
13408  *e diguyCharacter* target_character,
13409  *e int los_test_type) // (currently unused)
13410  **
13411  ** Currently the los_test_type argument defaults to 0 and is not used
13412  ** internally. It is, however, available in
13413  ** check_character_visibility() and will be passed to the callback.
13414  ** This can be useful if the end user wants to write scripting code
13415  ** that has alternative Line of Sight tests depending on agent
13416  ** conditions. (e.g. a test that factors in the character's field of
13417  ** view.)
13418  **
13419  ** The function then checks if the target character is visible. This
13420  ** can be done in a number of ways; a typical approach is to do an
13421  ** intersection test with the static scene. The default
13422  ** implementation tests the path from the characters head to the
13423  ** target's head and then to the target's feet.
13424  **
13425  ** The function should return 1 if the path to the target is clear,
13426  ** and 0 if there is an obstruction.
13427  **
13428  ** A default character line-of-sight function can be set for all
13429  ** subsequently created characters by calling
13430  ** diguyScenario::set_default_character_los_function().
13431  **
13432  *b Callable From:
13433  **
13434  *- - C++
13435  */
13436  int set_character_los_function(diguyCharacterLOSFunction* character_los_function);
13437 
13438  /*l
13439  *b Returns:
13440  **
13441  ** current character line-of-sight function; see
13442  ** set_character_los_function()
13443  **
13444  *b Callable From:
13445  **
13446  *- - C++
13447  */
13448  diguyCharacterLOSFunction* get_character_los_function();
13449 
13450 #endif
13451 
13452 
13453 /*****************************************************************************/
13470  int get_num_ik_chains();
13472 
13474  const char * get_ik_chain_name_at_index(int index);
13475 
13476  /*b Description:
13477  ** Moves the end effector for the specified ik chain to a location in the world.
13478  **
13479  *b Arguments:
13480  *a ik_chain_target - index of ik chain
13481  *a x,y,z - world location of where to move the IK end effector to.
13482  *a ramp_time - how long to take blending in solution
13483  **
13484  *b Returns:
13485  ** -1 on failure, 0 on success
13486  */
13487  int set_ik_target_world(int ik_chain_target, float x, float y, float z, float ramp_time = .25f);
13488 
13489  /*b Description:
13490  ** Moves the end effector for the specified ik chain to a location relative to the character.
13491  **
13492  *b Arguments:
13493  *a ik_chain_target - index of ik chain
13494  *a x,y,z - local location of where to move the IK end effector to.
13495  *a ramp_time - how long to take blending in solution
13496  **
13497  *b Returns:
13498  ** -1 on failure, 0 on success
13499  */
13500  int set_ik_target_local(int ik_chain_target, float x, float y, float z, float ramp_time = .25f);
13501 
13502  /*b Description:
13503  ** Resets the end effector to be solely driven by the animation system */
13504  int disable_ik_target(int ik_chain_target, float ramp_time = .25f);
13505 
13506  /*b Description:
13507  ** Sets the distance to the primary camera, this should be automatically set in OpenGL
13508  ** or if you set the camera position, in retained mode renderers you will need to set this
13509  ** manually. Currently only used by IK system for performance culling.
13510  */
13511  void set_distance_to_primary_camera(float camera_dist);
13512 
13514  float get_distance_to_primary_camera();
13515 
13516 /*****************************************************************************/
13532  /*l
13533  *b Description:
13534  **
13535  ** This function sets the initial character simulator this character
13536  ** will use. The current simulator will be set to this value on
13537  ** scenario reset.
13538  **
13539  ** The current simulator can be set by calling
13540  ** set_current_character_simulator().
13541  **
13542  ** The default simulator is
13543  ** DIGUY_CHARACTER_SIMULATOR_DIGUY_MOTION_ENGINE.
13544  **
13545  ** Requires active physics module if character simulator is set to
13546  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13547  **
13548  *b Arguments:
13549  **
13550  *a character_simulator - which simulator to use at reset
13551  **
13552  *b Returns:
13553  **
13554  ** 0 on success, -1 on failure
13555  */
13556  int set_initial_character_simulator(diguyCharacterSimulator character_simulator);
13557 
13558  /*l
13559  *b Returns:
13560  **
13561  ** initial character simulator
13562  */
13563  diguyCharacterSimulator get_initial_character_simulator();
13564 
13565  /*l
13566  *b Description:
13567  **
13568  ** This function sets the current character simulator this character
13569  ** will use. The current simulator will be reset to the initial
13570  ** character simulator on scenario reset.
13571  **
13572  ** The initial simulator can be set by calling
13573  ** set_initial_character_simulator().
13574  **
13575  *b Arguments:
13576  **
13577  *a character_simulator - new current character simulator
13578  **
13579  *b Returns:
13580  **
13581  ** 0 on success, -1 on failure
13582  */
13583  int set_current_character_simulator(diguyCharacterSimulator character_simulator);
13584 
13585  /*l
13586  *b Returns:
13587  **
13588  ** current character simulator
13589  */
13590  diguyCharacterSimulator get_current_character_simulator();
13591 
13592  /*l
13593  *b Description:
13594  **
13595  ** This function sets the initial physics simulation mode this
13596  ** character will use. The current simulation mode will be set to
13597  ** this value on scenario reset.
13598  **
13599  ** The current simulation mode can be set by calling
13600  ** set_current_physics_simulation_mode().
13601  **
13602  ** The default simulation mode is
13603  ** DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER.
13604  **
13605  ** The physics simulation mode will have no effect unless the current
13606  ** character simulator is
13607  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13608  **
13609  *b Arguments:
13610  **
13611  *a physics_simulation_mode - which simulation mode to use at reset
13612  **
13613  *b Returns:
13614  **
13615  ** 0 on success, -1 on failure
13616  */
13617  int set_initial_physics_simulation_mode(diguyPhysicsSimulationMode physics_simulation_mode);
13618 
13619  /*l
13620  *b Returns:
13621  **
13622  ** initial physics simulation mode
13623  */
13624  diguyPhysicsSimulationMode get_initial_physics_simulation_mode();
13625 
13626  /*l
13627  *b Description:
13628  **
13629  ** This function sets the current physics simulation mode this
13630  ** character will use. The current simulation mode will be reset to
13631  ** the initial physics simulator mode on scenario reset.
13632  **
13633  ** The initial simulation mode can be set by calling
13634  ** set_initial_physics_simulation_mode().
13635  **
13636  ** The physics simulation mode will have no effect unless the current
13637  ** character simulator is
13638  ** DIGUY_CHARACTER_SIMULATOR_PHYSICS_SIM_MODULE.
13639  **
13640  *b Arguments:
13641  **
13642  *a physics_simulation_mode - new current physics simulation mode
13643  **
13644  *b Returns:
13645  **
13646  ** 0 on success, -1 on failure
13647  */
13648  int set_current_physics_simulation_mode(diguyPhysicsSimulationMode physics_simulation_mode);
13649 
13650  /*l
13651  *b Returns:
13652  **
13653  ** initial physics simulation mode
13654  */
13655  diguyPhysicsSimulationMode get_current_physics_simulation_mode();
13656 
13657  /*l
13658  *b Description:
13659  **
13660  ** This function sets the physics collision group this character will
13661  ** be in when being simulated. For improved performance, collision
13662  ** detection between various characters and scene objects will not
13663  ** be performed, based on which collision groups the objects are in.
13664  **
13665  ** By default:
13666  **
13667  *- - characters in character group n collide against props in prop
13668  *- group n and scene objects in scene object group n
13669  *- in group n
13670  *- - characters in group ghost don't collide against any other
13671  *- characters, but do against scene objects and props
13672  *- - characters in group everything collide against all characters,
13673  *- props, and scene objects
13674  *- - all props collide against all other props and scene objects
13675  **
13676  ** Collision group relationships can be modified using
13677  ** diguyApp::set_collision_group_detection_flag().
13678  **
13679  *b Arguments:
13680  **
13681  *a physics_simulation_mode - new current physics simulation mode
13682  **
13683  *b Returns:
13684  **
13685  ** 0 on success, -1 on failure
13686  */
13687  int set_physics_collision_group(diguyPhysicsCollisionGroup collision_group);
13688 
13689  /*l
13690  *b Returns:
13691  **
13692  ** physics collision group
13693  */
13694  diguyPhysicsCollisionGroup get_physics_collision_group();
13695 
13696  /*l
13697  *b Description:
13698  **
13699  ** This function sets a time at which active simulation of a physics
13700  ** controlled character will stop. This is useful for:
13701  **
13702  *- - reducing simulation processing overhead
13703  *- - freezing a simulation that is mostly in steady state, but some
13704  *- small part remains oscillating
13705  **
13706  ** The physics controlled character will remain frozen in the last
13707  ** computed simulated pose.
13708  **
13709  *b Arguments:
13710  **
13711  *a t - scenario t at which simulation will freeze
13712  **
13713  ** t should be large enough for the simulation to reach a reasonably
13714  ** steady state, such as a human lying on the ground. A value that
13715  ** is usually reasonable is around 5 seconds.
13716  */
13717  void set_stop_physics_sim_at_t(float t);
13718 
13719  /*l
13720  *b Description:
13721  **
13722  ** Similar to set_stop_physics_sim_at_t(), but the passed time will
13723  ** be relative to the current simulation time as returned by
13724  ** diguyScenario::get_t().
13725  */
13726  void set_stop_physics_sim_in_t_seconds(float relative_t);
13727 
13728  /*l
13729  *b Returns:
13730  **
13731  ** time at which physics simulation will freeze
13732  */
13733  float get_stop_physics_sim_at_t();
13734 
13735  /*l
13736  *b Description:
13737  **
13738  ** This function applied an impulse force to the character. An
13739  ** impulse is a force that is applied all at one time, such as an
13740  ** explosion shock wave.
13741  **
13742  *b Arguments:
13743  **
13744  *a link - link to which impulse should be applied
13745  *a impulse_magnitude_[xyz] - magnitude of impulse in x direction
13746  *a link_offset_[xyz] - offset on link at which to apply impulse
13747  *a set_simulation_drives_character - pass 1 to automatically change
13748  *a the character's current simulation mode
13749  *a to DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER
13750  */
13751  void apply_impulse_to_physics_sim(const char* link,
13752  float impulse_magnitude_x,
13753  float impulse_magnitude_y,
13754  float impulse_magnitude_z,
13755  float link_offset_x = 0.0f,
13756  float link_offset_y = 0.0f,
13757  float link_offset_z = 0.0f,
13758  int set_simulation_drives_character = 1);
13759 
13760  /*l
13761  *b Description:
13762  **
13763  ** Similar to apply_impulse_to_physics_sim(), but impulse can be
13764  ** calculated relative to a world position. This is useful if, for
13765  ** example, a character should react to a nearby explosion.
13766  **
13767  *b Arguments:
13768  **
13769  *a link - link to which impulse should be applied
13770  *a impulse_magnitude_[xyz] - magnitude of impulse
13771  *a impulse_generator_position_[xyz] - world coordinates of impulse
13772  *a generating object
13773  *a max_distance - maximum distance from above position at
13774  *a which the impulse can affect this
13775  *a character
13776  *a impulse_rolloff - how much the impulse magnitude should
13777  *a decrease as distance from impulse source
13778  *a increases
13779  *a link_offset_[xyz] - offset on link at which to apply impulse
13780  *a set_simulation_drives_character - pass 1 to automatically change
13781  *a the character's current simulation mode
13782  *a to DIGUY_PHYSICS_SIMULATION_MODE_SIM_DRIVES_CHARACTER
13783  */
13784  void apply_impulse_to_physics_sim_from_world_position(const char* link,
13785  float impulse_magnitude_x,
13786  float impulse_magnitude_y,
13787  float impulse_magnitude_z,
13788  float impulse_generator_position_x,
13789  float impulse_generator_position_y,
13790  float impulse_generator_position_z,
13791  float max_distance = 20.0f,
13792  float impulse_rolloff = 0.0f,
13793  float link_offset_x = 0.0f,
13794  float link_offset_y = 0.0f,
13795  float link_offset_z = 0.0f,
13796  int set_simulation_drives_character = 1);
13797 
13798 /*****************************************************************************/
13802  /*l
13803  *b Description:
13804  **
13805  ** Sets texture load behavior to DIGUY_LOAD_INSTANTLY, DIGUY_LOAD_PRIORITY_ASYNC, or
13806  ** DIGUY_LOAD_ASYNC
13807  */
13808  static int set_texture_load_behavior(diguyGraphicsTextureLoadingBehavior mode);
13809 
13810  /*l
13811  *b Returns current behavior, as set in set_texture_load_behavior()
13812  */
13813  static diguyGraphicsTextureLoadingBehavior get_texture_load_behavior();
13814 
13815  /*l
13816  *b Description:
13817  **
13818  ** Sets maximum quality of shader to use (actual quality varies
13819  ** by distance from camera). See diguyGraphicsShaderQualityLevel for
13820  ** possible values.
13821  **
13822  *b Arguments:
13823  **
13824  *a quality_level - a value between DIGUY_GRAPHICS_SHADER_QUALITY_UNLIT
13825  *- and DIGUY_GRAPHICS_SHADER_QUALITY_MAX
13826  */
13827  static int set_max_shader_quality_level(int quality_level);
13828 
13829  /*l
13830  *b Returns:
13831  **
13832  ** max shader quality level, as set by set_max_shader_quality_level()
13833  */
13834  static int get_max_shader_quality_level();
13835 
13836 
13837 
13838 /****************************************************************************/
13845 /****************************************************************************/
13846  /*l
13847  *b Description:
13848  * Documentation Pending
13849  */
13850  int set_animation_events_enabled(int enable);
13851  int get_animation_events_enabled();
13852 
13854  int get_has_bump_maps();
13855 
13856  /*l
13857  *b Description:
13858  **
13859  ** This function returns how many channels the specified action has.
13860  ** If an action has more than one channel, the relative weights of
13861  ** its channels can be set using the set_action_channel_weight()
13862  ** function.
13863  **
13864  *b Arguments:
13865  **
13866  *a action_name - name of action to be queried
13867  **
13868  *b Returns:
13869  **
13870  ** number of channels in specified action
13871  */
13872  int get_action_num_channels(const char* action_name);
13873 
13874  /*l
13875  *b Description:
13876  **
13877  ** This function sets the weight one channel of a multi-channel
13878  ** action.
13879  **
13880  ** The passed weight should be between 0 and 1. The weights of
13881  ** the other channels in the action will be adjusted so that the
13882  ** total weight of all channels is 1.
13883  **
13884  *b Arguments:
13885  **
13886  *a action_name - name of action to be affected
13887  *a channel - which channel's weight to set
13888  *a weight - weight of the channel, between 0 and 1
13889  **
13890  *b Returns:
13891  **
13892  ** 0 on success, -1 on failure
13893  */
13894  int set_action_channel_weight(const char* action_name,
13895  char channel,
13896  float weight);
13897 
13898  /*l
13899  *b Description:
13900  **
13901  ** This function returns the weight of one channel of a multi-channel
13902  ** action.
13903  **
13904  *b Arguments:
13905  **
13906  *a action_name - name of action to be queried
13907  *a channel - which channel's weight to return
13908  **
13909  *b Returns:
13910  **
13911  ** weight of a channel
13912  */
13913  float get_action_channel_weight(const char* action_name,
13914  char channel);
13915 
13916  /*l
13917  *b Description:
13918  **
13919  ** This function returns the number of seconds before the transition
13920  ** to the desired action begins. If the character is already
13921  ** performing the desired action the function returns 0.
13922  **
13923  *b THIS FUNCTION DOES NOT YET RETURN VALID RESULTS.
13924  **
13925  *b Returns:
13926  **
13927  ** time to reach desired action, in seconds
13928  */
13929  float get_time_to_reach_desired_action();
13930 
13931  /*l
13932  *b Description:
13933  **
13934  ** Maps a character type map field to its value. See diguyCharacterTypeMap.
13935  **
13936  ** Returns:
13937  **
13938  ** The value, as a string.
13939  */
13940  const char* get_type_map_field(diguyCharacterTypeMapField field);
13941 
13942  /*l
13943  *b Description:
13944  **
13945  ** Maps a character type map field to its value, using a string version (e.g.
13946  ** "age") of the field name. See diguyCharacterTypeMap.
13947  **
13948  ** Returns:
13949  **
13950  ** The value, as a string.
13951  */
13952  const char* get_type_map_field_using_string(const char* field);
13953 
13954  /*l
13955  *b Description:
13956  **
13957  ** This function performs a "micro merge", allowing a diguyCharacter
13958  ** to have objects added to it by parsing a .dss file fragment in the
13959  ** form of a string.
13960  **
13961  ** This function can be used, for example, to add paths to
13962  ** dynamically created agents. A Lua Package can contain a number of
13963  ** text strings representing local paths for agents. On character
13964  ** creation these strings can be merged in and turned into
13965  ** per-character objects.
13966  **
13967  ** The DI-Guy Scenario path page has a "Display Asset" button for
13968  ** generating merge_object() compatible strings.
13969  **
13970  ** There is also a diguyScenario::merge_object() function that allows
13971  ** the merging of text blocks that represent sounds and particle
13972  ** systems.
13973  **
13974  ** Note: the parser is very sensitive to tabs and formatting!
13975  */
13976  int merge_object(const char* object);
13977 
13978  /*l
13979  *b Description:
13980  **
13981  ** Returns 1 if any active character in the named group is visible,
13982  ** otherwise 0.
13983  **
13984  *b Arguments:
13985  **
13986  *a group_name
13987  *a max_distance_to_check
13988  */
13989  int is_active_character_in_group_visible(const char* group_name,
13990  float max_distance_to_check = 100000.0f);
13991 
13992  /*l
13993  *b Description:
13994  **
13995  ** Gets local space bounding box, this function is currently expensive
13996  ** and should be used with care.
13997  **
13998  *b Arguments:
13999  **
14000  *a x1,y1,z1,x2,y2,z2 - output parameters
14001  **
14002  *b Returns:
14003  **
14004  ** 0 on success, -1 on failure
14005  ** (float * arguments converted to return values in Lua)
14006  */
14007  int get_local_space_bounding_box(float* x1, float* y1, float* z1,
14008  float* x2, float* y2, float* z2);
14009 
14010  /*l
14011  *b Description:
14012  **
14013  ** This causes a character's mind to get an update call even if time
14014  ** isn't passing in the scenario. This is occasionally useful for
14015  ** characters that are managing the UI.
14016  **
14017  ** Note that there is now a luaUIStateMachine that might be a better
14018  ** solution.
14019  */
14020  void set_mind_always_updates(int force_update);
14021 
14023  int get_mind_always_updates();
14024 
14025  /*l
14026  ** Returns angle in degrees from character's "forward facing" vector
14027  ** to the specified action bead, on the specified path
14028  */
14029  float get_angle_to_path(const char* path_name,
14030  const char* action_bead_name = NULL);
14031 
14032 
14033  /*
14034  * DI-Guy doesn't use these masks internally, but they can be useful
14035  * for some DI-Guy Graphics API scene graph implementations.
14036  */
14037  void set_scene_graph_mask(unsigned int mask);
14038  unsigned int get_scene_graph_mask();
14039 
14040  /*l
14041  *b Description:
14042  **
14043  ** Turns on texture modulation system that tries to make all characters look
14044  ** unique. Only supported by some appearances currently.
14045  */
14046  int set_use_texture_variations(int value);
14047 
14048  /*l
14049  *b Returns:
14050  ** If texture variations have been enabled for this character. Note: some
14051  ** characters now have texture variation
14052  */
14053  int get_use_texture_variations();
14054 
14055 
14060  diguyMotionEngineSnapshot get_motion_engine_snapshot();
14061 
14063  int apply_motion_engine_snapshot(const diguyMotionEngineSnapshot & action_info);
14064 
14065 
14066 
14068  int set_local_to_world_orientation_matrix( float rz, float rx, float ry);
14069  int set_local_to_world_orientation_matrix(
14070  float a0, float a1, float a2,
14071  float b0, float b1, float b2,
14072  float c0, float c1, float c2, int transpose = 0);
14073 
14074  int set_final_position_double(double x, double y, double z);
14075  int set_final_matrix(
14076  float a0, float a1, float a2, float a3,
14077  float b0, float b1, float b2, float b3,
14078  float c0, float c1, float c2, float c3,
14079  float d0, float d1, float d2, float d3);
14080 
14081 /****************************************************************************/
14082 /****************************************************************************/
14093 /****************************************************************************/
14094 /****************************************************************************/
14095 /****************************************************************************/
14096 
14097  // Deprecated as of 13.0;
14098  // Aim code has been robustified these shouldn't be needed anymore
14099  int aim_converge(int max_iterations = 30);
14100 
14102  void set_aim_algorithm(int aim_algorithm);
14103 
14105  int get_aim_algorithm();
14106 
14107  // Deprecated as of 9.1.3; use diguyCharacter::get_position_link() instead.
14108  // diguyGraphicsLink* get_base_link();
14109 
14110  // Deprecated as of 9.0.1; use set_apply_actor_scale_to_action_bead_travel() instead.
14111  // void set_apply_actor_scale_to_action_bead_xy_travel(int apply_scale_flag);
14112 
14113  // Deprecated as of 9.0.1; use get_apply_actor_scale_to_action_bead_travel() instead.
14114  // int get_apply_actor_scale_to_action_bead_xy_travel();
14115 
14116  /*l
14117  ** Deprecated as of 9.1.4. In general setting the weapon sound
14118  ** should no longer be necessary, as weapon sounds are now specified
14119  ** by the weapon's munition type. If this function is called, it
14120  ** will have the same effect as calling
14121  ** diguyCharacter::set_weapon_sound_override().
14122  */
14123  // int set_default_weapon_sound(const char* sound_name);
14124 
14125  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14126  //const char* get_default_weapon_sound();
14127 
14128  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14129  // int set_default_weapon_sound_gain(float gain);
14130 
14131  // Deprecated as of 9.1.4. See comments for set_default_weapon_sound().
14132  // float get_default_weapon_sound_gain();
14133 
14134  // Deprecated as of 9.1.4. Call set_weapon_munition_type_override() instead.
14135  // int set_weapon_munition_type(const char* munition_type);
14136 
14137  // Deprecated as of 9.1.4. Call get_weapon_munition_type_override() instead.
14138  // const char* get_weapon_munition_type();
14139 
14140  // Deprecated as of 10.5.2. Call set_weapon_max_azimuth_error() instead.
14141  // int set_weapon_horizontal_error(float h_error);
14142 
14143  // Deprecated as of 10.5.2. Call get_weapon_max_azimuth_error() instead.
14144  // float get_weapon_horizontal_error();
14145 
14146  // Deprecated as of 10.5.2. Call set_weapon_max_elevation_error() instead.
14147  // int set_weapon_vertical_error(float v_error);
14148 
14149  // Deprecated as of 10.5.2. Call get_weapon_max_elevation_error() instead.
14150  // float get_weapon_vertical_error();
14151 
14152  // Added as of 10.1.6. Invokes the old implementation of
14153  // begin_appearance_effect().
14154  //int begin_legacy_appearance_effect(const char* effect,
14155  // const char* override_link = "",
14156  // float override_scale = DIGUY_DEFAULT_FLOAT,
14157  // float override_offset_x = DIGUY_DEFAULT_FLOAT,
14158  // float override_offset_y = DIGUY_DEFAULT_FLOAT,
14159  // float override_offset_z = DIGUY_DEFAULT_FLOAT);
14160 
14161 
14162  // Added as of 10.1.6. Invokes the old implementation of
14163  // end_appearance_effect().
14164  //
14165  //int end_legacy_appearance_effect(const char* effect);
14166 
14167  // Added as of 10.1.6. Invokes the old implementation of
14168  // appearance_effect_is_active().
14169  //int legacy_appearance_effect_is_active(const char* effect);
14170 
14171  // Deprecated as of 10.1.8. Use set_render_mode_shader() instead.
14172  //int set_shader_program(const char* shader_name);
14173 
14174  // Deprecated as of 10.5.2. Use get_render_mode_shader() instead.
14175  //const char* get_recommended_appearance_shader_program_name();
14176 
14177  // Deprecated as of 10.5.1. Use merge_object() instead.
14178  //int merge_asset(const char* asset);
14179 
14180  // Deprecated as of 10.5.2. Use get_DIS_trailing_effect_state() instead.
14181  // void set_DIS_smoke_trail_state(int state);
14182 
14183  // Deprecated as of 10.5.2. Use get_DIS_trailing_effect_state() instead.
14184  // int get_DIS_smoke_trail_state();
14185 
14186  /*l
14187  ** Deprecated as of 12.0.0. Not supported in FaceFX.
14188  */
14189  int speak(const char* string);
14190 
14191  /*l
14192  ** Deprecated as of 12.0.0. Not supported in FaceFX.
14193  */
14194  int set_viseme(const char* viseme_name, float weight);
14195 
14196  /*l
14197  ** Deprecated as of 12.0.0. Not supported in FaceFX.
14198  */
14199  float get_viseme(const char* viseme_name);
14200 
14201  /*l
14202  ** Deprecated as of 12.0.0. Not supported in FaceFX.
14203  */
14204  int set_orientation_eye_left(float azimuth, float elevation);
14205 
14206  /*l
14207  ** Deprecated as of 12.0.0. Not supported in FaceFX.
14208  */
14209  int set_orientation_eye_right(float azimuth, float elevation);
14210 
14211  /*l
14212  ** Deprecated as of 12.0.0. Not supported in FaceFX.
14213  */
14214  float get_azimuth_eye_left();
14215 
14216  /*l
14217  ** Deprecated as of 12.0.0. Not supported in FaceFX.
14218  */
14219  float get_elevation_eye_left();
14220 
14221  /*l
14222  *b Returns:
14223  **
14224  ** the current azimuth of the right eye; see set_orientation_eyes()
14225  */
14226  float get_azimuth_eye_right();
14227 
14228  /*l
14229  *b Returns:
14230  **
14231  ** the current elevation of the right eye; see set_orientation_eyes()
14232  */
14233  float get_elevation_eye_right();
14234 
14235 /****************************************************************************/
14236 /****************************************************************************/
14237 
14242 #ifdef CPLUSPLUS_ONLY
14243 
14244  bdiScenarioCharacter* get_scripted_object();
14245 private:
14246 
14247  /*l
14248  ** A private constructor.
14249  */
14250  diguyCharacter(bdiScenarioCharacter* character);
14251 
14252  /*l
14253  ** A private destructor.
14254  */
14255  ~diguyCharacter();
14256 
14257  /*l
14258  ** A pointer to internal data.
14259  */
14260  bdiScenarioCharacter* m_scripted_object;
14261 
14262  friend class bdiPublishedCharacter;
14263  friend class bdiScenarioCharacter;
14264  friend class diguySensorRegion;
14265  friend class diguyScenario;
14266 
14267 #endif
14268 
14269 };
14270 
14271 
14272 #endif /* __diguyCharacter_H */
14273 
Definition: diguyViewLabel.h:44
A class that represents the unique per-character shader object.
Definition: diguyGraphicsShaderInstance.h:55
diguyGraphicsTextureLoadingBehavior
Definition: diguy_constants.h:377
Experimental class for helping with multichannel synchronization.
Definition: diguyMotionEngineSnapshot.h:6
#define DIGUY_DEFAULT_FLOAT
This value is a magic number that, when passed to certain functions, means that the function should u...
Definition: diguy_constants.h:79
diguyCallbackReturn diguyCharacterCallback(diguyCharacter *character, int callback_id, void *callback_params, void *callback_user_data)
Definition: diguy_typedefs.h:48
diguyCharacterTypeMapField
This enumeration allows type map fields to be queried using a numerical value rather than a string na...
Definition: diguyCharacterTypeMap.h:33
The class that represents what parameters a agent is currently using to carry out their base behavior...
Definition: diguyAgentParams.h:40
Definition: diguyChainSimulation.h:37
diguyHistoryType
DI-Guy history types.
Definition: diguy_constants.h:284
Definition: diguyPathShape.h:30
diguyMotionDirection
Definition: diguyMotionDirection.h:26
Definition: diguy_vector_classes.h:152
A class that represents a bullet impact in the world, often used by AIs to make reaction decisions...
Definition: diguyImpact.h:41
A bead that sits on a character's spline path and triggers a new gaze.
Definition: diguyCharacterPathGazeBead.h:35
Definition: diguyMotionPosture.h:32
diguyConnectionPointType
Definition: diguyConnectionPointType.h:27
Definition: diguy_constants.h:184
#define DIGUY_DEFAULT_INT
This value is a magic number that, when passed to certain functions, means that the function should u...
Definition: diguy_constants.h:89
Definition: diguy_constants.h:202
A view is a graphics window wherein the scenario and its characters are animated. Note that views hav...
Definition: diguyView.h:48
diguyMuzzle
This is an enumeration of the different muzzles that can be specified to various DI-Guy function call...
Definition: diguy_constants.h:200
A bead that sits on a character's spline path and triggers a new decision.
Definition: diguyCharacterPathDecisionBead.h:35
An interface for manipulating a character's spline path. Path is typically authored in DI-Guy Scenari...
Definition: diguyCharacterPath.h:50
diguyCharacterSimulator
This enumeration lists the ways that data can be generated for DI-Guy characters. ...
Definition: diguy_constants.h:1682
diguyCharacterClass
DI-Guy character classes.
Definition: diguy_constants.h:129
Attached to certain types of more complex vehicles, to manage their behavior.
Definition: diguyVehicleController.h:49
float diguyAltitudeFunction(diguyCharacter *character, float x, float y, float old_z, int *valid)
Definition: diguy_typedefs.h:54
int diguyCharacterLOSFunction(diguyCharacter *character, diguyCharacter *target_character, int visibility_type)
Definition: diguy_typedefs.h:103
Represents the scenario currently being portrayed.
Definition: diguyScenario.h:92
A group of DI-Guy characters, useful for organizing your scenarios.
Definition: diguyCharacterGroup.h:39
The class that represents a DI-Guy Entity in the world.
Definition: diguyCharacter.h:78
Definition: diguyWaypoint.h:29
Definition: diguySensorRegion.h:38
int diguyPointLOSFunction(diguyCharacter *character, float x, float y, float z)
Definition: diguy_typedefs.h:108
int diguyFeelerFunction(diguyCharacter *character, float origin_x, float origin_y, float origin_z, float dir_x, float dir_y, float dir_z, float max_distance_to_test, float *intersection_x, float *intersection_y, float *intersection_z, float *normal_x, float *normal_y, float *normal_z)
Definition: diguy_typedefs.h:61
static double t
4 Header files and forward declarations
Definition: simple_playback_ogl.cpp:53
Definition: diguy_constants.h:1513
Definition: diguyMotionVariant.h:54
diguyParameterComparison
This is an enumeration of the different parameter comparison options that can be specified to various...
Definition: diguy_constants.h:182
A class that allows end users to override a character's animation on a joint level.
Definition: diguyCharacterPoseOverride.h:38
diguyCallbackReturn
DI-Guy callbacks return a value of type diguyCallbackReturn, which will be DIGUY_CALLBACK_STOP or DIG...
Definition: diguy_constants.h:115
diguyMotionVariant
Definition: diguyMotionVariant.h:26
diguyCharacterMode
This is an enumeration of the different modes a DI-Guy character can be in.
Definition: diguy_constants.h:167
A class representing a overlaid performance on a character's base animation.
Definition: diguyCharacterGesture.h:46
A bead that sits on a character's spline path and triggers a new script evaluation.
Definition: diguyCharacterPathScriptBead.h:36
Definition: diguySoundInstance.h:29
Definition: diguyVariable.h:38
diguyCharacterAppearanceTypes
DI-Guy character appearance query API, this is for diguyCharacter::get_num_appearances_of_type() ...
Definition: diguy_constants.h:151
diguyPhysicsSimulationMode
This enumeration lists the modes that a DI-Guy character physics sim can be in, when the character si...
Definition: diguy_constants.h:1699
diguyPhysicsCollisionGroup
This enumeration lists the collision groups that a DI-Guy physics sim object can be in...
Definition: diguy_constants.h:1715
This class implements shader programs for use with DI-Guy character graphics.
Definition: diguyGraphicsShaderProgram.h:94
The class that represents a DI-Guy Crowd.
Definition: diguyCrowd.h:48
Represents algorithm for steering and maneuvering a character towards a goal point.
Definition: diguyCharacterGuide.h:474
diguyMotionPosture
Definition: diguyMotionPosture.h:26
A bead that sits on a character's spline path and triggers a new aim event.
Definition: diguyCharacterPathAimBead.h:35