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