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