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