DI-Guy SDK Documentation  13.2
diguyScenario.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2016 VT MAK
4  ** All rights reserved.
5  *********************************************************************/
6 
7 /*********************************************************************
8  **
9  *t diguyScenario
10  **
11  *b Link against: libdiguy
12  */
13 
14 #ifndef __diguyScenario_H
15 #define __diguyScenario_H
16 
17 #ifdef SWIG
18 %module diguyScenario
19 #else
20 #define CPLUSPLUS_ONLY
21 #endif
22 
23 #ifdef CPLUSPLUS_ONLY
24 
25 #include <declspec_diguy.h>
26 #include <diguyViewCamera.h>
27 #include <diguyViewFog.h>
28 #include <diguyViewLight.h>
29 #include <diguyMotionDirection.h>
30 #include <diguyMotionPosture.h>
31 #include <diguyMotionVariant.h>
32 #include <diguyCharacterTypeMap.h>
33 #include <diguy_vector_classes.h>
34 
35 #include "diguy_constants.h"
36 #include "diguy_typedefs.h"
37 #include "diguyCharacterPath.h"
39 #include "diguySensorRegion.h"
40 #include "diguySignal.h"
41 #include "diguyVariable.h"
42 #include "diguyView.h"
43 
44 class bdiScenario;
46 class diguyChainSettings;
47 class diguyCharacter;
51 class diguyCrowd;
52 class diguyCrowdProfile;
53 class diguyLoadManager;
54 class diguyFormation;
55 class diguyViewLabel;
57 class diguyInfoPopup;
58 class diguyImpact;
59 class diguyPathShape;
60 class diguyRegion;
62 class diguySceneObject;
63 class diguySensorRegion;
64 class diguySound;
65 class diguyVariable;
66 class diguyWaypoint;
67 class diguyView;
73 
74 #endif
75 
92 /****************************************************************************/
93 class BDI_DECLSPEC_diguy diguyScenario
94 {
95 
96 /*****************************************************************************/
106 public:
107 
108  /*l
109  *b Description:
110  **
111  ** This static function returns a pointer to the current scenario
112  ** object. All functions below can then be called through this
113  ** pointer. This is the same pointer returned by the call
114  ** diguy_create_scenario().
115  **
116  ** lua scripts get the current scenario through the variable
117  ** this_scenario.
118  **
119  *b Returns:
120  **
121  ** a pointer of type diguyScenario
122  **
123  *b C++ Example:
124  **
125  *e diguyScenario* sc = diguyScenario::get_current_scenario();
126  *e sc->reset();
127  **
128  *b Lua Example:
129  **
130  *e this_scenario:reset();
131  */
132  static diguyScenario* get_current_scenario();
133 
134  /*l
135  *b Description:
136  **
137  ** Returns the name of the object. This pointer will never be NULL.
138  **
139  *b Returns:
140  **
141  ** name of the object
142  */
143  const char* get_name();
144 
145  /*l
146  *b Description:
147  **
148  ** Returns the type name of the object. This pointer will never be
149  ** NULL.
150  **
151  *b Returns:
152  **
153  ** type name of the object
154  */
155  const char* get_type_name();
156 
157  /*l
158  *b Returns:
159  **
160  ** the scenario description as specified in the scenario info page
161  */
162  const char* get_description();
163 
164 
165 /*****************************************************************************/
175 #ifdef CPLUSPLUS_ONLY
176 
177  /*l
178  *b Description:
179  **
180  ** Sets the desired simulation time of the scenario.
181  **
182  ** Some update operations will use the simulation desired time
183  ** directly.
184  **
185  ** Many other scenario operations -- notably character position and
186  ** pose updates -- will not happen until the desired t passes each
187  ** subsequent tick dt threshold. See set_tick_dt().
188  **
189  ** This function sets both elapsed simulation time and elapsed
190  ** realtime to the same value. This is usually desired in DI-Guy
191  ** applications. To pass separate values for simulation time and
192  ** realtime time, call update2().
193  **
194  ** Time can be run backwards. This happens if the passed t is lower
195  ** than any t previously passed to the update() function; the
196  ** scenario remembers the highest t it has reached. If t is set to
197  ** less that the highest t reached, characters that have history data
198  ** will replay what they were doing at the specified time.
199  ** Characters that do not have history will remain motionless until t
200  ** advances past the previous highest t.
201  **
202  ** Scenario time will never go below 0.
203  **
204  ** If t reaches the scenario tout ("T Out") time (as set by
205  ** set_tout(), a number of things may happen. The scenario may:
206  **
207  *- - simply stop at the tout time
208  *- - continue past the tout time
209  *- - rewind to time 0 and play back recorded history
210  *- - reset and re-simulate the scenario from time 0
211  **
212  ** The default tout time is 60000 for DI-Guy applications. The tout
213  ** can be enabled and disabled with set_tout_enabled().
214  **
215  ** This function cannot explicitly be called for DI-Guy Scenario, but
216  ** the effects of t reaching tout during scenario simulation are
217  ** outlined here anyway.
218  **
219  *b For a DI-Guy application:
220  **
221  *- - If the scenario tout is enabled the scenario will stop.
222  *
223  *- - If the scenario tout is disabled the scenario will continue
224  *- indefinitely, regardless of scenario tout.
225  **
226  ** Note that no playback looping happens in a DI-Guy application if
227  ** tout is reached. Only in DI-Guy Scenario does the loop flag
228  ** have an effect.
229  *-
230  *b For DI-Guy Scenario:
231  **
232  *- - If the loop flag is not set (see set_playback_loop()) or a movie
233  *- is being recorded, the scenario will stop.
234  *
235  *- - If the loop flag is set, and any character in the scenario has
236  *- history data (see the History Functions for diguyCharacter), the
237  *- scenario will be rewound to 0 and play back history data.
238  *
239  *- - If the loop flag is set, but no characters in the scenario have
240  *- history data, the scenario will be reset to 0 and re-simulate
241  *- from there.
242  **
243  *b Arguments:
244  **
245  *a t - desired time in seconds
246  **
247  *b Returns:
248  **
249  ** 0 on success, -1 on failure
250  **
251  *b Callable From:
252  **
253  *- - C++
254  */
255  int update(float t);
256 
257  /*l
258  *b Description:
259  **
260  ** Similar to update(), but the realtime time can be explicitly
261  ** passed in.
262  **
263  *b Arguments:
264  **
265  *a t - desired simulation time in seconds
266  *a realtime_t - elapsed real time in seconds
267  **
268  *b Returns:
269  **
270  ** 0 on success, -1 on failure
271  **
272  *b Callable From:
273  **
274  *- - C++
275  */
276  int update2(float t, float realtime_t);
277 
278  /*l
279  *b Description:
280  **
281  ** This function sets whether the scenario is designed to loop at
282  ** tout. The default is for scenarios to loop.
283  **
284  ** Note that this has an effect only in DI-Guy Scenario. DI-Guy
285  ** applications do not use this flag.
286  **
287  ** See get_playback_loop().
288  **
289  *b Arguments:
290  **
291  *a playback_loop - pass 1 to have scenario loop at tout, 0 to not
292  **
293  *b Returns:
294  **
295  ** 0 on success, -1 on failure
296  **
297  *b Callable From:
298  **
299  *- - C++
300  */
301  int set_playback_loop(int playback_loop);
302 
303  /*l
304  *b Description:
305  **
306  ** Scenarios progress at discrete time steps, called "ticks". Each
307  ** tick is of the same duration. This function sets the amount of
308  ** time each tick takes.
309  **
310  ** Because changing the tick interval of a scenario changes when
311  ** event beads occur, any change may introduce subtle differences in
312  ** scenario playback.
313  **
314  ** Note that loading a .dss file will change the tick dt, as tick dt
315  ** is set on a per scenario basis.
316  **
317  ** The default tick dt of a new scenario is 0.03125 seconds, or 32
318  ** frames per second.
319  **
320  *b Arguments:
321  **
322  *a tick_dt - duration, in seconds, of each scenario tick
323  **
324  *b Returns:
325  **
326  ** 0 on success, -1 on failure
327  **
328  *b Callable From:
329  **
330  *- - C++
331  **
332  *b C++ Example:
333  **
334  *e diguyScenario* sc = diguy_create_scenario();
335  *e if (sc)
336  *e {
337  *e sc->load("my_scenario.dss");
338  *e sc->set_tick_dt(0.033333); // 30 fps
339  *e }
340  */
341  int set_tick_dt(float tick_dt);
342 
343 #endif
344 
345  /*l
346  *b Description:
347  **
348  ** This function returns the time in seconds that the scenario is
349  ** currently at. See update().
350  **
351  ** Note that this value will not necessarily track the t passed in
352  ** the update() function. This t advances only when the scenario's
353  ** current tick changes. See set_tick_dt() and update().
354  **
355  *b Returns:
356  **
357  ** current time in seconds
358  */
359  float get_t();
360 
361  /*l
362  *b Description:
363  **
364  ** This function returns the realtime time in seconds that the
365  ** scenario is currently at. This may be different than
366  ** get_desired_t() if the scenario is stopped or the time passed in
367  ** update() is not tracking realtime.
368  **
369  *b Returns:
370  **
371  ** current time in seconds
372  */
373  float get_realtime_t();
374 
375  /*l
376  *b Description:
377  **
378  ** This function returns the desired time in seconds that the
379  ** scenario is currently at. This may be different than get_t(),
380  ** which advances only when the scenario's current tick changes.
381  **
382  *b Returns:
383  **
384  ** current time in seconds
385  */
386  float get_desired_t();
387 
388  /*l
389  *b Description:
390  **
391  ** This function sets the tout ("T Out") time of the scenario. What
392  ** will happen when the scenario reaches this time depends on a
393  ** number of factors. See update() for more information.
394  **
395  *b Returns:
396  **
397  ** 0 on success, -1 on failure
398  **
399  *b Callable From:
400  **
401  *- - C++
402  */
403  int set_tout(float tout);
404 
405  /*l
406  *b Description:
407  **
408  ** This function returns the tout time of the scenario. This is the
409  ** time at which a scenario is designed to end.
410  **
411  ** See set_tout() and update().
412  **
413  *b Returns:
414  **
415  ** tout of scenario
416  */
417  float get_tout();
418 
419  /*l
420  *b Description:
421  **
422  ** This function sets what will happen when the scenario reaches its
423  ** tout time. If set to 0, the scenario will ignore the tout time
424  ** and continue indefinitely.
425  **
426  ** See update() for more information.
427  */
428  void set_tout_enabled(int tout_enabled);
429 
430  /*l
431  *b Description:
432  **
433  ** This function returns the whether tout is enabled.
434  **
435  ** See set_tout_enabled() and update().
436  **
437  *b Returns:
438  **
439  ** 1 if tout enabled, 0 if not
440  */
441  int get_tout_enabled();
442 
443  /*l
444  *b Description:
445  **
446  ** This function returns whether the scenario is designed to loop
447  ** when the scenario's tout time is reached.
448  **
449  ** See update() for more information about looping.
450  **
451  *b Returns:
452  **
453  ** 0 if no loop desired; 1 if loop desired
454  */
455  int get_playback_loop();
456 
457  /*l
458  *b Description:
459  **
460  ** This function returns the most recent setting of set_tick_dt().
461  */
462  float get_tick_dt();
463 
464  /*l
465  *b Returns:
466  **
467  ** This function returns the most recent setting of
468  ** set_ticks_can_be_dropped().
469  */
470  int get_ticks_can_be_dropped();
471 
472  /*l
473  *b Description:
474  **
475  ** This function sets whether a scenario can "drop" ticks in order to
476  ** catch up if it falls behind.
477  **
478  ** Scenario updates progress in discrete time steps called ticks (see
479  ** set_tick_dt() and update()). If the difference in times specified
480  ** in subsequent calls to update() is greater than the tick dt, which
481  ** can happen if calls to update() are taking too long because the
482  ** scenario is too complex or if the caller is attempting to "fast
483  ** forward" to a particular time in the scenario, the scenario may
484  ** skip processing of intermediate ticks in order to catch up.
485  **
486  ** The scenario will not consider itself behind until the number of
487  ** ticks covered by a particular call to update() is equal to or
488  ** greater than the value set by set_max_ticks_behind_until_drop().
489  **
490  ** Dropping ticks, while it improves performance, may have unintended
491  ** side effects, including:
492  **
493  *- - event beads of characters on paths that fall on the dropped
494  *- ticks -- including aim beads, decision beads, gaze beads, and
495  *- script beads -- will not be evaluated and will therefore have
496  *- no effect on the scenario
497  *- - review playback of characters (see
498  *- diguyCharacter::set_history_type()) over the dropped intervals
499  *- will be choppy
500  **
501  ** Not dropping ticks also has potential side effects:
502  **
503  *- - if a scenario is falling behind more and more on each call
504  *- to update(), it may never be able to catch up and performance
505  *- of DI-Guy will increasingly degrade
506  **
507  ** The default setting is that ticks can be dropped.
508  **
509  *b Arguments:
510  **
511  *a ticks_can_be_dropped - pass 1 for ticks to be dropped; else
512  *a pass 0
513  */
514  void set_ticks_can_be_dropped(int ticks_can_be_dropped);
515 
516  /*l
517  *b Returns:
518  **
519  ** This function returns the most recent setting of
520  ** set_max_ticks_behind_until_drop().
521  */
522  long get_max_ticks_behind_until_drop();
523 
524  /*l
525  *b Description:
526  **
527  ** This function sets how many ticks a scenario must be behind before
528  ** it starts dropping ticks in order to catch up.
529  **
530  ** For a discussion of how a scenario may fall behind, see
531  ** set_ticks_can_be_dropped().
532  **
533  ** Note that if ticks cannot be dropped, (e.g., 0 is passed to
534  ** set_ticks_can_be_dropped()) this function will have no effect.
535  **
536  ** The default value is 0 in the DI-Guy SDK, In DI-Guy Scenario it is 2.
537  **
538  *b Arguments:
539  **
540  *a max_ticks_behind_until_drop - how many ticks a scenario must
541  *a be behind until it drops ticks
542  */
543  void set_max_ticks_behind_until_drop(long max_ticks_behind_until_drop);
544 
545  /*l
546  *b Description:
547  **
548  ** This function sets the current playback mode of DI-Guy Scenario.
549  ** It currently will have no effect in applications using the DI-Guy
550  ** API.
551  **
552  *b Arguments:
553  **
554  *a playback_mode - new playback mode
555  **
556  *b Returns:
557  **
558  ** 0 on success, -1 on failure
559  */
560  int set_playback_mode(diguyScenarioPlaybackMode playback_mode);
561 
562  /*l
563  *b Description:
564  **
565  ** This function is shorthand for the function call
566  ** set_playback_mode(DIGUY_SCENARIO_PLAYBACK_MODE_STOP). It is
567  ** useful for pausing the scenario in decisions and decision beads.
568  **
569  *b Returns:
570  **
571  ** 0 on success, -1 on failure
572  **
573  *b Callable From:
574  **
575  *- - C++
576  *- - Script
577  *- - Decision
578  */
579  int set_playback_mode_stop();
580 
581  /*l
582  *b Description:
583  **
584  ** This function is shorthand for the function call
585  ** set_playback_mode(DIGUY_SCENARIO_PLAYBACK_MODE_PLAY). It is
586  ** useful for resuming a paused scenario in decisions and decision
587  ** beads.
588  **
589  *b Returns:
590  **
591  ** 0 on success, -1 on failure
592  **
593  *b Callable From:
594  **
595  *- - C++
596  *- - Script
597  *- - Decision
598  */
599  int set_playback_mode_play();
600 
601  /*l
602  *b Returns:
603  **
604  ** current playback mode as set by set_playback_mode() or the
605  ** DI-Guy Scenario user interface
606  */
607  diguyScenarioPlaybackMode get_playback_mode();
608 
609  /*l
610  *b Description:
611  **
612  ** This function derives a dt based on an input dt (usually derived
613  ** from change in realtime from previous to current frame) and the
614  ** scenario's current playback mode. The resulting dt can then be
615  ** used to advance the time passed to diguyScenario::update() so that
616  ** it emulates the effect of the VCR buttons in DI-Guy Scenario.
617  **
618  ** This function does not change the scenario's current time or
619  ** playback mode.
620  **
621  ** Examples based on a dt_in of 0.03 seconds:
622  **
623  *- - DIGUY_SCENARIO_PLAYBACK_MODE_STOP: derived_dt = 0.0
624  *- - DIGUY_SCENARIO_PLAYBACK_MODE_PLAY: derived_dt = 0.03
625  *- - DIGUY_SCENARIO_PLAYBACK_MODE_PLAY_REVERSE: derived_dt = -0.03
626  *- - DIGUY_SCENARIO_PLAYBACK_MODE_FF: derived_dt = 0.12
627  *- - DIGUY_SCENARIO_PLAYBACK_MODE_FF_REVERSE: derived_dt = -0.12
628  *- - DIGUY_SCENARIO_PLAYBACK_MODE_SS: derived_dt = frame dt
629  *- - DIGUY_SCENARIO_PLAYBACK_MODE_SS_REVERSE: derived_dt = - frame dt
630  *- - DIGUY_SCENARIO_PLAYBACK_MODE_REWIND: derived_dt = - scenario t
631  **
632  ** Note that the playback mode should be set to
633  ** DIGUY_SCENARIO_PLAYBACK_MODE_STOP after time advances in either of
634  ** the single step ("SS") modes or the rewind mode.
635  **
636  *b Arguments:
637  **
638  *a dt_in - delta time in seconds from advancing simulation time
639  */
640  float derive_playback_mode_dt(float dt_in);
641 
642  /*l
643  *b Description:
644  **
645  ** This function resets all scenario characters, signals, variables,
646  ** and all other scenario objects to their original state. Scenario
647  ** time will be set to 0.
648  **
649  *b Returns:
650  **
651  ** 0 on success, -1 on failure
652  */
653  int reset();
654 
655 
656 /*****************************************************************************/
661 #ifdef CPLUSPLUS_ONLY
662 
663  /*l
664  *b Description:
665  **
666  ** This function loads the specified scenario. Any previously loaded
667  ** scenario objects will be deleted. To merge a scenario into the
668  ** existing scenario (load without deleting existing objects), use
669  ** the call merge().
670  **
671  ** The passed filename can be either a ".dss" file, which is a DI-Guy
672  ** Scenario file, or a ".dsr" file, which is a DI-Guy Review file.
673  **
674  ** Once the file has been loaded an implicit reset() will occur.
675  **
676  *b Arguments:
677  **
678  *a filename - filename of scenario to be loaded
679  **
680  *b Returns:
681  **
682  ** 0 on success, -1 on failure
683  **
684  *b Callable From:
685  **
686  *- - C++
687  */
688  int load(const char* filename);
689 
690  /*l
691  *b Description:
692  **
693  ** Saves the scenario into its current filename. This filename will
694  ** be the most recent of:
695  **
696  *- - the filename used in a load() function call
697  *- - the filename used in a save_as() function call
698  **
699  ** The filename that will be used can be retrieved using the
700  ** get_filename() or get_filename_without_directory() functions.
701  **
702  ** Once saved the "unsaved" flag (as returned by get_unsaved()) will
703  ** be set to 0.
704  **
705  *b Returns:
706  **
707  ** 0 on success, -1 on failure
708  **
709  *b Callable From:
710  **
711  *- - C++
712  */
713  int save();
714 
715  /*l
716  *b Description:
717  **
718  ** Similar to save(), but new filename is specified by the filename
719  ** argument.
720  **
721  *b Arguments:
722  **
723  *a filename - new filename of scenario
724  **
725  *b Returns:
726  **
727  ** 0 on success, -1 on failure
728  **
729  *b Callable From:
730  **
731  *- - C++
732  */
733  int save_as(const char* filename);
734 
735  /*l
736  *b Description:
737  **
738  ** Returns the most recent of:
739  **
740  *- - the filename used in a load() function call
741  *- - the filename used in a save_as() function call
742  **
743  *b Returns:
744  **
745  ** filename of saved scenario
746  **
747  *b Callable From:
748  **
749  *- - C++
750  */
751  const char* get_filename();
752 
753  /*l
754  *b Description:
755  **
756  ** Similar to get_filename(), but with any leading directories
757  ** removed.
758  **
759  *b Callable From:
760  **
761  *- - C++
762  */
763  const char* get_filename_without_directory();
764 
765  /*l
766  *b Returns:
767  **
768  ** 1 if scenario has been modified since save or load, else 0
769  **
770  *b Callable From:
771  **
772  *- - C++
773  */
774  int get_unsaved();
775 
776  /*l
777  *b Description:
778  **
779  ** Manually sets the "unsaved" flag to the passed value.
780  **
781  *b Arguments:
782  **
783  *a unsaved - new unsaved status; 1 for unsaved, 0 for saved
784  **
785  *b Callable From:
786  **
787  *- - C++
788  */
789  void set_unsaved(int unsaved);
790 
791 #endif // CPLUSPLUS_ONLY
792 
793 /*****************************************************************************/
799 #ifdef CPLUSPLUS_ONLY
800 
801  /*l
802  *b Description:
803  **
804  ** This function draws all visible elements of the loaded scenario in
805  ** immediate mode graphics environments (see below). This is the
806  ** equivalent of calling draw_pass1(), immediately followed by
807  ** draw_pass2(), immediately followed by post_draw().
808  **
809  ** Note that any character graphics culling, far position rendering,
810  ** etc., depend on the render camera set by the set_render_camera()
811  ** function. A render camera does not always need to be set; see
812  ** set_render_camera() for more details.
813  **
814  *b Returns:
815  **
816  ** 0 on success, -1 on failure
817  **
818  *i OpenGL Version:
819  **
820  ** This function immediately draws all scenario elements. Either
821  ** this function, or draw_pass1(), draw_pass2(), and post_draw(),
822  ** should be called once per frame.
823  **
824  *b Callable From:
825  **
826  *- - C++
827  */
828  int draw();
829 
830  /*l
831  *b Description:
832  **
833  ** This function, along with draw_pass2(), allows the drawing of
834  ** opaque and transparent polygons to be separated. This function
835  ** draws all opaque polygons.
836  **
837  *b Returns:
838  **
839  ** 0 on success, -1 on failure
840  **
841  *i OpenGL Version:
842  **
843  ** This function immediately draws the opaque scenario elements.
844  ** Either this function or draw() should be called once per frame.
845  **
846  *b Callable From:
847  **
848  *- - C++
849  */
850  int draw_pass1();
851 
852  /*l
853  *b Description:
854  **
855  ** Same as draw_pass1(), but draws transparent scenario elements.
856  ** The also_call_post_draw argument is set to 1 for backwards
857  ** compatibility.
858  **
859  *b Callable From:
860  **
861  *- - C++
862  */
863  int draw_pass2(int also_call_post_draw = 1);
864 
865  /*l
866  *b Description:
867  **
868  ** Explicitly invokes particle drawing code, this can be useful for retained mode renderers
869  ** that have chosen to hook up our immediate mode particle system as a post draw stage (osg)
870  **
871  *b Callable From:
872  **
873  *- - C++
874  */
875  int draw_particles();
876 
877  /*l
878  *b Description:
879  **
880  ** Clears all the culling bits state for various characters, this should be called before any drawing is done.
881  ** It allows for multiple draw passes culling state info to get accumulated together. This is needed to
882  ** efficiently avoiding updating graphics classes for characters that are out of all rendering viewports. If a
883  ** character is generally visible we will update it's state with our multi-threaded pipeline. If it's not visible.
884  ** then we won't update it until it's actually drawn. In retained mode renderers diguyCharacter::set_is_culled(0)
885  ** must be set for each character that is drawn so that we know to update it's state in the faster manor.
886  **
887  *b Callable From:
888  **
889  *- - C++
890  */
891  void pre_draw_cull_state_reset();
892 
893  /*l
894  *b Description:
895  **
896  ** Saves all the culling bits for various characters, should be called after all drawing is done so that the next
897  ** call to update() has reasonable culling information to work with. See pre_draw_cull_state_reset() for more
898  ** information about graphics update culling.
899  **
900  *b Callable From:
901  **
902  *- - C++
903  */
904  void post_draw_cull_state_save();
905 
906 
907 
908  /*l
909  *b Description:
910  **
911  ** This function draws visual elements that must be drawn after the
912  ** main render has been done.
913  **
914  ** Note that this function is called automatically by the draw()
915  ** call. Only call this function if draw() is not called; e.g.,
916  ** if draw_pass1() and draw_pass2() are used.
917  **
918  ** This function can be called from scene graph type renderers which
919  ** typically don't need or want to have the draw() function called.
920  **
921  *b Arguments:
922  **
923  *a call_plugins_post_draw - pass 1 to call plugin post_draw()
924  *a functions
925  *a call_lua_packages_draw - pass 1 to call lua package draw functions
926  *a call_post_draw_callback - pass 1 to invoke callbacks with callback
927  *a id CALLBACK_ID_POST_DRAW
928  **
929  *b Returns:
930  **
931  ** 0 on success, -1 on failure
932  */
933  int post_draw(int call_plugins_post_draw = 1,
934  int call_lua_packages_draw = 1,
935  int call_post_draw_callback = 1);
936 
937  /*l
938  *b Description:
939  **
940  ** This function sets the attachment point that to be used for
941  ** graphics created by the library.
942  **
943  *b Arguments:
944  **
945  *a graphics_attach_ptr - this is a pointer to a group-type object;
946  *a the specific type is dependent on graphics
947  *a environment
948  **
949  *b Returns:
950  **
951  ** 0 on success, -1 on failure
952  **
953  *i OpenGL Version:
954  **
955  ** This function does not have any effect.
956  **
957  *i Direct3D Version:
958  **
959  ** The passed pointer should be a LPDIRECT3DRMFRAME2.
960  **
961  *e LPDIRECT3DRMFRAME2 attach_frame = get_scene_frame();
962  *e scenario->set_graphics_attach_ptr(attach_frame);
963  **
964  **
965  *b Callable From:
966  **
967  *- - C++
968  */
969  int set_graphics_attach_ptr(void* graphics_attach_ptr);
970 
971 #endif // CPLUSPLUS_ONLY
972 
973 
974 /*****************************************************************************/
984  /*l
985  *b Description:
986  **
987  ** This function creates a merge settings object. This object can
988  ** allow for fine control over which elements in a scenario are
989  ** merged during a merge() call, and what to do if there is a
990  ** collision with an existing element.
991  **
992  ** Once the initial settings are made based on the initial_settings
993  ** argument, the settings can be fine-tuned by calling member
994  ** functions of the diguyScenarioMergeSettings object.
995  **
996  ** Destroy the object with a call to destroy_merge_settings().
997  **
998  *b Arguments:
999  **
1000  *a initial_settings - what the initial settings should be when
1001  *a the object is created
1002  **
1003  *i DIGUY_MERGE_INITIAL_SETTINGS_DEFAULT
1004  **
1005  *a scenario settings - DIGUY_MERGE_FLAG_DONT_MERGE
1006  *a current view settings - DIGUY_MERGE_FLAG_OVERWRITE_EXISTING
1007  *a character - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1008  *a decision - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1009  *a formation - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1010  *a group - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1011  *a guide - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1012  *a info popup - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1013  *a library function - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1014  *a script - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1015  *a sensor region - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1016  *a signal - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1017  *a variables - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1018  *a camera settings - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1019  *a face exp - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1020  *a fog settings - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1021  *a light settings - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1022  *a particle system - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1023  *a path shape - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1024  *a scene object - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1025  *a scene object grid - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1026  *a sound - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1027  **
1028  *i DIGUY_MERGE_INITIAL_SETTINGS_MERGE_EVERYTHING
1029  **
1030  *a scenario settings - DIGUY_MERGE_FLAG_OVERWRITE_EXISTING
1031  *a current view settings - DIGUY_MERGE_FLAG_OVERWRITE_EXISTING
1032  *a character - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1033  *a decision - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1034  *a formation - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1035  *a group - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1036  *a guide - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1037  *a info popup - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1038  *a library function - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1039  *a script - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1040  *a sensor region - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1041  *a signal - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1042  *a variables - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1043  *a camera settings - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1044  *a face exp - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1045  *a fog settings - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1046  *a light settings - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1047  *a particle system - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1048  *a path shape - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1049  *a scene object - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1050  *a scene object grid - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1051  *a sound - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1052  **
1053  *i DIGUY_MERGE_INITIAL_SETTINGS_MERGE_NOTHING
1054  **
1055  *a scenario settings - DIGUY_MERGE_FLAG_DONT_MERGE
1056  *a current view settings - DIGUY_MERGE_FLAG_DONT_MERGE
1057  *a character - DIGUY_MERGE_FLAG_DONT_MERGE
1058  *a decision - DIGUY_MERGE_FLAG_DONT_MERGE
1059  *a formation - DIGUY_MERGE_FLAG_DONT_MERGE
1060  *a group - DIGUY_MERGE_FLAG_DONT_MERGE
1061  *a guide - DIGUY_MERGE_FLAG_DONT_MERGE
1062  *a info popup - DIGUY_MERGE_FLAG_DONT_MERGE
1063  *a library function - DIGUY_MERGE_FLAG_DONT_MERGE
1064  *a script - DIGUY_MERGE_FLAG_DONT_MERGE
1065  *a sensor region - DIGUY_MERGE_FLAG_DONT_MERGE
1066  *a signal - DIGUY_MERGE_FLAG_DONT_MERGE
1067  *a variables - DIGUY_MERGE_FLAG_DONT_MERGE
1068  *a camera settings - DIGUY_MERGE_FLAG_DONT_MERGE
1069  *a face exp - DIGUY_MERGE_FLAG_DONT_MERGE
1070  *a fog settings - DIGUY_MERGE_FLAG_DONT_MERGE
1071  *a light settings - DIGUY_MERGE_FLAG_DONT_MERGE
1072  *a particle system - DIGUY_MERGE_FLAG_DONT_MERGE
1073  *a path shape - DIGUY_MERGE_FLAG_DONT_MERGE
1074  *a scene object - DIGUY_MERGE_FLAG_DONT_MERGE
1075  *a scene object grid - DIGUY_MERGE_FLAG_DONT_MERGE
1076  *a sound - DIGUY_MERGE_FLAG_DONT_MERGE
1077  **
1078  *i DIGUY_MERGE_INITIAL_SETTINGS_DIGUY6_COMPATIBLE
1079  **
1080  *a scenario settings - DIGUY_MERGE_FLAG_OVERWRITE_EXISTING
1081  *a current view settings - DIGUY_MERGE_FLAG_OVERWRITE_EXISTING
1082  *a character - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1083  *a decision - DIGUY_MERGE_FLAG_KEEP_BOTH
1084  *a formation - DIGUY_MERGE_FLAG_KEEP_BOTH
1085  *a group - DIGUY_MERGE_FLAG_KEEP_BOTH
1086  *a guide - DIGUY_MERGE_FLAG_KEEP_BOTH
1087  *a info popup - DIGUY_MERGE_FLAG_KEEP_BOTH
1088  *a library function - DIGUY_MERGE_FLAG_KEEP_BOTH
1089  *a script - DIGUY_MERGE_FLAG_KEEP_BOTH
1090  *a sensor region - DIGUY_MERGE_FLAG_KEEP_BOTH
1091  *a signal - DIGUY_MERGE_FLAG_KEEP_BOTH
1092  *a variables - DIGUY_MERGE_FLAG_KEEP_BOTH
1093  *a camera settings - DIGUY_MERGE_FLAG_KEEP_BOTH
1094  *a face exp - DIGUY_MERGE_FLAG_KEEP_BOTH
1095  *a fog settings - DIGUY_MERGE_FLAG_KEEP_BOTH
1096  *a light settings - DIGUY_MERGE_FLAG_KEEP_BOTH
1097  *a particle system - DIGUY_MERGE_FLAG_KEEP_EXISTING_ONLY_AND_WARN
1098  *a path shape - DIGUY_MERGE_FLAG_KEEP_BOTH
1099  *a scene object - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1100  *a scene object grid - DIGUY_MERGE_FLAG_KEEP_BOTH
1101  *a sound - DIGUY_MERGE_FLAG_KEEP_BOTH
1102  **
1103  *b Returns:
1104  **
1105  ** object of type diguyScenarioMergeSettings
1106  */
1108 
1109  /*l
1110  *b Description:
1111  **
1112  ** This function destroys a merge settings object created by
1113  ** a call to create_merge_settings().
1114  */
1115  void destroy_merge_settings(diguyScenarioMergeSettings* merge_settings);
1116 
1117  /*l
1118  *b Description:
1119  **
1120  ** This function merges the specified scenario. Any previously loaded
1121  ** scenario elements will be retained, depending on settings in
1122  ** the merge_settings argument.
1123  **
1124  *b Arguments:
1125  **
1126  *a filename - filename of scenario to be merged
1127  *a merge_settings - object that controls how elements are merged;
1128  *a pass NULL for default merge handling
1129  **
1130  *b Returns:
1131  **
1132  ** 0 on success, -1 on failure
1133  */
1134  int merge(const char* filename,
1135  diguyScenarioMergeSettings* merge_settings = NULL);
1136 
1137  /*l
1138  *b Description:
1139  **
1140  * Documentation Pending
1141  **
1142  ** This function performs a "micro merge", allowing a scenario to
1143  ** merge in the contents of a text string representing a single
1144  ** object.
1145  **
1146  ** On example of use is for a Lua Package to contain a number of
1147  ** text strings representing particle systems or sounds that an agent
1148  ** need will need. When needed objects in text form can be merged
1149  ** into the scenario using this function.
1150  **
1151  ** The DI-Guy Scenario Particle System page has a "Display Object
1152  ** Text" button that can display the object text of a particle system
1153  ** that is appropriate for use by this function. Other object pages
1154  ** that have this button are Sound, Formation, and Crowd Profile.
1155  **
1156  ** Text can also be taken directly from .dss files.
1157  **
1158  ** See also the diguyCharacter::merge_object() function.
1159  **
1160  ** Note: the parser is very sensitive to tabs and formatting!
1161  */
1162  int merge_object(const char* string);
1163 
1164  /*l
1165  *b Description:
1166  **
1167  ** This function makes the objects in the specified library available
1168  ** for use in the scenario.
1169  **
1170  ** Object libraries allow new content to be created in one scenario
1171  ** and automatically shared to other scenarios. When including a
1172  ** library, objects that are already in the scenario are preserved.
1173  **
1174  ** A library with specified name must be available for inclusion.
1175  ** Object libraries are located in the
1176  ** $DIGUY/config/diguy/object_libraries and
1177  ** $DIGUY/custom/config/diguy/object_libraries directories. The
1178  ** filename for the library must be "library_[libname].cfg".
1179  **
1180  ** Available object libraries in these directories will automatically
1181  ** be detected by the scenario, but objects in the libraries will not
1182  ** be included in the scenario until this function is called.
1183  **
1184  ** For example, if the objects in the file "library_crowd_sounds.cfg"
1185  ** should be made available in the scenario, the library name
1186  ** "crowd_sounds" should be passed into this function.
1187  **
1188  ** Currently the following object types can be in libraries:
1189  **
1190  *- - particle system
1191  *- - formation
1192  *- - crowd profile
1193  *- - sound
1194  **
1195  *b Arguments:
1196  **
1197  *a library_name - name of library
1198  **
1199  *b Returns:
1200  **
1201  ** 0 on success, -1 on failure
1202  */
1203  int include_object_library(const char* library_name);
1204 
1205  /*l
1206  *b Description:
1207  **
1208  ** This function is the opposite of include_object_library().
1209  ** Objects in the named library are made unavailable to the scenario.
1210  **
1211  *b Arguments:
1212  **
1213  *a library_name - name of library
1214  **
1215  *b Returns:
1216  **
1217  ** 0 on success, -1 on failure
1218  */
1219  int uninclude_object_library(const char* library_name);
1220 
1221 
1222 /*****************************************************************************/
1232  /******************************************************
1233  **
1234  *4 Datetime Functions
1235  **
1236  */
1237 
1238  /*l
1239  *b Description:
1240  **
1241  ** This function will set what the current datetime will be when the
1242  ** scanario is reset.
1243  **
1244  ** Pass -1 for values that should be set based on current datetime.
1245  **
1246  ** Note that if set_base_datetime_default_to_now() and
1247  ** set_base_datetime_default_to_today() can override these values.
1248  */
1249  void set_base_datetime(int year = -1,
1250  int month = -1,
1251  int day = -1,
1252  int hour = -1,
1253  int minute = -1,
1254  int second = -1,
1255  int msec = -1);
1256 
1257  /*l
1258  *b Description:
1259  **
1260  ** Similar to set_base_datetime(), but datetime is stored in the
1261  ** passed string, formatted in the passed format string.
1262  */
1263  void set_base_datetime(const char* datetime_string,
1264  const char* format);
1265 
1266  /*l
1267  *b Description:
1268  **
1269  ** Retrieves the base datetime. Pass NULL for arguments that aren't
1270  ** needed.
1271  */
1272  void get_base_datetime(int* year = NULL,
1273  int* month = NULL,
1274  int* day = NULL,
1275  int* hour = NULL,
1276  int* minute = NULL,
1277  int* second = NULL,
1278  int* msec = NULL);
1279 
1280  /*l
1281  *b Description:
1282  **
1283  ** Setting this value to 1 will cause the time part of the datetime to
1284  ** be set to whatever "real" time it is when reset() is called,
1285  ** instead of the time stored in the base datetime as set by
1286  ** set_base_datetime(). For example, if it is 10:30 AM in "real time"
1287  ** when the scenario is reset, the current time will be set to
1288  ** 10:30:00:000 on reset.
1289  **
1290  ** Setting this value to 0 will restore the default behavior.
1291  */
1292  void set_base_datetime_default_to_now(int to_now);
1293 
1294  /*l
1295  *b Returns:
1296  **
1297  ** 1 if the current time will be set to the "real time" on reset,
1298  ** 0 is not
1299  */
1300  int get_base_datetime_default_to_now();
1301 
1302  /*l
1303  *b Description:
1304  **
1305  ** Similar to set_base_datetime_default_to_now(), but for the date
1306  ** part of the datetime.
1307  */
1308  void set_base_datetime_default_to_today(int to_today);
1309 
1310  /*l
1311  *b Returns:
1312  **
1313  ** 1 if the current date will be set to the "real date" on reset,
1314  ** 0 is not
1315  */
1316  int get_base_datetime_default_to_today();
1317 
1318  /*l
1319  *b Description:
1320  **
1321  ** Allows current datetime to be explicitly set. Note that in most
1322  ** cases the current datetime should be set by the base datetime plus
1323  ** how much time has advanced in the scenario.
1324  **
1325  ** This function can be useful if the datetime needs to be syncronized
1326  ** with that from another source, say, from network exercise data.
1327  */
1328  void set_current_datetime(int year = -1,
1329  int month = -1,
1330  int day = -1,
1331  int hour = -1,
1332  int minute = -1,
1333  int second = -1,
1334  int msec = -1);
1335 
1336  /*l
1337  *b Description:
1338  **
1339  ** Similar to set_current_datetime(), but datetime is stored in the
1340  ** passed string, formatted in the passed format string.
1341  */
1342  void set_current_datetime(const char* datetime_string,
1343  const char* format);
1344 
1345  /*l
1346  *b Description:
1347  **
1348  ** Retrieves the current datetime. Pass NULL for arguments that
1349  ** aren't needed.
1350  */
1351  void get_current_datetime(int* year = NULL,
1352  int* month = NULL,
1353  int* day = NULL,
1354  int* hour = NULL,
1355  int* minute = NULL,
1356  int* second = NULL,
1357  int* msec = NULL);
1358 
1359  /*l
1360  *b Description:
1361  **
1362  ** Retrieves the current datetime in string format.
1363  **
1364  *b Arguments:
1365  **
1366  *a format - format returned string should be in; pass NULL for default
1367  *a "M/d/yyyy h:mm:ss AP" format
1368  */
1369  const char* get_current_datetime_string(const char* format);
1370 
1371  /*l
1372  *b Description:
1373  **
1374  ** Pass 1 to specify that datetimes use UTC time, 0 to specify they
1375  ** are local time.
1376  */
1377  void set_datetimes_are_utc(int are_utc);
1378 
1379  /*l
1380  *b Returns:
1381  **
1382  ** 1 if datetimes use UTC time, 0 if not
1383  */
1384  int get_datetimes_are_utc();
1385 
1386  /*l
1387  *b Description:
1388  **
1389  ** If datetimes use UTC time, this function sets the offset hours
1390  ** of the current time from UTC.
1391  */
1392  void set_utc_offset_hours(float utc_offset_hours);
1393 
1394  /*l
1395  *b Returns:
1396  **
1397  ** offset in hours of datetimes from UTC
1398  */
1399  float get_utc_offset_hours();
1400 
1401  /*l
1402  *b Description:
1403  **
1404  ** Causes the number of UTC offset hours to be derived from local
1405  ** system settings -- an alternative to calling set_utc_offset_hours()
1406  */
1407  void set_use_local_tz_utc_offset_hours(int use_local_tz);
1408 
1410  int get_use_local_tz_utc_offset_hours();
1411 
1412  /*l
1413  *b Description:
1414  **
1415  ** Sets the rate at which datetime can advance. See diguyDatetimeAdvanceMethod
1416  ** for details.
1417  */
1418  void set_current_datetime_advance_method(diguyDatetimeAdvanceMethod advance_method);
1419 
1421  diguyDatetimeAdvanceMethod get_current_datetime_advance_method();
1422 
1423  /*l
1424  ** Sets a multiplier that affects the rate at which datetime advances. Set to less
1425  ** than 1 to go more slowly, greater than 1 to go faster. Only applies if datetime
1426  ** advance method is DIGUY_DATETIME_ADVANCE_METHOD_SIMULATION_TIME_RATE or
1427  ** DIGUY_DATETIME_ADVANCE_METHOD_REAL_TIME_RATE.
1428  */
1429  void set_current_datetime_advance_factor(float advance_factor);
1430 
1432  float get_current_datetime_advance_factor();
1433 
1434  /*l
1435  *b Description:
1436  **
1437  ** Returns current exercise's datetime values.
1438  */
1439  void get_network_datetime(int* year = NULL,
1440  int* month = NULL,
1441  int* day = NULL,
1442  int* hour = NULL,
1443  int* minute = NULL,
1444  int* second = NULL,
1445  int* msec = NULL);
1446 
1447 
1448  /******************************************************
1449  **
1450  *4 Simple Time Functions
1451  **
1452  */
1453 
1454  /*l
1455  *b Description:
1456  **
1457  ** This function sets the time of day which corresponds to scenario
1458  ** tin. It is a wall-clock time, and has no date content.
1459  **
1460  ** Note that if more detailed time and date information is needed
1461  ** refer to the "datetime" functions.
1462  **
1463  *b Arguments:
1464  **
1465  *a t - number of seconds after midnight; zero means
1466  *a midnight; 86399.0 means 11:59:59 pm
1467  **
1468  *b Returns:
1469  **
1470  ** 0 on success, -1 on failure
1471  */
1472  int set_tin_time_of_day(float t);
1473 
1474  /*l
1475  *b Description:
1476  **
1477  ** This function returns what time of day corresponds to scenario tin.
1478  ** It is a wall-clock time, and has no date content.
1479  **
1480  ** See set_tin_time_of_day().
1481  **
1482  ** Note that if more detailed time and date information is needed
1483  ** refer to the "datetime" functions.
1484  **
1485  *b Returns:
1486  **
1487  ** number of seconds after midnight
1488  */
1489  float get_tin_time_of_day();
1490 
1491  /*l
1492  *b Description:
1493  **
1494  ** This function returns what the simulated time of day is right now.
1495  ** It is computed by adding (scenario t - tin) to the value passed to
1496  ** set_tin_time_of_day();
1497  **
1498  ** See set_tin_time_of_day().
1499  **
1500  ** Note that if more detailed time and date information is needed
1501  ** refer to the "datetime" functions.
1502  **
1503  *b Returns:
1504  **
1505  ** number of seconds after midnight (simulated time of day)
1506  */
1507  float get_time_of_day();
1508 
1509 
1510 /*****************************************************************************/
1520 #ifdef CPLUSPLUS_ONLY
1521 
1522  /*l
1523  *b Description:
1524  **
1525  ** This function adds an appearance with the given name to the list of
1526  ** available appearances. If an appearance with the given name
1527  ** already exists the operation will fail and a message will be
1528  ** printed at debug level to the output log.
1529  **
1530  ** Internal copies are made of the passed strings.
1531  **
1532  *b Arguments:
1533  **
1534  *a appearance - name of the appearance
1535  *a equipment_list - NULL-terminated list of equipment that
1536  *a makes up the appearance
1537  *a character_types - NULL-terminated list of character types
1538  *a that this appearance will be available to
1539  *a actor - name of the actor this appearance fits
1540  **
1541  ** If NULL is passed for the actor argument the actor will
1542  ** be set to match the actor of the first character type
1543  ** in the character_types array.
1544  **
1545  *b Returns:
1546  **
1547  ** 0 on success, -1 on failure
1548  **
1549  *b Callable From:
1550  **
1551  *- - C++
1552  */
1553  int add_appearance(const char* appearance,
1554  char** equipment_list,
1555  char** character_types,
1556  const char* actor);
1557 
1558  /*l
1559  *b Description:
1560  **
1561  ** This function is similar to add_appearance(), but adds
1562  ** equipment_list shapes to an existing appearance.
1563  **
1564  ** The character types that the new appearance will be available to
1565  ** will match that of the specified existing appearance.
1566  **
1567  *b Arguments:
1568  **
1569  *a appearance - name of the new appearance
1570  *a existing_appearance - name of the existing appearance on which to
1571  *a base new appearance
1572  *a equipment_list - NULL-terminated list of equipment to add to
1573  ** the existing appearance
1574  **
1575  *b Returns:
1576  **
1577  ** 0 on success, -1 on failure
1578  **
1579  *b Callable From:
1580  **
1581  *- - C++
1582  */
1583  int add_appearance_based_on_existing_appearance(const char* appearance,
1584  const char* existing_appearance,
1585  char** equipment_list);
1586 
1587  /*l
1588  *b Description:
1589  **
1590  ** This function removes an appearance with the given name
1591  ** from the list of available appearances. If an appearance with
1592  ** the given name does not exist the operation will fail and
1593  ** a message will be printed at debug level to the output log.
1594  **
1595  *b NOTE:
1596  **
1597  ** Currently no check is made for whether the appearance is
1598  ** in use by a character. Removing an in-use appearance will
1599  ** result in undefined behavior.
1600  **
1601  *b Arguments:
1602  **
1603  *a appearance - name of the appearance
1604  **
1605  *b Returns:
1606  **
1607  ** 0 on success, -1 on failure
1608  **
1609  *b Callable From:
1610  **
1611  *- - C++
1612  */
1613  int remove_appearance(const char* appearance);
1614 
1615 #endif // CPLUSPLUS_ONLY
1616 
1617  /*l
1618  *b Description:
1619  **
1620  ** This function returns the number of character types associated with
1621  ** the given appearance, if any.
1622  **
1623  *b Arguments:
1624  **
1625  *a appearance - name of the appearance
1626  **
1627  *b Returns:
1628  **
1629  ** the number of character types, or 0
1630  */
1631  int get_num_character_types_with_appearance(const char* appearance_name);
1632 
1633  /*l
1634  *b Description:
1635  **
1636  ** This function returns one of the character types associated with
1637  ** the appearance, if any exists
1638  **
1639  *b Arguments:
1640  **
1641  *a appearance - name of the appearance
1642  *a index - which character type of the set to return
1643  **
1644  *b Returns:
1645  **
1646  ** a character type name on success, "none" on failure
1647  */
1648  const char *get_character_type_from_appearance(const char* appearance_name, int index = 0);
1649 
1650 
1651 /*****************************************************************************/
1661  /*l
1662  *b Description:
1663  **
1664  ** Gets the hand item class associated with a character type.
1665  **
1666  *b Arguments:
1667  **
1668  *a char_type_name - name of the char type
1669  *a appearance_name - optional appearance name, which might yield
1670  *a different results
1671  **
1672  *b Returns:
1673  **
1674  ** Name of hand item class on success, "none" on failure
1675  */
1676  const char *get_hand_item_class(const char *char_type_name, const char *appearance_name = NULL);
1677 
1678  /*l
1679  *b Description:
1680  **
1681  ** Gets the number of hand items in a particular hand item class.
1682  **
1683  *b Arguments:
1684  **
1685  *a hand_item_class - name of hand item class
1686  **
1687  *b Returns:
1688  **
1689  ** Number of hand items in class
1690  */
1691  int get_num_hand_items_in_class(const char *hand_item_class);
1692 
1693  /*l
1694  *b Description:
1695  **
1696  ** Gets the name of a hand item within the set associated with
1697  ** a hand item class.
1698  **
1699  *b Arguments:
1700  **
1701  *a hand_item_class - name of hand item class
1702  *a index - index within set
1703  **
1704  *b Returns:
1705  **
1706  ** Name of hand item, or "none"
1707  */
1708  const char *get_hand_item_from_class(const char *hand_item_class, int index);
1709 
1710 /*****************************************************************************/
1720  /*l
1721  *b Description:
1722  **
1723  ** This function preloads all base motions and the default
1724  ** appearance for the specified character type.
1725  **
1726  ** This can be done during initialization to preload characters that
1727  ** will be needed later in a scenario, to avoid a hitch in frame rate
1728  ** when the characters are loaded.
1729  **
1730  *b Arguments:
1731  **
1732  *a character_type - character type name, as returned by
1733  *a get_character_type_at_index(), for example
1734  **
1735  *b Returns:
1736  **
1737  ** 0 on success, -1 on failure
1738  */
1739  int preload_character_type(const char* character_type);
1740 
1741  /*l
1742  *b Description:
1743  **
1744  ** This function preloads all geometry for the specified appearance.
1745  ** This can be done during initialization to preload geometry that
1746  ** will be needed later in a scenario, to avoid a hitch in frame rate
1747  ** when the geometry is loaded.
1748  **
1749  *b Arguments:
1750  **
1751  *a appearance - name of the appearance whose geometry is to be
1752  *a preloaded
1753  **
1754  *b Returns:
1755  **
1756  ** 0 on success, -1 on failure
1757  */
1758  int preload_appearance(const char* appearance);
1759 
1760  /*l
1761  *b Description:
1762  **
1763  ** This function preloads all motions for the specified gesture
1764  ** for the specified character type.
1765  **
1766  ** This can be done during initialization to preload gestures that
1767  ** will be needed later in a scenario, to avoid a hitch in frame rate
1768  ** when the motions are loaded.
1769  **
1770  *b Arguments:
1771  **
1772  *a character_type - character's type
1773  *a gesture_name - name of the gesture to preload
1774  **
1775  *b Returns:
1776  **
1777  ** 0 on success, -1 on failure
1778  */
1779  int preload_gesture(const char* character_type, const char* gesture_name);
1780 
1781 
1782 /*****************************************************************************/
1797  /*l
1798  *b Description:
1799  **
1800  ** This function enables character culling.
1801  **
1802  ** This function works only in the OpenGL version when a valid render
1803  ** camera is set.
1804  */
1805  void set_character_culling_enabled(int character_culling);
1806 
1807  /*l
1808  *b Description:
1809  **
1810  ** This function gets the state of character culling.
1811  **
1812  ** This function works only in the OpenGL version when a valid render
1813  ** camera is set.
1814  **
1815  *b Returns:
1816  **
1817  ** 1 if enabled, 0 if disabled.
1818  */
1819  int get_character_culling_enabled();
1820 
1821  /*l
1822  *b Description:
1823  **
1824  ** This function enables scene object culling.
1825  **
1826  ** This function works only in the OpenGL version when a
1827  ** valid render camera is set.
1828  */
1829  void set_scene_object_culling_enabled(int object_culling);
1830 
1831  /*l
1832  *b Description:
1833  **
1834  ** This function get the state of scene object culling.
1835  **
1836  ** This function works only in the OpenGL version when a
1837  ** valid render camera is set.
1838  **
1839  *b Returns:
1840  **
1841  ** 1 if enabled, 0 if disabled
1842  */
1843  int get_scene_object_culling_enabled();
1844 
1845  /*l
1846  *b Description:
1847  **
1848  ** This function enables scene object sub object culling.
1849  **
1850  ** This function works only in the OpenGL version when a
1851  ** valid render camera is set.
1852  */
1853  void set_scene_object_sub_culling_enabled(int object_culling);
1854 
1855  /*l
1856  *b Description:
1857  **
1858  ** This function get the state of scene object sub culling.
1859  **
1860  ** This function works only in the OpenGL version when a
1861  ** valid render camera is set.
1862  **
1863  *b Returns:
1864  **
1865  ** 1 if enabled, 0 if disabled
1866  */
1867  int get_scene_object_sub_culling_enabled();
1868 
1869  /*l
1870  *b Description:
1871  **
1872  ** This function enables visualizing a character's bounding
1873  ** volume.
1874  **
1875  ** This function works only in the OpenGL version when a
1876  ** valid render camera is set.
1877  */
1878  void set_character_visualize_bounds_enabled(int visualize_bounds);
1879 
1880  /*l
1881  *b Description:
1882  **
1883  ** This function get the state of character bounding volume
1884  ** visualization.
1885  **
1886  ** This function works only in the OpenGL version when a
1887  ** valid render camera is set.
1888  **
1889  *b Returns:
1890  **
1891  ** 1 if enabled, 0 if disabled
1892  */
1893  int get_character_visualize_bounds_enabled();
1894 
1895  /*l
1896  *b Description:
1897  **
1898  ** This function enables visualizing a scene object's bounding
1899  ** volume.
1900  **
1901  ** This function works only in the OpenGL version when a
1902  ** valid render camera is set.
1903  */
1904  void set_scene_object_visualize_bounds_enabled(int val);
1905 
1906  /*l
1907  *b Description:
1908  **
1909  ** This function gets the state of scene objects bounding volume
1910  ** visualization.
1911  **
1912  ** This function works only in the OpenGL version when a
1913  ** valid render camera is set.
1914  **
1915  *b Returns:
1916  **
1917  ** 1 if enabled, 0 if disabled
1918  */
1919  int get_scene_object_visualize_bounds_enabled();
1920 
1921 
1922 /*****************************************************************************/
1981  /*l
1982  *b Returns:
1983  **
1984  ** number of available character types
1985  */
1986  int get_num_character_types();
1987 
1988  /*l
1989  *b Returns:
1990  **
1991  ** the string identifying the character type at the given index
1992  **
1993  *b Arguments:
1994  **
1995  *a index - index of the character type; indices start at 0
1996  */
1997  const char* get_character_type_at_index(int index);
1998 
1999  /*l
2000  *b Returns:
2001  **
2002  ** abbreviation of the given character type, when a shorter
2003  ** identifier is needed
2004  **
2005  *b Arguments:
2006  **
2007  *a character_type - character type name, as returned by
2008  *a get_character_type_at_index(), for example
2009  */
2010  const char* get_character_type_abbreviation(const char* character_type);
2011 
2012  /*l
2013  *b Description:
2014  **
2015  ** This function returns the version at which the specified
2016  ** character type was deprecated.
2017  **
2018  ** If the character type has not been deprecated, the empty string
2019  ** ("") is returned.
2020  **
2021  *b Arguments:
2022  **
2023  *a character_type - character type name, as returned by
2024  *a get_character_type_at_index(), for example
2025  **
2026  *b Returns:
2027  **
2028  ** version at which character became deprecated; empty string ("")
2029  ** if it hasn't been
2030  **
2031  *b C++ Example:
2032  **
2033  *e const char* version = scenario->get_character_type_deprecated_at_version();
2034  *e if (strlen(version) > 0)
2035  *e {
2036  *e // do something
2037  *e }
2038  */
2039  const char* get_character_type_deprecated_at_version(const char* character_type);
2040 
2041  /*l
2042  *b Description:
2043  **
2044  ** This function returns the suggested character type(s) that are
2045  ** recommended for deprecated character types.
2046  **
2047  ** If the character type has not been deprecated, the empty string
2048  ** ("") is returned.
2049  **
2050  ** If there is more than one suggested alternative, they will be
2051  ** separated by spaces.
2052  **
2053  *b Arguments:
2054  **
2055  *a character_type - character type name, as returned by
2056  *a get_character_type_at_index(), for example
2057  **
2058  *b Returns:
2059  **
2060  ** suggested replacement character type(s)
2061  **
2062  *b C++ Example:
2063  **
2064  *e const char* alternatives = scenario->get_character_type_deprecated_suggested_alternatives();
2065  *e if (strlen(version) > 0)
2066  *e {
2067  *e // do something
2068  *e }
2069  */
2070  const char* get_character_type_deprecated_suggested_alternatives(const char* character_type);
2071 
2072  /*l
2073  *b Description:
2074  **
2075  ** As the number of character types DI-Guy provides has grown,
2076  ** newer character types tend to be better than older ones.
2077  ** This can be because of a greater selection of actions, better
2078  ** quality motions, and other factors.
2079  **
2080  ** This function returns a value representing a qualitative "bias"
2081  ** of this character they relative to other character types.
2082  ** The higher the bias, the more recommended the character type is.
2083  ** A bias of 1 means strongly not recommended, 5 means average,
2084  ** 10 means highly recommended.
2085  **
2086  *b Returns:
2087  **
2088  ** quality bias, a unitless value from 1 to 10
2089  **
2090  *b Arguments:
2091  **
2092  *a character_type - character type name, as returned by
2093  *a get_character_type_at_index(), for example
2094  */
2095  int get_character_type_quality_bias(const char* character_type);
2096 
2097  /*l
2098  *b Description:
2099  **
2100  ** This function returns the type map of the specified character
2101  ** type. See the documentation for diguyCharacterTypeMap for what
2102  ** this information means.
2103  **
2104  ** Only the character type fields will have useful information; the
2105  ** appearance fields will contain default wildcard values.
2106  **
2107  *b Arguments:
2108  **
2109  *a character_type - character type name, as returned by
2110  *a get_character_type_at_index(), for example
2111  **
2112  *b Returns:
2113  **
2114  ** pointer to type diguyCharacterTypeMap; will never be NULL
2115  */
2116  diguyCharacterTypeMap* get_character_type_map(const char* character_type);
2117 
2118  /*l
2119  *b Returns:
2120  **
2121  ** default appearance of the specified character type
2122  **
2123  *b Arguments:
2124  **
2125  *a character_type - character type name, as returned by
2126  *a get_character_type_at_index(), for example
2127  */
2128  const char* get_character_type_default_appearance(const char* character_type);
2129 
2130  /*l
2131  *b Returns:
2132  **
2133  ** default skinned appearance of the specified character type
2134  **
2135  *b Arguments:
2136  **
2137  *a character_type - character type name, as returned by
2138  *a get_character_type_at_index(), for example
2139  */
2140  const char* get_character_type_default_skinned_appearance(const char* character_type);
2141 
2142  /*l
2143  *b Returns:
2144  **
2145  ** number of available appearances for the given character type
2146  **
2147  *b Arguments:
2148  **
2149  *a character_type - character type name, as returned by
2150  *a get_character_type_at_index(), for example
2151  */
2152  int get_character_type_num_appearances(const char* character_type);
2153 
2154  /*l
2155  *b Returns:
2156  **
2157  ** the string identifying the appearance at the given index for
2158  ** the specified character type
2159  **
2160  *b Arguments:
2161  **
2162  *a character_type - character type name, as returned by
2163  *a get_character_type_at_index(), for example
2164  *a index - index of the appearance; indices start at 0
2165  */
2166  const char* get_character_type_appearance_at_index(const char* character_type,
2167  int index);
2168 
2169  /*l
2170  *b Description:
2171  **
2172  ** As the number of appearances DI-Guy provides has grown,
2173  ** newer appearances tend to be better than older ones.
2174  **
2175  ** This function returns a value representing a qualitative "bias"
2176  ** of this character they relative to other character types.
2177  ** The higher the bias, the more recommended the character type is.
2178  ** A bias of 1 means strongly not recommended, 5 means average,
2179  ** 10 means highly recommended.
2180  **
2181  *b Returns:
2182  **
2183  ** quality bias, a unitless value from 1 to 10
2184  **
2185  *b Arguments:
2186  **
2187  *a appearance - appearance name
2188  */
2189  int get_appearance_quality_bias(const char * appearance);
2190 
2191  /*l
2192  *b Arguments:
2193  **
2194  *a character_type - a string indicating the character type
2195  *a base_appearance - a string indicating the basic character appearance
2196  *a appearance_type - a value indicating the type of supplementary appearance of concern,
2197  ** ie DIGUY_APPEARANCE_BODY, DIGUY_APPEARANCE_HEAD, DIGUY_APPEARANCE_EXPRESSIVE_HEAD,
2198  ** DIGUY_APPEARANCE_HAND_ITEM
2199  *b Returns:
2200  **
2201  ** The number of available supplementary appearances of given type
2202  */
2203  int get_num_appearances_of_appearance_type(const char* character_type, const char* base_appearance, diguyCharacterAppearanceTypes appearance_type);
2204 
2205  /*l
2206  *b Returns:
2207  **
2208  ** The name of the supplementary appearance (body, head, expressive head, hand item) or NULL
2209  **
2210  *b Arguments:
2211  **
2212  *a character_type - a string indicating the character type
2213  *a base_appearance - a string indicating the basic character appearance
2214  *a appearance_type - a value indicating the type of appearance of concern
2215  *a index - a value indicating the type of supplementary appearance of concern
2216  **
2217  */
2218  const char* get_appearance_name_at_index(const char* character_type, const char* base_appearance, diguyCharacterAppearanceTypes appearance_type, int index);
2219 
2220  /*l
2221  *b Returns:
2222  **
2223  ** number of available actions for the given character type
2224  **
2225  *b Arguments:
2226  **
2227  *a character_type - character type name, as returned by
2228  *a get_character_type_at_index(), for example
2229  */
2230  int get_character_type_num_actions(const char* character_type);
2231 
2232  /*l
2233  *b Returns:
2234  **
2235  ** the string identifying the action at the given index for
2236  ** the specified character type
2237  **
2238  *b Arguments:
2239  **
2240  *a character_type - character type name, as returned by
2241  *a get_character_type_at_index(), for example
2242  *a index - index of the action name; indices start at 0
2243  */
2244  const char* get_character_type_action_at_index(const char* character_type,
2245  int index);
2246 
2247  /*l
2248  *b Returns:
2249  **
2250  ** the average speed of the specified action for
2251  ** the specified character type
2252  **
2253  *b Arguments:
2254  **
2255  *a character_type - character type name, as returned by
2256  *a get_character_type_at_index(), for example
2257  *a action_name - the action to query
2258  */
2259  float get_character_type_action_speed(const char* character_type,
2260  const char* action_name);
2261 
2262  /*l
2263  *b Returns:
2264  **
2265  ** the duration of one rep of the specified action for
2266  ** the specified character type
2267  **
2268  *b Arguments:
2269  **
2270  *a character_type - character type name, as returned by
2271  *a get_character_type_at_index(), for example
2272  *a action_name - the action to query
2273  */
2274  float get_character_type_action_duration(const char* character_type,
2275  const char* action_name);
2276 
2277  /*l
2278  *b Returns:
2279  **
2280  ** the distance covered by one rep of the specified action for
2281  ** the specified character type
2282  **
2283  *b Arguments:
2284  **
2285  *a character_type - character type name, as returned by
2286  *a get_character_type_at_index(), for example
2287  *a action_name - the action to query
2288  */
2289  float get_character_type_action_distance(const char* character_type,
2290  const char* action_name);
2291 
2292  /*l
2293  *b Returns:
2294  **
2295  ** the diguyMotionDirection identifying the direction of travel of the
2296  ** specified action for the specified character type
2297  **
2298  *b Arguments:
2299  **
2300  *a character_type - character type name, as returned by
2301  *a get_character_type_at_index(), for example
2302  *a action_name - the action to query
2303  */
2304  diguyMotionDirection get_character_type_action_direction(
2305  const char* character_type,
2306  const char* action_name);
2307 
2308  /*l
2309  *b Returns:
2310  **
2311  ** the facing angle at the start of each repetition of the
2312  ** specified action for the specified character type, in degrees
2313  **
2314  *b Arguments:
2315  **
2316  *a character_type - character type name, as returned by
2317  *a get_character_type_at_index(), for example
2318  *a action_name - the action to query
2319  */
2320  float get_character_type_action_facing_angle_in(const char* character_type,
2321  const char* action_name);
2322 
2323  /*l
2324  *b Returns:
2325  **
2326  ** the facing angle at the end of each repetition of the
2327  ** specified action for the specified character type, in degrees
2328  **
2329  *b Arguments:
2330  **
2331  *a character_type - character type name, as returned by
2332  *a get_character_type_at_index(), for example
2333  *a action_name - the action to query
2334  */
2335  float get_character_type_action_facing_angle_out(const char* character_type,
2336  const char* action_name);
2337 
2338  /*l
2339  *b Returns:
2340  **
2341  ** the number of gestures available to
2342  ** the specified character type
2343  **
2344  *b Arguments:
2345  **
2346  *a character_type - character type name, as returned by
2347  *a get_character_type_at_index(), for example;
2348  *a pass "all" to get all gestures available,
2349  *a regardless of character type
2350  */
2351  int get_character_type_num_gestures(const char* character_type);
2352 
2353  /*l
2354  *b Returns:
2355  **
2356  ** the name of the gesture available to the specified
2357  ** character type at the specified index
2358  **
2359  *b Arguments:
2360  **
2361  *a character_type - character type name, as returned by
2362  *a get_character_type_at_index(), for example;
2363  *a pass "all" to get all gestures available,
2364  *a regardless of character type
2365  *a index - index of the gesture; indices start at 0
2366  */
2367  const char* get_character_type_gesture_at_index(const char* character_type,
2368  int index);
2369 
2370 
2371 /*****************************************************************************/
2381  /*l
2382  *b Description:
2383  **
2384  ** This function creates a new character and returns a
2385  ** pointer to it.
2386  **
2387  ** The function preload_character_type() should be called
2388  ** at the beginning of a scenario in which this call will
2389  ** be made to avoid a hitch in frame rate.
2390  **
2391  ** See also retrieve_character_from_recycle_bin() for a
2392  ** potentially faster way of creating a character.
2393  **
2394  *b Arguments:
2395  **
2396  *a name - name of the new character
2397  *a character_type - character's type
2398  *a appearance - base appearance of character; pass
2399  *a NULL to use default appearance
2400  *a hand_item - hand item appearance; pass
2401  *a NULL to use default appearance
2402  **
2403  *b Returns:
2404  **
2405  ** pointer of type diguyCharacter; NULL if creation failed
2406  */
2407  diguyCharacter* create_character(const char* name,
2408  const char* character_type,
2409  const char* appearance = NULL,
2410  const char* head_appearance = NULL,
2411  const char* hand_item = NULL);
2412 
2413  /*l
2414  *b Description:
2415  **
2416  ** This function is very similar to create_character(), but the
2417  ** character created is temporary.
2418  **
2419  ** Temporary characters will be destroyed automatically when the
2420  ** scenario is reset, and are not saved in .dss files. They are
2421  ** commonly used for projectiles, effects, and other objects that can
2422  ** come and go multiple times.
2423  **
2424  ** Temporary characters can be destroyed before scenario reset by
2425  ** calling destroy_character(), and can be sent to the character
2426  ** recycle bin by calling send_character_to_recycle_bin().
2427  **
2428  *b Arguments:
2429  **
2430  *a name - name of the new character
2431  *a character_type - character's type
2432  *a appearance - base appearance of character; pass
2433  *a NULL to use default appearance
2434  **
2435  *b Returns:
2436  **
2437  ** pointer of type diguyCharacter; NULL if creation failed
2438  */
2439  diguyCharacter* create_temporary_character(const char* name,
2440  const char* character_type,
2441  const char* appearance = NULL);
2442 
2443  /*l
2444  *b Description:
2445  **
2446  ** This function destroys a character.
2447  **
2448  ** If a character of the same character type and appearance may be
2449  ** needed later in the scenario, consider using
2450  ** send_character_to_recycle_bin() instead. Characters can be
2451  ** retrieved from the recycle bin more quickly than creating them
2452  ** "from scratch" with create_character().
2453  **
2454  *b Arguments:
2455  **
2456  *a character - pointer to a diguyCharacter
2457  **
2458  *b Returns:
2459  **
2460  ** 0 on success, -1 on failure
2461  **
2462  *b DI-Guy Networking Notes:
2463  **
2464  ** This function should not be called on characters that are reflected
2465  ** network characters. Such characters are destroyed automatically by
2466  ** DI-Guy Networking.
2467  */
2468  int destroy_character(diguyCharacter* character);
2469 
2470  int destroy_character_later(diguyCharacter*)
2471 ;
2472  /*l
2473  *b Description
2474  **
2475  ** This function is an alternative way of removing a character from
2476  ** the scenario. When a character is recycled it is removed from the
2477  ** scenario's list of active characters, but the memory associated
2478  ** with it is not freed. Instead, the character is placed in a
2479  ** "character recycle bin" from which it may be later retrieved with a
2480  ** call to retrieve_character_from_recycle_bin().
2481  **
2482  ** For an application that is creating and destroying a lot of
2483  ** characters with the same character types and appearances, this can
2484  ** avoid performance hiccups that happen when memory is allocated for
2485  ** new characters.
2486  **
2487  ** If it is known ahead of time what types and appearances of
2488  ** characters will be needed in the future, the recycle bin can be
2489  ** "pre-stocked" at scenario load time by first creating and then
2490  ** recycling a large number of characters all at once.
2491  **
2492  *b Returns:
2493  **
2494  ** 0 on success, -1 on failure
2495  */
2496  int send_character_to_recycle_bin(diguyCharacter* character);
2497 
2498  /*l
2499  *b Description
2500  **
2501  ** This function is an alternative way of creating a character. The
2502  ** character recycle bin is checked for a recycled character whose
2503  ** character type and appearance match that requested by this call.
2504  ** Characters are sent to the recycle bin by a call to
2505  ** send_character_to_recycle_bin().
2506  **
2507  ** If a match is found the recycled character will be removed from
2508  ** the recycle bin, given the passed name, and placed in the
2509  ** scenario's list of characters, for the most part just as if the
2510  ** character had been created by a call to create_character(). Some
2511  ** things such as position, current action, etc., may need to be
2512  ** immediately set.
2513  **
2514  ** If a match is not found, this function returns NULL and a call to
2515  ** create_character() must be made instead.
2516  **
2517  *b Arguments:
2518  **
2519  *a name - new name for the character retrieved from bin
2520  *a character_type - the character type to retrieve from the bin
2521  *a appearance - the appearance to retrieve from the bin, pass NULL
2522  *a or "default" to retrieve the default appearance
2523  *a make_character_temporary - pass 1 to make character temporary,
2524  *a 0 to leave permanent
2525  **
2526  *b Returns:
2527  **
2528  ** 0 on success, -1 on failure
2529  */
2530  diguyCharacter* retrieve_character_from_recycle_bin(const char* name,
2531  const char* character_type,
2532  const char* appearance,
2533  int make_character_temporary = 0);
2534 
2535  /*l
2536  *b Returns:
2537  **
2538  ** number of characters in the scenario
2539  */
2540  int get_num_characters();
2541 
2542  /*l
2543  *b Returns:
2544  **
2545  ** pointer of type diguyCharacter; NULL if no character at the
2546  ** specified index
2547  **
2548  *b Arguments:
2549  **
2550  *a index - index of the character; indices start at 0
2551  */
2552  diguyCharacter* get_character_at_index(int index);
2553 
2554  /*l
2555  *b Description:
2556  **
2557  ** This function returns a pointer to the specified character.
2558  **
2559  *b Arguments:
2560  **
2561  *a name - name of character to be found
2562  **
2563  *b Returns:
2564  **
2565  ** pointer of type diguyCharacter; NULL if not found
2566  */
2567  diguyCharacter* find_character(const char* name);
2568 
2569  /*l
2570  *b Description:
2571  **
2572  ** This function changes the scenario camera's position
2573  ** and fix point so it will be looking at the specified
2574  ** character.
2575  */
2576  void look_at_character(diguyCharacter* character);
2577 
2578  /*l
2579  *b Description:
2580  **
2581  ** This function returns a pointer to the target character
2582  ** of an event bead.
2583  **
2584  *b Returns:
2585  **
2586  ** pointer of type diguyCharacter; NULL if no current character
2587  */
2588  diguyCharacter* this_character();
2589 
2590  /*l
2591  *b Description:
2592  **
2593  ** This function returns a pointer to the current event bead.
2594  **
2595  *b Returns:
2596  **
2597  ** pointer of type diguyCharacterPathEvent; NULL if no current event
2598  ** bead
2599  */
2600  diguyCharacterPathEvent* this_event_bead();
2601 
2602 
2603 /*****************************************************************************/
2613  /*l
2614  *b Returns:
2615  **
2616  ** number of path shapes in the scenario
2617  */
2618  int get_num_path_shapes();
2619 
2620  /*l
2621  *b Returns:
2622  **
2623  ** pointer of type diguyPathShape; NULL if no
2624  ** path shape at the specified index
2625  **
2626  *b Arguments:
2627  **
2628  *a index - index of the path shape; indices start at 0
2629  */
2630  diguyPathShape* get_path_shape_at_index(int index);
2631 
2632  /*l
2633  *b Returns:
2634  **
2635  ** pointer of type diguyPathShape; NULL if no
2636  ** path shape at the specified index
2637  */
2638  diguyPathShape* get_current_path_shape();
2639 
2640  /*l
2641  *b Description:
2642  **
2643  ** This function returns a pointer to the specified path shape.
2644  **
2645  *b Arguments:
2646  **
2647  *a name - name of path shape to be found
2648  **
2649  *b Returns:
2650  **
2651  ** pointer of type diguyPathShape; NULL if not found
2652  */
2653  diguyPathShape* find_path_shape(const char* name);
2654 
2655  /*l
2656  *b Description:
2657  **
2658  ** This function creates a new path shape and returns a
2659  ** pointer to it.
2660  **
2661  *b Arguments:
2662  **
2663  *a name - name of the new path shape
2664  **
2665  *b Returns:
2666  **
2667  ** pointer of type diguyPathShape; NULL if creation failed
2668  */
2669  diguyPathShape* create_path_shape(const char* name);
2670 
2671  /*l
2672  *b Description:
2673  **
2674  ** This function creates a new path shape based on an
2675  ** existing path shape and returns a pointer to it.
2676  **
2677  *b Arguments:
2678  **
2679  *a existing_path_shape - pointer to diguyPathShape to be copied
2680  *a name - name of the new path shape
2681  **
2682  *b Returns:
2683  **
2684  ** pointer of type diguyPathShape; NULL if creation failed
2685  */
2686  diguyPathShape* copy_path_shape(diguyPathShape* existing_path_shape,
2687  const char* name);
2688 
2689  /*l
2690  *b Description:
2691  **
2692  ** This function destroys a path shape.
2693  **
2694  *b Arguments:
2695  **
2696  *a path_shape - pointer to a diguyPathShape
2697  **
2698  *b Returns:
2699  **
2700  ** 0 on success, -1 on failure
2701  */
2702  int destroy_path_shape(diguyPathShape* path_shape);
2703 
2704 
2705 /*****************************************************************************/
2710  /*l
2711  *b Description:
2712  **
2713  ** This function creates a new waypoint that can be used for creating
2714  ** new paths and path shapes.
2715  **
2716  ** The returned pointer must be destroyed using destroy_waypoint().
2717  ** The scenario keeps no record of waypoints created with this
2718  ** function.
2719  **
2720  ** The weights of the waypoint control how long the "control handles"
2721  ** of the waypoint are, in meters. The longer the control handle,
2722  ** the more the path will be stretched in the direction of the
2723  ** waypoint's orientation.
2724  **
2725  ** Unless otherwise specified, callable from:
2726  **
2727  *- - C++
2728  *- - Script
2729  **
2730  *b Arguments:
2731  **
2732  *a tx, ty, tz - position in meters from the origin
2733  *a rz, rx, ry - orientations in degrees counter-clockwise
2734  *a from the positive X axis
2735  *a weight_in - how much influence this waypoint exerts
2736  *a over the path curve entering this waypoint
2737  *a weight_out - how much influence this waypoint exerts
2738  *a over the path curve leaving this waypoint
2739  **
2740  ** By default, weight_in will be set to 1, and weight_out will be
2741  ** coupled to weight_in so that changes to one will affect the
2742  ** other. See diguyWaypoint::set_weight_in(). If a non-default
2743  ** value is passed for weight_out the weights of the waypoint will
2744  ** not be coupled.
2745  **
2746  *b Returns:
2747  **
2748  ** pointer to type diguyWaypoint
2749  */
2750  diguyWaypoint* create_waypoint(float x = 0.0f, float y = 0.0f, float z = 0.0f,
2751  float yaw = 0.0f, float roll = 0.0f, float pitch = 0.0f,
2752  float weight_in = DIGUY_DEFAULT_FLOAT,
2753  float weight_out = DIGUY_DEFAULT_FLOAT);
2754 
2755  /*l
2756  *b Description:
2757  **
2758  ** This function destroys a waypoint created by create_waypoint().
2759  ** Path shapes created using this waypoint will not be affected;
2760  ** they make internal copies of the waypoints that are used to
2761  ** create them.
2762  **
2763  ** Do *not* call this function on waypoints not created by
2764  ** create_waypoint()! e.g., a waypoint returned by a call to
2765  ** diguyCharacterPath::get_waypoint_at_index().
2766  **
2767  *b Arguments:
2768  **
2769  *a waypoint - waypoint to destroy
2770  **
2771  *b Returns:
2772  **
2773  ** 0 on success, -1 on failure
2774  */
2775  int destroy_waypoint(diguyWaypoint* waypoint);
2776 
2777 
2778 /*****************************************************************************/
2794  /*l
2795  *b Description:
2796  **
2797  ** This function searches DI-Guy's available character types and
2798  ** appearances for the closest match to the specified fields and
2799  ** values. See the documentation for diguyCharacterTypeMap for
2800  ** information on what fields are available, and what values they
2801  ** may take.
2802  **
2803  *b Arguments:
2804  **
2805  *a field1 - field in type map to check
2806  *a field1_value - value to check for
2807  *a field1_alternate_value - acceptable alternate value
2808  **
2809  ** (Arguments for fields 2 through 8 are the same.)
2810  **
2811  *b Returns:
2812  **
2813  ** pointer to type diguyCharacterTypeMap
2814  */
2815  diguyCharacterTypeMap* get_nearest_character_type_map(
2816  diguyCharacterTypeMapField field1, const char* field1_value, const char* field1_alternate_value,
2817  diguyCharacterTypeMapField field2 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field2_value = NULL, const char* field2_alternate_value = NULL,
2818  diguyCharacterTypeMapField field3 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field3_value = NULL, const char* field3_alternate_value = NULL,
2819  diguyCharacterTypeMapField field4 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field4_value = NULL, const char* field4_alternate_value = NULL,
2820  diguyCharacterTypeMapField field5 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field5_value = NULL, const char* field5_alternate_value = NULL,
2821  diguyCharacterTypeMapField field6 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field6_value = NULL, const char* field6_alternate_value = NULL,
2822  diguyCharacterTypeMapField field7 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field7_value = NULL, const char* field7_alternate_value = NULL,
2823  diguyCharacterTypeMapField field8 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field8_value = NULL, const char* field8_alternate_value = NULL);
2824 
2825  /*l
2826  *b Description:
2827  **
2828  ** Same as above, but fields to check are specified by string name
2829  ** instead of enumeration value.
2830  */
2831  diguyCharacterTypeMap* get_nearest_character_type_map_using_field_strings(
2832  const char* field1_string, const char* field1_value, const char* field1_alternate_value,
2833  const char* field2_string = NULL, const char* field2_value = NULL, const char* field2_alternate_value = NULL,
2834  const char* field3_string = NULL, const char* field3_value = NULL, const char* field3_alternate_value = NULL,
2835  const char* field4_string = NULL, const char* field4_value = NULL, const char* field4_alternate_value = NULL,
2836  const char* field5_string = NULL, const char* field5_value = NULL, const char* field5_alternate_value = NULL,
2837  const char* field6_string = NULL, const char* field6_value = NULL, const char* field6_alternate_value = NULL,
2838  const char* field7_string = NULL, const char* field7_value = NULL, const char* field7_alternate_value = NULL,
2839  const char* field8_string = NULL, const char* field8_value = NULL, const char* field8_alternate_value = NULL);
2840 
2841  /*l
2842  *b Description:
2843  **
2844  ** Same as above, but field values to match against are specified
2845  ** by the given type map id. No alternate values can be provided,
2846  ** though wildcards can be used by putting a "*" in for a field.
2847  */
2848  diguyCharacterTypeMap* get_nearest_character_type_map_id_match(const char* type_map_id);
2849 
2850  /*l
2851  *b Description:
2852  **
2853  ** This function returns the total number of type map entries that
2854  ** are in DI-Guy. It is against these entries that matches will be
2855  ** made.
2856  **
2857  ** This function, along with get_character_type_map_entry_at_index(),
2858  ** enables all type map information to be queried.
2859  **
2860  *b Returns:
2861  **
2862  ** number of total type map entries against which matches will be
2863  ** made
2864  */
2865  int get_num_character_type_map_entries();
2866 
2867  /*l
2868  *b Returns:
2869  **
2870  ** type map entry at specified index; see
2871  ** get_num_character_type_map_entries()
2872  */
2873  diguyCharacterTypeMap* get_character_type_map_entry_at_index(int index);
2874 
2875  /*l
2876  *b Description:
2877  **
2878  ** This function returns the total number of values that may
2879  ** be specified or returned in the character class field.
2880  **
2881  ** This function, along with get_type_map_character_class_at_index(),
2882  ** enables all available character classes to be queried.
2883  **
2884  *b Returns:
2885  **
2886  ** number of character classes
2887  */
2888  int get_num_type_map_character_classes();
2889 
2890  /*l
2891  *b Returns:
2892  **
2893  ** character class field value at specified index; see
2894  ** get_num_type_map_character_classes()
2895  */
2896  const char* get_type_map_character_class_at_index(int index);
2897 
2898  /*l
2899  *b Description:
2900  **
2901  ** This function returns the total number of values that may
2902  ** be specified or returned in the category field of a type
2903  ** map with the given character class.
2904  **
2905  ** This function, along with get_type_map_category_at_index(),
2906  ** enables all available categories available to each character
2907  ** class to be queried.
2908  **
2909  *b Returns:
2910  **
2911  ** number of categories
2912  */
2913  int get_num_type_map_categories(const char* character_class);
2914 
2915  /*l
2916  *b Returns:
2917  **
2918  ** category field value at specified index; see
2919  ** get_num_type_map_categories()
2920  */
2921  const char* get_type_map_category_at_index(const char* character_class,
2922  int index);
2923 
2924  /*l
2925  *b Description:
2926  **
2927  ** This function returns the total number of values that may
2928  ** be specified or returned in the subcategory field of a type
2929  ** map with the given character class and category.
2930  **
2931  ** This function, along with get_type_map_subcategory_at_index(),
2932  ** enables all available subcategories available to each character
2933  ** class and category to be queried.
2934  **
2935  *b Returns:
2936  **
2937  ** number of subcategories
2938  */
2939  int get_num_type_map_subcategories(const char* character_class,
2940  const char* category);
2941 
2942  /*l
2943  *b Returns:
2944  **
2945  ** subcategory field value at specified index; see
2946  ** get_num_type_map_subcategories()
2947  */
2948  const char* get_type_map_subcategory_at_index(const char* character_class,
2949  const char* category,
2950  int index);
2951 
2952 
2953 /*****************************************************************************/
2963  /*l
2964  *b Returns:
2965  **
2966  ** number of signals in the scenario
2967  */
2968  int get_num_signals();
2969 
2970  /*l
2971  *b Returns:
2972  **
2973  ** pointer of type diguySignal; NULL if no
2974  ** signal at the specified index
2975  **
2976  *b Arguments:
2977  **
2978  *a index - index of the signal; indices start at 0
2979  */
2980  diguySignal* get_signal_at_index(int index);
2981 
2982  /*l
2983  *b Description:
2984  **
2985  ** This function returns a pointer to the specified signal.
2986  **
2987  *b Arguments:
2988  **
2989  *a name - name of signal to be found
2990  **
2991  *b Returns:
2992  **
2993  ** pointer of type diguySignal; NULL if not found
2994  */
2995  diguySignal* find_signal(const char* name);
2996 
2997  /*l
2998  *b Description:
2999  **
3000  ** This function creates a new signal and returns a
3001  ** pointer to it.
3002  **
3003  *b Arguments:
3004  **
3005  *a name - name of the new signal
3006  **
3007  *b Returns:
3008  **
3009  ** pointer of type diguySignal
3010  */
3011  diguySignal* create_signal(const char* name);
3012 
3013  /*l
3014  *b Description:
3015  **
3016  ** This function destroys a signal.
3017  **
3018  *b Arguments:
3019  **
3020  *a signal - pointer to a diguySignal
3021  **
3022  *b Returns:
3023  **
3024  ** 0 on success, -1 on failure
3025  */
3026  int destroy_signal(diguySignal* signal);
3027 
3028  /*l
3029  *b Description:
3030  **
3031  ** This function resets all signals in the scenario.
3032  */
3033  void reset_signals();
3034 
3035 
3036  /*l
3037  *b Description:
3038  **
3039  ** This function hides all signals in the signal palette.
3040  **
3041  *b Arguments:
3042  **
3043  *a filter - optional filter, will only hide signals tagged with
3044  *a info_text equaling filter
3045  */
3046  int signal_palette_hide_all(const char* filter = NULL);
3047 
3048  /*l
3049  *b Description:
3050  **
3051  ** This function shows all signals in the signal palette.
3052  **
3053  *b Arguments:
3054  **
3055  *a filter - optional filter, will only show signals tagged with
3056  *a info_text filter
3057  */
3058  int signal_palette_show_all(const char* filter = NULL);
3059 
3060 
3061 /*****************************************************************************/
3075  /*l
3076  *b Returns:
3077  **
3078  ** number of sounds in the scenario
3079  */
3080  int get_num_sounds();
3081 
3082  /*l
3083  *b Returns:
3084  **
3085  ** pointer of type diguySound; NULL if no sound at the specified
3086  ** index
3087  **
3088  *b Arguments:
3089  **
3090  *a index - index of the sound; indices start at 0
3091  */
3092  diguySound* get_sound_at_index(int index);
3093 
3094  /*l
3095  *b Description:
3096  **
3097  ** This function returns a pointer to the specified sound.
3098  **
3099  *b Arguments:
3100  **
3101  *a name - name of sound to be found
3102  **
3103  *b Returns:
3104  **
3105  ** pointer of type diguySound; NULL if not found
3106  */
3107  diguySound* find_sound(const char* name);
3108 
3109  /*l
3110  *b Description:
3111  **
3112  ** This function creates a new sound and returns a pointer to it.
3113  **
3114  ** Note that sounds are not played directly. Instead they are used as
3115  ** templates for sound instances. See diguyCharacter::play_sound()
3116  ** and diguyCharacter::create_sound_instance().
3117  **
3118  *b Arguments:
3119  **
3120  *a name - name of the new sound
3121  *a sound_filename - filename of the sound
3122  **
3123  ** Note that name isn't the filename of the sound; it is the
3124  ** descriptive name that will show up in the UI and used in
3125  ** diguyCharacter calls that play sounds.
3126  **
3127  ** Pass the filename in the sound_filename argument or use the
3128  ** function diguySound::set_sound_filename() to set the filename of
3129  ** the sound.
3130  **
3131  ** See diguyCharacter::set_current_voice_actor() for information
3132  ** about naming sounds for different voice actors.
3133  **
3134  *b Returns:
3135  **
3136  ** pointer of type diguySound
3137  */
3138  diguySound* create_sound(const char* name,
3139  const char* sound_filename = NULL);
3140 
3141  /*l
3142  *b Description:
3143  **
3144  ** This function destroys a sound.
3145  **
3146  *b Arguments:
3147  **
3148  *a sound - pointer to diguySound to be destroyed
3149  **
3150  *b Returns:
3151  **
3152  ** 0 on success, -1 on failure
3153  */
3154  int destroy_sound(diguySound* sound);
3155 
3156  /*l
3157  *b Description:
3158  **
3159  ** This function preloads data for the sound.
3160  **
3161  *b Arguments:
3162  **
3163  *a sound - pointer to diguySound
3164  **
3165  *b Returns:
3166  **
3167  ** 0 on success, -1 on failure
3168  */
3169  int preload_sound(diguySound* sound);
3170 
3171  /*l
3172  **
3173  *b Description:
3174  **
3175  ** This function stops all sounds playing within the scenario.
3176  **
3177  *b Arguments:
3178  **
3179  *a rampdown_time - how long to allow the sounds to fade out
3180  **
3181  *b Returns:
3182  **
3183  ** 0 on success, -1 on failure
3184  */
3185  int stop_all_sounds(float rampdown_time = 0.0f);
3186 
3187  /*l
3188  **
3189  *b Description:
3190  **
3191  ** This function plays a non looping sound.
3192  **
3193  *b Arguments:
3194  **
3195  *a name - name of the sound
3196  *a x, y, z - location in the world the sound comes from
3197  *a gain - a volume multiplier
3198  *a save_event - if review data should record the creation of this
3199  *a sound
3200  **
3201  *b Returns:
3202  **
3203  ** 0 on success, -1 on failure
3204  */
3205  int play_3d_sound(const char* name,
3206  float x, float y, float z,
3207  float gain,
3208  int save_event);
3209 
3210 
3211 /*****************************************************************************/
3221  /*l
3222  *b Returns:
3223  **
3224  ** number of groups in the scenario
3225  */
3226  int get_num_groups();
3227 
3228  /*l
3229  *b Returns:
3230  **
3231  ** pointer of type diguyCharacterGroup; NULL if no
3232  ** group at the specified index
3233  **
3234  *b Arguments:
3235  **
3236  *a index - index of the group; indices start at 0
3237  */
3238  diguyCharacterGroup* get_group_at_index(int index);
3239 
3240  /*l
3241  *b Description:
3242  **
3243  ** This function returns a pointer to the specified group.
3244  **
3245  *b Arguments:
3246  **
3247  *a name - name of group to be found
3248  **
3249  *b Returns:
3250  **
3251  ** pointer of type diguyCharacterGroup; NULL if not found
3252  */
3253  diguyCharacterGroup* find_group(const char* name);
3254 
3255  /*l
3256  *b Description:
3257  **
3258  ** This function creates a new group and returns a
3259  ** pointer to it.
3260  **
3261  *b Arguments:
3262  **
3263  *a name - name of the new group
3264  **
3265  *b Returns:
3266  **
3267  ** pointer of type diguyCharacterGroup
3268  */
3269  diguyCharacterGroup* create_group(const char* name);
3270 
3271 
3272  /*l
3273  *b Description:
3274  **
3275  ** This function finds the group with the given name or
3276  ** creates it if it doesn't exist.
3277  **
3278  *b Arguments:
3279  **
3280  *a name - name of the group to find or create
3281  **
3282  *b Returns:
3283  **
3284  ** pointer of type diguyGroup; should never be NULL
3285  */
3286  diguyCharacterGroup* find_or_create_group(const char* name);
3287 
3288 
3289  /*l
3290  *b Description:
3291  **
3292  ** This function destroys a group.
3293  **
3294  *b Arguments:
3295  **
3296  *a group - pointer to a diguyCharacterGroup
3297  **
3298  *b Returns:
3299  **
3300  ** 0 on success, -1 on failure
3301  */
3302  int destroy_group(diguyCharacterGroup* group);
3303 
3304 
3305 /*****************************************************************************/
3315  int get_num_sensor_regions();
3317 
3318  /*l
3319  *b Returns:
3320  **
3321  ** pointer of type diguySensorRegion; NULL if no
3322  ** sensor region at the specified index
3323  **
3324  *b Arguments:
3325  **
3326  *a index - index of the sensor region; indices start at 0
3327  */
3328  diguySensorRegion* get_sensor_region_at_index(int index);
3329 
3331  diguySensorRegion* find_sensor_region(const char* name);
3332 
3334  diguySensorRegion* find_or_create_sensor_region(const char* name);
3335 
3336 /*****************************************************************************/
3346  /*l
3347  *b Returns:
3348  **
3349  ** number of scene objects in the scenario
3350  */
3351  int get_num_scene_objects();
3352 
3353  /*l
3354  *b Returns:
3355  **
3356  ** pointer of type diguySceneObject; NULL if no
3357  ** scene object at the specified index
3358  **
3359  *b Arguments:
3360  **
3361  *a index - index of the scene object; indices start at 0
3362  */
3363  diguySceneObject* get_scene_object_at_index(int index);
3364 
3365  /*l
3366  *b Returns:
3367  **
3368  ** pointer of type diguySceneObject; NULL if no
3369  ** scene object with specified name
3370  */
3371  diguySceneObject* find_scene_object(const char* name);
3372 
3373  /*l
3374  *b Description:
3375  **
3376  ** This function sets whether scene objects defined in the
3377  ** scenario are enabled, and therefore potentially visible.
3378  **
3379  ** Scene objects are *not* enabled by default.
3380  **
3381  *b Arguments:
3382  **
3383  *a scene_objects_enabled - flag determining whether scene
3384  *a objects are enabled; 1 for enabled,
3385  *a 0 for disabled
3386  */
3387  void set_scene_objects_enabled(int scene_objects_enabled);
3388 
3389  /*l
3390  *b Returns:
3391  **
3392  ** the most recent setting made by a call to
3393  ** set_scene_objects_enabled()
3394  */
3395  int get_scene_objects_enabled();
3396 
3397  /*l
3398  *b Description:
3399  **
3400  ** This function creates a new scene object and returns a
3401  ** pointer to it.
3402  **
3403  *b Arguments:
3404  **
3405  *a name - name of the new scene object
3406  *a filename - file the scene object should use
3407  **
3408  *b Returns:
3409  **
3410  ** pointer of type diguySceneObject; NULL if creation failed
3411  */
3412  diguySceneObject* create_scene_object(const char* name,
3413  const char* filename);
3414 
3415  /*l
3416  *b Description:
3417  **
3418  ** This function creates a new user defined scene object and returns a
3419  ** pointer to it.
3420  **
3421  *b Arguments:
3422  **
3423  *a name - name of the new scene object
3424  **
3425  *b Returns:
3426  **
3427  ** pointer of type diguySceneObject; NULL if creation failed
3428  */
3429  diguySceneObject* create_user_defined_scene_object(const char* name);
3430 
3431  /*l
3432  *b Description:
3433  **
3434  ** This function destroys a scene object.
3435  **
3436  *b Arguments:
3437  **
3438  *a scene_object - pointer to a diguySceneObject
3439  **
3440  *b Returns:
3441  **
3442  ** 0 on success, -1 on failure
3443  */
3444  int destroy_scene_object(diguySceneObject* scene_object);
3445 
3446 
3447 /*****************************************************************************/
3457  /*l
3458  *b Returns:
3459  **
3460  ** pointer to the scenario's primary view; there is one
3461  ** and only one primary view in the scenario
3462  */
3463  diguyView* get_primary_view();
3464 
3465  /*l
3466  *b Returns:
3467  **
3468  ** number of secondary views in the scenario
3469  */
3470  int get_num_secondary_views();
3471 
3472  /*l
3473  *b Returns:
3474  **
3475  ** pointer of type diguyView; NULL if no
3476  ** secondary view at the specified index
3477  **
3478  *b Arguments:
3479  **
3480  *a index - index of the secondary view; indices start at 0
3481  */
3482  diguyView* get_secondary_view_at_index(int index);
3483 
3484  /*l
3485  *b Description:
3486  **
3487  ** This function returns a pointer to the view with
3488  ** the given name. The primary view and all of the
3489  ** secondary views are checked for a name match.
3490  **
3491  *b Returns:
3492  **
3493  ** pointer of type diguyView; NULL if not found
3494  */
3495  diguyView* find_view(const char* name);
3496 
3497 
3498 /*****************************************************************************/
3508  /*l
3509  *b Description:
3510  **
3511  ** This function returns a pointer to the primary view's camera.
3512  ** This is equivalent to:
3513  **
3514  *e diguyView* v = scenario->get_primary_view();
3515  *e return v->get_camera();
3516  **
3517  *b Returns:
3518  **
3519  ** pointer of type diguyViewCamera; should never be NULL
3520  */
3521  diguyViewCamera* get_scenario_camera();
3522 
3523  /*l
3524  *b Description:
3525  **
3526  ** This function returns a pointer to the camera with
3527  ** the given name. The primary view's camera and all of the
3528  ** secondary views' cameras are checked for a name match.
3529  **
3530  *b Returns:
3531  **
3532  ** pointer of type diguyViewCamera; NULL if not found
3533  */
3534  diguyViewCamera* find_camera(const char* name);
3535 
3536  /*l
3537  *b Description:
3538  **
3539  ** This function sets a flag that determines whether script
3540  ** calls can set the primary view's camera settings.
3541  ** Specifically, if flag is 0, calls to diguyViewCamera::load()
3542  ** will have no effect; the camera should remain completely under
3543  ** user control.
3544  **
3545  *b Arguments:
3546  **
3547  *a flag - 1 to enable, 0 to disable
3548  */
3549  void set_scenario_camera_affected_by_script_events(int flag);
3550 
3551  /*l
3552  *b Returns:
3553  **
3554  ** the most recent setting made by
3555  ** set_scenario_camera_affected_by_script_events()
3556  */
3557  int get_scenario_camera_affected_by_script_events();
3558 
3559  /*l
3560  *b Description:
3561  **
3562  ** This function, like
3563  ** set_scenario_camera_affected_by_script_events(), determines
3564  ** whether script calls can set the primary view's camera settings,
3565  ** but only disables camera changes if there is an active I-Guy
3566  ** character as set by the set_iguy_character() call.
3567  **
3568  ** If set_scenario_camera_affected_by_script_events() has been called
3569  ** with a value of 0, then this function has no effect.
3570  **
3571  *b Arguments:
3572  **
3573  *a flag - 1 to enable, 0 to disable
3574  */
3575  void set_scenario_camera_affected_by_script_events_when_iguy_active(int flag);
3576 
3577  /*l
3578  *b Returns:
3579  **
3580  ** the most recent setting made by
3581  ** set_scenario_camera_affected_by_script_events()
3582  */
3583  int get_scenario_camera_affected_by_script_events_when_iguy_active();
3584 
3585  /*l
3586  *b Returns:
3587  **
3588  ** number of camera settings saved in the scenario
3589  */
3590  int get_num_camera_settings();
3591 
3592  /*l
3593  *b Returns:
3594  **
3595  ** pointer of type diguyViewCameraSettings; NULL if no
3596  ** camera settings at the specified index
3597  **
3598  *b Arguments:
3599  **
3600  *a index - index of the camera settings; indices start at 0
3601  */
3602  diguyViewCameraSettings* get_camera_settings_at_index(int index);
3603 
3604  /*l
3605  *b Description:
3606  **
3607  ** This function returns a pointer to the specified camera settings.
3608  **
3609  *b Arguments:
3610  **
3611  *a settings_name - name of camera settings to be found
3612  **
3613  *b Returns:
3614  **
3615  ** pointer of type diguyViewCamera; NULL if not found
3616  */
3617  diguyViewCameraSettings* find_camera_settings(const char* settings_name);
3618 
3619  /*l
3620  *b Description:
3621  **
3622  ** This function loads the specified camera settings into
3623  ** the primary view's camera.
3624  **
3625  *b Arguments:
3626  **
3627  *a settings_name - name of camera settings to be loaded
3628  *a update_current_camera - whether the current camera should be
3629  *a updated; defaults to 1
3630  **
3631  ** Not updating the current camera will cause the camera history
3632  ** to be lost.
3633  **
3634  *b Returns:
3635  **
3636  ** 0 on success, -1 on failure
3637  */
3638  int load_camera_settings(const char* settings_name, int update_current_camera = 1);
3639 
3640  /*l
3641  *b Description:
3642  **
3643  ** This function sets camera that will be used for down-stream
3644  ** camera-related operations. This includes:
3645  **
3646  *- - far position rendering in the OpenGL renderer
3647  *- - various culling operations (e.g. set_character_culling_enabled())
3648  *- - graphics LOD range scaling; see
3649  *- set_scale_graphics_lod_ranges_from_view_settings()
3650  **
3651  ** Typically the passed camera should be the primary view's camera.
3652  **
3653  ** A render camera does not always need to be set. If one is not
3654  ** set, the above camera-related operations will not be performed.
3655  **
3656  ** If a render camera is set the actual rendering environment
3657  ** camera settings (e.g. as set by gluLookAt() in OpenGL)
3658  ** should match the settings in the render camera, or there
3659  ** may be unexpected visual results.
3660  **
3661  *b Arguments:
3662  **
3663  *a camera - camera to use for camera-related operations
3664  */
3665  void set_render_camera(diguyViewCamera* camera);
3666  diguyViewCamera* get_render_camera();
3667 
3668 /*****************************************************************************/
3678  /*l
3679  *b Description:
3680  **
3681  ** This function returns a pointer to the scenario fog.
3682  ** This is the fog of the primary view.
3683  **
3684  *b Returns:
3685  **
3686  ** pointer of type diguyViewFog; should never be NULL
3687  */
3688  diguyViewFog* get_scenario_fog();
3689 
3690  /*l
3691  *b Description:
3692  **
3693  ** This function returns a pointer to the fog with
3694  ** the given name. The primary view's fog and all of the
3695  ** secondary views' fogs are checked for a name match.
3696  **
3697  *b Returns:
3698  **
3699  ** pointer of type diguyViewFog; NULL if not found
3700  */
3701  diguyViewFog* find_fog(const char* name);
3702 
3703  /*l
3704  *b Description:
3705  **
3706  ** This function returns the fog object with the given name, or
3707  ** creates one if not found.
3708  **
3709  *b Returns:
3710  **
3711  ** pointer of type diguyViewFog
3712  **
3713  *b Arguments:
3714  **
3715  *a name
3716  */
3717  diguyViewFog* find_or_create_fog(const char* name);
3718 
3719  /*l
3720  *b Description:
3721  **
3722  ** This function loads the named fog settings the currently active
3723  ** one.
3724  **
3725  *b Arguments:
3726  **
3727  *a name
3728  */
3729  void load_current_fog(const char* name);
3730 
3731  /*l
3732  *b Returns:
3733  **
3734  ** number of fog settings in the scenario
3735  */
3736  int get_num_fog_settings();
3737 
3738  /*l
3739  *b Returns:
3740  **
3741  ** pointer of type diguyViewFogSettings; NULL if no
3742  ** fog at the specified index
3743  **
3744  *b Arguments:
3745  **
3746  *a index - index of the fog settings; indices start at 0
3747  */
3748  diguyViewFogSettings* get_fog_settings_at_index(int index);
3749 
3750  /*l
3751  *b Description:
3752  **
3753  ** This function returns a pointer to the specified fog settings.
3754  **
3755  *b Arguments:
3756  **
3757  *a settings_name - name of fog settings to be found
3758  **
3759  *b Returns:
3760  **
3761  ** pointer of type diguyViewFogSettings; NULL if not found
3762  */
3763  diguyViewFogSettings* find_fog_settings(const char* settings_name);
3764 
3765  /*l
3766  *b Description:
3767  **
3768  ** This function loads the specified fog settings into
3769  ** the scenario fog.
3770  **
3771  *b Arguments:
3772  **
3773  *a settings_name - name of fog settings to be loaded
3774  **
3775  *b Returns:
3776  **
3777  ** pointer of type diguyViewFog; NULL if not found
3778  */
3779  int load_fog_settings(const char* settings_name);
3780 
3781 
3782 /*****************************************************************************/
3792  /*l
3793  *b Description:
3794  **
3795  ** This function returns a pointer to the scenario light.
3796  ** These are the lights of the primary view.
3797  **
3798  *b Arguments:
3799  **
3800  *a number - number of light to be found
3801  **
3802  *b Returns:
3803  **
3804  ** pointer of type diguyViewLight; can be null if asked for a
3805  ** non-existent light
3806  */
3807  diguyViewLight* get_scenario_light(int i = 0);
3808 
3809  /*l
3810  *b Description:
3811  **
3812  ** This function returns a pointer to the light with
3813  ** the given name. The primary view's light and all of the
3814  ** secondary views' lights are checked for a name match.
3815  **
3816  *b Returns:
3817  **
3818  ** pointer of type diguyViewLight; NULL if not found
3819  */
3820  diguyViewLight* find_light(const char* name);
3821 
3822  /*l
3823  *b Returns:
3824  **
3825  ** number of light settings in the scenario
3826  */
3827  int get_num_light_settings();
3828 
3829  /*l
3830  *b Returns:
3831  **
3832  ** pointer of type diguyViewLightSettings; NULL if no
3833  ** light settings at the specified index
3834  **
3835  *b Arguments:
3836  **
3837  *a index - index of the light settings; indices start at 0
3838  */
3839  diguyViewLightSettings* get_light_settings_at_index(int index);
3840 
3841  /*l
3842  *b Description:
3843  **
3844  ** This function returns a pointer to the specified light settings.
3845  **
3846  *b Arguments:
3847  **
3848  *a name - name of light settings to be found
3849  **
3850  *b Returns:
3851  **
3852  ** pointer of type diguyViewLightSettings; NULL if not found
3853  */
3854  diguyViewLightSettings* find_light_settings(const char* settings_name);
3855 
3856  /*l
3857  *b Description:
3858  **
3859  ** This function loads the specified light settings into
3860  ** the scenario light.
3861  **
3862  *b Arguments:
3863  **
3864  *a settings_name - name of light settings to be loaded
3865  *a light_num - which light to load into
3866  **
3867  *b Returns:
3868  **
3869  ** pointer of type diguyViewLight; NULL if not found
3870  */
3871  int load_light_settings(const char* settings_name, int light_num = 0);
3872 
3878  void set_use_override_ambient_material(int enabled);
3879 
3881  int get_use_override_ambient_material();
3882 
3884  void set_global_ambient_material(float value);
3885 
3887  float get_global_ambient_material();
3888 
3889 /*****************************************************************************/
3899  /*l
3900  *b Returns:
3901  **
3902  ** number of info popups in the scenario
3903  */
3904  int get_num_info_popups();
3905 
3906  /*l
3907  *b Returns:
3908  **
3909  ** pointer of type diguyInfoPopup; NULL if no
3910  ** info popup at the specified index
3911  **
3912  *b Arguments:
3913  **
3914  *a index - index of the info popup; indices start at 0
3915  */
3916  diguyInfoPopup* get_info_popup_at_index(int index);
3917 
3918  /*l
3919  *b Description:
3920  **
3921  ** This function returns a pointer to the specified info popup.
3922  **
3923  *b Arguments:
3924  **
3925  *a name - name of info popup to be found
3926  **
3927  *b Returns:
3928  **
3929  ** pointer of type diguyInfoPopup; NULL if not found
3930  */
3931  diguyInfoPopup* find_info_popup(const char* name);
3932 
3933  /*l
3934  *b Description:
3935  **
3936  ** This function sets the default encoding for info popups
3937  ** that do not have an encoding specified.
3938  **
3939  *b Arguments:
3940  **
3941  *a info_popup_default_encoding - new default encoding
3942  **
3943  *b Returns:
3944  **
3945  ** 0 on success, -1 on failure
3946  */
3947  int set_info_popup_default_encoding(const char* info_popup_default_encoding);
3948 
3949  /*l
3950  *b Description:
3951  **
3952  ** This function returns the default encoding of info popups.
3953  **
3954  *b Returns:
3955  **
3956  ** default encoding; value will never be NULL, but may be
3957  ** the empty string ("") if no default encoding has been
3958  ** specified
3959  */
3960  const char* get_info_popup_default_encoding();
3963 /*****************************************************************************/
3973  /*l
3974  *b Returns:
3975  **
3976  ** number of variables in the scenario
3977  */
3978  int get_num_variables();
3979 
3980  /*l
3981  *b Returns:
3982  **
3983  ** pointer of type diguyVariable; NULL if no
3984  ** variable at the specified index
3985  **
3986  *b Arguments:
3987  **
3988  *a index - index of the variable; indices start at 0
3989  */
3990  diguyVariable* get_variable_at_index(int index);
3991 
3992  /*l
3993  *b Description:
3994  **
3995  ** This function returns a pointer to the specified variable.
3996  **
3997  *b Arguments:
3998  **
3999  *a name - name of variable to be found
4000  **
4001  *b Returns:
4002  **
4003  ** pointer of type diguyVariable; NULL if not found
4004  */
4005  diguyVariable* find_variable(const char* name);
4006 
4007  /*l
4008  *b Description:
4009  **
4010  ** This function finds the variable with the given name or
4011  ** creates it if it doesn't exist.
4012  **
4013  *b Arguments:
4014  **
4015  *a name - name of the variable to find or create
4016  **
4017  *b Returns:
4018  **
4019  ** pointer of type diguyVariable; should never be NULL
4020  */
4021  diguyVariable* find_or_create_variable(const char* name);
4022 
4023  /*l
4024  *b Description:
4025  **
4026  ** This function destroys the passed variable.
4027  **
4028  *b Arguments:
4029  **
4030  *a variable - pointer to a diguyVariable
4031  **
4032  *b Returns:
4033  **
4034  ** 0 on success, -1 on failure
4035  */
4036  int destroy_variable(diguyVariable* variable);
4037 
4038 
4039 /*****************************************************************************/
4049  /*l
4050  *b Returns:
4051  **
4052  ** number of face_expressions in the scenario
4053  */
4054  int get_num_face_expressions();
4055 
4056  /*l
4057  *b Returns:
4058  **
4059  ** pointer of type diguyCharacterFaceExpression; NULL if no
4060  ** info popup at the specified index
4061  **
4062  *b Arguments:
4063  **
4064  *a index - index of the face_expression; indices start at 0
4065  */
4066  diguyCharacterFaceExpression* get_face_expression_at_index(int index);
4067 
4068  /*l
4069  *b Description:
4070  **
4071  ** This function returns a pointer to the specified face expression.
4072  **
4073  *b Arguments:
4074  **
4075  *a name - name of face_expression to be found
4076  **
4077  *b Returns:
4078  **
4079  ** pointer of type diguyCharacterFaceExpression; NULL if not found
4080  */
4081  diguyCharacterFaceExpression* find_face_expression(const char* name);
4082 
4083  /*l
4084  *b Description:
4085  **
4086  ** This function creates a new face expression with the given name.
4087  **
4088  *b Arguments:
4089  **
4090  *a name - name of the new face expression
4091  *a target_actor - name of the actor to use as template; defaults to
4092  *a "exface" for backwards compatiblity
4093  **
4094  *b Returns:
4095  **
4096  ** pointer of type diguyCharacterFaceExpression
4097  */
4098  diguyCharacterFaceExpression* create_face_expression(const char* name,
4099  const char* target_actor = "exface");
4100 
4101  /*l
4102  *b Description:
4103  **
4104  ** This function destroys the passed face expression.
4105  **
4106  *b Arguments:
4107  **
4108  *a face_expression - pointer to a diguyCharacterFaceExpression
4109  **
4110  *b Returns:
4111  **
4112  ** 0 on success, -1 on failure
4113  */
4114  int destroy_face_expression(diguyCharacterFaceExpression* face_expression);
4115 
4116 
4117 /*****************************************************************************/
4127  /*l
4128  *b Returns:
4129  **
4130  ** number of chain settings in the scenario
4131  */
4132  int get_num_chain_settings();
4133 
4134  /*l
4135  *b Returns:
4136  **
4137  ** pointer of type diguyChainSettings; NULL if no
4138  ** chain settings at the specified index
4139  **
4140  *b Arguments:
4141  **
4142  *a index - index of the chain settings; indices start at 0
4143  */
4144  diguyChainSettings* get_chain_settings_at_index(int index);
4145 
4146  /*l
4147  *b Description:
4148  **
4149  ** This function returns a pointer to the specified chain settings.
4150  **
4151  *b Arguments:
4152  **
4153  *a name - name of chain settings to be found
4154  **
4155  *b Returns:
4156  **
4157  ** pointer of type diguyChainSettings; NULL if not found
4158  */
4159  diguyChainSettings* find_chain_settings(const char* name);
4160 
4161  /*l
4162  *b Description:
4163  **
4164  ** This function creates a new chain settings and returns a
4165  ** pointer to it.
4166  **
4167  *b Arguments:
4168  **
4169  *a name - name of the new chain settings
4170  **
4171  *b Returns:
4172  **
4173  ** pointer of type diguyChainSettings
4174  */
4175  diguyChainSettings* create_chain_settings(const char* name);
4176 
4177  /*l
4178  *b Description:
4179  **
4180  ** This function destroys a chain settings.
4181  **
4182  *b Arguments:
4183  **
4184  *a chain settings - pointer to a diguyChainSettings
4185  **
4186  *b Returns:
4187  **
4188  ** 0 on success, -1 on failure
4189  */
4190  int destroy_chain_settings(diguyChainSettings* chain_settings);
4191 
4192 
4193 /*****************************************************************************/
4203  /*l
4204  *b Description:
4205  **
4206  ** This is an enumeration of the different callbacks
4207  ** that can be registered with add_callback() and
4208  ** add_callback_script().
4209  **
4210  ** Callbacks return a value of type diguyCallbackReturn,
4211  ** which will be DIGUY_CALLBACK_STOP or DIGUY_CALLBACK_CONTINUE.
4212  ** If the callback returns DIGUY_CALLBACK_STOP, the default handler
4213  ** of the function will not be called; the callback is asserting
4214  ** that it has done everything necessary for the function call.
4215  ** If the callback returns DIGUY_CALLBACK_CONTINUE, the default
4216  ** handler for the function will be called after the callback.
4217  **
4218  *************************************************************************
4219  *4 Callback Enums:
4220  **
4221  *i CALLBACK_ID_CREATE
4222  **
4223  ** This callback will be called when a new scenario is created.
4224  ** It should only be used by
4225  ** diguyApp::add_default_scenario_callback(). Using it in
4226  ** set_callback() will have no effect, as by that time the
4227  ** scenario has already been created.
4228  **
4229  *i CALLBACK_ID_RESET
4230  **
4231  ** This callback will be called when the scenario is reset.
4232  **
4233  *i CALLBACK_ID_WAIT_CURSOR_SHOW
4234  **
4235  ** This callback will be called when a diguy operation
4236  ** is likely to take some time, allowing an application to
4237  ** display a wait cursor.
4238  **
4239  *i CALLBACK_ID_WAIT_CURSOR_HIDE
4240  **
4241  ** This callback will be called when a diguy operation
4242  ** that caused a wait cursor to be shown has completed,
4243  ** allowing an application to hide the wait cursor.
4244  **
4245  *i CALLBACK_ID_LOAD
4246  **
4247  ** This callback will be called when a scenario is loaded, thereby
4248  ** giving a chance for custom code to read extra elements from the
4249  ** loaded file.
4250  **
4251  *i CALLBACK_ID_SAVE
4252  **
4253  ** This callback will be called when a scenario is saved, thereby
4254  ** giving a chance for custom code to insert extra elements into the
4255  ** saved file.
4256  **
4257  *i CALLBACK_ID_LOAD_SCENARIO_FILE
4258  **
4259  ** This callback will be called just before a scenario loads
4260  ** a new file.
4261  **
4262  *i CALLBACK_ID_SAVE_SCENARIO_FILE
4263  **
4264  ** This callback will be called just after a scenario saves
4265  ** a new file. With a char * pointer to the file name.
4266  **
4267  *i CALLBACK_ID_MANUALLY_INVOKED
4268  **
4269  ** This callback id will be supplied to event handlers invoked
4270  ** by a call to manually_invoke_event_handler().
4271  **
4272  ** The user's returned diguyCallbackReturn value will be ignored.
4273  **
4274  *i CALLBACK_ID_POST_DRAW
4275  **
4276  ** This callback will be called just after a scenario finishes it's
4277  ** draw commands. The diguyViewPainter class can be used to issue
4278  ** abstract draw commands in DI-Guy Scenario.
4279  **
4280  *i Lua Example:
4281  **
4282  *e local painter = this_app:get_view_painter();
4283  *e painter:set_pen_color(1,1,0);
4284  *e painter:draw_line(0,0,0, 1,1,1);
4285  **
4286  *i CALLBACK_ID_PLAYBACK_MODE_CHANGED
4287  **
4288  ** This callback will be called when the playback mode of the
4289  ** scenario has changed. For example, the Play or Stop buttons are
4290  ** pressed in DI-Guy Scenario, or set_playback_mode() is called.
4291  **
4292  ** The user's returned diguyCallbackReturn value will be ignored.
4293  **
4294  *i CALLBACK_ID_INPUT_MODE_CHANGED
4295  **
4296  ** This callback will be called when the input mode of the
4297  ** scenario has changed. For example, when an Input Mode button is
4298  ** pressed in DI-Guy Scenario, or diguyApp::set_base_input_mode()
4299  ** is called.
4300  **
4301  ** The user's returned diguyCallbackReturn value will be ignored.
4302  **
4303  *i CALLBACK_ID_RENDER_MODE_CHANGED
4304  **
4305  ** This callback will be called if the render mode of the scenario
4306  ** changes, typically due to a set_current_render_mode().
4307  **
4308  ** The user's returned diguyCallbackReturn value will be ignored.
4309  **
4310  *i CALLBACK_ID_POST_LOAD_CHECKPOINT
4311  **
4312  ** This callback will be called just after a scenario finishes
4313  ** loading a checkpoint file.
4314  */
4315  enum {
4316  CALLBACK_ID_CREATE = 1,
4317  CALLBACK_ID_DESTROY,
4318  CALLBACK_ID_RESET,
4319  CALLBACK_ID_WAIT_CURSOR_SHOW,
4320  CALLBACK_ID_WAIT_CURSOR_HIDE,
4321  CALLBACK_ID_LOAD,
4322  CALLBACK_ID_SAVE,
4323  CALLBACK_ID_LOAD_SCENARIO_FILE,
4324  CALLBACK_ID_SAVE_SCENARIO_FILE,
4325  CALLBACK_ID_SCENE_OBJECT_IMPACT,
4326  CALLBACK_ID_LEFT_CLICK_SCENE,
4327  CALLBACK_ID_RIGHT_CLICK_SCENE,
4328  CALLBACK_ID_TIMED_EVENT,
4329  CALLBACK_ID_MANUALLY_INVOKED,
4330  CALLBACK_ID_POST_DRAW,
4331  CALLBACK_ID_PLAYBACK_MODE_CHANGED,
4332  CALLBACK_ID_INPUT_MODE_CHANGED,
4333  CALLBACK_ID_RENDER_MODE_CHANGED,
4334  CALLBACK_ID_PRE_REINITIALIZE,
4335  CALLBACK_ID_POST_REINITIALIZE,
4336  CALLBACK_ID_POST_LOAD_CHECKPOINT
4337  };
4338 
4339 #ifdef CPLUSPLUS_ONLY
4340 
4341  /*l
4342  *b Description:
4343  **
4344  ** This function adds a scenario callback.
4345  **
4346  *b Arguments:
4347  **
4348  *a callback - pointer to function with prototype
4349  *a diguyScenarioCallback (typedefed above)
4350  *a callback_id - integer id of when this callback is to be called
4351  *a callback_params - not currently used; pass NULL
4352  *a callback_user_data - pointer for user's own use; DI-Guy will
4353  *a do nothing to the contents of this pointer
4354  *a beyond passing it back when the callback is
4355  *a invoked
4356  *a remove_on_scenario_load - pass 1 to remove the callback on a
4357  *a scenario load, 0 to not
4358  **
4359  *b Returns:
4360  **
4361  ** 0 on success, -1 on failure
4362  **
4363  *b Callable From:
4364  **
4365  *- - C++
4366  */
4367  int add_callback(int callback_id,
4368  diguyScenarioCallback* callback,
4369  void* callback_params = 0,
4370  void* callback_user_data = 0,
4371  int remove_on_scenario_load = 1);
4372 
4373  /*l
4374  *b Description:
4375  **
4376  ** This function removes a user callback. All callbacks matching
4377  ** the specified callback_id and callback function will be removed.
4378  **
4379  *b Arguments:
4380  **
4381  *a callback_id - integer id of callback
4382  *a callback - pointer to function with prototype
4383  *a diguyCharacterCallback (typedefed above)
4384  **
4385  *b Returns:
4386  **
4387  ** 0 on success, -1 on failure
4388  **
4389  *b Callable From:
4390  **
4391  *- - C++
4392  */
4393  int remove_callback(int callback_id,
4394  diguyScenarioCallback* callback);
4395 
4396  /*l
4397  *b Description:
4398  **
4399  ** This function removes a user callback. All callbacks matching
4400  ** the specified callback_id and callback_user_data pointer will
4401  ** be removed.
4402  **
4403  *b Arguments:
4404  **
4405  *a callback_id - integer id of callback
4406  *a callback_user_data - pointer for user's own use
4407  **
4408  *b Returns:
4409  **
4410  ** 0 on success, -1 on failure
4411  **
4412  *b Callable From:
4413  **
4414  *- - C++
4415  */
4416  int remove_callback_with_user_data(int callback_id,
4417  void* callback_user_data);
4418 
4419  /*l
4420  *b Description:
4421  **
4422  ** This function sets a default user callback that will be added to
4423  ** all new characters. See diguyCharacter::add_callback() for
4424  ** details.
4425  **
4426  *b Callable From:
4427  **
4428  *- - C++
4429  */
4430  int add_default_character_callback(int callback_id,
4431  diguyCharacterCallback* callback,
4432  void* callback_params,
4433  void* callback_user_data,
4434  int add_to_existing_objects_flag = 0,
4435  int remove_on_scenario_load = 1);
4436 
4437  /*l
4438  *b Description:
4439  **
4440  ** This function removes a user callback. All default character
4441  ** callbacks matching the specified callback_id and callback function
4442  ** will be removed.
4443  **
4444  *b Arguments:
4445  **
4446  *a callback_id - integer id of callback
4447  *a callback - pointer to function with prototype
4448  *a diguyCharacterCallback (typedefed above)
4449  **
4450  *b Callable From:
4451  **
4452  *- - C++
4453  */
4454  int remove_default_character_callback(int callback_id,
4455  diguyCharacterCallback* callback);
4456 
4457  /*l
4458  *b Description:
4459  **
4460  ** This function removes a default user callback previously added by
4461  ** add_default_character_callback(). See
4462  ** diguyCharacter::remove_callback_with_user_data() for details.
4463  **
4464  *b Callable From:
4465  **
4466  *- - C++
4467  */
4468  int remove_default_character_callback_with_user_data(int callback_id,
4469  void* callback_user_data);
4470 
4471 
4472  /*l
4473  *b Description:
4474  **
4475  ** This function sets a default user callback that will be added
4476  ** to all new sensor regions. See
4477  ** diguySensorRegion::add_callback() for details.
4478  **
4479  *b Callable From:
4480  **
4481  *- - C++
4482  */
4483  int add_default_sensor_region_callback(int callback_id,
4484  diguySensorRegionCallback* callback,
4485  void* callback_params,
4486  void* callback_user_data,
4487  int add_to_existing_objects_flag = 0,
4488  int remove_on_scenario_load = 1);
4489 
4490  /*l
4491  *b Description:
4492  **
4493  ** This function removes a user callback. All default sensor region
4494  ** callbacks matching the specified callback_id and callback function
4495  ** will be removed.
4496  **
4497  *b Arguments:
4498  **
4499  *a callback_id - integer id of callback
4500  *a callback - pointer to function with prototype
4501  *a diguyCharacterCallback (typedefed above)
4502  **
4503  *b Callable From:
4504  **
4505  *- - C++
4506  */
4507  int remove_default_sensor_region_callback(int callback_id,
4508  diguySensorRegionCallback* callback);
4509 
4510  /*l
4511  *b Description:
4512  **
4513  ** This function removes a default user callback. All default sensor
4514  ** region callbacks matching the specified callback_id and
4515  ** callback_user_data pointer will be removed.
4516  **
4517  *b Arguments:
4518  **
4519  *a callback_id - integer id of callback
4520  *a callback_user_data - pointer for user's own use
4521  **
4522  *b Callable From:
4523  **
4524  *- - C++
4525  */
4526  int remove_default_sensor_region_callback_with_user_data(int callback_id,
4527  void* callback_user_data);
4528 
4529  /*l
4530  *b Description:
4531  **
4532  ** This function adds a default user callback that will be added
4533  ** to all new signals.
4534  **
4535  *b Callable From:
4536  **
4537  *- - C++
4538  */
4539  int add_default_signal_callback(int callback_id,
4540  diguySignalCallback* callback,
4541  void* callback_params,
4542  void* callback_user_data,
4543  int add_to_existing_objects_flag = 0,
4544  int remove_on_scenario_load = 1);
4545 
4546  /*l
4547  *b Description:
4548  **
4549  ** This function removes a user callback. All default signal
4550  ** callbacks matching the specified callback_id and callback function
4551  ** will be removed.
4552  **
4553  *b Arguments:
4554  **
4555  *a callback_id - integer id of callback
4556  *a callback - pointer to function with prototype
4557  *a diguyCharacterCallback (typedefed above)
4558  **
4559  *b Callable From:
4560  **
4561  *- - C++
4562  */
4563  int remove_default_signal_callback(int callback_id,
4564  diguySignalCallback* callback);
4565 
4566  /*l
4567  *b Description:
4568  **
4569  ** This function removes a default user callback. All default signal
4570  ** callbacks matching the specified callback_id and callback_user_data
4571  ** pointer will be removed.
4572  **
4573  *b Arguments:
4574  **
4575  *a callback_id - integer id of callback
4576  *a callback_user_data - pointer for user's own use
4577  **
4578  *b Callable From:
4579  **
4580  *- - C++
4581  */
4582  int remove_default_signal_callback_with_user_data(int callback_id,
4583  void* callback_user_data);
4584 
4585  /*l
4586  *b Description:
4587  **
4588  ** This function adds a default user callback that will be added
4589  ** to all new variables.
4590  **
4591  *b Callable From:
4592  **
4593  *- - C++
4594  */
4595  int add_default_variable_callback(int callback_id,
4596  diguyVariableCallback* callback,
4597  void* callback_params,
4598  void* callback_user_data,
4599  int add_to_existing_objects_flag = 0,
4600  int remove_on_scenario_load = 1);
4601 
4602  /*l
4603  *b Description:
4604  **
4605  ** This function removes a user callback. All default variable
4606  ** callbacks matching the specified callback_id and callback function
4607  ** will be removed.
4608  **
4609  *b Arguments:
4610  **
4611  *a callback_id - integer id of callback
4612  *a callback - pointer to function with prototype
4613  *a diguyCharacterCallback (typedefed above)
4614  **
4615  *b Callable From:
4616  **
4617  *- - C++
4618  */
4619  int remove_default_variable_callback(int callback_id,
4620  diguyVariableCallback* callback);
4621 
4622  /*l
4623  *b Description:
4624  **
4625  ** This function removes a default user callback. All default
4626  ** variable callbacks matching the specified callback_id and
4627  ** callback_user_data pointer will be removed.
4628  **
4629  *b Arguments:
4630  **
4631  *a callback_id - integer id of callback
4632  *a callback_user_data - pointer for user's own use
4633  **
4634  *b Callable From:
4635  **
4636  *- - C++
4637  */
4638  int remove_default_variable_callback_with_user_data(int callback_id,
4639  void* callback_user_data);
4640 
4641  /*l
4642  *b Description:
4643  **
4644  ** This function adds a default user callback that will be added
4645  ** to all new views.
4646  **
4647  ** Note that unlike most of the other add default callback
4648  ** functions, this one's add_to_existing_objects_flag argument
4649  ** defaults to a value of 1, since views in scenarios always
4650  ** exist and are neither created nor destroyed.
4651  **
4652  *b Callable From:
4653  **
4654  *- - C++
4655  */
4656  int add_default_view_callback(int callback_id,
4657  diguyViewCallback* callback,
4658  void* callback_params,
4659  void* callback_user_data,
4660  int add_to_existing_objects_flag = 1,
4661  int remove_on_scenario_load = 1);
4662 
4663  /*l
4664  *b Description:
4665  **
4666  ** This function removes a user callback. All default view
4667  ** callbacks matching the specified callback_id and callback function
4668  ** will be removed.
4669  **
4670  *b Arguments:
4671  **
4672  *a callback_id - integer id of callback
4673  *a callback - pointer to function with prototype
4674  *a diguyCharacterCallback (typedefed above)
4675  **
4676  *b Callable From:
4677  **
4678  *- - C++
4679  */
4680  int remove_default_view_callback(int callback_id,
4681  diguyViewCallback* callback);
4682 
4683  /*l
4684  *b Description:
4685  **
4686  ** This function removes a default user callback. All default view
4687  ** callbacks matching the specified callback_id and callback_user_data
4688  ** pointer will be removed.
4689  **
4690  *b Arguments:
4691  **
4692  *a callback_id - integer id of callback
4693  *a callback_user_data - pointer for user's own use
4694  **
4695  *b Callable From:
4696  **
4697  *- - C++
4698  */
4699  int remove_default_view_callback_with_user_data(int callback_id,
4700  void* callback_user_data);
4701 
4702  /*l
4703  *b Description:
4704  **
4705  ** This function adds a default user callback that will be added
4706  ** to all cameras.
4707  **
4708  *b Callable From:
4709  **
4710  *- - C++
4711  */
4712  int add_default_camera_callback(int callback_id,
4713  diguyViewCameraCallback* callback,
4714  void* callback_params,
4715  void* callback_user_data,
4716  int add_to_existing_objects_flag = 0,
4717  int remove_on_scenario_load = 1);
4718 
4719  /*l
4720  *b Description:
4721  **
4722  ** This function removes a user callback. All default camera
4723  ** callbacks matching the specified callback_id and callback function
4724  ** will be removed.
4725  **
4726  *b Arguments:
4727  **
4728  *a callback_id - integer id of callback
4729  *a callback - pointer to function with prototype
4730  *a diguyCharacterCallback (typedefed above)
4731  **
4732  *b Callable From:
4733  **
4734  *- - C++
4735  */
4736  int remove_default_camera_callback(int callback_id,
4737  diguyViewCameraCallback* callback);
4738 
4739  /*l
4740  *b Description:
4741  **
4742  ** This function removes a default user callback. All default camera
4743  ** callbacks matching the specified callback_id and callback_user_data
4744  ** pointer will be removed.
4745  **
4746  *b Arguments:
4747  **
4748  *a callback_id - integer id of callback
4749  *a callback_user_data - pointer for user's own use
4750  **
4751  *b Callable From:
4752  **
4753  *- - C++
4754  */
4755  int remove_default_camera_callback_with_user_data(int callback_id,
4756  void* callback_user_data);
4757 
4758  /*l
4759  *b Description:
4760  **
4761  ** This function adds a default user callback that will be added
4762  ** to all new fogs.
4763  **
4764  *b Callable From:
4765  **
4766  *- - C++
4767  */
4768  int add_default_fog_callback(int callback_id,
4769  diguyViewFogCallback* callback,
4770  void* callback_params,
4771  void* callback_user_data,
4772  int add_to_existing_objects_flag = 0,
4773  int remove_on_scenario_load = 1);
4774 
4775  /*l
4776  *b Description:
4777  **
4778  ** This function removes a user callback. All default fog
4779  ** callbacks matching the specified callback_id and callback function
4780  ** will be removed.
4781  **
4782  *b Arguments:
4783  **
4784  *a callback_id - integer id of callback
4785  *a callback - pointer to function with prototype
4786  *a diguyCharacterCallback (typedefed above)
4787  **
4788  *b Callable From:
4789  **
4790  *- - C++
4791  */
4792  int remove_default_fog_callback(int callback_id,
4793  diguyViewFogCallback* callback);
4794 
4795  /*l
4796  *b Description:
4797  **
4798  ** This function removes a default user callback. All default fog
4799  ** callbacks matching the specified callback_id and callback_user_data
4800  ** pointer will be removed.
4801  **
4802  *b Arguments:
4803  **
4804  *a callback_id - integer id of callback
4805  *a callback_user_data - pointer for user's own use
4806  **
4807  *b Callable From:
4808  **
4809  *- - C++
4810  */
4811  int remove_default_fog_callback_with_user_data(int callback_id,
4812  void* callback_user_data);
4813 
4814  /*l
4815  *b Description:
4816  **
4817  ** This function adds a default user callback that will be added
4818  ** to all new lights.
4819  **
4820  *b Callable From:
4821  **
4822  *- - C++
4823  */
4824  int add_default_light_callback(int callback_id,
4825  diguyViewLightCallback* callback,
4826  void* callback_params,
4827  void* callback_user_data,
4828  int add_to_existing_objects_flag = 0,
4829  int remove_on_scenario_load = 1);
4830 
4831  /*l
4832  *b Description:
4833  **
4834  ** This function removes a user callback. All default light
4835  ** callbacks matching the specified callback_id and callback function
4836  ** will be removed.
4837  **
4838  *b Arguments:
4839  **
4840  *a callback_id - integer id of callback
4841  *a callback - pointer to function with prototype
4842  *a diguyCharacterCallback (typedefed above)
4843  **
4844  *b Callable From:
4845  **
4846  *- - C++
4847  */
4848  int remove_default_light_callback(int callback_id,
4849  diguyViewLightCallback* callback);
4850 
4851  /*l
4852  *b Description:
4853  **
4854  ** This function removes a default user callback. All default light
4855  ** callbacks matching the specified callback_id and callback_user_data
4856  ** pointer will be removed.
4857  **
4858  *b Arguments:
4859  **
4860  *a callback_id - integer id of callback
4861  *a callback_user_data - pointer for user's own use
4862  **
4863  *b Callable From:
4864  **
4865  *- - C++
4866  */
4867  int remove_default_light_callback_with_user_data(int callback_id,
4868  void* callback_user_data);
4869 
4870 #endif
4871 
4872  /*l
4873  *b Description:
4874  **
4875  ** This function causes all of the scenario callbacks with the given
4876  ** callback_id to be called now.
4877  **
4878  *b Arguments:
4879  **
4880  *a callback_id - integer id of callback
4881  */
4882  void manually_invoke_callbacks_now(int callback_id);
4883 
4884  /*l
4885  *b Description:
4886  **
4887  ** This function adds a user callback script. Callback scripts can
4888  ** be removed with remove_callback_script().
4889  **
4890  ** See diguyCharacter::add_callback_script() for an example
4891  ** of use.
4892  **
4893  *b Arguments:
4894  **
4895  *a callback_id - integer id of the callback
4896  *a callback_script - Script text of callback to be added
4897  *a callback_script_type - the type of script contained in
4898  *a callback_script
4899  *a remove_on_scenario_load - if the callback is removed when a new
4900  *a scenario is loaded
4901  **
4902  ** If NULL is passed for callback_script_type, a default script type
4903  ** will be derived based on the default script interpreter of the
4904  ** scenario.
4905  **
4906  *i Lua specific:
4907  **
4908  ** When the script is called, the object for which it is being called
4909  ** will be in the callback_object global.
4910  **
4911  ** To pass NULL when calling from a lua script, use nil.
4912  **
4913  *b Returns:
4914  **
4915  ** 0 on success, -1 on failure
4916  */
4917  int add_callback_script(int callback_id,
4918  const char* callback_script,
4919  const char* callback_script_type = NULL,
4920  int remove_on_scenario_load = 1);
4921 
4922  /*l
4923  *b Description:
4924  **
4925  ** This function removes a user callback script previously added with
4926  ** add_callback_script().
4927  **
4928  ** See diguyCharacter::remove_callback_script() for an example
4929  ** of use.
4930  **
4931  *b Arguments:
4932  **
4933  *a callback_id - integer id of the callback
4934  *a callback_script - Script text of callback previously added
4935  *a callback_script_type - the type of script contained in
4936  *a callback_script
4937  **
4938  ** If NULL is passed for callback_script, all callback
4939  ** scripts whose ids match callback_id and whose types match
4940  ** callback_script_type will be removed.
4941  **
4942  ** If NULL is passed for callback_script_type, a default script type
4943  ** will be derived based on the default script interpreter of the
4944  ** scenario.
4945  **
4946  *i Lua specific:
4947  **
4948  ** To pass NULL when calling from a lua script, use nil.
4949  **
4950  *b Returns:
4951  **
4952  ** 0 on success, -1 on failure
4953  */
4954  int remove_callback_script(int callback_id,
4955  const char* callback_script,
4956  const char* callback_script_type = NULL);
4957 
4958  /*l
4959  *b Description:
4960  **
4961  ** This function adds a default character callback script.
4962  ** The callback script will be added to all new characters.
4963  ** See diguyCharacter::add_callback_script() for
4964  ** more details.
4965  **
4966  *b Returns:
4967  **
4968  ** 0 on success, -1 on failure
4969  */
4970  int add_default_character_callback_script(int callback_id,
4971  const char* callback_script,
4972  const char* callback_script_type = NULL,
4973  int add_to_existing_objects_flag = 0,
4974  int remove_on_scenario_load = 1);
4975 
4976  /*l
4977  *b Description:
4978  **
4979  ** This function removes a default character callback script.
4980  ** See diguyCharacter::remove_callback_script() for
4981  ** more details.
4982  **
4983  *b Returns:
4984  **
4985  ** 0 on success, -1 on failure
4986  */
4987  int remove_default_character_callback_script(int callback_id,
4988  const char* callback_script,
4989  const char* callback_script_type = NULL);
4990 
4991  /*l
4992  *b Description:
4993  **
4994  ** This function adds a default sensor region callback script.
4995  ** The callback script will be added to all new sensor regions.
4996  ** See diguySensorRegion::add_callback_script() for
4997  ** more details.
4998  **
4999  *b Returns:
5000  **
5001  ** 0 on success, -1 on failure
5002  */
5003  int add_default_sensor_region_callback_script(int callback_id,
5004  const char* callback_script,
5005  const char* callback_script_type = NULL,
5006  int add_to_existing_objects_flag = 0,
5007  int remove_on_scenario_load = 1);
5008 
5009  /*l
5010  *b Description:
5011  **
5012  ** This function removes a default sensor region callback script.
5013  ** See diguySensorRegion::remove_callback_script() for
5014  ** more details.
5015  **
5016  *b Returns:
5017  **
5018  ** 0 on success, -1 on failure
5019  */
5020  int remove_default_sensor_region_callback_script(int callback_id,
5021  const char* callback_script,
5022  const char* callback_script_type = NULL);
5023 
5024  /*l
5025  *b Description:
5026  **
5027  ** This function adds a default signal callback script.
5028  ** The callback script will be added to all new signals.
5029  ** See diguySignal::add_callback_script() for
5030  ** more details.
5031  **
5032  *b Returns:
5033  **
5034  ** 0 on success, -1 on failure
5035  */
5036  int add_default_signal_callback_script(int callback_id,
5037  const char* callback_script,
5038  const char* callback_script_type = NULL,
5039  int add_to_existing_objects_flag = 0,
5040  int remove_on_scenario_load = 1);
5041 
5042  /*l
5043  *b Description:
5044  **
5045  ** This function removes a default signal callback script.
5046  ** See diguySignal::remove_callback_script() for
5047  ** more details.
5048  **
5049  *b Returns:
5050  **
5051  ** 0 on success, -1 on failure
5052  */
5053  int remove_default_signal_callback_script(int callback_id,
5054  const char* callback_script,
5055  const char* callback_script_type = NULL);
5056 
5057  /*l
5058  *b Description:
5059  **
5060  ** This function adds a default variable callback script.
5061  ** The callback script will be added to all new variables.
5062  ** See diguySignal::add_callback_script() for
5063  ** more details.
5064  **
5065  *b Returns:
5066  **
5067  ** 0 on success, -1 on failure
5068  */
5069  int add_default_variable_callback_script(int callback_id,
5070  const char* callback_script,
5071  const char* callback_script_type = NULL,
5072  int add_to_existing_objects_flag = 0,
5073  int remove_on_scenario_load = 1);
5074 
5075  /*l
5076  *b Description:
5077  **
5078  ** This function removes a default variable callback script.
5079  ** See diguySignal::remove_callback_script() for
5080  ** more details.
5081  **
5082  *b Returns:
5083  **
5084  ** 0 on success, -1 on failure
5085  */
5086  int remove_default_variable_callback_script(int callback_id,
5087  const char* callback_script,
5088  const char* callback_script_type = NULL);
5089 
5090  /*l
5091  *b Description:
5092  **
5093  ** This function adds a default view callback script.
5094  ** The callback script will be added to all new views.
5095  ** See diguyView::add_callback_script() for
5096  ** more details.
5097  **
5098  *b Returns:
5099  **
5100  ** 0 on success, -1 on failure
5101  */
5102  int add_default_view_callback_script(int callback_id,
5103  const char* callback_script,
5104  const char* callback_script_type = NULL,
5105  int add_to_existing_objects_flag = 0,
5106  int remove_on_scenario_load = 1);
5107 
5108  /*l
5109  *b Description:
5110  **
5111  ** This function removes a default character view script.
5112  ** See diguyView::remove_callback_script() for
5113  ** more details.
5114  **
5115  *b Returns:
5116  **
5117  ** 0 on success, -1 on failure
5118  */
5119  int remove_default_view_callback_script(int callback_id,
5120  const char* callback_script,
5121  const char* callback_script_type = NULL);
5122 
5123  /*l
5124  *b Description:
5125  **
5126  ** This function adds a default camera callback script.
5127  ** The callback script will be added to all new cameras.
5128  ** See diguyViewCamera::add_callback_script() for
5129  ** more details.
5130  **
5131  *b Returns:
5132  **
5133  ** 0 on success, -1 on failure
5134  */
5135  int add_default_camera_callback_script(int callback_id,
5136  const char* callback_script,
5137  const char* callback_script_type = NULL,
5138  int add_to_existing_objects_flag = 0,
5139  int remove_on_scenario_load = 1);
5140 
5141  /*l
5142  *b Description:
5143  **
5144  ** This function removes a default camera callback script.
5145  ** See diguyViewCamera::remove_callback_script() for
5146  ** more details.
5147  **
5148  *b Returns:
5149  **
5150  ** 0 on success, -1 on failure
5151  */
5152  int remove_default_camera_callback_script(int callback_id,
5153  const char* callback_script,
5154  const char* callback_script_type = NULL);
5155 
5156  /*l
5157  *b Description:
5158  **
5159  ** This function adds a default fog callback script.
5160  ** The callback script will be added to all new fogs.
5161  ** See diguyViewFog::add_callback_script() for
5162  ** more details.
5163  **
5164  *b Returns:
5165  **
5166  ** 0 on success, -1 on failure
5167  */
5168  int add_default_fog_callback_script(int callback_id,
5169  const char* callback_script,
5170  const char* callback_script_type = NULL,
5171  int add_to_existing_objects_flag = 0,
5172  int remove_on_scenario_load = 1);
5173 
5174  /*l
5175  *b Description:
5176  **
5177  ** This function removes a default fog callback script.
5178  ** See diguyViewFog::remove_callback_script() for
5179  ** more details.
5180  **
5181  *b Returns:
5182  **
5183  ** 0 on success, -1 on failure
5184  */
5185  int remove_default_fog_callback_script(int callback_id,
5186  const char* callback_script,
5187  const char* callback_script_type = NULL);
5188 
5189  /*l
5190  *b Description:
5191  **
5192  ** This function adds a default light callback script.
5193  ** The callback script will be added to all new lights.
5194  ** See diguyViewLight::add_callback_script() for
5195  ** more details.
5196  **
5197  *b Returns:
5198  **
5199  ** 0 on success, -1 on failure
5200  */
5201  int add_default_light_callback_script(int callback_id,
5202  const char* callback_script,
5203  const char* callback_script_type = NULL,
5204  int add_to_existing_objects_flag = 0,
5205  int remove_on_scenario_load = 1);
5206 
5207  /*l
5208  *b Description:
5209  **
5210  ** This function removes a default light callback script.
5211  ** See diguyViewLight::remove_callback_script() for
5212  ** more details.
5213  **
5214  *b Returns:
5215  **
5216  ** 0 on success, -1 on failure
5217  */
5218  int remove_default_light_callback_script(int callback_id,
5219  const char* callback_script,
5220  const char* callback_script_type = NULL);
5221 
5222 
5223 /*****************************************************************************/
5239  /*l
5240  *b Description:
5241  **
5242  ** This function maps the event handler with the given name
5243  ** to a callback id. This mapping will be saved in the .dss
5244  ** file and restored when the .dss file is loaded.
5245  **
5246  ** Mappings can also be made via the DI-Guy Scenario UI.
5247  **
5248  ** The event handler is one of the following:
5249  **
5250  *- - a scenario callback function registered by
5251  *- diguyApp::register_scenario_event_handler() or
5252  *- diguyApp::register_scenario_event_handler_from_library()
5253  *- - a script registered by
5254  *- diguyApp::register_scenario_event_handler_script()
5255  *- - a Script, Decision, or Library Function in the scenario
5256  *- whose "Event Type" is "Scenario"
5257  **
5258  *b Arguments:
5259  **
5260  *a callback_id - integer id of callback
5261  *a handler_name - name of the event handler to map
5262  **
5263  *b Returns:
5264  **
5265  ** 0 on success, -1 on failure
5266  */
5267  int map_event_handler_to_callback_id(int callback_id,
5268  const char* handler_name);
5269 
5270  /*l
5271  *b Description:
5272  **
5273  ** This function unmaps the event handler with the given name
5274  ** from a callback id.
5275  **
5276  *b Arguments:
5277  **
5278  *a callback_id - integer id of callback
5279  *a handler_name - name of the event handler to map
5280  *a unmap_all_matches - pass 0 to unmap only the first match,
5281  *a pass 1 to unmap all matches
5282  **
5283  *b Returns:
5284  **
5285  ** 0 on success, -1 on failure
5286  */
5287  int unmap_event_handler_from_callback_id(int callback_id,
5288  const char* handler_name,
5289  int unmap_all_matches = 0);
5290 
5291  /*l
5292  *b Description:
5293  **
5294  ** This function manually invokes the named scenario event handler.
5295  ** The callback_id that will be passed to the event handler will
5296  ** be CALLBACK_ID_MANUALLY_INVOKED.
5297  **
5298  ** Note that care should be taken not to end up in an infinite loop
5299  ** of event calls. In general an event handler should not end up
5300  ** directly or indirectly invoking itself.
5301  **
5302  ** The event handler is one of the following:
5303  **
5304  *- - a scenario callback function registered by
5305  *- diguyApp::register_scenario_event_handler() or
5306  *- diguyApp::register_scenario_event_handler_from_library()
5307  *- - a script registered by
5308  *- diguyApp::register_scenario_event_handler_script()
5309  *- - a Script, Decision, or Library Function in the scenario
5310  *- whose "Event Type" is "Scenario"
5311  **
5312  *b Arguments:
5313  **
5314  *a handler_name - name of the event handler to invoke
5315  **
5316  *b Returns:
5317  **
5318  ** DIGUY_CALLBACK_CONTINUE or DIGUY_CALLBACK_STOP
5319  **
5320  *b Callable From:
5321  **
5322  *- - C++
5323  *- - Script
5324  *- - Decision
5325  */
5326  diguyCallbackReturn manually_invoke_event_handler(const char* handler_name);
5327 
5328 #ifdef CPLUSPLUS_ONLY
5329 
5330  /*l
5331  *b Description:
5332  **
5333  ** This function registers a character event handler
5334  ** function that can later be mapped via a call to
5335  ** diguyCharacter::map_event_handler_to_callback_id().
5336  **
5337  ** Call unregister_character_event_handler() to
5338  ** unregister the function.
5339  **
5340  *b Arguments:
5341  **
5342  *a handler_name - name of the event handler
5343  *a callback - pointer to handler function
5344  *a callback_user_data - pointer for user's own use; DI-Guy will
5345  *a do nothing to the contents of this pointer
5346  *a beyond passing it back when the handler
5347  *a function is called
5348  **
5349  *b Returns:
5350  **
5351  ** 0 on success, -1 on failure
5352  **
5353  *b Callable From:
5354  **
5355  *- - C++
5356  */
5357  int register_character_event_handler(const char* handler_name,
5358  diguyCharacterCallback* callback,
5359  void* callback_user_data = 0);
5360 
5361 #endif
5362 
5363  /*l
5364  *b Description:
5365  **
5366  ** This function registers a character event handler
5367  ** function that can later be mapped via a call to
5368  ** diguyCharacter::map_event_handler_to_callback_id().
5369  **
5370  ** Unlike register_character_event_handler(), which directly
5371  ** passes a function pointer, this function looks up the
5372  ** function pointer from a shared library (a .dll under
5373  ** Windows, a .so under Unix).
5374  **
5375  ** The passed library_name should not include the
5376  ** .dll or .so extension; these will be added automatically.
5377  ** This allows for cross-platform scenarios that don't
5378  ** have differing dynamic library extensions built into
5379  ** them.
5380  **
5381  ** Call unregister_character_event_handler() to
5382  ** unregister the function.
5383  **
5384  *b Arguments:
5385  **
5386  *a handler_name - name of the event handler
5387  *a library_name - pointer to handler function
5388  *a function_name - pointer to handler function
5389  *a callback_user_data - pointer for user's own use; DI-Guy will
5390  *a do nothing to the contents of this pointer
5391  *a beyond passing it back when the handler
5392  *a function is called
5393  **
5394  *b Returns:
5395  **
5396  ** 0 on success, -1 on failure
5397  */
5398  int register_character_event_handler_from_library(const char* handler_name,
5399  const char* library_name,
5400  const char* function_name,
5401  void* callback_user_data = 0);
5402 
5403  /*l
5404  *b Description:
5405  **
5406  ** This function registers a character event handler
5407  ** script that can later be mapped via a call to
5408  ** diguyCharacter::map_event_handler_to_callback_id().
5409  **
5410  ** Call unregister_character_event_handler() to
5411  ** unregister the script.
5412  **
5413  *b Arguments:
5414  **
5415  *a handler_name - name of the event handler
5416  *a handler_script - Script text
5417  *a handler_script_type - type of script; pass NULL
5418  *a for scenario to use the default
5419  *a script interpreter
5420  **
5421  *b Returns:
5422  **
5423  ** 0 on success, -1 on failure
5424  */
5425  int register_character_event_handler_script(const char* handler_name,
5426  const char* handler_script,
5427  const char* handler_script_type = 0);
5428 
5429  /*l
5430  *b Returns:
5431  **
5432  ** 1 if there is a character event handler with the given
5433  ** name, 0 if not
5434  **
5435  *b Arguments:
5436  **
5437  *a handler_name - name of the event handler
5438  */
5439  int has_registered_character_event_handler(const char* handler_name);
5440 
5441  /*l
5442  *b Description:
5443  **
5444  ** This function unregisters a character event handler.
5445  ** This will unmap the event handler from any mappings
5446  ** it is a part of.
5447  **
5448  *b Arguments:
5449  **
5450  *a handler_name - name of the event handler
5451  **
5452  *b Returns:
5453  **
5454  ** 0 on success, -1 on failure
5455  */
5456  int unregister_character_event_handler(const char* handler_name);
5457 
5458 #ifdef CPLUSPLUS_ONLY
5459 
5460  /*l
5461  *b Description:
5462  **
5463  ** This function is analogous to the
5464  ** register_character_event_handler() function,
5465  ** but is for signals rather than characters.
5466  **
5467  *b Callable From:
5468  **
5469  *- - C++
5470  */
5471  int register_signal_event_handler(const char* handler_name,
5472  diguySignalCallback* callback,
5473  void* callback_user_data = 0);
5474 
5475 #endif
5476 
5477  /*l
5478  *b Description:
5479  **
5480  ** This function is analogous to the
5481  ** register_character_event_handler_from_library() function,
5482  ** but is for signals rather than characters.
5483  */
5484  int register_signal_event_handler_from_library(const char* handler_name,
5485  const char* library_name,
5486  const char* function_name,
5487  void* callback_user_data = 0);
5488 
5489  /*l
5490  *b Description:
5491  **
5492  ** This function is analogous to the
5493  ** register_character_event_handler_script() function,
5494  ** but is for signals rather than characters.
5495  */
5496  int register_signal_event_handler_script(const char* handler_name,
5497  const char* handler_script,
5498  const char* handler_script_type = 0);
5499 
5500  /*l
5501  *b Description:
5502  **
5503  ** This function is analogous to the
5504  ** has_registered_character_event_handler() function,
5505  ** but is for signals rather than characters.
5506  */
5507  int has_registered_signal_event_handler(const char* handler_name);
5508 
5509  /*l
5510  *b Description:
5511  **
5512  ** This function is analogous to the
5513  ** unregister_character_event_handler() function,
5514  ** but is for signals rather than characters.
5515  */
5516  int unregister_signal_event_handler(const char* handler_name);
5517 
5518 #ifdef CPLUSPLUS_ONLY
5519 
5520  /*l
5521  *b Description:
5522  **
5523  ** This function is analogous to the
5524  ** register_character_event_handler() function,
5525  ** but is for sensor regions rather than characters.
5526  **
5527  *b Callable From:
5528  **
5529  *- - C++
5530  */
5531  int register_sensor_region_event_handler(const char* handler_name,
5532  diguySensorRegionCallback* callback,
5533  void* callback_user_data = 0);
5534 
5535 #endif
5536 
5537  /*l
5538  *b Description:
5539  **
5540  ** This function is analogous to the
5541  ** register_character_event_handler_from_library() function,
5542  ** but is for sensor regions rather than characters.
5543  */
5544  int register_sensor_region_event_handler_from_library(const char* handler_name,
5545  const char* library_name,
5546  const char* function_name,
5547  void* callback_user_data = 0);
5548 
5549  /*l
5550  *b Description:
5551  **
5552  ** This function is analogous to the
5553  ** register_character_event_handler_script() function,
5554  ** but is for sensor regions rather than characters.
5555  */
5556  int register_sensor_region_event_handler_script(const char* handler_name,
5557  const char* handler_script,
5558  const char* handler_script_type = 0);
5559 
5560  /*l
5561  *b Description:
5562  **
5563  ** This function is analogous to the
5564  ** has_registered_character_event_handler() function,
5565  ** but is for sensor regions rather than characters.
5566  */
5567  int has_registered_sensor_region_event_handler(const char* handler_name);
5568 
5569  /*l
5570  *b Description:
5571  **
5572  ** This function is analogous to the
5573  ** unregister_character_event_handler() function,
5574  ** but is for sensor regions rather than characters.
5575  */
5576  int unregister_sensor_region_event_handler(const char* handler_name);
5577 
5578 #ifdef CPLUSPLUS_ONLY
5579 
5580  /*l
5581  *b Description:
5582  **
5583  ** This function is analogous to the
5584  ** register_character_event_handler() function,
5585  ** but is for variables rather than characters.
5586  **
5587  *b Callable From:
5588  **
5589  *- - C++
5590  */
5591  int register_variable_event_handler(const char* handler_name,
5592  diguyVariableCallback* callback,
5593  void* callback_user_data = 0);
5594 
5595 #endif
5596 
5597  /*l
5598  *b Description:
5599  **
5600  ** This function is analogous to the
5601  ** register_character_event_handler_from_library() function,
5602  ** but is for variables rather than characters.
5603  */
5604  int register_variable_event_handler_from_library(const char* handler_name,
5605  const char* library_name,
5606  const char* function_name,
5607  void* callback_user_data = 0);
5608 
5609  /*l
5610  *b Description:
5611  **
5612  ** This function is analogous to the
5613  ** register_character_event_handler_script() function,
5614  ** but is for variables rather than characters.
5615  */
5616  int register_variable_event_handler_script(const char* handler_name,
5617  const char* handler_script,
5618  const char* handler_script_type = 0);
5619 
5620  /*l
5621  *b Description:
5622  **
5623  ** This function is analogous to the
5624  ** has_registered_character_event_handler() function,
5625  ** but is for variables rather than characters.
5626  */
5627  int has_registered_variable_event_handler(const char* handler_name);
5628 
5629  /*l
5630  *b Description:
5631  **
5632  ** This function is analogous to the
5633  ** unregister_character_event_handler() function,
5634  ** but is for variables rather than characters.
5635  */
5636  int unregister_variable_event_handler(const char* handler_name);
5637 
5638 
5639 
5640 /*****************************************************************************/
5650  /*l
5651  *b Description:
5652  **
5653  ** This function saves the current run of the scenario to the
5654  ** specified file, and other files whose names are derived from
5655  ** the passed filename. The passed filename should end with the
5656  ** extension ".dsr" (DI-Guy Review).
5657  **
5658  ** The review data can be reloaded later by calling the load()
5659  ** function, and passing the same filename.
5660  **
5661  ** The following is saved for later review:
5662  **
5663  *- - all character positions and poses
5664  *- - sounds played by characters due to play_sound() and
5665  ** fire_weapon_n_times() calls
5666  **
5667  ** Note that Paths, Waypoints, and Event Beads per se are *not* saved,
5668  ** but rather their effects on the characters' positions and poses.
5669  **
5670  *b Arguments:
5671  **
5672  *a filename - file in which to save review data
5673  **
5674  *b Returns:
5675  **
5676  ** 0 on success, -1 on failure
5677  *b C++ Example:
5678  **
5679  *e // when shutting down the current run:
5680  *e scenario->save_review_data("review0.dsr");
5681  *e
5682  *e // when after action review is needed:
5683  *e scenario->load("review0.dsr");
5684  */
5685  int save_review_data(const char* filename);
5686 
5687  /*l
5688  *b Returns:
5689  **
5690  ** 1 if scenario was loaded from review data (from a .dsr file);
5691  ** 0 if not (from a .dss file)
5692  */
5693  int get_loaded_from_review_data();
5694 
5695  /*l
5696  *b Description:
5697  **
5698  ** This function sets what type of "history" will be kept for the
5699  ** scenario.
5700  **
5701  ** If time is run backwards in a scenario with history,
5702  ** the following will be "remembered" and replayed:
5703  **
5704  *- - camera settings currently in the primary view's camera
5705  *- - signal trigger counts
5706  *- - enabled/disabled status of scene objects
5707  *- - sounds
5708  **
5709  ** The default is DIGUY_HISTORY_TYPE_NONE for scenarios created
5710  ** using the DI-Guy API, and DIGUY_HISTORY_TYPE_COMPLETE for scenarios
5711  ** created using the DI-Guy Scenario editor.
5712  **
5713  *b Arguments:
5714  **
5715  *a history_type - history type to be used for the scenario
5716  **
5717  ** history_type should be one of the following values:
5718  **
5719  *i DIGUY_HISTORY_TYPE_NONE
5720  **
5721  ** This history type saves no history.
5722  **
5723  *i DIGUY_HISTORY_TYPE_COMPLETE
5724  **
5725  ** This history type saves a complete history.
5726  **
5727  ** DIGUY_HISTORY_TYPE_LAST and DIGUY_HISTORY_TYPE_FIRST are not
5728  ** supported for scenario history.
5729  **
5730  *b Returns:
5731  **
5732  ** 0 on success, -1 on failure
5733  */
5734  int set_history_type(diguyHistoryType history_type);
5735 
5736  /*l
5737  *b Returns:
5738  **
5739  ** the current history type of the scenario; see
5740  ** set_history_type()
5741  */
5742  diguyHistoryType get_history_type();
5743 
5744  /*l
5745  *b Description:
5746  **
5747  ** This function sets the history type for this scenario, as well as
5748  ** the history types of all characters.
5749  **
5750  ** See also diguyScenario::set_history_type() and
5751  ** diguyCharacter::set_history_type().
5752  **
5753  *b Arguments:
5754  **
5755  *a history_type - history type to be used for the scenario and all
5756  *a characters
5757  */
5758  void set_overall_history_type(diguyHistoryType overall_history_type);
5759 
5760  /*l
5761  *b Description:
5762  **
5763  ** This function returns the overall history type of the scenario.
5764  **
5765  ** The return value will be:
5766  **
5767  *- - DIGUY_HISTORY_TYPE_COMPLETE if history is enabled for the
5768  *- scenario and *all* characters
5769  *- - DIGUY_HISTORY_TYPE_PARTIAL if history is enabled for at least
5770  *- one of the scenario or any character, but not all
5771  *- - DIGUY_HISTORY_TYPE_NONE if history is not enabled for the
5772  *- scenario or any character
5773  **
5774  ** See also diguyScenario::get_history_type() and
5775  ** diguyCharacter::get_history_type().
5776  */
5777  diguyHistoryType get_overall_history_type();
5778 
5779  /*l
5780  *b Returns:
5781  **
5782  ** whether the scenario is playing back stored history
5783  */
5784  int get_replaying_history();
5785 
5786  /*l
5787  *b Description:
5788  **
5789  ** This function sets how many sound instances are kept in memory when
5790  ** history is enabled. By keeping them in memory, users can "scrub"
5791  ** backwards in time and hear sounds that were started earlier in time
5792  ** and will be resumed at the proper offset into the sound. This
5793  ** function lets users balance that need with memory management.
5794  **
5795  *b Arguments:
5796  **
5797  *a num_sound_instances - override system default of 100
5798  **
5799  *b Returns:
5800  **
5801  ** none
5802  */
5803  void set_history_max_sound_instances(int num_sound_instances);
5804 
5805 
5806 /*****************************************************************************/
5816  /*l
5817  *b Description:
5818  **
5819  ** This function sets whether automatic graphics LOD switching
5820  ** should be enabled for certain graphics environments (see below).
5821  **
5822  ** By default it is enabled in DI-Guy Scenario, and disabled in a
5823  ** DI-Guy API application.
5824  **
5825  ** There are two ways that DI-Guy calculates the proper
5826  ** graphics LOD. For some graphics environments the calculation
5827  ** is done "manually", using data from a diguyViewCamera.
5828  ** In other environments the calculation is done by the graphics
5829  ** environment itself. The method used in each graphics
5830  ** environment is noted below.
5831  **
5832  *i OpenGL Version:
5833  **
5834  ** This function enables or disables automatic LOD switching.
5835  ** In this graphics environment LOD calculations are done by
5836  ** the renderer; information from the diguyViewCamera is not
5837  ** used.
5838  **
5839  *i DI-Guy Graphics API Version:
5840  **
5841  ** This function enables or disables automatic LOD switching.
5842  ** In this graphics environment LOD calculations are done by
5843  ** the renderer; information from the diguyViewCamera is not
5844  ** used.
5845  */
5846  void set_automatic_graphics_lod_switching(int enable_graphics_lod_switching);
5847 
5849  int get_automatic_graphics_lod_switching();
5850 
5853  int set_character_culling_distance(float dist);
5854 
5856  float get_character_culling_distance();
5857 
5860  int set_vehicle_culling_distance(float dist);
5861 
5863  float get_vehicle_culling_distance();
5864 
5867  int set_prop_culling_distance(float dist);
5869  float get_prop_culling_distance();
5870 
5871  /*l
5872  *b Description:
5873  **
5874  ** Turns on instancing system. This can yield much faster rendering, but can make
5875  ** rendering pipeline much more complex. This value is initially
5876  ** set by use_shader_instancing in the diguy graphics init structure.
5877  */
5878  void set_instancing_enabled(int val);
5879 
5881  int get_instancing_enabled() const;
5882 
5883  /*l
5884  *b Description:
5885  **
5886  ** Sets the minimum LOD that the instancing system turns on this defaults to LOD 4.
5887  */
5888  void set_instancing_min_lod(int val);
5889 
5891  int get_instancing_min_lod() const;
5892 
5894  void set_visualize_instance_groups(int val);
5895 
5897  int get_visualize_instance_groups() const;
5898 
5899  /*l
5900  *b Description:
5901  ** For scene graph renderers, it can be necessary to patch the texture buffer object after
5902  ** the scene graph finishes updating various post processes (ground clamping for instance),
5903  ** or modifying the TBO with a local space camera. This function lets DI-Guy knows to keep
5904  ** track of TBO shape index data, and not fill out the positions in the TBO data.
5905  **
5906  ** This function allows the end user to set the matrix in the TBO for each shape
5907  ** the character has. It requires diguyCharacter::set_final_tbo_position_matrix() is called
5908  ** after build_instance_groups() and before update_instancing_data()
5909  */
5910  void set_instancing_tbo_patching_enabled(int enable_patching);
5911  int get_instancing_tbo_patching_enabled() const;
5912 
5916  void set_instancing_position_callback_enabled(int use_user_position_matrices);
5917  int get_instancing_position_callback_enabled() const;
5918 
5925  void set_num_extra_per_instance_data_floats(int number);
5926  int get_num_extra_per_instance_data_floats() const;
5927 
5929  void build_instance_groups();
5930 
5933  void update_instancing_data();
5934 
5935 #ifdef CPLUSPLUS_ONLY
5936 
5937  /*l
5938  *b Description:
5939  **
5940  ** Sets the distances at which level of detail switching occurs
5941  ** for characters of the specified type. Existing characters
5942  ** are not affected; only newly created characters will have the
5943  ** specified LOD switching ranges.
5944  **
5945  ** Characters will display with the highest level of detail when
5946  ** viewed from a distance between ranges[0] and ranges[1].
5947  ** Characters will not display at all when viewed from further
5948  ** away than the highest switching range.
5949  **
5950  ** Note: ranges[0] should almost always be 0.0.
5951  **
5952  *b Arguments:
5953  **
5954  *a character_type - character type name, as returned by
5955  *a get_character_type_at_index()
5956  *a ranges - an array of 8 non-negative floating point numbers,
5957  *a each larger than the one before, specifying the
5958  *a LOD switching ranges in meters
5959  **
5960  ** Pass "all" for character_type to set the default ranges of all
5961  ** character types.
5962  **
5963  ** The table below indicates the number of polygons for one of the
5964  ** default soldier models in each level of detail, and the LOD
5965  ** switching ranges in effect before this function is called.
5966  **
5967  *e lod polys min max
5968  *e --------------------------
5969  *e 1 2300 0 5
5970  *e 2 900 5 10
5971  *e 3 550 10 20
5972  *e 4 280 20 40
5973  *e 5 130 40 70
5974  *e 6 60 70 100
5975  *e 7 40 100 1000
5976  **
5977  *b Callable From:
5978  **
5979  *- - C++
5980  */
5981  void set_default_lod_ranges(const char* character_type, float* ranges);
5982 
5983 #endif
5984 
5985  /*l
5986  *b Description:
5987  **
5988  ** This function sets whether view and camera settings such as
5989  ** field-of-view (FOV) and window size should be taken into account
5990  ** when determining the graphics LOD from a character's LOD ranges.
5991  **
5992  ** The camera settings that are used are taken from the current
5993  ** render camera, as set by set_render_camera(). This happens
5994  ** automatically in DI-Guy Scenario, but must be set manually
5995  ** in the DI-Guy SDK.
5996  **
5997  ** DI-Guy graphics LODs are distance-based, but this approach can
5998  ** be problematic if the current camera's FOV is very narrow; a
5999  ** narrow FOV essentially acts like a telephoto lens. In this case
6000  ** a character that is far away, and would therefore be rendered
6001  ** with few polygons, can actually be quite large in the 3D view.
6002  **
6003  ** Setting this flag to 1 will cause the FOV to be taken into account
6004  ** when calculating the effective distance of a character from the
6005  ** camera.
6006  **
6007  ** Many DI-Guy LOD distances assume that the vertical FOV of the
6008  ** view is around 40. Smaller FOVs will scale the distances larger
6009  ** so that LOD changes happen further out. Likewise larger FOVs
6010  ** will scale the distances smaller; in this case even nearby
6011  ** characters will appear small and therefore need less resolution.
6012  **
6013  *b Arguments:
6014  **
6015  ** do_scale - pass 1 to enable scaling, 0 to disable
6016  */
6017  void set_scale_graphics_lod_ranges_from_view_settings(int do_scale);
6018 
6019  /*l
6020  *b Returns:
6021  **
6022  ** most recent setting of
6023  ** set_scale_graphics_lod_ranges_from_view_settings()
6024  */
6025  int get_scale_graphics_lod_ranges_from_view_settings();
6026 
6027  /*l
6028  *b Description:
6029  **
6030  ** This function sets whether automatic motion LOD switching
6031  ** should be enabled.
6032  **
6033  ** By default it is enabled in DI-Guy Scenario, and disabled in a
6034  ** DI-Guy API application.
6035  **
6036  ** When running in a user application that uses the DI-Guy
6037  ** API, the primary view's camera's position and orientation
6038  ** must be kept consistent with the application's perception
6039  ** of current camera settings. A pointer to the primary view's
6040  ** camera can be obtained by calling get_scenario_camera().
6041  **
6042  ** The following describes the algorithm used by automatic motion
6043  ** LOD switching:
6044  **
6045  *- - if a character is in front of the primary view's camera,
6046  *- the motion LOD is set to 1 (animate all joints)
6047  *- - else set motion LOD to 5 (stop animating everything but
6048  *- base position)
6049  **
6050  ** Note that if there are multiple views open on the scenario,
6051  ** the character must be behind *all* cameras for the motion
6052  ** LOD to be set to 5.
6053  **
6054  ** Also, if the history type of the character (as set by
6055  ** diguyCharacter::set_history_type()) is anything but
6056  ** DIGUY_HISTORY_TYPE_NONE, motion LOD 1 will be used since
6057  ** during scenario playback the character might be in front
6058  ** of any camera.
6059  */
6060  void set_automatic_motion_lod_switching(int enable_motion_lod_switching);
6061 
6062  /*l
6063  *b Description:
6064  **
6065  ** This function returns whether automatic motion LOD switching
6066  ** is be enabled for characters in the scenario, as set by
6067  ** set_automatic_motion_lod_switching().
6068  **
6069  *b Returns:
6070  **
6071  ** 1 if LODs enabled; 0 if not
6072  */
6073  int get_automatic_motion_lod_switching();
6074 
6075 
6076 /*****************************************************************************/
6086  /*l
6087  *b Description:
6088  **
6089  ** This function sends the passed string through the script
6090  ** interpreter.
6091  **
6092  *b Arguments:
6093  **
6094  *a script_text - string to be evaluated
6095  *a save_as_transient - flag stating whether script_text should
6096  *a be remembered as a transient event at
6097  *a the current scenario t; see
6098  *a push_transient_script_event()
6099  *a script_type - type of script contained in script_text; pass
6100  *a NULL to use scenario's default interpreter
6101  *a script_source - string identifying the 'source' of the script;
6102  *a will be printed in error output if there are
6103  *a syntax errors in the script
6104  **
6105  *b Returns:
6106  **
6107  ** 0 on success, -1 on failure
6108  **
6109  *b C++ Example:
6110  **
6111  *e scenario->eval_script("signal1:trigger();",
6112  *e 0,
6113  *e "lua",
6114  *e "User Script");
6115  */
6116  int eval_script(const char* script_text,
6117  int save_as_transient = 0,
6118  const char* script_type = NULL,
6119  const char* script_source = NULL);
6120 
6121  /*l
6122  *b Description:
6123  **
6124  ** This function sends the contents of the specified file through
6125  ** the script interpreter.
6126  **
6127  *b Arguments:
6128  **
6129  *a filename - filename of script to be evaluated
6130  *a script_type - type of script contained in file; pass NULL
6131  *a to use the scenario's default interpreter
6132  **
6133  *b Returns:
6134  **
6135  ** 0 on success, -1 on failure
6136  **
6137  *b C++ Example:
6138  **
6139  *e scenario->eval_script_file("my_scripts.pl");
6140  */
6141  int eval_script_file(const char* filename,
6142  const char* script_type = NULL);
6143 
6144  /*l
6145  *b Description:
6146  **
6147  ** This function manually triggers a script.
6148  **
6149  *b Arguments:
6150  **
6151  *a script_name - name of the script to be triggered
6152  **
6153  *b Returns:
6154  **
6155  ** return result of script; 0 if script not found
6156  **
6157  *b Callable From:
6158  **
6159  *- - C++
6160  *- - Script
6161  *- - Decision
6162  */
6163  int trigger_script(const char* script_name);
6164 
6165  /*l
6166  *b Description:
6167  **
6168  ** This function is similar to trigger_script(), but delays the
6169  ** trigger by the specified time.
6170  **
6171  *b Arguments:
6172  **
6173  *a script_name - name of the script to be triggered
6174  *a t_delay - how many seconds to delay trigger
6175  **
6176  *b Callable From:
6177  **
6178  *- - C++
6179  *- - Script
6180  *- - Decision
6181  */
6182  void trigger_script_delayed(const char* script_name, float t_delay);
6183 
6184  /*l
6185  *b Description:
6186  **
6187  ** This function manually triggers a decision.
6188  **
6189  *b Arguments:
6190  **
6191  *a decision_name - name of the decision to be triggered
6192  **
6193  *b Returns:
6194  **
6195  ** return result of decision; 0 if decision not found
6196  **
6197  *b Callable From:
6198  **
6199  *- - C++
6200  *- - Script
6201  *- - Decision
6202  */
6203  int trigger_decision(const char* decision_name);
6204 
6205  /*l
6206  *b Description:
6207  **
6208  ** This function is similar to trigger_decision(), but delays the
6209  ** trigger by the specified time.
6210  **
6211  *b Arguments:
6212  **
6213  *a decision_name - name of the decision to be triggered
6214  *a t_delay - how many seconds to delay trigger
6215  **
6216  *b Callable From:
6217  **
6218  *- - C++
6219  *- - Script
6220  *- - Decision
6221  */
6222  void trigger_decision_delayed(const char* decision_name, float t_delay);
6223 
6224  /*l
6225  *b Description:
6226  **
6227  ** This function places the passed script text on a list of scripts
6228  ** that should be re-evaluated when the scenario is replayed from
6229  ** review data.
6230  **
6231  ** Note that the script is *not* evaluated at this time. This can be
6232  ** done by calling eval_script() and passing 1 for the
6233  ** save_as_transient argument.
6234  **
6235  ** If the scenario is reset (as in a call to reset()), all transient
6236  ** scripts will be deleted. The transient script events can be saved
6237  ** and restored by calling save_transient_script_events() and
6238  ** load_transient_script_events(), respectively.
6239  **
6240  *b Arguments:
6241  **
6242  *a t - time at which script should be re-evaluated
6243  *a during scenario playback
6244  *a script_text - Script to be evaluated
6245  *a script_type - Scripting language to use (lua)
6246  **
6247  ** A copy of the passed script text is made.
6248  **
6249  *b Returns:
6250  **
6251  ** 0 on success, -1 on failure
6252  */
6253  void push_transient_script_event(float t, const char* script_text, const char* script_type);
6254 
6255  /*l
6256  *b Description:
6257  **
6258  ** This function deletes all transient script events.
6259  */
6260  void clear_transient_script_events();
6261 
6262  /*l
6263  *b Description:
6264  **
6265  ** This function saves the transient script events to the specified
6266  ** file. They can be restored by calling
6267  ** load_transient_script_events() with the same filename.
6268  **
6269  *b Arguments:
6270  **
6271  *a filename - file in which transient script events should be saved
6272  **
6273  *b Returns:
6274  **
6275  ** 0 on success, -1 on failure
6276  */
6277  int save_transient_script_events(const char* filename);
6278 
6279  /*l
6280  *b Description:
6281  **
6282  ** This function loads transient script events saved by a call to
6283  ** save_transient_script_events().
6284  **
6285  *b Arguments:
6286  **
6287  *a filename - file from which transient script events should be
6288  *a loaded
6289  **
6290  *b Returns:
6291  **
6292  ** 0 on success, -1 on failure
6293  */
6294  int load_transient_script_events(const char* filename);
6295 
6296  /*l
6297  *b Description:
6298  **
6299  ** This function creates a package object that points to an external
6300  ** file. If the language is not specified it will be determined based
6301  ** on the filename's extension. DI-Guy will attempt to derive an
6302  ** appropriate name for the package. In DI-Guy Scenario package
6303  ** dependencies are also extracted and loaded; currently this must be
6304  ** done manually in the SDK.
6305  */
6306  int load_package(const char* filename,
6307  const char* language = NULL,
6308  int warn_if_not_found = 1);
6309 
6310  /*l
6311  *b Description:
6312  **
6313  ** Documentation Pending
6314  */
6315  int load_package_with_dependancy(const char* filename,
6316  const char* depends_on_package,
6317  const char* language = NULL,
6318  int warn_if_not_found = 1);
6319 
6320 
6321 /*****************************************************************************/
6331  /*l
6332  *b Description:
6333  **
6334  ** This function returns the number of postures the specified
6335  ** character type's actions support.
6336  **
6337  ** Use this function along with get_character_type_posture_at_index()
6338  ** to enumerate the character's postures.
6339  **
6340  *b Arguments:
6341  **
6342  *a character_type - character type name, as returned by
6343  *a get_character_type_at_index(), for example
6344  **
6345  *b Returns:
6346  **
6347  ** the number of postures the specified character type's actions
6348  ** support
6349  */
6350  int get_character_type_num_postures(const char* character_type);
6351 
6352  /*l
6353  *b Description:
6354  **
6355  ** This function returns the posture at the specified index.
6356  **
6357  ** Use this function along with get_character_type_num_postures()
6358  ** to enumerate the character's postures.
6359  **
6360  *b Arguments:
6361  **
6362  *a character_type - character type name, as returned by
6363  *a get_character_type_at_index(), for example
6364  *a index - index of the posture; indices start at 0
6365  **
6366  *b Returns:
6367  **
6368  ** the posture at the specified index
6369  */
6370  diguyMotionPosture get_character_type_posture_at_index(const char* character_type,
6371  int index);
6372 
6373  /*l
6374  *b Description:
6375  **
6376  ** This function returns the overall posture of the specified action.
6377  **
6378  ** The results of this function call can be useful in calls to the
6379  ** diguyCharacter::get_action_from_description() function, if
6380  ** for example an action with the same posture but a faster speed
6381  ** is desired.
6382  **
6383  *b Arguments:
6384  **
6385  *a character_type - character type name, as returned by
6386  *a get_character_type_at_index(), for example
6387  *a action_name - the action to query
6388  **
6389  *b Returns:
6390  **
6391  ** the overall posture of the specified action
6392  */
6393  diguyMotionPosture get_character_type_action_posture(const char* character_type,
6394  const char* action_name);
6395 
6396  /*l
6397  *b Description:
6398  **
6399  ** This function returns the number of variants the specified
6400  ** character type's actions support.
6401  **
6402  ** Use this function along with get_character_type_variant_at_index()
6403  ** to enumerate the character's variants.
6404  **
6405  ** This function differs from
6406  ** get_character_type_action_num_variants() in that this function
6407  ** returns the number of variants of *all* actions of the
6408  ** character. The other function returns the number of variants
6409  ** of a single action.
6410  **
6411  *b Arguments:
6412  **
6413  *a character_type - character type name, as returned by
6414  *a get_character_type_at_index(), for example
6415  **
6416  *b Returns:
6417  **
6418  ** the number of variants the specified character type's actions
6419  ** support
6420  */
6421  int get_character_type_num_variants(const char* character_type);
6422 
6423  /*l
6424  *b Description:
6425  **
6426  ** This function returns the variant at the specified index.
6427  **
6428  ** Use this function along with get_character_type_num_variants()
6429  ** to enumerate the character's variants.
6430  **
6431  ** This function differs from
6432  ** get_character_type_action_variant_at_index() in that this function
6433  ** returns one of the variants of *all* actions of the
6434  ** character. The other function returns one of the variants
6435  ** of a single action.
6436  **
6437  *b Arguments:
6438  **
6439  *a character_type - character type name, as returned by
6440  *a get_character_type_at_index(), for example
6441  *a index - index of the posture; indices start at 0
6442  **
6443  *b Returns:
6444  **
6445  ** the variant at the specified index
6446  */
6447  diguyMotionVariant get_character_type_variant_at_index(const char* character_type,
6448  int index);
6449 
6450  /*l
6451  *b Description:
6452  **
6453  ** This function returns the primary variant of the specified action.
6454  **
6455  *b Arguments:
6456  **
6457  *a character_type - character type name, as returned by
6458  *a get_character_type_at_index(), for example
6459  *a action_name - the action to query
6460  **
6461  *b Returns:
6462  **
6463  ** the overall variant of the specified action
6464  */
6465  diguyMotionVariant get_character_type_action_primary_variant(const char* character_type,
6466  const char* action_name);
6467 
6468  /*l
6469  *b Description:
6470  **
6471  ** This function returns the number of variants the specified
6472  ** action of the specified character type has.
6473  **
6474  ** Use this function along with
6475  ** get_character_type_action_variant_at_index()
6476  ** to enumerate the character's variants.
6477  **
6478  ** This function differs from
6479  ** get_character_type_num_variants() in that this function
6480  ** returns the number of variants of a single action of the
6481  ** character. The other function returns the number of variants
6482  ** of *all* actions.
6483  **
6484  *b Arguments:
6485  **
6486  *a character_type - character type name, as returned by
6487  *a get_character_type_at_index(), for example
6488  *a action_name - the action to query
6489  **
6490  *b Returns:
6491  **
6492  ** the number of variants of the specified action of the specified
6493  ** character type
6494  */
6495  int get_character_type_action_num_variants(const char* character_type,
6496  const char* action_name);
6497 
6498  /*l
6499  *b Description:
6500  **
6501  ** This function returns the variant at the specified index.
6502  **
6503  ** Use this function along with
6504  ** get_character_type_action_num_variants()
6505  ** to enumerate the character's variants.
6506  **
6507  ** This function differs from
6508  ** get_character_type_variant_at_index() in that this function
6509  ** returns one of the variants of a single action of the
6510  ** character. The other function returns one of the variants
6511  ** of *all* actions.
6512  **
6513  *b Arguments:
6514  **
6515  *a character_type - character type name, as returned by
6516  *a get_character_type_at_index(), for example
6517  *a index - index of the posture; indices start at 0
6518  **
6519  *b Returns:
6520  **
6521  ** the variant at the specified index
6522  */
6523  diguyMotionVariant get_character_type_action_variant_at_index(const char* character_type,
6524  const char* action_name,
6525  int index);
6526 
6527  /*l
6528  *b Description:
6529  **
6530  ** This function returns the number of directions the specified
6531  ** character type's actions can move.
6532  **
6533  ** Use the get_character_type_direction_at_index() function to
6534  ** enumerate the directions available to a character.
6535  **
6536  ** The results of this function call can be useful in calls to the
6537  ** diguyCharacter::get_action_from_description() function.
6538  **
6539  *b Arguments:
6540  **
6541  *a character_type - character type name, as returned by
6542  *a get_character_type_at_index(), for example
6543  **
6544  *b Returns:
6545  **
6546  ** the number of directions the specified character type's actions
6547  ** can move
6548  */
6549  int get_character_type_num_directions(const char* character_type);
6550 
6551  /*l
6552  *b Description:
6553  **
6554  ** Use the get_character_type_num_directions() function to
6555  ** get the number of directions available to a character.
6556  **
6557  ** The results of this function call can be useful in calls to the
6558  ** diguyCharacter::get_action_from_description() function.
6559  **
6560  *b Arguments:
6561  **
6562  *a character_type - character type name, as returned by
6563  *a get_character_type_at_index(), for example
6564  *a index - index of the direction; indices start at 0
6565  **
6566  *b Returns:
6567  **
6568  ** the direction at the specified index
6569  */
6570  diguyMotionDirection get_character_type_direction_at_index(const char* character_type,
6571  int index);
6572 
6573 
6574 /*****************************************************************************/
6600  /*l
6601  *b Returns:
6602  **
6603  ** number of interaction machines in the scenario
6604  */
6605  int get_num_interaction_machines();
6606 
6607  /*l
6608  *b Description:
6609  **
6610  ** This function creates a new interaction machine and returns a
6611  ** pointer to it.
6612  **
6613  ** Note that there is a shared interaction machine that always
6614  ** exists; a pointer to it can be obtained by calling
6615  ** get_shared_interaction_machine(). See that function for more
6616  ** details.
6617  **
6618  *b Arguments:
6619  **
6620  *a name - name of the new interaction machine
6621  **
6622  *b Returns:
6623  **
6624  ** pointer of type diguyInteractionMachine; NULL if creation failed
6625  */
6626  diguyInteractionMachine* create_interaction_machine(const char* name);
6627 
6628  /*l
6629  *b Description:
6630  **
6631  ** This function destroys the passed interaction machine.
6632  **
6633  ** NOTE: This function should not be called on the shared
6634  ** interaction machine returned by get_shared_interaction_machine().
6635  **
6636  *b Arguments:
6637  **
6638  *a interaction_machine - pointer to a diguyInteractionMachine
6639  *a to be destroyed
6640  */
6641  void destroy_interaction_machine(diguyInteractionMachine* interaction_machine);
6642 
6643  /*l
6644  *b Returns:
6645  **
6646  ** pointer of type diguyInteractionMachine; NULL if no interaction
6647  ** machine at the specified index
6648  **
6649  *b Arguments:
6650  **
6651  *a index - index of the interaction machine; indices start at 0
6652  */
6653  diguyInteractionMachine* get_interaction_machine_at_index(int index);
6654 
6655  /*l
6656  *b Description:
6657  **
6658  ** This function returns a pointer to the specified interaction
6659  ** machine.
6660  **
6661  *b Arguments:
6662  **
6663  *a name - name of interaction machine to be found
6664  **
6665  *b Returns:
6666  **
6667  ** pointer of type diguyInteractionMachine; NULL if not found
6668  */
6669  diguyInteractionMachine* find_interaction_machine(const char* name);
6670 
6671  /*l
6672  *b Description:
6673  **
6674  ** This function returns a pointer to the "active" interaction
6675  ** machine. Only one interaction machine can be showing and
6676  ** accepting input at a time.
6677  **
6678  *b Returns:
6679  **
6680  ** pointer of type diguyInteractionMachine; NULL if no interaction
6681  ** machine is active.
6682  */
6683  diguyInteractionMachine* get_active_interaction_machine();
6684 
6685  /*l
6686  *b Description:
6687  **
6688  ** This function returns a pointer to the shared interaction machine
6689  ** that is always available.
6690  **
6691  ** This shared interaction machine is convenient for quick
6692  ** alerts, notifications, or questions. Because it is shared,
6693  ** however, most or all of its parameters need to be set each
6694  ** time it is to be shown.
6695  **
6696  ** Do not call destroy_interaction_machine() on the returned
6697  ** object. It is owned by the scenario.
6698  **
6699  *b Returns:
6700  **
6701  ** pointer of type diguyInteractionMachine; should never be NULL
6702  */
6703  diguyInteractionMachine* get_shared_interaction_machine();
6704 
6705  /*l
6706  *b Description:
6707  **
6708  ** This is a convenience function for using the shared interaction
6709  ** machine to show a notification to the user. It sets parameters
6710  ** of the shared interaction machine based on the passed info and
6711  ** shows/activates the machine.
6712  **
6713  *b Arguments:
6714  **
6715  *a heading - text that will be at the top of the dialog
6716  *a info - informational text
6717  *a pause_scenario - pass 1 to pause the scenario while the
6718  *a interaction machine is active, 0 to leave
6719  *a the scenario running if it was when this
6720  *a function was called
6721  *a input_text - text that user will have to click to dismiss
6722  *a the interaction machine; something like "Ok"
6723  *a is typical
6724  *a ui_appearance - the color theme of the interaction machine
6725  **
6726  ** See the diguyInteractionMachine documentation for more information
6727  ** on what the various parameters mean.
6728  **
6729  *b Returns:
6730  **
6731  ** 0 on success, -1 on failure
6732  **
6733  *b Lua Example:
6734  **
6735  *e this_scenario:show_notification_with_shared_interaction_machine(
6736  *e "WARNING!",
6737  *e "Moving any closer to the harmful gas is not advised.",
6738  *e 0,
6739  *e "Ok",
6740  *e diguyInteractionMachine_UI_APPEARANCE_NOTIFICATION);
6741  **
6742  */
6743  int show_notification_with_shared_interaction_machine(const char* heading,
6744  const char* info,
6745  int pause_scenario = 0,
6746  const char* input_text = NULL,
6748 
6749 
6750 /*****************************************************************************/
6760  /*l
6761  *b Description:
6762  **
6763  ** This function returns a pointer to the I-Guy controller object
6764  ** of the scenario.
6765  **
6766  *b Returns:
6767  **
6768  ** pointer of type diguyIGuyController; should never be NULL
6769  */
6770  diguyIGuyController* get_iguy_controller();
6771 
6772 
6773 /*****************************************************************************/
6783  /*l
6784  *b Description:
6785  **
6786  ** This function finds the diguyViewLabel with the given name or
6787  ** creates it if it doesn't exist.
6788  **
6789  *b Arguments:
6790  **
6791  *a name - name of the diguyViewLabel to find or create
6792  **
6793  *b Returns:
6794  **
6795  ** pointer of type diguyViewLabel; should never be NULL
6796  */
6797  diguyViewLabel* find_or_create_label(const char* name);
6798 
6799  /*l
6800  *b Description:
6801  **
6802  ** This function returns a pointer to the specified diguyViewLabel.
6803  **
6804  *b Arguments:
6805  **
6806  *a name - name of diguyViewLabel to be found
6807  **
6808  *b Returns:
6809  **
6810  ** pointer of type diguyViewLabel; NULL if not found
6811  */
6812  diguyViewLabel* find_label(const char* name);
6813 
6814  /*l
6815  *b Description:
6816  **
6817  ** This function destroys the passed in diguyViewLabel.
6818  **
6819  *b Arguments:
6820  **
6821  *a label - pointer to a diguyViewLabel
6822  **
6823  *b Returns:
6824  **
6825  ** 0 on success, -1 on failure
6826  */
6827  int destroy_label(diguyViewLabel* label);
6828 
6829  /*l
6830  *b Returns:
6831  **
6832  ** The number of diguyViewLabel objects in the scenario.
6833  */
6834  int get_num_labels();
6835 
6836  /*l
6837  *b Returns:
6838  **
6839  ** The diguyViewLabel at the given index.
6840  **
6841  *b Arguments:
6842  **
6843  *a index - index of the diguyViewLabel; indices start at 0
6844  */
6845  diguyViewLabel* get_label_at_index(int index);
6846 
6847  /*l
6848  *b Description:
6849  **
6850  ** This function removes all diguyViewLabels in the scenario.
6851  */
6852  void reset_labels();
6853 
6854  /*l
6855  *b Description:
6856  **
6857  ** This function moves the specified diguyViewLabel to the front of
6858  ** the drawing list. This is sometimes necessary if labels overlap.
6859  **
6860  *b Arguments:
6861  **
6862  *a label - pointer to diguyViewLabel to move
6863  */
6864  void send_label_to_front(diguyViewLabel* label);
6865 
6866  /*l
6867  *b Description:
6868  **
6869  ** This function moves the specified diguyViewLabel to the back of
6870  ** the drawing list. This is sometimes necessary if labels overlap.
6871  **
6872  *b Arguments:
6873  **
6874  *a label - pointer to diguyViewLabel to move
6875  */
6876  void send_label_to_back(diguyViewLabel* label);
6877 
6878  /*l
6879  *b Description:
6880  **
6881  ** Functions that allow the built-in OGL renderer to draw labels on screen for
6882  ** debugging use, update_character_labels must be called first.
6883  **
6884  *e scenario->update_character_labels();
6885  *e scenario->draw_character_labels();
6886  **
6887  *b Returns:
6888  **
6889  ** -1 if not possible to draw labels
6890  */
6891  int draw_character_labels();
6892 
6894  void update_character_labels();
6895 
6896 /*****************************************************************************/
6906  /*l
6907  *b Description:
6908  **
6909  ** This function finds the diguyViewButtonPanel with the given name or
6910  ** creates it if it doesn't exist.
6911  **
6912  *b Arguments:
6913  **
6914  *a name - name of the diguyViewButtonPanel to find or create
6915  **
6916  *b Returns:
6917  **
6918  ** pointer of type diguyViewButtonPanel; should never be NULL
6919  */
6920  diguyViewButtonPanel* find_or_create_panel(const char* name,
6921  int horizontal = 0,
6922  int title = 1);
6923 
6924  /*l
6925  *b Description:
6926  **
6927  ** This function returns a pointer to the specified
6928  ** diguyViewButtonPanel.
6929  **
6930  *b Arguments:
6931  **
6932  *a name - name of diguyViewButtonPanel to be found
6933  **
6934  *b Returns:
6935  **
6936  ** pointer of type diguyViewButtonPanel; NULL if not found
6937  */
6938  diguyViewButtonPanel* find_panel(const char* name);
6939 
6940  /*l
6941  *b Description:
6942  **
6943  ** This function destroys the passed in diguyViewButtonPanel.
6944  **
6945  *b Arguments:
6946  **
6947  *a panel - pointer to a diguyViewButtonPanel
6948  **
6949  *b Returns:
6950  **
6951  ** 0 on success, -1 on failure
6952  */
6953  int destroy_panel(diguyViewButtonPanel* panel);
6954 
6955  /*l
6956  *b Returns:
6957  **
6958  ** The number of diguyViewButtonPanel objects in the scenario.
6959  */
6960  int get_num_panels();
6961 
6962  /*l
6963  *b Returns:
6964  **
6965  ** The diguyViewButtonPanel at the given index.
6966  **
6967  *b Arguments:
6968  **
6969  *a index - index of the diguyViewButtonPanel; indices start at 0
6970  */
6971  diguyViewButtonPanel* get_panel_at_index(int index);
6972 
6973 
6974 /*****************************************************************************/
6987  /*l
6988  *b Description:
6989  **
6990  ** This function returns the number of AI minds that are available to
6991  ** AI agent characters.
6992  **
6993  *b Returns:
6994  **
6995  ** number of available minds
6996  */
6997  int get_num_minds();
6998 
6999  /*l
7000  *b Returns:
7001  **
7002  ** name of the AI mind at the specified index
7003  */
7004  const char* get_mind_name_at_index(int index);
7005 
7006  /*l
7007  *b Description:
7008  **
7009  ** This function tests if a diguyCharacter pointer is a valid pointer.
7010  ** This is done by comparing the passed address to those of all
7011  ** characters in the scenario. The function is not exceedingly fast
7012  ** but can be useful when building AI that functions in a networked
7013  ** environment.
7014  **
7015  *b Returns:
7016  **
7017  ** 0 if invalid, 1 if valid
7018  */
7019  int is_valid_character_pointer(diguyCharacter* character);
7020 
7021  /*l
7022  *b Description:
7023  **
7024  ** This function tests if a diguyCharacterGroup pointer is a valid
7025  ** pointer. This is done by comparing the passed address to those of
7026  ** all groups in the scenario. The function is not exceedingly fast
7027  ** but can be useful when building AI that functions in a networked
7028  ** environment.
7029  **
7030  *b Returns:
7031  **
7032  ** 0 if invalid, 1 if valid
7033  */
7034  int is_valid_character_group_pointer(diguyCharacterGroup* character_group);
7035 
7036 /*****************************************************************************/
7052  /*l
7053  *b Description:
7054  **
7055  ** This function creates a new crowd and returns a pointer to it.
7056  **
7057  ** A Lua object is also created that has a pointer to this crowd.
7058  ** This object can be retrieved by calling find_lua_crowd(crowd_name)
7059  ** or find_lua_crowd(diguyCrowd* pointer) in lua.
7060  **
7061  *b Arguments:
7062  **
7063  *a name - name of crowd to be created
7064  *a make_companion_of_all - pass 1 to make this crowd a companion
7065  *a of all existing crowds
7066  **
7067  *b Returns:
7068  **
7069  ** pointer of type diguyCrowd
7070  */
7071  diguyCrowd* create_crowd(const char* name,
7072  int make_companion_of_all = 1);
7073 
7074  /*l
7075  *b Description:
7076  **
7077  ** This function destroys a crowd. It can also optionally destroy the
7078  ** characters that are crowd members, and the path shape that is
7079  ** associated with the crowd.
7080  **
7081  *b Arguments:
7082  **
7083  *a crowd - pointer to a diguyCrowd
7084  *a also_destroy_crowd_members - pass 1 to also destroy crowd member
7085  *a characters
7086  *a also_destroy_path_shapes - pass 1 to also destroy crowd-
7087  *a associated path shapes
7088  *a delay_destruction - pass 1 to wait till the next update
7089  *a call to destroy the crowd; can avoid
7090  *a crashes when AI's receive destruction
7091  *a messages
7092  **
7093  *b Returns:
7094  **
7095  ** 0 on success, -1 on failure
7096  */
7097  int destroy_crowd(diguyCrowd* crowd,
7098  int also_destroy_crowd_members = 0,
7099  int also_destroy_path_shapes = 0,
7100  int delay_destruction = 0);
7101 
7102  /*l
7103  *b Returns:
7104  **
7105  ** the number of crowds in the scenario
7106  */
7107  int get_num_crowds();
7108 
7109  /*l
7110  *b Returns:
7111  **
7112  ** pointer of type diguyCrowd; NULL if no crowd at the specified index
7113  **
7114  *b Arguments:
7115  **
7116  *a index - index of the crowd; indices start at 0
7117  */
7118  diguyCrowd* get_crowd_at_index(int index);
7119 
7120  /*l
7121  *b Returns:
7122  **
7123  ** A unique name based on base_name, e.g. "my_crowd7" from "my_crowd".
7124  **
7125  *b Arguments:
7126  **
7127  *a base_name - base string from which to build a unique name
7128  */
7129  const char* get_unique_crowd_name(const char* base_name);
7130 
7131  /*l
7132  *b Description:
7133  **
7134  ** This function returns a pointer to the specified crowd.
7135  **
7136  *b Arguments:
7137  **
7138  *a name - name of crowd to be found
7139  **
7140  *b Returns:
7141  **
7142  ** pointer of type diguyCrowd; NULL if not found
7143  */
7144  diguyCrowd* find_crowd(const char* crowd_name);
7145 
7146  /*l
7147  *b Description:
7148  **
7149  ** This function returns a pointer to the crowd with the given
7150  ** name. A new crowd with the given name will be created if
7151  ** it doesn't already exist.
7152  **
7153  *b Arguments:
7154  **
7155  *a name - name of the crowd to find or create
7156  *a make_companion_of_all - pass 1 to make this crowd a companion
7157  *a of all existing crowds
7158  **
7159  *b Returns:
7160  **
7161  ** pointer of type diguyCrowd; should never be NULL
7162  */
7163  diguyCrowd* find_or_create_crowd(const char* crowd_name,
7164  int make_companion_of_all = 1);
7165 
7166  /*l
7167  *b Description:
7168  **
7169  ** This function sets whether crowds should be created for
7170  ** incoming network entities.
7171  **
7172  *b Arguments:
7173  **
7174  *a do_create - pass 1 to create network crowds; 0 to not
7175  */
7176  void set_create_network_crowds(int do_create);
7177 
7178  /*l
7179  *b Returns:
7180  **
7181  *a 1 if network crowds will be created; 0 if not
7182  **
7183  */
7184  int get_create_network_crowds();
7185 
7186 
7187 /*****************************************************************************/
7202  /*l
7203  *b Description:
7204  **
7205  ** This function creates a new crowd profile and returns a
7206  ** pointer to it.
7207  **
7208  *b Arguments:
7209  **
7210  *a name - name of crowd profile to be created
7211  **
7212  *b Returns:
7213  **
7214  ** pointer of type diguyCrowdProfile
7215  */
7216  diguyCrowdProfile* create_crowd_profile(const char* name);
7217 
7218  /*l
7219  *b Description:
7220  **
7221  ** This function destroys a crowd profile.
7222  **
7223  *b Arguments:
7224  **
7225  *a crowd_profile - pointer to a diguyCrowdProfile
7226  **
7227  *b Returns:
7228  **
7229  ** 0 on success, -1 on failure
7230  */
7231  int destroy_crowd_profile(diguyCrowdProfile* crowd_profile);
7232 
7233  /*l
7234  *b Returns:
7235  **
7236  ** The number of crowd profiles in the scenario.
7237  */
7238  int get_num_crowd_profiles();
7239 
7240  /*l
7241  *b Returns:
7242  **
7243  ** pointer of type diguyCrowdProfile; NULL if no crowd profile
7244  ** at the specified index
7245  **
7246  *b Arguments:
7247  **
7248  *a index - index of the crowd profile; indices start at 0
7249  */
7250  diguyCrowdProfile* get_crowd_profile_at_index(int index);
7251 
7252  /*l
7253  *b Description:
7254  **
7255  ** This function returns a pointer to the specified crowd profile.
7256  **
7257  *b Arguments:
7258  **
7259  *a name - name of crowd profile to be found
7260  **
7261  *b Returns:
7262  **
7263  ** pointer of type diguyCrowdProfile; NULL if not found
7264  */
7265  diguyCrowdProfile* find_crowd_profile(const char* name);
7266 
7267 
7268 /*****************************************************************************/
7278  /*l
7279  *b Returns:
7280  **
7281  ** pointer of type diguyLoadManager; this scenario's character
7282  ** load manager
7283  */
7284  diguyLoadManager* get_character_load_manager();
7285 
7286 
7287 /*****************************************************************************/
7297  /*l
7298  *b Description:
7299  **
7300  ** This function forces the octtree to rebuild if it's out of date.
7301  */
7302  int force_octtree_generation();
7303 
7304  /*l
7305  *b Description:
7306  **
7307  ** Documentation Pending
7308  */
7309  void add_character_to_octtree(diguyCharacter* character,
7310  int use_bounding_box_only = 0);
7311 
7312  /*l
7313  *b Description:
7314  **
7315  ** Documentation Pending
7316  */
7317  void remove_character_from_octtree(diguyCharacter* character);
7318 
7319  /*l
7320  *b Description:
7321  **
7322  ** Documentation Pending
7323  */
7324  int preload_octtree(const char* character_type, const char* appearance);
7325 
7326  /*l
7327  *b Description:
7328  **
7329  ** This function uses the octtree to check if the path between x1,
7330  ** y1, z1 and x2, y2, z2 has any static obstructions.
7331  **
7332  *b Returns:
7333  **
7334  ** 1 if the path is clear, 0 if static obstructions are present.
7335  */
7336  int check_visibility(float x1, float y1, float z1,
7337  float x2, float y2, float z2);
7338 
7339 
7340 /*****************************************************************************/
7350 #ifdef CPLUSPLUS_ONLY
7351 
7352  /*l
7353  *b Description:
7354  **
7355  ** This function sets a default altitude function that will be added
7356  ** to all characters that are subsequently created. It can be overridden
7357  ** on a per-character basis by a call to diguyCharacter::set_altitude_function().
7358  ** See that function for details.
7359  **
7360  *b Callable From:
7361  **
7362  *- - C++
7363  */
7364  int set_default_character_altitude_function(diguyAltitudeFunction* altitude_function);
7365 
7366  /*l
7367  *b Description:
7368  **
7369  ** This function sets a generic altitude function for the scenario
7370  ** that is used for local path clamping and other operations that
7371  ** require the altitude at specific x, y coordinates to be calculated.
7372  ** This is for the benefit of SDK users who have their own representation
7373  ** of terrain and structures.
7374  **
7375  ** diguyScenario::ground_clamp() can be told to use the registered
7376  ** function, but this is optional.
7377  **
7378  ** DI-Guy Scenario has a default altitude function; replacing the
7379  ** default function is not recommended.
7380  **
7381  *b Callable From:
7382  **
7383  *- - C++
7384  */
7385  void set_altitude_function(diguyScenarioAltitudeFunction* altitude_function);
7386 
7387  /*l
7388  *b Returns:
7389  **
7390  ** the altitude function for the scenario as set by
7391  ** set_altitude_function()
7392  **
7393  *b Callable From:
7394  **
7395  *- - C++
7396  */
7397  diguyScenarioAltitudeFunction* get_altitude_function();
7398 
7399 #endif
7400 
7403  void set_altitude_max_climb(float altitude_max_climb);
7404  float get_altitude_max_climb();
7405 
7408  void set_altitude_max_drop(float altitude_max_drop);
7409  float get_altitude_max_drop();
7410 
7411 
7412 /*****************************************************************************/
7422  /*l
7423  *b Description:
7424  **
7425  ** Sets the default intersection function. This function will be used to determine
7426  ** whether there is an intersection between a specified ray and the world.
7427  */
7428  static void set_default_intersection_function(diguyScenarioIntersectionFunction* intersection_function);
7429  void set_intersection_function(diguyScenarioIntersectionFunction* intersection_function);
7430 
7431  /*l
7432  *b Description:
7433  **
7434  ** Creates a detonation using the specified munition name. If the
7435  ** DI-Guy networking module is enabled the detonation is broadcast
7436  ** over the network.
7437  **
7438  *b Arguments:
7439  **
7440  *a munition_name - name of the munition to detonate; this will
7441  *a potentially trigger special effects depending
7442  *a on the munition
7443  *a x, y, z - location of the detonation
7444  *a attacker_name - this MUST be specified if the detonation is being
7445  *a broadcast over the network
7446  *a radius_override - defaults to the data in the munition config file
7447  *a broadcast_on_network - pass 0 to not broadcast detonation on DIS
7448  *a network
7449  **
7450  ** Note: Overriding the detonation radius will NOT work on broadcast
7451  ** detonations since the override value is not transmitted.
7452  */
7453  int trigger_detonation(const char* munition_name,
7454  float x, float y, float z,
7455  const char* attacker_name = NULL,
7456  float radius_override = -1.0f,
7457  int broadcast_on_network = 1);
7458 
7459  /*l
7460  *b Description:
7461  **
7462  ** This function checks for intersection against characters in the
7463  ** specified view.
7464  **
7465  ** To check for intersections against both characters and scene
7466  ** objects, call get_intersection_at_screen_coords().
7467  **
7468  ** The returned diguyImpact pointer is owned by the scenario and
7469  ** should not be deleted. It will remain valid until the next call
7470  ** to any one of the following functions:
7471  **
7472  *- - find_character_at_screen_coords()
7473  *- - get_impact_at_screen_coords()
7474  *- - get_intersection_at_screen_coords()
7475  **
7476  *i This function should only be called from a DI-Guy Scenario Plugin.
7477  **
7478  *b Arguments:
7479  **
7480  *a view - view to check
7481  *a sx, sy - view coordinates to check
7482  **
7483  *b Returns:
7484  **
7485  ** pointer of type diguyImpact; NULL if no character intersected
7486  **
7487  *b Callable From:
7488  **
7489  *- - DI-Guy Scenario Plugin
7490  */
7491  diguyImpact* find_character_at_screen_coords(diguyView* view,
7492  float sx,
7493  float sy);
7494 
7495  /*l
7496  *b Description:
7497  **
7498  ** This function creates an impact object based on the sx and sy in
7499  ** the specified view. This function will trigger an impact callback
7500  ** on individuals who are touched, (it will not however kill
7501  ** characters who don't have impact callbacks.
7502  **
7503  ** The returned diguyImpact pointer is owned by the scenario and
7504  ** should not be deleted. It will remain valid until the next call
7505  ** to any one of the following functions:
7506  **
7507  *- - find_character_at_screen_coords()
7508  *- - get_impact_at_screen_coords()
7509  *- - get_intersection_at_screen_coords()
7510  **
7511  *i This function should only be called from a DI-Guy Scenario Plugin.
7512  **
7513  *b Arguments:
7514  **
7515  *a view - view to check
7516  *a sx, sy - view coordinates to check
7517  *a use_octtree - use the octtree; will not test against all
7518  *a characters unless they are explicitly added,
7519  *a but much faster
7520  **
7521  *b Returns:
7522  **
7523  ** pointer of type diguyImpact;
7524  **
7525  *b Callable From:
7526  **
7527  *- - DI-Guy Scenario Plugin
7528  */
7529  diguyImpact* get_impact_at_screen_coords(diguyView* view,
7530  float sx,
7531  float sy,
7532  int use_octtree = 0);
7533 
7534  /*l
7535  *b Description:
7536  **
7537  ** This function checks for intersection against the world *and*
7538  ** characters in the specified view. Unlike the function
7539  ** get_impact_at_screen_coords(), this function doesn't trigger
7540  ** callbacks; instead, it just fills out the impact info.
7541  **
7542  ** The returned diguyImpact pointer is owned by the scenario and
7543  ** should not be deleted. It will remain valid until the next call to
7544  ** any one of the following functions:
7545  **
7546  *- - find_character_at_screen_coords()
7547  *- - get_impact_at_screen_coords()
7548  *- - get_intersection_at_screen_coords()
7549  **
7550  *i This function should only be called from a DI-Guy Scenario Plugin.
7551  **
7552  *b Arguments:
7553  **
7554  *a view - view to check
7555  *a sx, sy - view coordinates to check
7556  *a use_octtree - use the octtree; will not test against all
7557  *a characters unless they are explicitly added,
7558  *a but much faster
7559  **
7560  *b Returns:
7561  **
7562  ** diguyImpact with the xyz location of the intersection; NULL if
7563  ** there was nothing to intersect there
7564  **
7565  *b Callable From:
7566  **
7567  *- - DI-Guy Scenario Plugin
7568  */
7569  diguyImpact* get_intersection_at_screen_coords(diguyView* view,
7570  float sx,
7571  float sy,
7572  int use_octtree = 0);
7573 
7574  /*l
7575  *b Description:
7576  **
7577  ** This function checks for intersection against the world and returns
7578  ** basic collision results.
7579  **
7580  ** This function will only return valid results in environments where
7581  ** the DI-Guy geometry octtree is available; currently that is when
7582  ** using OpenGL and the DI-Guy flight geometry loader. DI-Guy
7583  ** Scenario is such a case.
7584  **
7585  *b Arguments:
7586  **
7587  *a origin_x, origin_y, origin_z - starting location of the ray trace
7588  *a dir_x, dir_y, dir_z - direction of ray trace (should be normalized)
7589  *a max_distance_to_test - max distance ray will travel;
7590  *a -1.0 will test an infinitely long ray
7591  *a intersection_x, _y, and _z - world location of intersection
7592  *a normal_x, normal_y, normal_z - normal of intersection surface
7593  **
7594  ** Smaller values for max_distance_to_test will result in better
7595  ** performance.
7596  **
7597  ** The location of the intersection point is returned in the
7598  ** intersection x, y, and z pointers.
7599  **
7600  ** The normal of the surface intersected is returned in the normal
7601  ** x, y, and z pointers.
7602  **
7603  *b Returns:
7604  **
7605  ** 1 if intersection occurred, 0 if not.
7606  */
7607  int intersect_static_geometry(
7608  float origin_x, float origin_y, float origin_z,
7609  float dir_x, float dir_y, float dir_z,
7610  float max_distance_to_test,
7611  float* intersection_x, float* intersection_y, float* intersection_z,
7612  float* normal_x = NULL, float* normal_y = NULL, float* normal_z = NULL,
7613  int use_callback = 1);
7614 
7615  /*l
7616  *b Description:
7617  **
7618  ** This function returns the z height, or altitude, of the uppermost
7619  ** piece of terrain under the passed x, y, z point.
7620  **
7621  ** Two methods can be used to determine the altitude: a custom scenario
7622  ** altitude function set by the user, or by testing against DI-Guy's
7623  ** internal octtree calculated from terrain geometry.
7624  **
7625  ** See set_altitude_function() for information on the scenario
7626  ** altitude function. DI-Guy Scenario has its own version of this function,
7627  ** which defaults to using the octtree when it's available, and falls back on
7628  ** using a screen render and Z-buffer check when it's not.
7629  **
7630  ** Note that the octtree is not always available. In general, it is
7631  ** available only in DI-Guy Scenario, or when the built-in OpenGL
7632  ** renderer and DI-Guy flight geometry loader are in use. Users of the SDK
7633  ** typically have their own representations of terrain and structures.
7634  **
7635  *b Arguments:
7636  **
7637  *a x, y, z - world location to ground clamp
7638  *a valid - optional pointer to get an explicit result if anything
7639  *a was hit
7640  *a use_altitude_function - pass 1 to use scenario altitude function
7641  *a (tried first)
7642  *a use_octtree - pass 1 to use internal octtree
7643  **
7644  *b Returns:
7645  **
7646  ** new_z if ground clamp was possible, original z if not
7647  */
7648  float ground_clamp(float x, float y, float z,
7649  int* valid = NULL,
7650  int use_altitude_function = 1,
7651  int use_octtree = 0);
7652 
7653 
7654 #ifdef CPLUSPLUS_ONLY
7655 
7656  /******************************************************
7657  **
7658  *4 Impact Callback Functions:
7659  **
7660  ** Unless otherwise specified, callable from:
7661  **
7662  *- - C++
7663  *- - Script
7664  */
7665 
7666  /*l
7667  *b Description:
7668  **
7669  ** The following prototype should be used for the impact
7670  ** function:
7671  **
7672  *e int impact_func(diguyImpact* impact,
7673  *e float from_x,
7674  *e float from_y,
7675  *e float from_z,
7676  *e float to_x,
7677  *e float to_y,
7678  *e float to_z,
7679  *e diguyScenario* s);
7680  **
7681  ** When a character fires their weapon, DI-Guy calls this function
7682  ** with a pointer to the diguyImpact that must be filled out, the x,
7683  ** y, z position of the shot, and the target x, y, z.
7684  **
7685  ** The impact function should then do an intersection test and return
7686  ** 1 if a hit occurred.
7687  **
7688  ** By default the impact should have both the attacker and the
7689  ** munition type already specified. The intersection function must at
7690  ** least call diguyImpact::set_valid_impact() for the system to
7691  ** consider the impact valid. See diguyImpact for a sample function.
7692  **
7693  *b Callable From:
7694  **
7695  *- - C++
7696  */
7697  int set_fire_weapon_intersection_function(diguyScenarioFindImpactOnLineFunction* impact_function);
7698 
7699  /*l
7700  *b Description:
7701  **
7702  ** This function sets an impact function that will be added to all new
7703  ** scenarios. It can be overridden by an explicit call to
7704  ** diguyScenario::set_fire_weapon_intersection_function(). See that
7705  ** function for details.
7706  **
7707  *b Callable From:
7708  **
7709  *- - C++
7710  */
7711  static void set_default_fire_weapon_intersection_function(diguyScenarioFindImpactOnLineFunction* impact_function);
7712 
7713 #endif
7714 
7715  /*l
7716  *b Description:
7717  **
7718  ** Most DI-Guy visual objects (e.g., characters, path shapes,
7719  ** waypoints) have a unique identified, or UID. In many cases these
7720  ** UID values can be coded into 24-bit color values. This can be
7721  ** useful for implementing some types of intersection detection
7722  ** functions, in which each visual object is rendered with a different
7723  ** color.
7724  **
7725  ** This function will take the passed color values and update internal
7726  ** DI-Guy state of which objects objects have been hit.
7727  **
7728  ** It will also return an impact record containing information a
7729  ** subset of that information.
7730  **
7731  ** This can include:
7732  **
7733  *- - the hit character, if one was hit
7734  *- - the hit link and shape of the character
7735  *- - the hit scene object, if one was hit
7736  **
7737  ** Note that the returned impact pointer is owned by DI-Guy and is
7738  ** temporary. The information you need from it should be immediately
7739  ** read, and the pointer should not be stored.
7740  */
7741  diguyImpact* map_color_to_impact(char r, char g, char b);
7742 
7743  /*l
7744  *b Description:
7745  **
7746  ** When the callback with id diguyScenario::CALLBACK_ID_SCENE_OBJECT_IMPACT
7747  ** is called, this function will return the impact object containing
7748  ** information about that impact.
7749  **
7750  ** There may be multiple impacts that result from some operations.
7751  ** In this case this function should be called multiple times, until
7752  ** it returns NULL. When processing of data from each successive
7753  ** impact is done, call set_last_impact_been_processed() to queue up
7754  ** the next impact object for processing.
7755  **
7756  ** The maximum number of unprocessed impacts is finite, and set by
7757  ** the function set_max_unprocessed_impacts().
7758  **
7759  ** Note that the returned impact pointers are owned by DI-Guy and are
7760  ** temporary. The information you need from them should be
7761  ** immediately read, and the pointers should not be stored.
7762  */
7763  diguyImpact* get_last_env_impact_info();
7764 
7765  /*l
7766  *b Description:
7767  **
7768  ** Reading of data from the last impact information will be considered
7769  ** complete when this function is called.
7770  */
7771  void set_last_impact_been_processed();
7772 
7773  /*l
7774  *b Description:
7775  **
7776  ** This function will add the passed impact object to the list of
7777  ** impact objects to be processed by calls to
7778  ** get_last_env_impact_info(). An internal copy of the impact object
7779  ** is made.
7780  */
7781  void set_last_env_impact_info(const diguyImpact& impact);
7782 
7783  /*l
7784  *b Description:
7785  **
7786  ** Sets the maximum number of unprocessed impacts there can be.
7787  **
7788  ** The unprocessed impact array is a first-in-first-out queue. If an
7789  ** impact occurs that pushes the number of unprocessed impacts past
7790  ** this maximum number, earlier impacts will be dropped from the
7791  ** array.
7792  **
7793  ** The initial value is 10.
7794  */
7795  void set_max_unprocessed_impacts(int max_unprocessed_impacts);
7796 
7797 
7798 #ifdef CPLUSPLUS_ONLY
7799 
7800 
7801 /*****************************************************************************/
7821  /*l
7822  *b Description:
7823  **
7824  ** This function sets a default point line of sight function that
7825  ** will be added to all new characters. It can be overridden by an
7826  ** explicit call to diguyCharacter::set_point_los_function(). See
7827  ** that function for details.
7828  **
7829  *b Callable From:
7830  **
7831  *- - C++
7832  */
7833  int set_default_point_los_function(diguyPointLOSFunction* point_los_function);
7834 
7835  /*l
7836  *b Description:
7837  **
7838  ** This function sets a default character line of sight function that
7839  ** will be added to all new characters. It can be overridden by an
7840  ** explicit call to diguyCharacter::set_character_los_function().
7841  ** See that function for details.
7842  **
7843  *b Callable From:
7844  **
7845  *- - C++
7846  */
7847  int set_default_character_los_function(diguyCharacterLOSFunction* character_los_function);
7848 
7849  /*l
7850  *b Description:
7851  **
7852  ** This function sets a default feeler function that will be added
7853  ** to all new DI-Guy AI agents. It can be overridden by an explicit
7854  ** call to diguyCharacter::agent_set_feeler_function().
7855  **
7856  ** See the "User-Defined Feelers" section in diguyCharacter.h for
7857  ** more information.
7858  **
7859  *b Arguments:
7860  **
7861  *a feeler_function - pointer to user-defined feeler function
7862  **
7863  *b Returns:
7864  **
7865  ** 0 on success, -1 on failure
7866  **
7867  *b Callable From:
7868  **
7869  *- - C++
7870  */
7871  int set_default_agent_feeler_function(diguyFeelerFunction* feeler_function);
7872 
7873 #endif
7874 
7875  /*l
7876  *b Description:
7877  **
7878  ** Experimental intersection-detection function.
7879  **
7880  *b Arguments:
7881  **
7882  *a origin_x,origin_y,origin_z - starting point
7883  *a dir_x,dir_y,dir_z - direction vector
7884  *a max_distance_to_test - distance to test to
7885  *a use_callback - 1 to use
7886  **
7887  *b Returns:
7888  **
7889  ** diguyIntersectionResult structure
7890  */
7891  diguyIntersectionResult exp_intersect_geometry(
7892  float origin_x, float origin_y, float origin_z,
7893  float dir_x, float dir_y, float dir_z,
7894  float max_distance_to_test,
7895  int use_callback = 1);
7896 
7897 /*****************************************************************************/
7907  /*l
7908  *b Description:
7909  **
7910  ** This function returns a pointer to the region with the given
7911  ** name. A new region with the given name will be created if
7912  ** it doesn't already exist.
7913  **
7914  *b Arguments:
7915  **
7916  *a name - name of the region to find or create
7917  **
7918  *b Returns:
7919  **
7920  ** pointer of type diguyRegion; should never be NULL
7921  */
7922  diguyRegion* find_or_create_region(const char* name);
7923 
7924  /*l
7925  *b Description:
7926  **
7927  ** This function returns a pointer to the specified region.
7928  **
7929  *b Arguments:
7930  **
7931  *a name - name of region to be found
7932  **
7933  *b Returns:
7934  **
7935  ** pointer of type diguyRegion; NULL if not found
7936  */
7937  diguyRegion* find_region(const char* name);
7938 
7939  /*l
7940  *b Description:
7941  **
7942  ** This function creates a new diguyRegion and returns a pointer to
7943  ** it.
7944  **
7945  *b Arguments:
7946  **
7947  *a name - name of the new region object
7948  **
7949  *b Returns:
7950  **
7951  ** pointer of type diguyRegion
7952  */
7953  diguyRegion* create_region(const char* name);
7954 
7955  /*l
7956  *b Description:
7957  **
7958  ** This function destroys the passed region.
7959  **
7960  *b Arguments:
7961  **
7962  *a region - region to destroy
7963  */
7964  void destroy_region(diguyRegion* region);
7965 
7966  /*l
7967  *b Returns:
7968  **
7969  ** number of regions in the scenario
7970  */
7971  int get_num_regions();
7972 
7973  /*l
7974  *b Returns:
7975  **
7976  ** pointer of type diguyRegion; NULL if no region at the
7977  ** specified index
7978  **
7979  *b Arguments:
7980  **
7981  *a index - index of the region; indices start at 0
7982  */
7983  diguyRegion* get_region_at_index(int index);
7984 
7985  /*l
7986  *b Description:
7987  **
7988  ** The scenario will attempt to create a navigation path on the
7989  ** via_region. An A* path planning algorithm is used to find the
7990  ** path. See also diguyCharacter::agent_move_to_point() and
7991  ** diguyCharacter::agent_move_to_point_via_subregions().
7992  **
7993  *b Arguments:
7994  **
7995  *a x1, y1, z1 - start location
7996  *a x2, y2, z2 - end location
7997  *a via_region - name of the region to run A* on
7998  *a path_shape - path shape that stores the created path
7999  *a preferred_subregions_mask - diguySubregionMask value of regions
8000  *a preferred for travel
8001  *a cost_bias_for_preferred_regions - how much cheaper it will be
8002  *a to cross spaces that are part of desired subregion;
8003  *a should be < 1.0
8004  *a cost_bias_for_neutral_regions - how much more expensive it will be
8005  *a to cross spaces that are not part of desired subregion; see
8006  *a below for more information
8007  *a repulsed_regions_mask - diguySubregionMask value of regions *not*
8008  *a preferred for travel
8009  *a cost_bias_for_repulsed_regions - how much more expensive it will be
8010  *a to cross regions that are marked as repulsive; pass
8011  *a DIGUY_DEFAULT_FLOAT to avoid completely
8012  **
8013  ** Pass DIGUY_DEFAULT_FLOAT for cost_bias_for_neutral_regions and
8014  ** cost_bias_for_repulsed_regions to specify that they should be
8015  ** avoided completely.
8016  **
8017  ** The preferred_subregions_mask and repulsed_regions_mask use
8018  ** DI-Guy subregion mask values combined together. For example,
8019  ** DIGUY_SUBREGION_MASK_SIDEWALK | DIGUY_SUBREGION_MASK_CROSSWALK.
8020  **
8021  ** For cost_bias_for_neutral_regions, specifying a non-zero value for
8022  ** this lowers the likelihood that searches fail on disjointed
8023  ** subregions. A value < 1 will cause the planner to run faster but
8024  ** explore fewer points, possibly missing preferred regions. Values
8025  ** greater then 1 will explore more points but will be slower.
8026  **
8027  *b Returns:
8028  **
8029  ** 0 on success, -1 on failure
8030  */
8031  int find_navigation_path(float x1, float y1, float z1,
8032  float x2, float y2, float z2,
8033  const char* via_region,
8034  diguyPathShape* path_shape,
8035  float cost_bias_for_preferred_regions = 0.25f,
8036  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
8037  float cost_bias_for_neutral_regions = 1.1f,
8038  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
8039  float cost_bias_for_repulsive_regions = 100.0f);
8040 
8041  /*l
8042  *b Description:
8043  **
8044  ** Sets an upper limit on how far a character is willing to travel as
8045  ** a multiple of the straight line distance between point A and point
8046  ** B before declaring that it can't get to a location.
8047  **
8048  ** Note that internally the straight line distance is forced to have a
8049  ** lower bound of 10 meters, so a character is always willing to
8050  ** travel a minimum of 10 * max_distance_planning_multiplier meters.
8051  **
8052  ** Defaults to -1, which means off.
8053  */
8054  void set_max_distance_planning_multiplier(float mul);
8055 
8056  /*l
8057  *b Returns:
8058  **
8059  ** float constant that's used to decide if planner should give up;
8060  ** -1 means off
8061  */
8062  float get_max_distance_planning_multiplier();
8063 
8064  /*l
8065  *b Description:
8066  **
8067  ** This function returns in seconds how much time has been spent path
8068  ** planning during the current frame. It can be used to avoid 100
8069  ** characters simultaneously hitting the path planner.
8070  **
8071  *b Returns:
8072  **
8073  ** time in seconds
8074  */
8075  float get_time_spent_path_planning_this_frame();
8076 
8077  /*l
8078  *b Description:
8079  **
8080  ** This function enables the path planner to run in a background
8081  ** thread. Note this only occurs if the
8082  ** diguyCharacter::agent_move_to_point_bg() or
8083  ** diguyCharacter::agent_move_to_point_via_subregions_bg() api
8084  ** functions are used.
8085  **
8086  ** By default the multi-threaded path planner is on.
8087  */
8088  void set_multithreaded_path_planning_enabled(int value);
8089  /*l
8090  *b Returns:
8091  **
8092  ** Returns 1 if the path planner is enabled to run in a background
8093  ** thread. By default the multi-threaded path planner is on.
8094  */
8095  int get_multithreaded_path_planning_enabled();
8096 
8097 
8098 /*****************************************************************************/
8108  /*l
8109  *b Returns:
8110  **
8111  ** number of formations in the scenario
8112  */
8113  int get_num_formations();
8114 
8115  /*l
8116  *b Returns:
8117  **
8118  ** pointer of type diguyFormation; NULL if no
8119  ** formation at the specified index
8120  **
8121  *b Arguments:
8122  **
8123  *a index - index of the formation; indices start at 0
8124  */
8125  diguyFormation* get_formation_at_index(int index);
8126 
8127  /*l
8128  *b Description:
8129  **
8130  ** This function returns a pointer to the specified formation.
8131  **
8132  *b Arguments:
8133  **
8134  *a name - name of formation to be found
8135  **
8136  *b Returns:
8137  **
8138  ** pointer of type diguyFormation; NULL if not found
8139  */
8140  diguyFormation* find_formation(const char* name);
8141 
8142  /*l
8143  *b Description:
8144  **
8145  ** This function returns a pointer to the first formation it finds of
8146  ** a given size.
8147  **
8148  *b Arguments:
8149  **
8150  *a size - size of formation to be found
8151  **
8152  *b Returns:
8153  **
8154  ** pointer of type diguyFormation; NULL if not found
8155  */
8156  diguyFormation* find_formation_of_size(int size);
8157 
8158  /*l
8159  *b Description:
8160  **
8161  ** This function creates a new formation and returns a
8162  ** pointer to it.
8163  **
8164  *b Arguments:
8165  **
8166  *a name - name of the new formation
8167  **
8168  *b Returns:
8169  **
8170  ** pointer of type diguyFormation
8171  */
8172  diguyFormation* create_formation(const char* name);
8173 
8174  /*l
8175  *b Description:
8176  **
8177  ** This function finds the formation with the given name or
8178  ** creates it if it doesn't exist.
8179  **
8180  *b Arguments:
8181  **
8182  *a name - name of the formation to find or create
8183  **
8184  *b Returns:
8185  **
8186  ** pointer of type diguyFormation; should never be NULL
8187  */
8188  diguyFormation* find_or_create_formation(const char* name);
8189 
8190  /*l
8191  *b Description:
8192  **
8193  ** This function destroys a formation.
8194  **
8195  *b Arguments:
8196  **
8197  *a formation - pointer to a diguyFormation
8198  **
8199  *b Returns:
8200  **
8201  ** 0 on success, -1 on failure
8202  */
8203  int destroy_formation(diguyFormation* formation);
8204 
8205 
8206 /*****************************************************************************/
8222  void set_draw_authoring_visuals(int visible);
8224  int get_draw_authoring_visuals();
8225 
8226  void set_action_bead_labels_visible(diguyVisibleFlag vflag);
8227  void set_aim_trajectories_visible(diguyVisibleFlag vflag);
8228  void set_author_selection_handles_visible(diguyVisibleFlag vflag);
8229  void set_bead_array_visible(diguyVisibleFlag vflag);
8230  void set_character_labels_visible(diguyVisibleFlag vflag);
8231  void set_character_visible(diguyVisibleFlag vflag);
8232  void set_crowd_behavior_visible(diguyVisibleFlag flag);
8233  void set_crowd_feelers_visible(diguyVisibleFlag flag);
8234  void set_crowd_influence_visible(diguyVisibleFlag flag);
8235  void set_crowd_regions_visible(diguyVisibleFlag flag);
8236  void set_light_array_visible(diguyVisibleFlag vflag);
8237  void set_lua_objects_visible(diguyVisibleFlag flag);
8238  void set_mesh_region_array_visible(diguyVisibleFlag vflag);
8239  void set_sensor_region_array_visible(diguyVisibleFlag vflag);
8240  void set_spath_visible(diguyVisibleFlag vflag);
8241  void set_waypoint_array_visible(diguyVisibleFlag vflag);
8242 
8243  diguyVisibleFlag get_action_bead_labels_visible();
8244  diguyVisibleFlag get_aim_trajectories_visible();
8245  diguyVisibleFlag get_author_selection_handles_visible();
8246  diguyVisibleFlag get_bead_array_visible();
8247  diguyVisibleFlag get_character_labels_visible();
8248  diguyVisibleFlag get_character_visible();
8249  diguyVisibleFlag get_crowd_behavior_visible();
8250  diguyVisibleFlag get_crowd_feelers_visible();
8251  diguyVisibleFlag get_crowd_influence_visible();
8252  diguyVisibleFlag get_crowd_regions_visible();
8253  diguyVisibleFlag get_light_array_visible();
8254  diguyVisibleFlag get_lua_objects_visible();
8255  diguyVisibleFlag get_mesh_region_array_visible();
8256  diguyVisibleFlag get_sensor_region_array_visible();
8257  diguyVisibleFlag get_spath_visible();
8258  diguyVisibleFlag get_waypoint_array_visible();
8259 
8260  void set_hide_author_selection_handles_during_play(int visible);
8261  int get_hide_author_selection_handles_during_play();
8262 
8263 
8264 /*****************************************************************************/
8274  /*l
8275  *b Returns:
8276  **
8277  ** If weapon fire will create light flashes, smoke and shell ejections, (depending on munition configuration)
8278  */
8279  int get_weapon_fire_effects_enabled();
8280 
8281  /*l
8282  *b Description:
8283  **
8284  ** Sets if weapon fire will create light flashes, smoke and shell ejections, (depending on munition configuration)
8285  */
8286  int set_weapon_fire_effects_enabled(int enabled);
8287 
8288  /*l
8289  *b Returns:
8290  **
8291  ** The number of light flashes that are currently active
8292  */
8293  int get_num_active_fire_effects();
8294 
8295  /*l
8296  *b Description:
8297  **
8298  ** This function gets the data needed for producing a weapon flash
8299  ** light source in the world. The convenience function diguyOglUtils::update_lighting()
8300  ** shows sample implementation for feeding this data into uniform buffers.
8301  **/
8302  int get_weapon_fire_effect_data(int index, float * radius,
8303  double * position_x, double * position_y, double * position_z,
8304  float * color_r, float * color_g, float * color_b,
8305  float * falloff_r,
8306  float * falloff_rsq);
8307 
8309  int get_num_active_lights();
8310 
8312  int sort_active_lights();
8313 
8314  /*l
8315  *b Description:
8316  **
8317  ** This function gets the data needed for producing a particle system or vehicle light.
8318  ** The convenience function diguyOglUtils::update_lighting()
8319  ** shows sample implementation for feeding this data into uniform buffers.
8320  **/
8321  int get_active_light_data(int index, diguyLightRenderDesc * light_desc);
8322 
8323 /*****************************************************************************/
8338  /*l
8339  *b Description:
8340  **
8341  ** Sets the current selected character in scenario
8342  **
8343  *b Returns:
8344  **
8345  ** 0 on success, -1 on failure
8346  **/
8347  int set_current_character(diguyCharacter* current_character);
8348 
8349  /*l
8350  *b Returns:
8351  **
8352  ** The current selected character in scenario
8353  **/
8354  diguyCharacter* get_current_character();
8355 
8357  int get_current_character_index();
8358 
8359  /*l
8360  *b Description:
8361  **
8362  ** Sets the current selected crowd in scenario
8363  **
8364  *b Returns:
8365  **
8366  ** 0 on success, -1 on failure
8367  **/
8368  int set_current_crowd(diguyCrowd* current_crowd);
8369  /*l
8370  *b Returns:
8371  **
8372  ** The current selected crowd in scenario
8373  **/
8374  diguyCrowd* get_current_crowd();
8375 
8376  /*l
8377  *b Description:
8378  **
8379  ** Sets the active crowd profile, which determines the attributes
8380  ** of subsequently-created crowds. See diguyCrowdProfile.
8381  **
8382  *b Returns:
8383  **
8384  ** 0 on success, -1 on failure
8385  **/
8386  int set_current_crowd_profile(diguyCrowdProfile* current_profile);
8387  /*l
8388  *b Description:
8389  **
8390  ** Sets the active crowd profile by name.
8391  **
8392  *b Returns:
8393  **
8394  ** 0 on success, -1 on failure
8395  **/
8396  int set_current_crowd_profile_by_name(const char* crowd_profile_name);
8397  /*l
8398  *b Returns:
8399  **
8400  ** Active crowd profile
8401  **/
8402  diguyCrowdProfile* get_current_crowd_profile();
8403 
8404  /*l
8405  *b Description:
8406  **
8407  ** Sets the current region. See diguyRegion.
8408  **
8409  *b Returns:
8410  **
8411  ** 0 on success, -1 on failure
8412  **/
8413  int set_current_region(diguyRegion* current_region);
8414  /*l
8415  *b Returns:
8416  **
8417  ** Current region.
8418  **/
8419  diguyRegion* get_current_region();
8420 
8421 
8422 /*****************************************************************************/
8427  /*l
8428  *b Description:
8429  **
8430  ** This function enables or disables the particle module.
8431  ** By default the particle module is enabled.
8432  */
8433  void set_particle_module_disabled(int disable_particle_module);
8434 
8435  /*l
8436  *b Description:
8437  **
8438  ** This function creates a particle system with type description_name
8439  ** at x, y, z. If duration is specified the system will automatically
8440  ** stop emitting after that amount of time.
8441  **
8442  *b Arguments:
8443  **
8444  *a description_name - name of particle description to create
8445  *a x, y, z - the world space position of the system
8446  *a record_transient_event - pass 1 to have this particle system
8447  *a play in history playback
8448  *a duration - how long the emitter should emit; if -1 is
8449  *a specified then the description must have a
8450  *a lifetime specified
8451  */
8452  int create_particle_system(const char* description_name,
8453  float x, float y, float z,
8454  int record_transient_event = 1,
8455  float duration = -1.0f);
8456 
8457  /*l
8458  *b Description:
8459  **
8460  ** Similar to create_particle_system(), but allows orientation to be set.
8461  **
8462  *b Arguments:
8463  **
8464  *a rz, rx, ry - orientation axes
8465  **
8466  ** (See create_particle_system() for other parameters)
8467  */
8468  int create_particle_system_with_orientation(const char* description_name,
8469  float x, float y, float z,
8470  float rz, float rx, float ry,
8471  int record_transient_event = 1,
8472  float duration = -1.0f);
8473 
8474  /*l
8475  *b Returns:
8476  **
8477  ** 1 if the particle description named description_name exists,
8478  ** else 0
8479  */
8480  int has_particle_description(const char* description_name);
8481 
8482  /*l
8483  *b Description:
8484  **
8485  ** Set wind velocity vector for particle system
8486  */
8487  void set_global_wind(float x, float y, float z);
8488 
8489 
8490 /*****************************************************************************/
8496 // These should probably be C++ only. Not sure how much they make sense for
8497 // exposure to the scripting languages, unless you want perl to call lua
8498 // via C++.
8499 
8500  /*l
8501  *b Returns:
8502  **
8503  ** string representation of lua_object.field_name
8504  **
8505  ** Note that the returned string pointer will not remain valid, so
8506  ** the returned string should be copied.
8507  **
8508  *b Arguments:
8509  **
8510  *a lua_object - a global lua object
8511  *a field_name - name of the field; field_name can include ".",
8512  *a allowing retrieval of fields in complex data
8513  *a structures
8514  **/
8515  const char* lua_get_object_field_as_string(const char* lua_object,
8516  const char* field_name);
8517 
8518  /*l
8519  **
8520  *b Description:
8521  **
8522  ** Runs a member function of a lua object.
8523  **
8524  *b Arguments:
8525  **
8526  *a lua_object - a lua object in the global scope, object names with fields should be properly handled
8527  *a ie object.subobject.blah should get properly parsed
8528  *a function_name - name of the function to call
8529  *a argument - optional string argument
8530  *a has_return_string - if set to 1 function will pop the top value of
8531  *a the lua stack and return it as a string
8532  **
8533  *b Returns:
8534  **
8535  ** NULL or string representation of
8536  ** lua_object:function_name(argument).
8537  **
8538  ** The returned string should be copied if it needs to be used later.
8539  **/
8540  const char* lua_evaluate_object_function(const char* lua_object,
8541  const char* function_name,
8542  const char* argument = NULL,
8543  int has_return_string = 0);
8544 
8545  /*l
8546  *b Description:
8547  **
8548  ** A two argument version of lua_evaluate_object_function().
8549  */
8550  const char* lua_evaluate_object_function_2a(const char* lua_object,
8551  const char* function_name,
8552  const char* argument,
8553  const char* argument2,
8554  int has_return_string = 0);
8555 
8556  /*l
8557  *b Description:
8558  **
8559  ** A three argument version of lua_evaluate_object_function().
8560  */
8561  const char* lua_evaluate_object_function_3a(const char* lua_object,
8562  const char* function_name,
8563  const char* argument,
8564  const char* argument2,
8565  const char* argument3,
8566  int has_return_string = 0);
8567 
8568  /*l
8569  *b Description:
8570  **
8571  ** A four argument version of lua_evaluate_object_function().
8572  */
8573  const char* lua_evaluate_object_function_4a(const char* lua_object,
8574  const char* function_name,
8575  const char* argument,
8576  const char* argument2,
8577  const char* argument3,
8578  const char* argument4,
8579  int has_return_string = 0);
8580 
8581 
8582  /*l
8583  *b Description:
8584  **
8585  ** Executes a lua_object:state_manager() function call. Useful for
8586  ** creating sleep-able coroutine based objects that aren't
8587  ** characters.
8588  **/
8589  int lua_send_message_to_object(const char* lua_object,
8590  const char* sender,
8591  const char* message_type,
8592  const char* message,
8593  const char* message_params = NULL);
8594 
8595 #ifdef CPLUSPLUS_ONLY
8596 
8597  /*l
8598  *b Description:
8599  **
8600  ** This function allows low level access to the lua_State pointer.
8601  ** This pointer can be used by a programmer to query and run functions
8602  ** on the Lua virtual machine. This object can also be used to
8603  ** register new C functions to lua, which allows you to instrument and
8604  ** create callbacks from script to your code. See luaL_register
8605  ** on-line.
8606  **
8607  ** For more information on how the Lua C api works see:
8608  ** http://www.lua.org/pil/24.html
8609  **
8610  *b NOTE:
8611  **
8612  ** Currently all scenarios share the same underlying Lua state object.
8613  ** This may cause issues in applications with multiple scenarios.
8614  **
8615  *b Callable From:
8616  **
8617  *- - C++
8618  */
8619  void* get_lua_state();
8620 
8621  /*l
8622  *b Description:
8623  **
8624  ** Mainly used to pass a qt pointer to lua so lqt can be used to
8625  ** modify/read from the widget. This requires the that the lqt package
8626  ** is loaded; see the lqt.lua utility package for more info.
8627  **
8628  *b Arguments:
8629  **
8630  *a lua_state - a Lua_State pointer, might be the same as get_lua_state();
8631  *a depends if the calling function is inside a coroutine
8632  *a class_name - class name should be a core class of qt with a star
8633  *a after it; i.e. "QWidget*" or "QLineEdit*"
8634  *a ptr - pointer to that is returned to the calling function in lua
8635  **
8636  *b Callable From:
8637  **
8638  *- - C++
8639  **
8640  *b C++ Example:
8641  **
8642  *e int push_graphics_view_to_lua(lua_State *L)
8643  *e {
8644  *e bdiQGraphicsView* graphics_view = get_primary_3d_window_graphics_view();
8645  *e if (m_scenario->push_qt_pointer_to_lua(L, "QGraphicsView*", graphics_view) == -1)
8646  *e {
8647  *e return 0;
8648  *e }
8649  *e return 1;
8650  *e }
8651  **
8652  ** Plug-in init code:
8653  **
8654  *e lua_State* L = (lua_State*)scenario->get_lua_state();
8655  *e if (L)
8656  *e {
8657  *e lua_register(L, "get_graphics_view", push_graphics_view_to_lua);
8658  *e }
8659  **
8660  ** In lua:
8661  **
8662  *e local graphics_view = get_graphics_view();
8663  **
8664  **/
8665  int push_qt_pointer_to_lua(void* lua_state,
8666  const char* class_name,
8667  void* ptr);
8668 
8669  /*l
8670  *b Description:
8671  **
8672  ** The most open function calling function available, if this doesn't
8673  ** manage to accomplish what you need you probably want to start
8674  ** using the lua interpreter directly.
8675  **
8676  ** The type arguments are string versions of the type being sent to
8677  ** lua, options include:
8678  *>
8679  *- - '' - empty argument
8680  *- - 'b' boolean - void* argument1 is assumed to be an int
8681  *- - 'f' field - void* argument1 assumed to be character string of
8682  *- a field of a global lua object; supports nested
8683  *- fields like foo.bar.a
8684  *- - 's' string - void* argument1 assumed to be character string
8685  *- - 'd' double - void* argument is assumed to be a double
8686  *- - diguy... - void* argument assumed to be a diguy class
8687  *- pointer ie "diguyCharacter", "diguyCrowd" (no
8688  *- star used for diguy classes)
8689  *- - Q...* - void* argument is assumed to be a pointer to a
8690  *- child of QObject; the class name should be a core
8691  *- class of qt with a star after it, e.g. "QWidget*"
8692  *- or "QLineEdit*"
8693  *<
8694  *b Arguments:
8695  **
8696  *a lua_object - a global lua object
8697  *a function_name - name of the function to call
8698  *a arg(1/2/3/4)_type - is the data type
8699  *a argument(1/2/3/4) - void* pointers to data
8700  *a has_return_string - if set to 1 function will pop the top value of
8701  *a the lua stack and return it as a string
8702  **
8703  *b Returns:
8704  **
8705  ** NULL or string representation of lua_object:function_name(argument)
8706  **
8707  ** The returned string should be copied if it needs to be used later.
8708  **
8709  *b Callable From:
8710  **
8711  *- - C++
8712  **/
8713  const char* lua_evaluate_object_function_4a_flex(const char* lua_object,
8714  const char* function_name,
8715  const char* arg1_type, void* argument1,
8716  const char* arg2_type, void* argument2,
8717  const char* arg3_type, void* argument3,
8718  const char* arg4_type, void* argument4,
8719  int has_return_string = 0);
8720 
8721  /*l
8722  *b Description:
8723  **
8724  ** Effectively the same as diguyScenario::lua_evaluate_object_function_4a_flex()
8725  ** but works on global functions.
8726  **
8727  *b Callable From:
8728  **
8729  *- - C++
8730  */
8731  const char* lua_evaluate_global_function_4a_flex(const char* function_name,
8732  const char* arg_type, void* argument,
8733  const char* arg_type2, void* argument2,
8734  const char* arg_type3, void* argument3,
8735  const char* arg_type4, void* argument4,
8736  int has_return_string = 0);
8737 
8738 #endif
8739 
8740  /*l
8741  *b Description:
8742  **
8743  ** Prints a message to lua interpreter log object. In DI-Guy
8744  ** Scenario this is sent to the AI Mind Editor and used to fill out
8745  ** the error log. The Mind editor log parses debug.traceback()
8746  ** calls.
8747  **/
8748  int lua_log_printf(int notify_level, const char* string);
8749 
8750  /*l
8751  *b Returns:
8752  **
8753  ** package meta data as a formatted string; useful for debugging,
8754  ** only valid inside DI-Guy Scenario
8755  */
8756  const char* dump_package_info(const char* package_name);
8757 
8758 /*****************************************************************************/
8764  /*l
8765  **
8766  *b Description:
8767  **
8768  ** Sends a message to specified diguyCharacter. The recipient must have a
8769  ** Lua mind that is capable of handling the message. The message will wake up
8770  ** the sleep() function in the mind that last relinquished control
8771  ** from the mind's coroutine.
8772  **
8773  *b Arguments:
8774  **
8775  *a to_character - the diguyCharacter to receive the message
8776  *a from_character - the diguyCharacter from whom the message originates
8777  *a message_type - should properly be "signal", but other settings may be used
8778  *a message - the actual name of the message, e.g. "detonation"
8779  *a message_params - comma-separated parameters, for use by the message handler
8780  **
8781  *b Returns:
8782  **
8783  ** 1 if message delivery successful, otherwise 0
8784  **
8785  *b Callable From:
8786  **
8787  *- - C++ and Lua
8788  **/
8789  int send_message(diguyCharacter *to_character,
8790  diguyCharacter *from_character,
8791  const char* message_type,
8792  const char* message,
8793  const char* message_params = NULL);
8794 
8795  /*l
8796  **
8797  *b Description:
8798  **
8799  ** Broadcasts a message to all other diguyCharacters within a certain
8800  ** radius of the from_character. The recipients must have Lua minds
8801  ** that are capable of handling the message. The message will wake up
8802  ** the sleep() function in the mind that last relinquished control
8803  ** from the mind's coroutine.
8804  **
8805  *b Arguments:
8806  **
8807  *a from_character - the diguyCharacter from whom the message originates
8808  *a radius - how far the broadcast goes (in meters) from the from_character
8809  *a message_type - should properly be "broadcast", but other settings may be used
8810  *a message - the actual name of the message, e.g. "detonation"
8811  *a message_params - comma-separated parameters, for use by the message handler
8812  **
8813  *b Returns:
8814  **
8815  ** -1 for failure, >= 0 for number of successful receptions
8816  **
8817  *b Callable From:
8818  **
8819  *- - C++ and Lua
8820  **/
8821  int broadcast_message(diguyCharacter *from_character,
8822  float radius,
8823  const char* message_type,
8824  const char* message,
8825  const char* message_params = NULL);
8826 
8827  /*l
8828  **
8829  *b Description:
8830  **
8831  ** Broadcasts a message to all diguyCharacters within named group, who
8832  ** are within given radius of the from_character. See comments for
8833  ** broadcast_message() above.
8834  **
8835  *b Arguments:
8836  **
8837  *a from_character - the diguyCharacter from whom the message originates
8838  *a group_name - name of group to broadcast to
8839  *a radius - how far the broadcast goes (in meters) from the from_character
8840  *a message_type - should properly be "broadcast", but other settings may be used
8841  *a message - the actual name of the message, e.g. "detonation"
8842  *a message_params - comma-separated parameters, for use by the message handler
8843  **
8844  *b Returns:
8845  **
8846  ** -1 for failure, >= 0 for number of successful receptions
8847  **
8848  *b Callable From:
8849  **
8850  *- - C++ and Lua
8851  **/
8852  int broadcast_message_to_group(diguyCharacter *from_character,
8853  const char * group_name,
8854  float radius,
8855  const char* message_type,
8856  const char* message,
8857  const char* message_params = NULL);
8858 
8859 /****************************************************************************/
8860 /****************************************************************************/
8861 /****************************************************************************/
8868 /****************************************************************************/
8869 /****************************************************************************/
8870 /****************************************************************************/
8871 
8872  /*l
8873  *b Returns:
8874  **
8875  ** value set by last call to set_eval_decisions_as_scripts()
8876  */
8877  int get_eval_decisions_as_scripts();
8878 
8879  /*l
8880  *b Description:
8881  **
8882  ** If called with an argument of 1, all decision beads and decision beads will
8883  ** be converted to scripts before being run.
8884  */
8885  void set_eval_decisions_as_scripts(int eval_decisions_as_scripts);
8886 
8887  /*l
8888  *b Description:
8889  **
8890  ** Gets the point of impact with the world along specified line segment
8891  **
8892  *b Returns:
8893  **
8894  ** pointer to diguyImpact object or NULL
8895  */
8896  diguyImpact* get_impact_on_line(float from_x,
8897  float from_y,
8898  float from_z,
8899  float to_x,
8900  float to_y,
8901  float to_z);
8902 
8903  /*l
8904  *b Description:
8905  **
8906  ** Increments wait cursor counter. If non-zero, then wait cursor is displayed
8907  ** in DI-GUY scenario.
8908  */
8909  void wait_cursor_push();
8910  /*l
8911  *b Description:
8912  **
8913  ** Decrements wait cursor counter.
8914  */
8915  void wait_cursor_pop();
8916 
8918  diguyParticleSystemRenderer * get_particle_renderer();
8919 
8920 #ifdef CPLUSPLUS_ONLY
8921 
8922  /*l
8923  *b Description:
8924  **
8925  ** This function sets a generic node pointer that can later be
8926  ** retrieved by the get_graphics_api_node_ptr() call. The pointer is
8927  ** otherwise not used.
8928  **
8929  *b Arguments:
8930  **
8931  *a node_ptr - generic void* pointer
8932  **
8933  *b Callable From:
8934  **
8935  *- - C++
8936  */
8937  void set_graphics_api_node_ptr(void* node_ptr);
8938 
8939  /*l
8940  *b Returns:
8941  **
8942  ** pointer set by most recent call to set_graphics_api_node_ptr
8943  **
8944  *b Callable From:
8945  **
8946  *- - C++
8947  */
8948  void* get_graphics_api_node_ptr();
8949 
8950 #endif
8951 
8952  /*l
8953  *b Description:
8954  **
8955  ** Sets whether shadow disks are drawn for characters. Call with 1 to turn on,
8956  ** 0 to turn off.
8957  */
8958  void set_draw_character_shadow_disks(int draw_character_shadow_disks);
8959 
8960  /*l
8961  *b Returns:
8962  **
8963  ** 1 if shadow disks are drawn, 0 if not
8964  */
8965  int get_draw_character_shadow_disks();
8966 
8967  /*l
8968  *b Returns:
8969  **
8970  ** size of texture map for shadows
8971  */
8972  int get_shadow_map_size();
8973 
8974  /*l
8975  *b Description:
8976  **
8977  ** Sets size of texture map for shadows. Defaults to 1024. Allowed values
8978  ** are powers of two up to 4096.
8979  */
8980  int set_shadow_map_size(int shadow_size);
8981 
8982  /*l
8983  *b Description:
8984  **
8985  ** Used for DI-Guy OSG Author Programming Example. Sets the default value
8986  ** used for characters. See also diguyCharacter::set_scene_graph_mask()
8987  */
8988  void set_default_character_scene_graph_mask(unsigned long mask);
8989  unsigned long get_default_character_scene_graph_mask();
8990 
8991  /*l
8992  *b Description:
8993  **
8994  ** Used for DI-Guy OSG Author Programming Example. Sets the default value
8995  ** used for characters. See also diguySceneObject::set_scene_graph_mask()
8996  */
8997  void set_default_scene_object_scene_graph_mask(unsigned long mask);
8998  unsigned long get_default_scene_object_scene_graph_mask();
8999 
9000  /*l
9001  *b Description:
9002  **
9003  ** For internal use.
9004  */
9005  void set_internal_int(int var, int val);
9006  void set_internal_float(int var, float val);
9007 
9008  /*l
9009  *b Description:
9010  **
9011  ** This sets the number of point lights that get handed down to
9012  ** diguyGraphicsShaderTechnique::pick_shader_program().
9013  */
9014  int set_num_active_point_lights(int active_lights);
9015 
9016  /*l
9017  *b Description:
9018  ** This gets the number of point lights that get handed down to
9019  ** diguyGraphicsShaderTechnique::pick_shader_program() the default is 0.
9020  ** The convenience function diguyOglUtils::update_lighting()
9021  ** shows sample implementation for feeding this data into uniform buffers.
9022  **/
9023  int get_num_active_point_lights();
9024 
9025 /****************************************************************************/
9026 /****************************************************************************/
9027 /****************************************************************************/
9031 /****************************************************************************/
9032 /****************************************************************************/
9033 /****************************************************************************/
9034 
9035  /*l
9036  *b Description:
9037  **
9038  ** Sets bounding box of world
9039  **
9040  *b Arguments:
9041  **
9042  *a x_min,y_min,z_min,x_max,y_max,z_max - bounds
9043  **
9044  *b Returns:
9045  **
9046  ** 0 on success, -1 on failure
9047  ** (float * arguments converted to return values in Lua)
9048  */
9049  int set_world_bounds(float x_min, float y_min, float z_min,
9050  float x_max, float y_max, float z_max);
9051 
9052  /*l
9053  *b Description:
9054  **
9055  ** Gets bounding box of world
9056  **
9057  *b Arguments:
9058  **
9059  *a x_min,y_min,z_min,x_max,y_max,z_max - output parameters
9060  **
9061  *b Returns:
9062  **
9063  ** 0 on success, -1 on failure
9064  ** (float * arguments converted to return values in Lua)
9065  */
9066  int get_world_bounds(float* x_min, float* y_min, float* z_min,
9067  float* x_max, float* y_max, float* z_max);
9068 
9069 
9070 
9071 /****************************************************************************/
9072 /****************************************************************************/
9073 /****************************************************************************/
9077 /****************************************************************************/
9078 /****************************************************************************/
9079 /****************************************************************************/
9080 
9081  /*l
9082  *b Description:
9083  **
9084  ** Internal use
9085  */
9086  void set_checkpoint_frequency(float freq);
9087  /*l
9088  *b Description:
9089  **
9090  ** Internal use
9091  */
9092  float get_checkpoint_frequency();
9093  /*l
9094  *b Description:
9095  **
9096  ** Internal use
9097  */
9098  void set_checkpointing_enabled(int enable_checkpointing);
9099  /*l
9100  *b Description:
9101  **
9102  ** Internal use
9103  */
9104  int get_checkpointing_enabled();
9105 
9106  // should be removed, only for testing
9107  //void checkpoint();
9108  //void load_checkpoint();
9109 
9110 /****************************************************************************/
9111 /****************************************************************************/
9112 /****************************************************************************/
9116 /****************************************************************************/
9117 /****************************************************************************/
9118 /****************************************************************************/
9119 
9120  /*l
9121  *b Description:
9122  **
9123  ** Sets initial render mode
9124  **
9125  *b Arguments:
9126  **
9127  *a render_mode - string containing render mode setting name
9128  **
9129  ** Built-in render modes:
9130  **
9131  *- "normal"
9132  *- "shadow"
9133  *- "glow"
9134  *- "alternate1"
9135  *- "alternate2"
9136  *- "alternate3"
9137  */
9138  void set_initial_render_mode(const char* render_mode);
9139 
9140  /*l
9141  *b Returns:
9142  **
9143  ** initial render mode, as string
9144  **
9145  */
9146  const char* get_initial_render_mode();
9147 
9148  /*l
9149  *b Description:
9150  **
9151  ** Sets current render mode. See set_initial_render_mode()
9152  **
9153  */
9154  void set_current_render_mode(const char* render_mode);
9155 
9156  /*l
9157  *b Returns:
9158  **
9159  ** render mode, as string, derived from current light settings
9160  **
9161  *b Arguments:
9162  **
9163  *a set_current_to_derived - if 1, current render mode becomes derived
9164  *- mode
9165  **
9166  */
9167  const char* derive_render_mode_from_light_settings(int set_current_to_derived = 1);
9168 
9170  const char* get_current_render_mode();
9171 
9172  /*l
9173  *b Description:
9174  **
9175  ** Sets default shader for characters
9176  **
9177  *b Arguments:
9178  **
9179  *a render_mode - string containing render mode name
9180  *a shader_name - string containing name of shader technique
9181  *- (there should be a _glsl.cfg file of the same name)
9182  *a update_existing_characters - if 1, all existing characters will now
9183  *- be drawn using this shader
9184  */
9185  void set_default_character_shader(const char* render_mode,
9186  const char* shader_name,
9187  int update_existing_characters = 1);
9188 
9190  const char* get_default_character_shader(const char* render_mode);
9191 
9192  /*l
9193  *b Description:
9194  **
9195  ** Sets default shader for scene objects
9196  **
9197  *b Arguments:
9198  **
9199  *a render_mode - string containing render mode name
9200  *a shader_name - string containing name of shader technique
9201  *- (there should be a _glsl.cfg file of the same name)
9202  *a update_existing_scene_objects - if 1, all existing scene objects will now
9203  *- be drawn using this shader
9204  */
9205  void set_default_scene_object_shader(const char* render_mode,
9206  const char* shader_name,
9207  int update_existing_scene_objects = 1);
9208 
9210  const char* get_default_scene_object_shader(const char* render_mode);
9211 
9212  /*l
9213  *b Description:
9214  **
9215  ** Sets default shader for particle systems
9216  **
9217  *b Arguments:
9218  **
9219  *a render_mode - string containing render mode name
9220  *a shader_name - string containing name of shader technique
9221  *- (there should be a _glsl.cfg file of the same name)
9222  *a update_existing_particle_systems - if 1, all existing particle systems will now
9223  *- be drawn using this shader
9224  */
9225  void set_default_particle_system_shader(const char* render_mode,
9226  const char* shader_name,
9227  int update_existing_particle_systems = 1);
9228 
9230  const char* get_default_particle_system_shader(const char* render_mode);
9231 
9232  /*l
9233  *b Description:
9234  **
9235  ** Sets FaceFX animation set for a given actor.
9236  **
9237  *b Arguments:
9238  **
9239  *a actor_name - actor's name
9240  *a file_name - fully qualified file name ending in ".animset_ingame"
9241  */
9242  int facefx_mount_animset(const char* actor_name, const char* file_name);
9243 
9244  /*l
9245  *b Description:
9246  **
9247  ** Sets vehicle smoothing on or off. If 1, vehicle will be updated
9248  ** at a higher rate than frame dt
9249  **
9250  ** Default is on.
9251  */
9252  int set_vehicle_smoothing_enabled(int enable_smoothing);
9253  int get_vehicle_smoothing_enabled();
9254 
9255  /*l
9256  *b Description:
9257  **
9258  * Documentation Pending EXPERIMENTAL IK
9259  */
9260  int set_realtime_ik_enabled(int val);
9261  int get_realtime_ik_enabled();
9262 
9263  int set_draw_ik_visuals(int val);
9264  int get_draw_ik_visuals();
9265 
9266  int set_draw_skeletons(int val);
9267  int get_draw_skeletons();
9268 
9269  float get_last_update_time()
9270  {
9271  if(m_last_update_time == -9999.0f){
9272  return 0.0f;
9273  }
9274  return m_last_update_time;
9275  }
9276 
9277  void set_disable_profiler();
9278 
9281  void calculate_character_lods();
9282 
9283 
9284  const char* get_lua_field_as_string(const char* lua_object, const char* field_name,
9285  int warn_if_no_field = 1);
9286 
9287  float get_lua_field_as_float(const char* lua_object, const char* field_name,
9288  int warn_if_no_field = 1,
9289  int* found_field = NULL);
9290 /****************************************************************************/
9291 /****************************************************************************/
9292 /****************************************************************************/
9303 /****************************************************************************/
9304 /****************************************************************************/
9305 /****************************************************************************/
9306 
9307  // Removed due to head system changes. Body Appearance now dictates what heads are available
9308  /*l
9309  ** Similar to get_character_type_num_appearances(), but for
9310  ** head appearances.
9311  */
9312  int get_character_type_num_head_appearances(const char* character_type);
9313 
9314  /*l
9315  ** Similar to get_character_type_appearance_at_index(), but for
9316  ** head appearances.
9317  */
9318  const char* get_character_type_head_appearance_at_index(const char* character_type,
9319  int index);
9320 
9321 #ifdef CPLUSPLUS_ONLY
9322 
9323  /*l
9324  *b Description:
9325  **
9326  ** Deprecated; use diguyApp::add_default_scenario_callback() instead.
9327  */
9328  static int add_default_callback(int callback_id,
9329  diguyScenarioCallback* callback,
9330  void* callback_params = 0,
9331  void* callback_user_data = 0);
9332 
9333  /*l
9334  *b Description:
9335  **
9336  ** Deprecated; use diguyApp::remove_default_scenario_callback()
9337  ** instead.
9338  */
9339  static int remove_default_callback(int callback_id,
9340  diguyScenarioCallback* callback);
9341 
9342 #endif
9343 
9344  /*l
9345  *b Description:
9346  **
9347  ** Deprecated;
9348  ** use diguyApp::remove_default_scenario_callback_with_User_data()
9349  ** instead.
9350  */
9351  static int remove_default_callback_with_user_data(int callback_id,
9352  void* callback_user_data);
9353 
9354  /*l
9355  *b Description:
9356  **
9357  ** Deprecated; use diguyApp::add_default_scenario_callback_script()
9358  ** instead.
9359  */
9360  static int add_default_callback_script(int callback_id,
9361  const char* callback_script,
9362  const char* callback_script_type);
9363 
9364  /*l
9365  *b Description:
9366  **
9367  ** Deprecated; use diguyApp::remove_default_scenario_callback_script()
9368  ** instead.
9369  */
9370  static int remove_default_callback_script(int callback_id,
9371  const char* callback_script,
9372  const char* callback_script_type);
9373 
9374  /*l
9375  *b Description:
9376  **
9377  ** Deprecated as of 10.0.0; use get_character_type_map() intead,
9378  ** and then call
9379  ** diguyCharacterTypeMap::get_field_value(DIGUY_CHARACTER_TYPE_MAP_FIELD_CHARACTER_CLASS)
9380  */
9381  const char* get_character_type_class(const char* character_type);
9382 
9383  /*l
9384  *b Description:
9385  **
9386  ** Deprecated as of 10.5.1; use merge_object() intead.
9387  */
9388  int merge_asset(const char* string);
9389 
9390  /*l
9391  *b Description:
9392  **
9393  ** Deprecated as of 12.0.0; use bdi_log_print() from libbdilog.h
9394  ** instead.
9395  */
9396  void print_to_log(int notify_level, const char* string);
9397 
9398 
9399 #ifdef CPLUSPLUS_ONLY
9400 
9401  /*
9402  *2 VegaPrime Helper Functions
9403  */
9404  diguyCharacter* create_pending_reflected_character(const char* name,
9405  const char* character_type,
9406  const char* appearance = NULL);
9407 
9408  int set_network_translation(float x, float y, float z);
9409  int get_network_translation(float* x, float* y, float* z);
9410 
9411  /*l
9412  *b Description:
9413  **
9414  ** Deprecated as of 12.0.0; use save_as() instead.
9415  */
9416  void set_project_filename(const char* project_filename);
9417 
9418  /*l
9419  *b Description:
9420  **
9421  ** Deprecated as of 12.0.0; use get_filename() or
9422  ** get_filename_without_directory() intead.
9423  */
9424  const char* get_project_filename();
9425 
9431  bdiScenario* get_scripted_object();
9432 
9433 
9434 private:
9435 
9436  /*l
9437  ** A private constructor. Use the DI-Guy function
9438  ** diguy_create_scenario() to obtain a diguyScenario object pointer.
9439  */
9440  diguyScenario(bdiScenario* scenario);
9441 
9442  /*l
9443  ** A private destructor. Use the DI-Guy function
9444  ** diguy_destroy_scenario() to delete a diguyScenario object pointer.
9445  */
9446  virtual ~diguyScenario();
9447 
9448  /*l
9449  ** A pointer to internal data.
9450  */
9451  bdiScenario* m_scenario;
9452  float m_last_update_time;
9453 
9454  friend class bdiScenario;
9455 
9456 #endif
9457 
9458 };
9459 
9460 #endif /* __diguyScenario_H */
9461 
int diguyScenarioFindImpactOnLineFunction(diguyImpact *impact, float from_x, float from_y, float from_z, float to_x, float to_y, float to_z, diguyScenario *s)
Definition: diguy_typedefs.h:141
Definition: diguyViewLabel.h:44
A two-and-a-half-dimensional surface that represents either a navigation mesh or an area that's been ...
Definition: diguyRegion.h:50
The diguyViewCameraSettings class holds camera settings data that can be loaded into a diguyViewCamer...
Definition: diguyViewCameraSettings.h:43
#define DIGUY_DEFAULT_FLOAT
This value is a magic number that, when passed to certain functions, means that the function should u...
Definition: diguy_constants.h:64
diguyCallbackReturn diguyScenarioCallback(diguyScenario *scenario, int callback_id, void *callback_params, void *callback_user_data)
Definition: diguy_typedefs.h:154
diguyCallbackReturn diguyViewFogCallback(diguyViewFog *fog, int callback_id, void *callback_params, void *callback_user_data)
Definition: diguy_typedefs.h:208
Summary:
Definition: diguyViewLightSettings.h:45
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
diguyHistoryType
DI-Guy history types.
Definition: diguy_constants.h:280
Definition: diguyPathShape.h:30
Definition: diguyViewLight.h:55
The diguyViewFogSettings class holds camera settings data that can be loaded into a diguyViewFog usin...
Definition: diguyViewFogSettings.h:43
Experimental class for diguyIntersectionResult exp_intersect_geometry.
Definition: diguyImpact.h:617
diguyMotionDirection
Definition: diguyMotionDirection.h:26
chain settings.. Rarely used
Definition: diguyChainSettings.h:32
int diguyScenarioIntersectionFunction(diguyScenario *scenario, 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:77
Definition: diguyInfoPopup.h:32
A class that represents a bullet impact in the world, often used by AIs to make reaction decisions...
Definition: diguyImpact.h:41
Definition: diguyLoadManager.h:30
The class that represents the makeup and base params of a diguyCrowd.
Definition: diguyCrowdProfile.h:37
Interface to base class of event beads, not often used.
Definition: diguyCharacterPathEvent.h:39
float diguyScenarioAltitudeFunction(diguyScenario *scenario, float x, float y, float old_z, int *valid)
Definition: diguy_typedefs.h:129
A view is a graphics window wherein the scenario and its characters are animated. Note that views hav...
Definition: diguyView.h:48
Definition: diguy_constants.h:678
As string: "unknown".
Definition: diguyCharacterTypeMap.h:38
diguyScenarioMergeInitialSettings
This enumeration tells DI-Guy what values to use as defaults when the diguyScenario::create_merge_set...
Definition: diguy_constants.h:676
diguyCallbackReturn diguySensorRegionCallback(diguySensorRegion *sensor_region, int callback_id, void *callback_params, void *callback_user_data)
Definition: diguy_typedefs.h:178
The character type map provides extra information about DI-Guy character types and appearances...
Definition: diguyCharacterTypeMap.h:290
float diguyAltitudeFunction(diguyCharacter *character, float x, float y, float old_z, int *valid)
Definition: diguy_typedefs.h:54
This class is a simple structure for transmitting diguy lights down to the uniform buffer system this...
Definition: diguyViewLight.h:36
int diguyCharacterLOSFunction(diguyCharacter *character, diguyCharacter *target_character, int visibility_type)
Definition: diguy_typedefs.h:103
diguyCallbackReturn diguyViewLightCallback(diguyViewLight *light, int callback_id, void *callback_params, void *callback_user_data)
Definition: diguy_typedefs.h:172
Represents the scenario currently being portrayed.
Definition: diguyScenario.h:92
A group of DI-Guy characters, useful for organizing your scenarios.
Definition: diguyCharacterGroup.h:38
The class that represents a DI-Guy Entity in the world.
Definition: diguyCharacter.h:81
A class that represents the layout of a group of characters.
Definition: diguyFormation.h:41
Definition: diguyWaypoint.h:29
Definition: diguySensorRegion.h:38
int diguyPointLOSFunction(diguyCharacter *character, float x, float y, float z)
Definition: diguy_typedefs.h:108
diguyCallbackReturn diguyViewCallback(diguyView *view, int callback_id, void *callback_params, void *callback_user_data)
Definition: diguy_typedefs.h:202
This class is represents a sound file on disk.
Definition: diguySound.h:39
An interface class that allows diguy to trigger an immediate mode rendering of a diguy particle syste...
Definition: diguyParticleSystem.h:147
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
The class that represents a camera in the world.
Definition: diguyViewCamera.h:260
static double t
4 Header files and forward declarations
Definition: simple_playback_ogl.cpp:55
Definition: diguySignal.h:36
Definition: diguy_constants.h:1507
diguyCallbackReturn diguySignalCallback(diguySignal *signal, int callback_id, void *callback_params, void *callback_user_data)
Definition: diguy_typedefs.h:184
Definition: diguyViewButtonPanel.h:35
Definition: diguyViewFog.h:35
diguyCallbackReturn
DI-Guy callbacks return a value of type diguyCallbackReturn, which will be DIGUY_CALLBACK_STOP or DIG...
Definition: diguy_constants.h:96
diguyMotionVariant
Definition: diguyMotionVariant.h:26
A scene object is a static (that is, non-moving) object in the scenario. Scene objects are the basic ...
Definition: diguySceneObject.h:43
diguyVisibleFlag
This enumeration lists the visibility options for various objects in the DI-Guy Scenario environment...
Definition: diguy_constants.h:512
Definition: diguyInteractionMachine.h:323
Definition: diguyVariable.h:38
A class that gives access to IGuy's parameters.
Definition: diguyIGuyController.h:33
diguyCharacterAppearanceTypes
DI-Guy character appearance query API, this is for diguyCharacter::get_num_appearances_of_type() ...
Definition: diguy_constants.h:132
diguyScenarioPlaybackMode
This enumeration identifies which playback mode time should follow.
Definition: diguy_constants.h:489
A class representing a facial pose.
Definition: diguyCharacterFaceExpression.h:33
Definition: diguyScenarioMergeSettings.h:37
diguyInteractionMachine objects give DI-Guy Scenario users a way of providing interactive, UI-driven input to a scenario that can change the way a scenario progresses.
Definition: diguyInteractionMachine.h:81
The class that represents a DI-Guy Crowd, DI-Guy AI agents can be given orders at an individual level...
Definition: diguyCrowd.h:47
diguyMotionPosture
Definition: diguyMotionPosture.h:26
diguyDatetimeAdvanceMethod
This enumeration lists the methods in which the datetime of a scenario can advance.
Definition: diguy_constants.h:1601
diguyCallbackReturn diguyVariableCallback(diguyVariable *variable, int callback_id, void *callback_params, void *callback_user_data)
Definition: diguy_typedefs.h:190
static diguyScenario * scenario
Definition: simple_playback_ogl.cpp:56
diguyCallbackReturn diguyViewCameraCallback(diguyViewCamera *camera, int callback_id, void *callback_params, void *callback_user_data)
Definition: diguy_typedefs.h:196