DI-Guy SDK Documentation  13.8
diguyScenario.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2025 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 #include <diguyViewCamera.h>
22 #include <diguyViewFog.h>
23 #include <diguyViewLight.h>
24 #include <diguyMotionDirection.h>
25 #include <diguyMotionPosture.h>
26 #include <diguyMotionVariant.h>
27 #include <diguyCharacterTypeMap.h>
28 #include <diguy_vector_classes.h>
29 
30 // for texture atlas enum
31 #include <diguyGraphicsTexture.h>
32 
33 #include "diguy_constants.h"
34 #include "diguy_typedefs.h"
35 #include "diguyCharacterPath.h"
37 #include "diguySensorRegion.h"
38 #include "diguySignal.h"
39 #include "diguyVariable.h"
40 #include "diguyView.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(0)
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  ** abbreviation of the given character type, when a shorter
2063  ** identifier is needed
2064  **
2065  *b Arguments:
2066  **
2067  *a character_type - character type name, as returned by
2068  *a get_character_type_at_index(), for example
2069  */
2070  const char* get_character_type_abbreviation(const char* character_type);
2071 
2072  /*l
2073  *b Description:
2074  **
2075  ** This function returns the version at which the specified
2076  ** character type was deprecated.
2077  **
2078  ** If the character type has not been deprecated, the empty string
2079  ** ("") is returned.
2080  **
2081  *b Arguments:
2082  **
2083  *a character_type - character type name, as returned by
2084  *a get_character_type_at_index(), for example
2085  **
2086  *b Returns:
2087  **
2088  ** version at which character became deprecated; empty string ("")
2089  ** if it hasn't been
2090  **
2091  *b C++ Example:
2092  **
2093  *e const char* version = scenario->get_character_type_deprecated_at_version();
2094  *e if (strlen(version) > 0)
2095  *e {
2096  *e // do something
2097  *e }
2098  */
2099  const char* get_character_type_deprecated_at_version(const char* character_type);
2100 
2101  /*l
2102  *b Description:
2103  **
2104  ** This function returns the suggested character type(s) that are
2105  ** recommended for deprecated character types.
2106  **
2107  ** If the character type has not been deprecated, the empty string
2108  ** ("") is returned.
2109  **
2110  ** If there is more than one suggested alternative, they will be
2111  ** separated by spaces.
2112  **
2113  *b Arguments:
2114  **
2115  *a character_type - character type name, as returned by
2116  *a get_character_type_at_index(), for example
2117  **
2118  *b Returns:
2119  **
2120  ** suggested replacement character type(s)
2121  **
2122  *b C++ Example:
2123  **
2124  *e const char* alternatives = scenario->get_character_type_deprecated_suggested_alternatives();
2125  *e if (strlen(version) > 0)
2126  *e {
2127  *e // do something
2128  *e }
2129  */
2130  const char* get_character_type_deprecated_suggested_alternatives(const char* character_type);
2131 
2132  /*l
2133  *b Description:
2134  **
2135  ** As the number of character types DI-Guy provides has grown,
2136  ** newer character types tend to be better than older ones.
2137  ** This can be because of a greater selection of actions, better
2138  ** quality motions, and other factors.
2139  **
2140  ** This function returns a value representing a qualitative "bias"
2141  ** of this character they relative to other character types.
2142  ** The higher the bias, the more recommended the character type is.
2143  ** A bias of 1 means strongly not recommended, 5 means average,
2144  ** 10 means highly recommended.
2145  **
2146  *b Returns:
2147  **
2148  ** quality bias, a unitless value from 1 to 10
2149  **
2150  *b Arguments:
2151  **
2152  *a character_type - character type name, as returned by
2153  *a get_character_type_at_index(), for example
2154  */
2155  int get_character_type_quality_bias(const char* character_type);
2156 
2157  /*l
2158  *b Description:
2159  **
2160  ** This function returns the type map of the specified character
2161  ** type. See the documentation for diguyCharacterTypeMap for what
2162  ** this information means.
2163  **
2164  ** Only the character type fields will have useful information; the
2165  ** appearance fields will contain default wildcard values.
2166  **
2167  *b Arguments:
2168  **
2169  *a character_type - character type name, as returned by
2170  *a get_character_type_at_index(), for example
2171  **
2172  *b Returns:
2173  **
2174  ** pointer to type diguyCharacterTypeMap; will never be NULL
2175  */
2176  diguyCharacterTypeMap* get_character_type_map(const char* character_type);
2177 
2178  /*l
2179  *b Returns:
2180  **
2181  ** default appearance of the specified character type
2182  **
2183  *b Arguments:
2184  **
2185  *a character_type - character type name, as returned by
2186  *a get_character_type_at_index(), for example
2187  */
2188  const char* get_character_type_default_appearance(const char* character_type);
2189 
2190  /*l
2191  *b Returns:
2192  **
2193  ** default skinned appearance of the specified character type
2194  **
2195  *b Arguments:
2196  **
2197  *a character_type - character type name, as returned by
2198  *a get_character_type_at_index(), for example
2199  */
2200  const char* get_character_type_default_skinned_appearance(const char* character_type);
2201 
2202  /*l
2203  *b Returns:
2204  **
2205  ** number of available appearances for the given character type
2206  **
2207  *b Arguments:
2208  **
2209  *a character_type - character type name, as returned by
2210  *a get_character_type_at_index(), for example
2211  */
2212  int get_character_type_num_appearances(const char* character_type);
2213 
2214  /*l
2215  *b Returns:
2216  **
2217  ** the string identifying the appearance at the given index for
2218  ** the specified character type
2219  **
2220  *b Arguments:
2221  **
2222  *a character_type - character type name, as returned by
2223  *a get_character_type_at_index(), for example
2224  *a index - index of the appearance; indices start at 0
2225  */
2226  const char* get_character_type_appearance_at_index(const char* character_type,
2227  int index);
2228 
2229  /*l
2230  *b Description:
2231  **
2232  ** As the number of appearances DI-Guy provides has grown,
2233  ** newer appearances tend to be better than older ones.
2234  **
2235  ** This function returns a value representing a qualitative "bias"
2236  ** of this character they relative to other character types.
2237  ** The higher the bias, the more recommended the character type is.
2238  ** A bias of 1 means strongly not recommended, 5 means average,
2239  ** 10 means highly recommended.
2240  **
2241  *b Returns:
2242  **
2243  ** quality bias, a unitless value from 1 to 10
2244  **
2245  *b Arguments:
2246  **
2247  *a appearance - appearance name
2248  */
2249  int get_appearance_quality_bias(const char* appearance);
2250 
2251  /*l
2252  *b Arguments:
2253  **
2254  *a character_type - a string indicating the character type
2255  *a base_appearance - a string indicating the basic character appearance
2256  *a appearance_type - a value indicating the type of supplementary appearance of concern,
2257  ** ie DIGUY_APPEARANCE_BODY, DIGUY_APPEARANCE_HEAD, DIGUY_APPEARANCE_EXPRESSIVE_HEAD,
2258  ** DIGUY_APPEARANCE_HAND_ITEM
2259  *b Returns:
2260  **
2261  ** The number of available supplementary appearances of given type
2262  */
2263  int get_num_appearances_of_appearance_type( const char* character_type, const char* base_appearance,
2264  diguyCharacterAppearanceTypes appearance_type );
2265 
2266  /*l
2267  *b Returns:
2268  **
2269  ** The name of the supplementary appearance (body, head, expressive head, hand item) or NULL
2270  **
2271  *b Arguments:
2272  **
2273  *a character_type - a string indicating the character type
2274  *a base_appearance - a string indicating the basic character appearance
2275  *a appearance_type - a value indicating the type of appearance of concern
2276  *a index - a value indicating the type of supplementary appearance of concern
2277  **
2278  */
2279  const char* get_appearance_name_at_index( const char* character_type, const char* base_appearance,
2280  diguyCharacterAppearanceTypes appearance_type, int index );
2281 
2283  int get_num_patches_for_appearance( const char* base_appearance, diguyTextureUniformPatchLocations patch_location );
2284 
2286  int get_appearance_default_patch_index( const char* base_appearance,
2287  diguyTextureUniformPatchLocations patch_location ) const;
2288 
2290  const diguyPatchIdentifier& get_appearance_default_patch_id( const char* base_appearance,
2291  diguyTextureUniformPatchLocations patch_location ) const;
2292 
2294  const char* get_appearance_patch_name_at_index( const char* base_appearance,
2295  diguyTextureUniformPatchLocations patch_location, int index ) const;
2296 
2299  const diguyPatchIdentifier& get_appearance_patch_id_at_index( const char* base_appearance,
2300  diguyTextureUniformPatchLocations patch_type, int index ) const;
2301 
2303  int get_num_actors();
2305  const char* get_actor_name_at_index( int index );
2306 
2308  const char* get_actor_name( const char* base_appearance );
2309 
2311  int get_num_equipment_for_actor( const char* actor_name );
2312 
2314  const char* get_equipment_name_for_actor( const char* actor_name, int index );
2315 
2317  const char* get_equipment_type_for_actor( const char* actor_name, int index );
2318 
2320  int get_num_equipment_for_appearance( const char* base_appearance );
2321 
2323  const char* get_equipment_name_for_appearance( const char* base_appearance, int index );
2324 
2326  const char* get_equipment_type_for_appearance( const char* base_appearance, int index );
2327 
2328  /*l
2329  *b Returns:
2330  **
2331  ** number of available actions for the given character type
2332  **
2333  *b Arguments:
2334  **
2335  *a character_type - character type name, as returned by get_character_type_at_index(), for example
2336  */
2337  int get_character_type_num_actions( const char* character_type );
2338 
2339  /*l
2340  *b Returns:
2341  **
2342  ** the string identifying the action at the given index for the specified character type
2343  **
2344  *b Arguments:
2345  **
2346  *a character_type - character type name, as returned by get_character_type_at_index(), for example
2347  *a index - index of the action name; indices start at 0
2348  */
2349  const char* get_character_type_action_at_index( const char* character_type, int index );
2350 
2351  /*l
2352  *b Returns:
2353  **
2354  ** the display name for the specified action for the specified character type
2355  **
2356  *b Arguments:
2357  **
2358  *a character_type - character type name, as returned by get_character_type_at_index(), for example
2359  *a action_name - the action to query
2360  */
2361  const char* get_character_type_action_display_name( const char* character_type, const char* action_name );
2362 
2363  /*l
2364  *b Returns:
2365  **
2366  ** the average speed of the specified action for the specified character type
2367  **
2368  *b Arguments:
2369  **
2370  *a character_type - character type name, as returned by get_character_type_at_index(), for example
2371  *a action_name - the action to query
2372  */
2373  float get_character_type_action_speed( const char* character_type, const char* action_name );
2374 
2375  /*l
2376  *b Returns:
2377  **
2378  ** the duration of one rep of the specified action for the specified character type
2379  **
2380  *b Arguments:
2381  **
2382  *a character_type - character type name, as returned by get_character_type_at_index(), for example
2383  *a action_name - the action to query
2384  */
2385  float get_character_type_action_duration( const char* character_type, const char* action_name );
2386 
2387  /*l
2388  *b Returns:
2389  **
2390  ** the distance covered by one rep of the specified action for the specified character type
2391  **
2392  *b Arguments:
2393  **
2394  *a character_type - character type name, as returned by get_character_type_at_index(), for example
2395  *a action_name - the action to query
2396  */
2397  float get_character_type_action_distance( const char* character_type, const char* action_name );
2398 
2399  /*l
2400  *b Returns:
2401  **
2402  ** the displacement covered by one rep of the specified action for the specified character type
2403  **
2404  *b Arguments:
2405  **
2406  *a character_type - character type name, as returned by get_character_type_at_index(), for example
2407  *a action_name - the action to query
2408  */
2409  int get_character_type_action_displacement( const char* character_type, const char* action_name,
2410  float* x, float* y, float* z );
2411 
2412  /*l
2413  *b Description:
2414  **
2415  ** Looks up the transition used between the given two actions, and returns information about the transition.
2416  **
2417  *b Arguments:
2418  **
2419  *a character_type - character type name, as returned by get_character_type_at_index(), for example
2420  *a from_action_name - the starting action to get transition info for
2421  *a to_action_name - the ending action to get transition info for.
2422  **
2423  *b Returns:
2424  **
2425  ** true on success, false on failure
2426  **
2427  */
2428  bool get_character_type_transition_info( const char* character_type, const char* from_action_name,
2429  const char* to_action_name, diguyTransitionInfo& info );
2430 
2431  /*l
2432  *b Returns:
2433  **
2434  ** the diguyMotionDirection identifying the direction of travel of the specified action for the specified character type
2435  **
2436  *b Arguments:
2437  **
2438  *a character_type - character type name, as returned by get_character_type_at_index(), for example
2439  *a action_name - the action to query
2440  */
2441  diguyMotionDirection get_character_type_action_direction( const char* character_type, const char* action_name );
2442 
2443  /*l
2444  *b Returns:
2445  **
2446  ** the facing angle at the start of each repetition of the specified action for the specified character type, in degrees
2447  **
2448  *b Arguments:
2449  **
2450  *a character_type - character type name, as returned by get_character_type_at_index(), for example
2451  *a action_name - the action to query
2452  */
2453  float get_character_type_action_facing_angle_in( const char* character_type, const char* action_name );
2454 
2455  /*l
2456  *b Returns:
2457  **
2458  ** the facing angle at the end of each repetition of the specified action for the specified character type, in degrees
2459  **
2460  *b Arguments:
2461  **
2462  *a character_type - character type name, as returned by get_character_type_at_index(), for example
2463  *a action_name - the action to query
2464  */
2465  float get_character_type_action_facing_angle_out( const char* character_type, const char* action_name );
2466 
2467  /*l
2468  *b Returns:
2469  **
2470  ** the number of gestures available to the specified character type
2471  **
2472  *b Arguments:
2473  **
2474  *a character_type - character type name, as returned by get_character_type_at_index(), for example;
2475  *a pass "all" to get all gestures available, regardless of character type
2476  */
2477  int get_character_type_num_gestures( const char* character_type );
2478 
2479  /*l
2480  *b Returns:
2481  **
2482  ** the name of the gesture available to the specified character type at the specified index
2483  **
2484  *b Arguments:
2485  **
2486  *a character_type - character type name, as returned by get_character_type_at_index(), for example;
2487  *a pass "all" to get all gestures available, regardless of character type
2488  *a index - index of the gesture; indices start at 0
2489  */
2490  const char* get_character_type_gesture_at_index( const char* character_type, int index );
2491 
2492  /*l
2493  *b Returns:
2494  **
2495  ** the metadata of the gesture available to the specified
2496  ** character type at the specified index see get_character_type_gesture_at_index() for args
2497  */
2498  diguyGestureMetadata* get_character_type_gesture_meta_data_at_index( const char* character_type, int index );
2499 
2500 
2501 /*****************************************************************************/
2511  /*l
2512  *b Description:
2513  **
2514  ** This function creates a new character and returns a
2515  ** pointer to it.
2516  **
2517  ** The function preload_character_type() should be called
2518  ** at the beginning of a scenario in which this call will
2519  ** be made to avoid a hitch in frame rate.
2520  **
2521  ** See also retrieve_character_from_recycle_bin() for a
2522  ** potentially faster way of creating a character.
2523  **
2524  *b Arguments:
2525  **
2526  *a name - name of the new character
2527  *a character_type - character's type
2528  *a appearance - base appearance of character; pass
2529  *a NULL to use default appearance
2530  *a hand_item - hand item appearance; pass
2531  *a NULL to use default appearance
2532  **
2533  *b Returns:
2534  **
2535  ** pointer of type diguyCharacter; NULL if creation failed
2536  */
2537  diguyCharacter* create_character(const char* name,
2538  const char* character_type,
2539  const char* appearance = NULL,
2540  const char* head_appearance = NULL,
2541  const char* hand_item = NULL);
2542 
2543  /*l
2544  *b Description:
2545  **
2546  ** This function is very similar to create_character(), but the
2547  ** character created is temporary.
2548  **
2549  ** Temporary characters will be destroyed automatically when the
2550  ** scenario is reset, and are not saved in .dss files. They are
2551  ** commonly used for projectiles, effects, and other objects that can
2552  ** come and go multiple times.
2553  **
2554  ** Temporary characters can be destroyed before scenario reset by
2555  ** calling destroy_character(), and can be sent to the character
2556  ** recycle bin by calling send_character_to_recycle_bin().
2557  **
2558  *b Arguments:
2559  **
2560  *a name - name of the new character
2561  *a character_type - character's type
2562  *a appearance - base appearance of character; pass
2563  *a NULL to use default appearance
2564  **
2565  *b Returns:
2566  **
2567  ** pointer of type diguyCharacter; NULL if creation failed
2568  */
2569  diguyCharacter* create_temporary_character(const char* name,
2570  const char* character_type,
2571  const char* appearance = NULL);
2572 
2573  /*l
2574  *b Description:
2575  **
2576  ** This function destroys a character.
2577  **
2578  ** If a character of the same character type and appearance may be
2579  ** needed later in the scenario, consider using
2580  ** send_character_to_recycle_bin() instead. Characters can be
2581  ** retrieved from the recycle bin more quickly than creating them
2582  ** "from scratch" with create_character().
2583  **
2584  *b Arguments:
2585  **
2586  *a character - pointer to a diguyCharacter
2587  **
2588  *b Returns:
2589  **
2590  ** 0 on success, -1 on failure
2591  **
2592  *b DI-Guy Networking Notes:
2593  **
2594  ** This function should not be called on characters that are reflected
2595  ** network characters. Such characters are destroyed automatically by
2596  ** DI-Guy Networking.
2597  */
2598  int destroy_character(diguyCharacter* character);
2599 
2600  int destroy_character_later(diguyCharacter*)
2601 ;
2602  /*l
2603  *b Description
2604  **
2605  ** This function is an alternative way of removing a character from
2606  ** the scenario. When a character is recycled it is removed from the
2607  ** scenario's list of active characters, but the memory associated
2608  ** with it is not freed. Instead, the character is placed in a
2609  ** "character recycle bin" from which it may be later retrieved with a
2610  ** call to retrieve_character_from_recycle_bin().
2611  **
2612  ** For an application that is creating and destroying a lot of
2613  ** characters with the same character types and appearances, this can
2614  ** avoid performance hiccups that happen when memory is allocated for
2615  ** new characters.
2616  **
2617  ** If it is known ahead of time what types and appearances of
2618  ** characters will be needed in the future, the recycle bin can be
2619  ** "pre-stocked" at scenario load time by first creating and then
2620  ** recycling a large number of characters all at once.
2621  **
2622  *b Returns:
2623  **
2624  ** 0 on success, -1 on failure
2625  */
2626  int send_character_to_recycle_bin(diguyCharacter* character);
2627 
2628  /*l
2629  *b Description
2630  **
2631  ** This function is an alternative way of creating a character. The
2632  ** character recycle bin is checked for a recycled character whose
2633  ** character type and appearance match that requested by this call.
2634  ** Characters are sent to the recycle bin by a call to
2635  ** send_character_to_recycle_bin().
2636  **
2637  ** If a match is found the recycled character will be removed from
2638  ** the recycle bin, given the passed name, and placed in the
2639  ** scenario's list of characters, for the most part just as if the
2640  ** character had been created by a call to create_character(). Some
2641  ** things such as position, current action, etc., may need to be
2642  ** immediately set.
2643  **
2644  ** If a match is not found, this function returns NULL and a call to
2645  ** create_character() must be made instead.
2646  **
2647  *b Arguments:
2648  **
2649  *a name - new name for the character retrieved from bin
2650  *a character_type - the character type to retrieve from the bin
2651  *a appearance - the appearance to retrieve from the bin, pass NULL
2652  *a or "default" to retrieve the default appearance
2653  *a make_character_temporary - pass 1 to make character temporary,
2654  *a 0 to leave permanent
2655  **
2656  *b Returns:
2657  **
2658  ** 0 on success, -1 on failure
2659  */
2660  diguyCharacter* retrieve_character_from_recycle_bin(const char* name,
2661  const char* character_type,
2662  const char* appearance,
2663  int make_character_temporary = 0);
2664 
2665  /*l
2666  *b Returns:
2667  **
2668  ** number of characters in the scenario
2669  */
2670  int get_num_characters();
2671 
2672  /*l
2673  *b Returns:
2674  **
2675  ** pointer of type diguyCharacter; NULL if no character at the
2676  ** specified index
2677  **
2678  *b Arguments:
2679  **
2680  *a index - index of the character; indices start at 0
2681  */
2682  diguyCharacter* get_character_at_index(int index);
2683 
2684  /*l
2685  *b Description:
2686  **
2687  ** This function returns a pointer to the specified character.
2688  **
2689  *b Arguments:
2690  **
2691  *a name - name of character to be found
2692  **
2693  *b Returns:
2694  **
2695  ** pointer of type diguyCharacter; NULL if not found
2696  */
2697  diguyCharacter* find_character(const char* name);
2698 
2699  /*l
2700  *b Description:
2701  **
2702  ** This function changes the scenario camera's position
2703  ** and fix point so it will be looking at the specified
2704  ** character.
2705  */
2706  void look_at_character(diguyCharacter* character);
2707 
2708  /*l
2709  *b Description:
2710  **
2711  ** This function returns a pointer to the target character
2712  ** of an event bead.
2713  **
2714  *b Returns:
2715  **
2716  ** pointer of type diguyCharacter; NULL if no current character
2717  */
2718  diguyCharacter* this_character();
2719 
2720  /*l
2721  *b Description:
2722  **
2723  ** This function returns a pointer to the current event bead.
2724  **
2725  *b Returns:
2726  **
2727  ** pointer of type diguyCharacterPathEvent; NULL if no current event
2728  ** bead
2729  */
2730  diguyCharacterPathEvent* this_event_bead();
2731 
2732 
2733 /*****************************************************************************/
2743  /*l
2744  *b Returns:
2745  **
2746  ** number of path shapes in the scenario
2747  */
2748  int get_num_path_shapes();
2749 
2750  /*l
2751  *b Returns:
2752  **
2753  ** pointer of type diguyPathShape; NULL if no
2754  ** path shape at the specified index
2755  **
2756  *b Arguments:
2757  **
2758  *a index - index of the path shape; indices start at 0
2759  */
2760  diguyPathShape* get_path_shape_at_index(int index);
2761 
2762  /*l
2763  *b Returns:
2764  **
2765  ** pointer of type diguyPathShape; NULL if no
2766  ** path shape at the specified index
2767  */
2768  diguyPathShape* get_current_path_shape();
2769 
2770  /*l
2771  *b Description:
2772  **
2773  ** This function returns a pointer to the specified path shape.
2774  **
2775  *b Arguments:
2776  **
2777  *a name - name of path shape to be found
2778  **
2779  *b Returns:
2780  **
2781  ** pointer of type diguyPathShape; NULL if not found
2782  */
2783  diguyPathShape* find_path_shape(const char* name);
2784 
2785  /*l
2786  *b Description:
2787  **
2788  ** This function creates a new path shape and returns a
2789  ** pointer to it.
2790  **
2791  *b Arguments:
2792  **
2793  *a name - name of the new path shape
2794  **
2795  *b Returns:
2796  **
2797  ** pointer of type diguyPathShape; NULL if creation failed
2798  */
2799  diguyPathShape* create_path_shape(const char* name);
2800 
2801  /*l
2802  *b Description:
2803  **
2804  ** This function creates a new path shape based on an
2805  ** existing path shape and returns a pointer to it.
2806  **
2807  *b Arguments:
2808  **
2809  *a existing_path_shape - pointer to diguyPathShape to be copied
2810  *a name - name of the new path shape
2811  **
2812  *b Returns:
2813  **
2814  ** pointer of type diguyPathShape; NULL if creation failed
2815  */
2816  diguyPathShape* copy_path_shape(diguyPathShape* existing_path_shape,
2817  const char* name);
2818 
2819  /*l
2820  *b Description:
2821  **
2822  ** This function destroys a path shape.
2823  **
2824  *b Arguments:
2825  **
2826  *a path_shape - pointer to a diguyPathShape
2827  **
2828  *b Returns:
2829  **
2830  ** 0 on success, -1 on failure
2831  */
2832  int destroy_path_shape(diguyPathShape* path_shape);
2833 
2834 
2835 /*****************************************************************************/
2840  /*l
2841  *b Description:
2842  **
2843  ** This function creates a new waypoint that can be used for creating
2844  ** new paths and path shapes.
2845  **
2846  ** The returned pointer must be destroyed using destroy_waypoint().
2847  ** The scenario keeps no record of waypoints created with this
2848  ** function.
2849  **
2850  ** The weights of the waypoint control how long the "control handles"
2851  ** of the waypoint are, in meters. The longer the control handle,
2852  ** the more the path will be stretched in the direction of the
2853  ** waypoint's orientation.
2854  **
2855  ** Unless otherwise specified, callable from:
2856  **
2857  *- - C++
2858  *- - Script
2859  **
2860  *b Arguments:
2861  **
2862  *a tx, ty, tz - position in meters from the origin
2863  *a rz, rx, ry - orientations in degrees counter-clockwise
2864  *a from the positive X axis
2865  *a weight_in - how much influence this waypoint exerts
2866  *a over the path curve entering this waypoint
2867  *a weight_out - how much influence this waypoint exerts
2868  *a over the path curve leaving this waypoint
2869  **
2870  ** By default, weight_in will be set to 1, and weight_out will be
2871  ** coupled to weight_in so that changes to one will affect the
2872  ** other. See diguyWaypoint::set_weight_in(). If a non-default
2873  ** value is passed for weight_out the weights of the waypoint will
2874  ** not be coupled.
2875  **
2876  *b Returns:
2877  **
2878  ** pointer to type diguyWaypoint
2879  */
2880  diguyWaypoint* create_waypoint(float x = 0.0f, float y = 0.0f, float z = 0.0f,
2881  float yaw = 0.0f, float roll = 0.0f, float pitch = 0.0f,
2882  float weight_in = DIGUY_DEFAULT_FLOAT,
2883  float weight_out = DIGUY_DEFAULT_FLOAT);
2884 
2885  /*l
2886  *b Description:
2887  **
2888  ** This function destroys a waypoint created by create_waypoint().
2889  ** Path shapes created using this waypoint will not be affected;
2890  ** they make internal copies of the waypoints that are used to
2891  ** create them.
2892  **
2893  ** Do *not* call this function on waypoints not created by
2894  ** create_waypoint()! e.g., a waypoint returned by a call to
2895  ** diguyCharacterPath::get_waypoint_at_index().
2896  **
2897  *b Arguments:
2898  **
2899  *a waypoint - waypoint to destroy
2900  **
2901  *b Returns:
2902  **
2903  ** 0 on success, -1 on failure
2904  */
2905  int destroy_waypoint(diguyWaypoint* waypoint);
2906 
2907 
2908 /*****************************************************************************/
2924  /*l
2925  *b Description:
2926  **
2927  ** This function searches DI-Guy's available character types and
2928  ** appearances for the closest match to the specified fields and
2929  ** values. See the documentation for diguyCharacterTypeMap for
2930  ** information on what fields are available, and what values they
2931  ** may take.
2932  **
2933  *b Arguments:
2934  **
2935  *a field1 - field in type map to check
2936  *a field1_value - value to check for
2937  *a field1_alternate_value - acceptable alternate value
2938  **
2939  ** (Arguments for fields 2 through 8 are the same.)
2940  **
2941  *b Returns:
2942  **
2943  ** pointer to type diguyCharacterTypeMap
2944  */
2945  diguyCharacterTypeMap* get_nearest_character_type_map(
2946  diguyCharacterTypeMapField field1, const char* field1_value, const char* field1_alternate_value,
2947  diguyCharacterTypeMapField field2 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field2_value = NULL, const char* field2_alternate_value = NULL,
2948  diguyCharacterTypeMapField field3 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field3_value = NULL, const char* field3_alternate_value = NULL,
2949  diguyCharacterTypeMapField field4 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field4_value = NULL, const char* field4_alternate_value = NULL,
2950  diguyCharacterTypeMapField field5 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field5_value = NULL, const char* field5_alternate_value = NULL,
2951  diguyCharacterTypeMapField field6 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field6_value = NULL, const char* field6_alternate_value = NULL,
2952  diguyCharacterTypeMapField field7 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field7_value = NULL, const char* field7_alternate_value = NULL,
2953  diguyCharacterTypeMapField field8 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field8_value = NULL, const char* field8_alternate_value = NULL);
2954 
2955  /*l
2956  *b Description:
2957  **
2958  ** Same as above, but fields to check are specified by string name
2959  ** instead of enumeration value.
2960  */
2961  diguyCharacterTypeMap* get_nearest_character_type_map_using_field_strings(
2962  const char* field1_string, const char* field1_value, const char* field1_alternate_value,
2963  const char* field2_string = NULL, const char* field2_value = NULL, const char* field2_alternate_value = NULL,
2964  const char* field3_string = NULL, const char* field3_value = NULL, const char* field3_alternate_value = NULL,
2965  const char* field4_string = NULL, const char* field4_value = NULL, const char* field4_alternate_value = NULL,
2966  const char* field5_string = NULL, const char* field5_value = NULL, const char* field5_alternate_value = NULL,
2967  const char* field6_string = NULL, const char* field6_value = NULL, const char* field6_alternate_value = NULL,
2968  const char* field7_string = NULL, const char* field7_value = NULL, const char* field7_alternate_value = NULL,
2969  const char* field8_string = NULL, const char* field8_value = NULL, const char* field8_alternate_value = NULL);
2970 
2971  /*l
2972  *b Description:
2973  ** Get the number of type maps matching the given fields and (optional) character type. The type maps in
2974  ** the list can then be referenced using get_matching_type_map_at_index(int). Once get_num_matching_type_maps
2975  ** is called again, the new filter will be applied, changing the number of type maps and their indices.
2976  */
2977  int get_num_matching_type_maps( const diguyCharacterTypeMapFieldValues* field_values, const char* character_type = NULL,
2978  const diguyCharacterTypeMapFieldValues* alternate_values = NULL );
2979 
2980  /*l
2981  *b Description:
2982  **
2983  ** Get the type map at the given index in the array of matches. Note that this index is only valid until
2984  ** the next call to get_num_matching_type_maps, at which point the array of type maps is changed.
2985  */
2986  diguyCharacterTypeMap* get_matching_type_map_at_index( int index );
2987 
2988  /*l
2989  *b Description:
2990  **
2991  ** Same as above, but field values to match against are specified
2992  ** by the given type map id. No alternate values can be provided,
2993  ** though wildcards can be used by putting a "*" in for a field.
2994  */
2995  diguyCharacterTypeMap* get_nearest_character_type_map_id_match(const char* type_map_id);
2996 
2997  /*l
2998  *b Description:
2999  **
3000  ** This function returns the total number of type map entries that
3001  ** are in DI-Guy. It is against these entries that matches will be
3002  ** made.
3003  **
3004  ** This function, along with get_character_type_map_entry_at_index(),
3005  ** enables all type map information to be queried.
3006  **
3007  *b Returns:
3008  **
3009  ** number of total type map entries against which matches will be
3010  ** made
3011  */
3012  int get_num_character_type_map_entries();
3013 
3014  /*l
3015  *b Returns:
3016  **
3017  ** type map entry at specified index; see
3018  ** get_num_character_type_map_entries()
3019  */
3020  diguyCharacterTypeMap* get_character_type_map_entry_at_index(int index);
3021 
3022  /*l
3023  *b Description:
3024  **
3025  ** This function returns the total number of values that may
3026  ** be specified or returned in the character class field.
3027  **
3028  ** This function, along with get_type_map_character_class_at_index(),
3029  ** enables all available character classes to be queried.
3030  **
3031  *b Returns:
3032  **
3033  ** number of character classes
3034  */
3035  int get_num_type_map_character_classes();
3036 
3037  /*l
3038  *b Returns:
3039  **
3040  ** character class field value at specified index; see
3041  ** get_num_type_map_character_classes()
3042  */
3043  const char* get_type_map_character_class_at_index(int index);
3044 
3045  /*l
3046  *b Description:
3047  **
3048  ** This function returns the total number of values that may
3049  ** be specified or returned in the category field of a type
3050  ** map with the given character class.
3051  **
3052  ** This function, along with get_type_map_category_at_index(),
3053  ** enables all available categories available to each character
3054  ** class to be queried.
3055  **
3056  *b Returns:
3057  **
3058  ** number of categories
3059  */
3060  int get_num_type_map_categories(const char* character_class);
3061 
3062  /*l
3063  *b Returns:
3064  **
3065  ** category field value at specified index; see
3066  ** get_num_type_map_categories()
3067  */
3068  const char* get_type_map_category_at_index(const char* character_class,
3069  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 subcategory field of a type
3076  ** map with the given character class and category.
3077  **
3078  ** This function, along with get_type_map_subcategory_at_index(),
3079  ** enables all available subcategories available to each character
3080  ** class and category to be queried.
3081  **
3082  *b Returns:
3083  **
3084  ** number of subcategories
3085  */
3086  int get_num_type_map_subcategories(const char* character_class,
3087  const char* category);
3088 
3089  /*l
3090  *b Returns:
3091  **
3092  ** subcategory field value at specified index; see
3093  ** get_num_type_map_subcategories()
3094  */
3095  const char* get_type_map_subcategory_at_index(const char* character_class,
3096  const char* category,
3097  int index);
3098 
3099 
3100 /*****************************************************************************/
3110  /*l
3111  *b Returns:
3112  **
3113  ** number of signals in the scenario
3114  */
3115  int get_num_signals();
3116 
3117  /*l
3118  *b Returns:
3119  **
3120  ** pointer of type diguySignal; NULL if no
3121  ** signal at the specified index
3122  **
3123  *b Arguments:
3124  **
3125  *a index - index of the signal; indices start at 0
3126  */
3127  diguySignal* get_signal_at_index(int index);
3128 
3129  /*l
3130  *b Description:
3131  **
3132  ** This function returns a pointer to the specified signal.
3133  **
3134  *b Arguments:
3135  **
3136  *a name - name of signal to be found
3137  **
3138  *b Returns:
3139  **
3140  ** pointer of type diguySignal; NULL if not found
3141  */
3142  diguySignal* find_signal(const char* name);
3143 
3144  /*l
3145  *b Description:
3146  **
3147  ** This function creates a new signal and returns a
3148  ** pointer to it.
3149  **
3150  *b Arguments:
3151  **
3152  *a name - name of the new signal
3153  **
3154  *b Returns:
3155  **
3156  ** pointer of type diguySignal
3157  */
3158  diguySignal* create_signal(const char* name);
3159 
3160  /*l
3161  *b Description:
3162  **
3163  ** This function destroys a signal.
3164  **
3165  *b Arguments:
3166  **
3167  *a signal - pointer to a diguySignal
3168  **
3169  *b Returns:
3170  **
3171  ** 0 on success, -1 on failure
3172  */
3173  int destroy_signal(diguySignal* signal);
3174 
3175  /*l
3176  *b Description:
3177  **
3178  ** This function resets all signals in the scenario.
3179  */
3180  void reset_signals();
3181 
3182 
3183  /*l
3184  *b Description:
3185  **
3186  ** This function hides all signals in the signal palette.
3187  **
3188  *b Arguments:
3189  **
3190  *a filter - optional filter, will only hide signals tagged with
3191  *a info_text equaling filter
3192  */
3193  int signal_palette_hide_all(const char* filter = NULL);
3194 
3195  /*l
3196  *b Description:
3197  **
3198  ** This function shows all signals in the signal palette.
3199  **
3200  *b Arguments:
3201  **
3202  *a filter - optional filter, will only show signals tagged with
3203  *a info_text filter
3204  */
3205  int signal_palette_show_all(const char* filter = NULL);
3206 
3207 
3208 /*****************************************************************************/
3222  /*l
3223  *b Returns:
3224  **
3225  ** number of sounds in the scenario
3226  */
3227  int get_num_sounds();
3228 
3229  /*l
3230  *b Returns:
3231  **
3232  ** pointer of type diguySound; NULL if no sound at the specified
3233  ** index
3234  **
3235  *b Arguments:
3236  **
3237  *a index - index of the sound; indices start at 0
3238  */
3239  diguySound* get_sound_at_index(int index);
3240 
3241  /*l
3242  *b Description:
3243  **
3244  ** This function returns a pointer to the specified sound.
3245  **
3246  *b Arguments:
3247  **
3248  *a name - name of sound to be found
3249  **
3250  *b Returns:
3251  **
3252  ** pointer of type diguySound; NULL if not found
3253  */
3254  diguySound* find_sound(const char* name);
3255 
3256  /*l
3257  *b Description:
3258  **
3259  ** This function creates a new sound and returns a pointer to it.
3260  **
3261  ** Note that sounds are not played directly. Instead they are used as
3262  ** templates for sound instances. See diguyCharacter::play_sound()
3263  ** and diguyCharacter::create_sound_instance().
3264  **
3265  *b Arguments:
3266  **
3267  *a name - name of the new sound
3268  *a sound_filename - filename of the sound
3269  **
3270  ** Note that name isn't the filename of the sound; it is the
3271  ** descriptive name that will show up in the UI and used in
3272  ** diguyCharacter calls that play sounds.
3273  **
3274  ** Pass the filename in the sound_filename argument or use the
3275  ** function diguySound::set_sound_filename() to set the filename of
3276  ** the sound.
3277  **
3278  ** See diguyCharacter::set_current_voice_actor() for information
3279  ** about naming sounds for different voice actors.
3280  **
3281  *b Returns:
3282  **
3283  ** pointer of type diguySound
3284  */
3285  diguySound* create_sound(const char* name,
3286  const char* sound_filename = NULL);
3287 
3288  /*l
3289  *b Description:
3290  **
3291  ** This function destroys a sound.
3292  **
3293  *b Arguments:
3294  **
3295  *a sound - pointer to diguySound to be destroyed
3296  **
3297  *b Returns:
3298  **
3299  ** 0 on success, -1 on failure
3300  */
3301  int destroy_sound(diguySound* sound);
3302 
3303  /*l
3304  *b Description:
3305  **
3306  ** This function preloads data for the sound.
3307  **
3308  *b Arguments:
3309  **
3310  *a sound - pointer to diguySound
3311  **
3312  *b Returns:
3313  **
3314  ** 0 on success, -1 on failure
3315  */
3316  int preload_sound(diguySound* sound);
3317 
3318  /*l
3319  **
3320  *b Description:
3321  **
3322  ** This function stops all sounds playing within the scenario.
3323  **
3324  *b Arguments:
3325  **
3326  *a rampdown_time - how long to allow the sounds to fade out
3327  **
3328  *b Returns:
3329  **
3330  ** 0 on success, -1 on failure
3331  */
3332  int stop_all_sounds(float rampdown_time = 0.0f);
3333 
3334  /*l
3335  **
3336  *b Description:
3337  **
3338  ** This function plays a non looping sound.
3339  **
3340  *b Arguments:
3341  **
3342  *a name - name of the sound
3343  *a x, y, z - location in the world the sound comes from
3344  *a gain - a volume multiplier
3345  *a save_event - if review data should record the creation of this
3346  *a sound
3347  **
3348  *b Returns:
3349  **
3350  ** 0 on success, -1 on failure
3351  */
3352  int play_3d_sound(const char* name,
3353  float x, float y, float z,
3354  float gain,
3355  int save_event);
3356 
3357 
3358 /*****************************************************************************/
3368  /*l
3369  *b Returns:
3370  **
3371  ** number of groups in the scenario
3372  */
3373  int get_num_groups();
3374 
3375  /*l
3376  *b Returns:
3377  **
3378  ** pointer of type diguyCharacterGroup; NULL if no
3379  ** group at the specified index
3380  **
3381  *b Arguments:
3382  **
3383  *a index - index of the group; indices start at 0
3384  */
3385  diguyCharacterGroup* get_group_at_index(int index);
3386 
3387  /*l
3388  *b Description:
3389  **
3390  ** This function returns a pointer to the specified group.
3391  **
3392  *b Arguments:
3393  **
3394  *a name - name of group to be found
3395  **
3396  *b Returns:
3397  **
3398  ** pointer of type diguyCharacterGroup; NULL if not found
3399  */
3400  diguyCharacterGroup* find_group(const char* name);
3401 
3402  /*l
3403  *b Description:
3404  **
3405  ** This function creates a new group and returns a
3406  ** pointer to it.
3407  **
3408  *b Arguments:
3409  **
3410  *a name - name of the new group
3411  **
3412  *b Returns:
3413  **
3414  ** pointer of type diguyCharacterGroup
3415  */
3416  diguyCharacterGroup* create_group(const char* name);
3417 
3418 
3419  /*l
3420  *b Description:
3421  **
3422  ** This function finds the group with the given name or
3423  ** creates it if it doesn't exist.
3424  **
3425  *b Arguments:
3426  **
3427  *a name - name of the group to find or create
3428  **
3429  *b Returns:
3430  **
3431  ** pointer of type diguyGroup; should never be NULL
3432  */
3433  diguyCharacterGroup* find_or_create_group(const char* name);
3434 
3435 
3436  /*l
3437  *b Description:
3438  **
3439  ** This function destroys a group.
3440  **
3441  *b Arguments:
3442  **
3443  *a group - pointer to a diguyCharacterGroup
3444  **
3445  *b Returns:
3446  **
3447  ** 0 on success, -1 on failure
3448  */
3449  int destroy_group(diguyCharacterGroup* group);
3450 
3451 
3452 /*****************************************************************************/
3462  int get_num_sensor_regions();
3464 
3465  /*l
3466  *b Returns:
3467  **
3468  ** pointer of type diguySensorRegion; NULL if no
3469  ** sensor region at the specified index
3470  **
3471  *b Arguments:
3472  **
3473  *a index - index of the sensor region; indices start at 0
3474  */
3475  diguySensorRegion* get_sensor_region_at_index(int index);
3476 
3478  diguySensorRegion* find_sensor_region(const char* name);
3479 
3481  diguySensorRegion* find_or_create_sensor_region(const char* name);
3482 
3483 /*****************************************************************************/
3493  /*l
3494  *b Returns:
3495  **
3496  ** number of scene objects in the scenario
3497  */
3498  int get_num_scene_objects();
3499 
3500  /*l
3501  *b Returns:
3502  **
3503  ** pointer of type diguySceneObject; NULL if no
3504  ** scene object at the specified index
3505  **
3506  *b Arguments:
3507  **
3508  *a index - index of the scene object; indices start at 0
3509  */
3510  diguySceneObject* get_scene_object_at_index(int index);
3511 
3512  /*l
3513  *b Returns:
3514  **
3515  ** pointer of type diguySceneObject; NULL if no
3516  ** scene object with specified name
3517  */
3518  diguySceneObject* find_scene_object(const char* name);
3519 
3520  /*l
3521  *b Description:
3522  **
3523  ** This function sets whether scene objects defined in the
3524  ** scenario are enabled, and therefore potentially visible.
3525  **
3526  ** Scene objects are *not* enabled by default.
3527  **
3528  *b Arguments:
3529  **
3530  *a scene_objects_enabled - flag determining whether scene
3531  *a objects are enabled; 1 for enabled,
3532  *a 0 for disabled
3533  */
3534  void set_scene_objects_enabled(int scene_objects_enabled);
3535 
3536  /*l
3537  *b Returns:
3538  **
3539  ** the most recent setting made by a call to
3540  ** set_scene_objects_enabled()
3541  */
3542  int get_scene_objects_enabled();
3543 
3544  /*l
3545  *b Description:
3546  **
3547  ** This function creates a new scene object and returns a
3548  ** pointer to it.
3549  **
3550  *b Arguments:
3551  **
3552  *a name - name of the new scene object
3553  *a filename - file the scene object should use
3554  **
3555  *b Returns:
3556  **
3557  ** pointer of type diguySceneObject; NULL if creation failed
3558  */
3559  diguySceneObject* create_scene_object(const char* name,
3560  const char* filename);
3561 
3562  /*l
3563  *b Description:
3564  **
3565  ** This function creates a new user defined scene object and returns a
3566  ** pointer to it.
3567  **
3568  *b Arguments:
3569  **
3570  *a name - name of the new scene object
3571  **
3572  *b Returns:
3573  **
3574  ** pointer of type diguySceneObject; NULL if creation failed
3575  */
3576  diguySceneObject* create_user_defined_scene_object(const char* name);
3577 
3578  /*l
3579  *b Description:
3580  **
3581  ** This function destroys a scene object.
3582  **
3583  *b Arguments:
3584  **
3585  *a scene_object - pointer to a diguySceneObject
3586  **
3587  *b Returns:
3588  **
3589  ** 0 on success, -1 on failure
3590  */
3591  int destroy_scene_object(diguySceneObject* scene_object);
3592 
3593 
3594 /*****************************************************************************/
3604  /*l
3605  *b Returns:
3606  **
3607  ** pointer to the scenario's primary view; there is one
3608  ** and only one primary view in the scenario
3609  */
3610  diguyView* get_primary_view();
3611 
3612  /*l
3613  *b Description:
3614  **
3615  ** Creates a new secondary view for the scenario.
3616  **
3617  *b Returns:
3618  **
3619  ** true on success, false on failure
3620  */
3621  bool create_new_secondary_view();
3622 
3623  /*l
3624  *b Returns:
3625  **
3626  ** number of secondary views in the scenario
3627  */
3628  int get_num_secondary_views();
3629 
3630  /*l
3631  *b Returns:
3632  **
3633  ** pointer of type diguyView; NULL if no
3634  ** secondary view at the specified index
3635  **
3636  *b Arguments:
3637  **
3638  *a index - index of the secondary view; indices start at 0
3639  */
3640  diguyView* get_secondary_view_at_index(int index);
3641 
3642  /*l
3643  *b Description:
3644  **
3645  ** This function returns a pointer to the view with
3646  ** the given name. The primary view and all of the
3647  ** secondary views are checked for a name match.
3648  **
3649  *b Returns:
3650  **
3651  ** pointer of type diguyView; NULL if not found
3652  */
3653  diguyView* find_view(const char* name);
3654 
3655 
3656 /*****************************************************************************/
3666  /*l
3667  *b Description:
3668  **
3669  ** This function returns a pointer to the primary view's camera.
3670  ** This is equivalent to:
3671  **
3672  *e diguyView* v = scenario->get_primary_view();
3673  *e return v->get_camera();
3674  **
3675  *b Returns:
3676  **
3677  ** pointer of type diguyViewCamera; should never be NULL
3678  */
3679  diguyViewCamera* get_scenario_camera();
3680 
3681  /*l
3682  *b Description:
3683  **
3684  ** This function returns a pointer to the camera with
3685  ** the given name. The primary view's camera and all of the
3686  ** secondary views' cameras are checked for a name match.
3687  **
3688  *b Returns:
3689  **
3690  ** pointer of type diguyViewCamera; NULL if not found
3691  */
3692  diguyViewCamera* find_camera(const char* name);
3693 
3694  /*l
3695  *b Description:
3696  **
3697  ** This function sets a flag that determines whether script
3698  ** calls can set the primary view's camera settings.
3699  ** Specifically, if flag is 0, calls to diguyViewCamera::load()
3700  ** will have no effect; the camera should remain completely under
3701  ** user control.
3702  **
3703  *b Arguments:
3704  **
3705  *a flag - 1 to enable, 0 to disable
3706  */
3707  void set_scenario_camera_affected_by_script_events(int flag);
3708 
3709  /*l
3710  *b Returns:
3711  **
3712  ** the most recent setting made by
3713  ** set_scenario_camera_affected_by_script_events()
3714  */
3715  int get_scenario_camera_affected_by_script_events();
3716 
3717  /*l
3718  *b Description:
3719  **
3720  ** This function, like
3721  ** set_scenario_camera_affected_by_script_events(), determines
3722  ** whether script calls can set the primary view's camera settings,
3723  ** but only disables camera changes if there is an active I-Guy
3724  ** character as set by the set_iguy_character() call.
3725  **
3726  ** If set_scenario_camera_affected_by_script_events() has been called
3727  ** with a value of 0, then this function has no effect.
3728  **
3729  *b Arguments:
3730  **
3731  *a flag - 1 to enable, 0 to disable
3732  */
3733  void set_scenario_camera_affected_by_script_events_when_iguy_active(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_when_iguy_active();
3742 
3743  /*l
3744  *b Returns:
3745  **
3746  ** number of camera settings saved in the scenario
3747  */
3748  int get_num_camera_settings();
3749 
3750  /*l
3751  *b Returns:
3752  **
3753  ** pointer of type diguyViewCameraSettings; NULL if no
3754  ** camera settings at the specified index
3755  **
3756  *b Arguments:
3757  **
3758  *a index - index of the camera settings; indices start at 0
3759  */
3760  diguyViewCameraSettings* get_camera_settings_at_index(int index);
3761 
3762  /*l
3763  *b Description:
3764  **
3765  ** This function returns a pointer to the specified camera settings.
3766  **
3767  *b Arguments:
3768  **
3769  *a settings_name - name of camera settings to be found
3770  **
3771  *b Returns:
3772  **
3773  ** pointer of type diguyViewCamera; NULL if not found
3774  */
3775  diguyViewCameraSettings* find_camera_settings(const char* settings_name);
3776 
3777  /*l
3778  *b Description:
3779  **
3780  ** This function loads the specified camera settings into
3781  ** the primary view's camera.
3782  **
3783  *b Arguments:
3784  **
3785  *a settings_name - name of camera settings to be loaded
3786  *a update_current_camera - whether the current camera should be
3787  *a updated; defaults to 1
3788  **
3789  ** Not updating the current camera will cause the camera history
3790  ** to be lost.
3791  **
3792  *b Returns:
3793  **
3794  ** 0 on success, -1 on failure
3795  */
3796  int load_camera_settings(const char* settings_name, int update_current_camera = 1);
3797 
3798  /*l
3799  *b Description:
3800  **
3801  ** This function sets camera that will be used for down-stream
3802  ** camera-related operations. This includes:
3803  **
3804  *- - far position rendering in the OpenGL renderer
3805  *- - various culling operations (e.g. set_character_culling_enabled())
3806  *- - graphics LOD range scaling; see
3807  *- set_scale_graphics_lod_ranges_from_view_settings()
3808  **
3809  ** Typically the passed camera should be the primary view's camera.
3810  **
3811  ** A render camera does not always need to be set. If one is not
3812  ** set, the above camera-related operations will not be performed.
3813  **
3814  ** If a render camera is set the actual rendering environment
3815  ** camera settings (e.g. as set by gluLookAt() in OpenGL)
3816  ** should match the settings in the render camera, or there
3817  ** may be unexpected visual results.
3818  **
3819  *b Arguments:
3820  **
3821  *a camera - camera to use for camera-related operations
3822  */
3823  void set_render_camera(diguyViewCamera* camera);
3824  diguyViewCamera* get_render_camera();
3825 
3826 /*****************************************************************************/
3836  /*l
3837  *b Description:
3838  **
3839  ** This function returns a pointer to the scenario fog.
3840  ** This is the fog of the primary view.
3841  **
3842  *b Returns:
3843  **
3844  ** pointer of type diguyViewFog; should never be NULL
3845  */
3846  diguyViewFog* get_scenario_fog();
3847 
3848  /*l
3849  *b Description:
3850  **
3851  ** This function returns a pointer to the fog with
3852  ** the given name. The primary view's fog and all of the
3853  ** secondary views' fogs are checked for a name match.
3854  **
3855  *b Returns:
3856  **
3857  ** pointer of type diguyViewFog; NULL if not found
3858  */
3859  diguyViewFog* find_fog(const char* name);
3860 
3861  /*l
3862  *b Description:
3863  **
3864  ** This function returns the fog object with the given name, or
3865  ** creates one if not found.
3866  **
3867  *b Returns:
3868  **
3869  ** pointer of type diguyViewFog
3870  **
3871  *b Arguments:
3872  **
3873  *a name
3874  */
3875  diguyViewFog* find_or_create_fog(const char* name);
3876 
3877  /*l
3878  *b Description:
3879  **
3880  ** This function loads the named fog settings the currently active
3881  ** one.
3882  **
3883  *b Arguments:
3884  **
3885  *a name
3886  */
3887  void load_current_fog(const char* name);
3888 
3889  /*l
3890  *b Returns:
3891  **
3892  ** number of fog settings in the scenario
3893  */
3894  int get_num_fog_settings();
3895 
3896  /*l
3897  *b Returns:
3898  **
3899  ** pointer of type diguyViewFogSettings; NULL if no
3900  ** fog at the specified index
3901  **
3902  *b Arguments:
3903  **
3904  *a index - index of the fog settings; indices start at 0
3905  */
3906  diguyViewFogSettings* get_fog_settings_at_index(int index);
3907 
3908  /*l
3909  *b Description:
3910  **
3911  ** This function returns a pointer to the specified fog settings.
3912  **
3913  *b Arguments:
3914  **
3915  *a settings_name - name of fog settings to be found
3916  **
3917  *b Returns:
3918  **
3919  ** pointer of type diguyViewFogSettings; NULL if not found
3920  */
3921  diguyViewFogSettings* find_fog_settings(const char* settings_name);
3922 
3923  /*l
3924  *b Description:
3925  **
3926  ** This function loads the specified fog settings into
3927  ** the scenario fog.
3928  **
3929  *b Arguments:
3930  **
3931  *a settings_name - name of fog settings to be loaded
3932  **
3933  *b Returns:
3934  **
3935  ** pointer of type diguyViewFog; NULL if not found
3936  */
3937  int load_fog_settings(const char* settings_name);
3938 
3939 
3940 /*****************************************************************************/
3950  /*l
3951  *b Description:
3952  **
3953  ** This function returns a pointer to the scenario light.
3954  ** These are the lights of the primary view.
3955  **
3956  *b Arguments:
3957  **
3958  *a number - number of light to be found
3959  **
3960  *b Returns:
3961  **
3962  ** pointer of type diguyViewLight; can be null if asked for a
3963  ** non-existent light
3964  */
3965  diguyViewLight* get_scenario_light(int i = 0);
3966 
3967  /*l
3968  *b Description:
3969  **
3970  ** This function returns a pointer to the light with
3971  ** the given name. The primary view's light and all of the
3972  ** secondary views' lights are checked for a name match.
3973  **
3974  *b Returns:
3975  **
3976  ** pointer of type diguyViewLight; NULL if not found
3977  */
3978  diguyViewLight* find_light(const char* name);
3979 
3980  /*l
3981  *b Returns:
3982  **
3983  ** number of light settings in the scenario
3984  */
3985  int get_num_light_settings();
3986 
3987  /*l
3988  *b Returns:
3989  **
3990  ** pointer of type diguyViewLightSettings; NULL if no
3991  ** light settings at the specified index
3992  **
3993  *b Arguments:
3994  **
3995  *a index - index of the light settings; indices start at 0
3996  */
3997  diguyViewLightSettings* get_light_settings_at_index(int index);
3998 
3999  /*l
4000  *b Description:
4001  **
4002  ** This function returns a pointer to the specified light settings.
4003  **
4004  *b Arguments:
4005  **
4006  *a name - name of light settings to be found
4007  **
4008  *b Returns:
4009  **
4010  ** pointer of type diguyViewLightSettings; NULL if not found
4011  */
4012  diguyViewLightSettings* find_light_settings(const char* settings_name);
4013 
4014  /*l
4015  *b Description:
4016  **
4017  ** This function loads the specified light settings into
4018  ** the scenario light.
4019  **
4020  *b Arguments:
4021  **
4022  *a settings_name - name of light settings to be loaded
4023  *a light_num - which light to load into
4024  **
4025  *b Returns:
4026  **
4027  ** pointer of type diguyViewLight; NULL if not found
4028  */
4029  int load_light_settings(const char* settings_name, int light_num = 0);
4030 
4036  void set_use_override_ambient_material(int enabled);
4037 
4039  int get_use_override_ambient_material();
4040 
4042  void set_global_ambient_material(float value);
4043 
4045  float get_global_ambient_material();
4046 
4047 /*****************************************************************************/
4057  /*l
4058  *b Returns:
4059  **
4060  ** number of info popups in the scenario
4061  */
4062  int get_num_info_popups();
4063 
4064  /*l
4065  *b Returns:
4066  **
4067  ** pointer of type diguyInfoPopup; NULL if no
4068  ** info popup at the specified index
4069  **
4070  *b Arguments:
4071  **
4072  *a index - index of the info popup; indices start at 0
4073  */
4074  diguyInfoPopup* get_info_popup_at_index(int index);
4075 
4076  /*l
4077  *b Description:
4078  **
4079  ** This function returns a pointer to the specified info popup.
4080  **
4081  *b Arguments:
4082  **
4083  *a name - name of info popup to be found
4084  **
4085  *b Returns:
4086  **
4087  ** pointer of type diguyInfoPopup; NULL if not found
4088  */
4089  diguyInfoPopup* find_info_popup(const char* name);
4090 
4091  /*l
4092  *b Description:
4093  **
4094  ** This function sets the default encoding for info popups
4095  ** that do not have an encoding specified.
4096  **
4097  *b Arguments:
4098  **
4099  *a info_popup_default_encoding - new default encoding
4100  **
4101  *b Returns:
4102  **
4103  ** 0 on success, -1 on failure
4104  */
4105  int set_info_popup_default_encoding(const char* info_popup_default_encoding);
4107  /*l
4108  *b Description:
4109  **
4110  ** This function returns the default encoding of info popups.
4111  **
4112  *b Returns:
4113  **
4114  ** default encoding; value will never be NULL, but may be
4115  ** the empty string ("") if no default encoding has been
4116  ** specified
4117  */
4118  const char* get_info_popup_default_encoding();
4119 
4120 
4121 /*****************************************************************************/
4131  /*l
4132  *b Returns:
4133  **
4134  ** number of variables in the scenario
4135  */
4136  int get_num_variables();
4137 
4138  /*l
4139  *b Returns:
4140  **
4141  ** pointer of type diguyVariable; NULL if no
4142  ** variable at the specified index
4143  **
4144  *b Arguments:
4145  **
4146  *a index - index of the variable; indices start at 0
4147  */
4148  diguyVariable* get_variable_at_index(int index);
4149 
4150  /*l
4151  *b Description:
4152  **
4153  ** This function returns a pointer to the specified variable.
4154  **
4155  *b Arguments:
4156  **
4157  *a name - name of variable to be found
4158  **
4159  *b Returns:
4160  **
4161  ** pointer of type diguyVariable; NULL if not found
4162  */
4163  diguyVariable* find_variable(const char* name);
4164 
4165  /*l
4166  *b Description:
4167  **
4168  ** This function finds the variable with the given name or
4169  ** creates it if it doesn't exist.
4170  **
4171  *b Arguments:
4172  **
4173  *a name - name of the variable to find or create
4174  **
4175  *b Returns:
4176  **
4177  ** pointer of type diguyVariable; should never be NULL
4178  */
4179  diguyVariable* find_or_create_variable(const char* name);
4180 
4181  /*l
4182  *b Description:
4183  **
4184  ** This function destroys the passed variable.
4185  **
4186  *b Arguments:
4187  **
4188  *a variable - pointer to a diguyVariable
4189  **
4190  *b Returns:
4191  **
4192  ** 0 on success, -1 on failure
4193  */
4194  int destroy_variable(diguyVariable* variable);
4195 
4196 
4197 /*****************************************************************************/
4207  /*l
4208  *b Returns:
4209  **
4210  ** number of face_expressions in the scenario
4211  */
4212  int get_num_face_expressions();
4213 
4214  /*l
4215  *b Returns:
4216  **
4217  ** pointer of type diguyCharacterFaceExpression; NULL if no
4218  ** info popup at the specified index
4219  **
4220  *b Arguments:
4221  **
4222  *a index - index of the face_expression; indices start at 0
4223  */
4224  diguyCharacterFaceExpression* get_face_expression_at_index(int index);
4225 
4226  /*l
4227  *b Description:
4228  **
4229  ** This function returns a pointer to the specified face expression.
4230  **
4231  *b Arguments:
4232  **
4233  *a name - name of face_expression to be found
4234  **
4235  *b Returns:
4236  **
4237  ** pointer of type diguyCharacterFaceExpression; NULL if not found
4238  */
4239  diguyCharacterFaceExpression* find_face_expression(const char* name);
4240 
4241  /*l
4242  *b Description:
4243  **
4244  ** This function creates a new face expression with the given name.
4245  **
4246  *b Arguments:
4247  **
4248  *a name - name of the new face expression
4249  *a target_actor - name of the actor to use as template; defaults to
4250  *a "exface" for backwards compatiblity
4251  **
4252  *b Returns:
4253  **
4254  ** pointer of type diguyCharacterFaceExpression
4255  */
4256  diguyCharacterFaceExpression* create_face_expression(const char* name,
4257  const char* target_actor = "exface");
4258 
4259  /*l
4260  *b Description:
4261  **
4262  ** This function destroys the passed face expression.
4263  **
4264  *b Arguments:
4265  **
4266  *a face_expression - pointer to a diguyCharacterFaceExpression
4267  **
4268  *b Returns:
4269  **
4270  ** 0 on success, -1 on failure
4271  */
4272  int destroy_face_expression(diguyCharacterFaceExpression* face_expression);
4273 
4274 
4275 /*****************************************************************************/
4285  /*l
4286  *b Returns:
4287  **
4288  ** number of chain settings in the scenario
4289  */
4290  int get_num_chain_settings();
4291 
4292  /*l
4293  *b Returns:
4294  **
4295  ** pointer of type diguyChainSettings; NULL if no
4296  ** chain settings at the specified index
4297  **
4298  *b Arguments:
4299  **
4300  *a index - index of the chain settings; indices start at 0
4301  */
4302  diguyChainSettings* get_chain_settings_at_index(int index);
4303 
4304  /*l
4305  *b Description:
4306  **
4307  ** This function returns a pointer to the specified chain settings.
4308  **
4309  *b Arguments:
4310  **
4311  *a name - name of chain settings to be found
4312  **
4313  *b Returns:
4314  **
4315  ** pointer of type diguyChainSettings; NULL if not found
4316  */
4317  diguyChainSettings* find_chain_settings(const char* name);
4318 
4319  /*l
4320  *b Description:
4321  **
4322  ** This function creates a new chain settings and returns a
4323  ** pointer to it.
4324  **
4325  *b Arguments:
4326  **
4327  *a name - name of the new chain settings
4328  **
4329  *b Returns:
4330  **
4331  ** pointer of type diguyChainSettings
4332  */
4333  diguyChainSettings* create_chain_settings(const char* name);
4334 
4335  /*l
4336  *b Description:
4337  **
4338  ** This function destroys a chain settings.
4339  **
4340  *b Arguments:
4341  **
4342  *a chain settings - pointer to a diguyChainSettings
4343  **
4344  *b Returns:
4345  **
4346  ** 0 on success, -1 on failure
4347  */
4348  int destroy_chain_settings(diguyChainSettings* chain_settings);
4349 
4350 
4351 /*****************************************************************************/
4361  /*l
4362  *b Description:
4363  **
4364  ** This is an enumeration of the different callbacks
4365  ** that can be registered with add_callback() and
4366  ** add_callback_script().
4367  **
4368  ** Callbacks return a value of type diguyCallbackReturn,
4369  ** which will be DIGUY_CALLBACK_STOP or DIGUY_CALLBACK_CONTINUE.
4370  ** If the callback returns DIGUY_CALLBACK_STOP, the default handler
4371  ** of the function will not be called; the callback is asserting
4372  ** that it has done everything necessary for the function call.
4373  ** If the callback returns DIGUY_CALLBACK_CONTINUE, the default
4374  ** handler for the function will be called after the callback.
4375  **
4376  *************************************************************************
4377  *4 Callback Enums:
4378  **
4379  *i CALLBACK_ID_CREATE
4380  **
4381  ** This callback will be called when a new scenario is created.
4382  ** It should only be used by
4383  ** diguyApp::add_default_scenario_callback(). Using it in
4384  ** set_callback() will have no effect, as by that time the
4385  ** scenario has already been created.
4386  **
4387  *i CALLBACK_ID_RESET
4388  **
4389  ** This callback will be called when the scenario is reset.
4390  **
4391  *i CALLBACK_ID_WAIT_CURSOR_SHOW
4392  **
4393  ** This callback will be called when a diguy operation
4394  ** is likely to take some time, allowing an application to
4395  ** display a wait cursor.
4396  **
4397  *i CALLBACK_ID_WAIT_CURSOR_HIDE
4398  **
4399  ** This callback will be called when a diguy operation
4400  ** that caused a wait cursor to be shown has completed,
4401  ** allowing an application to hide the wait cursor.
4402  **
4403  *i CALLBACK_ID_LOAD
4404  **
4405  ** This callback will be called when a scenario is loaded, thereby
4406  ** giving a chance for custom code to read extra elements from the
4407  ** loaded file.
4408  **
4409  *i CALLBACK_ID_SAVE
4410  **
4411  ** This callback will be called when a scenario is saved, thereby
4412  ** giving a chance for custom code to insert extra elements into the
4413  ** saved file.
4414  **
4415  *i CALLBACK_ID_LOAD_SCENARIO_FILE
4416  **
4417  ** This callback will be called just before a scenario loads
4418  ** a new file.
4419  **
4420  *i CALLBACK_ID_SAVE_SCENARIO_FILE
4421  **
4422  ** This callback will be called just after a scenario saves
4423  ** a new file. With a char * pointer to the file name.
4424  **
4425  *i CALLBACK_ID_MANUALLY_INVOKED
4426  **
4427  ** This callback id will be supplied to event handlers invoked
4428  ** by a call to manually_invoke_event_handler().
4429  **
4430  ** The user's returned diguyCallbackReturn value will be ignored.
4431  **
4432  *i CALLBACK_ID_POST_DRAW
4433  **
4434  ** This callback will be called just after a scenario finishes it's
4435  ** draw commands. The diguyViewPainter class can be used to issue
4436  ** abstract draw commands in DI-Guy Scenario.
4437  **
4438  *i Lua Example:
4439  **
4440  *e local painter = this_app:get_view_painter();
4441  *e painter:set_pen_color(1,1,0);
4442  *e painter:draw_line(0,0,0, 1,1,1);
4443  **
4444  *i CALLBACK_ID_PLAYBACK_MODE_CHANGED
4445  **
4446  ** This callback will be called when the playback mode of the
4447  ** scenario has changed. For example, the Play or Stop buttons are
4448  ** pressed in DI-Guy Scenario, or set_playback_mode() is called.
4449  **
4450  ** The user's returned diguyCallbackReturn value will be ignored.
4451  **
4452  *i CALLBACK_ID_INPUT_MODE_CHANGED
4453  **
4454  ** This callback will be called when the input mode of the
4455  ** scenario has changed. For example, when an Input Mode button is
4456  ** pressed in DI-Guy Scenario, or diguyApp::set_base_input_mode()
4457  ** is called.
4458  **
4459  ** The user's returned diguyCallbackReturn value will be ignored.
4460  **
4461  *i CALLBACK_ID_RENDER_MODE_CHANGED
4462  **
4463  ** This callback will be called if the render mode of the scenario
4464  ** changes, typically due to a set_current_render_mode().
4465  **
4466  ** The user's returned diguyCallbackReturn value will be ignored.
4467  **
4468  *i CALLBACK_ID_POST_LOAD_CHECKPOINT
4469  **
4470  ** This callback will be called just after a scenario finishes
4471  ** loading a checkpoint file.
4472  */
4473  enum {
4474  CALLBACK_ID_CREATE = 1,
4475  CALLBACK_ID_DESTROY,
4476  CALLBACK_ID_RESET,
4477  CALLBACK_ID_WAIT_CURSOR_SHOW,
4478  CALLBACK_ID_WAIT_CURSOR_HIDE,
4479  CALLBACK_ID_LOAD,
4480  CALLBACK_ID_SAVE,
4481  CALLBACK_ID_LOAD_SCENARIO_FILE,
4482  CALLBACK_ID_SAVE_SCENARIO_FILE,
4483  CALLBACK_ID_SCENE_OBJECT_IMPACT,
4484  CALLBACK_ID_LEFT_CLICK_SCENE,
4485  CALLBACK_ID_RIGHT_CLICK_SCENE,
4486  CALLBACK_ID_TIMED_EVENT,
4487  CALLBACK_ID_MANUALLY_INVOKED,
4488  CALLBACK_ID_POST_DRAW,
4489  CALLBACK_ID_PLAYBACK_MODE_CHANGED,
4490  CALLBACK_ID_INPUT_MODE_CHANGED,
4491  CALLBACK_ID_RENDER_MODE_CHANGED,
4492  CALLBACK_ID_PRE_REINITIALIZE,
4493  CALLBACK_ID_POST_REINITIALIZE,
4494  CALLBACK_ID_POST_LOAD_CHECKPOINT
4495  };
4496 
4497 #ifdef CPLUSPLUS_ONLY
4498 
4499  /*l
4500  *b Description:
4501  **
4502  ** This function adds a scenario callback.
4503  **
4504  *b Arguments:
4505  **
4506  *a callback - pointer to function with prototype
4507  *a diguyScenarioCallback (typedefed above)
4508  *a callback_id - integer id of when this callback is to be called
4509  *a callback_params - not currently used; pass NULL
4510  *a callback_user_data - pointer for user's own use; DI-Guy will
4511  *a do nothing to the contents of this pointer
4512  *a beyond passing it back when the callback is
4513  *a invoked
4514  *a remove_on_scenario_load - pass 1 to remove the callback on a
4515  *a scenario load, 0 to not
4516  **
4517  *b Returns:
4518  **
4519  ** 0 on success, -1 on failure
4520  **
4521  *b Callable From:
4522  **
4523  *- - C++
4524  */
4525  int add_callback(int callback_id,
4526  diguyScenarioCallback* callback,
4527  void* callback_params = 0,
4528  void* callback_user_data = 0,
4529  int remove_on_scenario_load = 1);
4530 
4531  /*l
4532  *b Description:
4533  **
4534  ** This function removes a user callback. All callbacks matching
4535  ** the specified callback_id and callback function will be removed.
4536  **
4537  *b Arguments:
4538  **
4539  *a callback_id - integer id of callback
4540  *a callback - pointer to function with prototype
4541  *a diguyCharacterCallback (typedefed above)
4542  **
4543  *b Returns:
4544  **
4545  ** 0 on success, -1 on failure
4546  **
4547  *b Callable From:
4548  **
4549  *- - C++
4550  */
4551  int remove_callback(int callback_id,
4552  diguyScenarioCallback* callback);
4553 
4554  /*l
4555  *b Description:
4556  **
4557  ** This function removes a user callback. All callbacks matching
4558  ** the specified callback_id and callback_user_data pointer will
4559  ** be removed.
4560  **
4561  *b Arguments:
4562  **
4563  *a callback_id - integer id of callback
4564  *a callback_user_data - pointer for user's own use
4565  **
4566  *b Returns:
4567  **
4568  ** 0 on success, -1 on failure
4569  **
4570  *b Callable From:
4571  **
4572  *- - C++
4573  */
4574  int remove_callback_with_user_data(int callback_id,
4575  void* callback_user_data);
4576 
4577  /*l
4578  *b Description:
4579  **
4580  ** This function sets a default user callback that will be added to
4581  ** all new characters. See diguyCharacter::add_callback() for
4582  ** details.
4583  **
4584  *b Callable From:
4585  **
4586  *- - C++
4587  */
4588  int add_default_character_callback(int callback_id,
4589  diguyCharacterCallback* callback,
4590  void* callback_params,
4591  void* callback_user_data,
4592  int add_to_existing_objects_flag = 0,
4593  int remove_on_scenario_load = 1);
4594 
4595  /*l
4596  *b Description:
4597  **
4598  ** This function removes a user callback. All default character
4599  ** callbacks matching the specified callback_id and callback function
4600  ** will be removed.
4601  **
4602  *b Arguments:
4603  **
4604  *a callback_id - integer id of callback
4605  *a callback - pointer to function with prototype
4606  *a diguyCharacterCallback (typedefed above)
4607  **
4608  *b Callable From:
4609  **
4610  *- - C++
4611  */
4612  int remove_default_character_callback(int callback_id,
4613  diguyCharacterCallback* callback);
4614 
4615  /*l
4616  *b Description:
4617  **
4618  ** This function removes a default user callback previously added by
4619  ** add_default_character_callback(). See
4620  ** diguyCharacter::remove_callback_with_user_data() for details.
4621  **
4622  *b Callable From:
4623  **
4624  *- - C++
4625  */
4626  int remove_default_character_callback_with_user_data(int callback_id,
4627  void* callback_user_data);
4628 
4629 
4630  /*l
4631  *b Description:
4632  **
4633  ** This function sets a default user callback that will be added
4634  ** to all new sensor regions. See
4635  ** diguySensorRegion::add_callback() for details.
4636  **
4637  *b Callable From:
4638  **
4639  *- - C++
4640  */
4641  int add_default_sensor_region_callback(int callback_id,
4642  diguySensorRegionCallback* callback,
4643  void* callback_params,
4644  void* callback_user_data,
4645  int add_to_existing_objects_flag = 0,
4646  int remove_on_scenario_load = 1);
4647 
4648  /*l
4649  *b Description:
4650  **
4651  ** This function removes a user callback. All default sensor region
4652  ** callbacks matching the specified callback_id and callback function
4653  ** will be removed.
4654  **
4655  *b Arguments:
4656  **
4657  *a callback_id - integer id of callback
4658  *a callback - pointer to function with prototype
4659  *a diguyCharacterCallback (typedefed above)
4660  **
4661  *b Callable From:
4662  **
4663  *- - C++
4664  */
4665  int remove_default_sensor_region_callback(int callback_id,
4666  diguySensorRegionCallback* callback);
4667 
4668  /*l
4669  *b Description:
4670  **
4671  ** This function removes a default user callback. All default sensor
4672  ** region callbacks matching the specified callback_id and
4673  ** callback_user_data pointer will be removed.
4674  **
4675  *b Arguments:
4676  **
4677  *a callback_id - integer id of callback
4678  *a callback_user_data - pointer for user's own use
4679  **
4680  *b Callable From:
4681  **
4682  *- - C++
4683  */
4684  int remove_default_sensor_region_callback_with_user_data(int callback_id,
4685  void* callback_user_data);
4686 
4687  /*l
4688  *b Description:
4689  **
4690  ** This function adds a default user callback that will be added
4691  ** to all new signals.
4692  **
4693  *b Callable From:
4694  **
4695  *- - C++
4696  */
4697  int add_default_signal_callback(int callback_id,
4698  diguySignalCallback* callback,
4699  void* callback_params,
4700  void* callback_user_data,
4701  int add_to_existing_objects_flag = 0,
4702  int remove_on_scenario_load = 1);
4703 
4704  /*l
4705  *b Description:
4706  **
4707  ** This function removes a user callback. All default signal
4708  ** callbacks matching the specified callback_id and callback function
4709  ** will be removed.
4710  **
4711  *b Arguments:
4712  **
4713  *a callback_id - integer id of callback
4714  *a callback - pointer to function with prototype
4715  *a diguyCharacterCallback (typedefed above)
4716  **
4717  *b Callable From:
4718  **
4719  *- - C++
4720  */
4721  int remove_default_signal_callback(int callback_id,
4722  diguySignalCallback* callback);
4723 
4724  /*l
4725  *b Description:
4726  **
4727  ** This function removes a default user callback. All default signal
4728  ** callbacks matching the specified callback_id and callback_user_data
4729  ** pointer will be removed.
4730  **
4731  *b Arguments:
4732  **
4733  *a callback_id - integer id of callback
4734  *a callback_user_data - pointer for user's own use
4735  **
4736  *b Callable From:
4737  **
4738  *- - C++
4739  */
4740  int remove_default_signal_callback_with_user_data(int callback_id,
4741  void* callback_user_data);
4742 
4743  /*l
4744  *b Description:
4745  **
4746  ** This function adds a default user callback that will be added
4747  ** to all new variables.
4748  **
4749  *b Callable From:
4750  **
4751  *- - C++
4752  */
4753  int add_default_variable_callback(int callback_id,
4754  diguyVariableCallback* callback,
4755  void* callback_params,
4756  void* callback_user_data,
4757  int add_to_existing_objects_flag = 0,
4758  int remove_on_scenario_load = 1);
4759 
4760  /*l
4761  *b Description:
4762  **
4763  ** This function removes a user callback. All default variable
4764  ** callbacks matching the specified callback_id and callback function
4765  ** will be removed.
4766  **
4767  *b Arguments:
4768  **
4769  *a callback_id - integer id of callback
4770  *a callback - pointer to function with prototype
4771  *a diguyCharacterCallback (typedefed above)
4772  **
4773  *b Callable From:
4774  **
4775  *- - C++
4776  */
4777  int remove_default_variable_callback(int callback_id,
4778  diguyVariableCallback* callback);
4779 
4780  /*l
4781  *b Description:
4782  **
4783  ** This function removes a default user callback. All default
4784  ** variable callbacks matching the specified callback_id and
4785  ** callback_user_data pointer will be removed.
4786  **
4787  *b Arguments:
4788  **
4789  *a callback_id - integer id of callback
4790  *a callback_user_data - pointer for user's own use
4791  **
4792  *b Callable From:
4793  **
4794  *- - C++
4795  */
4796  int remove_default_variable_callback_with_user_data(int callback_id,
4797  void* callback_user_data);
4798 
4799  /*l
4800  *b Description:
4801  **
4802  ** This function adds a default user callback that will be added
4803  ** to all new views.
4804  **
4805  ** Note that unlike most of the other add default callback
4806  ** functions, this one's add_to_existing_objects_flag argument
4807  ** defaults to a value of 1, since views in scenarios always
4808  ** exist and are neither created nor destroyed.
4809  **
4810  *b Callable From:
4811  **
4812  *- - C++
4813  */
4814  int add_default_view_callback(int callback_id,
4815  diguyViewCallback* callback,
4816  void* callback_params,
4817  void* callback_user_data,
4818  int add_to_existing_objects_flag = 1,
4819  int remove_on_scenario_load = 1);
4820 
4821  /*l
4822  *b Description:
4823  **
4824  ** This function removes a user callback. All default view
4825  ** callbacks matching the specified callback_id and callback function
4826  ** will be removed.
4827  **
4828  *b Arguments:
4829  **
4830  *a callback_id - integer id of callback
4831  *a callback - pointer to function with prototype
4832  *a diguyCharacterCallback (typedefed above)
4833  **
4834  *b Callable From:
4835  **
4836  *- - C++
4837  */
4838  int remove_default_view_callback(int callback_id,
4839  diguyViewCallback* callback);
4840 
4841  /*l
4842  *b Description:
4843  **
4844  ** This function removes a default user callback. All default view
4845  ** callbacks matching the specified callback_id and callback_user_data
4846  ** pointer will be removed.
4847  **
4848  *b Arguments:
4849  **
4850  *a callback_id - integer id of callback
4851  *a callback_user_data - pointer for user's own use
4852  **
4853  *b Callable From:
4854  **
4855  *- - C++
4856  */
4857  int remove_default_view_callback_with_user_data(int callback_id,
4858  void* callback_user_data);
4859 
4860  /*l
4861  *b Description:
4862  **
4863  ** This function adds a default user callback that will be added
4864  ** to all cameras.
4865  **
4866  *b Callable From:
4867  **
4868  *- - C++
4869  */
4870  int add_default_camera_callback(int callback_id,
4871  diguyViewCameraCallback* callback,
4872  void* callback_params,
4873  void* callback_user_data,
4874  int add_to_existing_objects_flag = 0,
4875  int remove_on_scenario_load = 1);
4876 
4877  /*l
4878  *b Description:
4879  **
4880  ** This function removes a user callback. All default camera
4881  ** callbacks matching the specified callback_id and callback function
4882  ** will be removed.
4883  **
4884  *b Arguments:
4885  **
4886  *a callback_id - integer id of callback
4887  *a callback - pointer to function with prototype
4888  *a diguyCharacterCallback (typedefed above)
4889  **
4890  *b Callable From:
4891  **
4892  *- - C++
4893  */
4894  int remove_default_camera_callback(int callback_id,
4895  diguyViewCameraCallback* callback);
4896 
4897  /*l
4898  *b Description:
4899  **
4900  ** This function removes a default user callback. All default camera
4901  ** callbacks matching the specified callback_id and callback_user_data
4902  ** pointer will be removed.
4903  **
4904  *b Arguments:
4905  **
4906  *a callback_id - integer id of callback
4907  *a callback_user_data - pointer for user's own use
4908  **
4909  *b Callable From:
4910  **
4911  *- - C++
4912  */
4913  int remove_default_camera_callback_with_user_data(int callback_id,
4914  void* callback_user_data);
4915 
4916  /*l
4917  *b Description:
4918  **
4919  ** This function adds a default user callback that will be added
4920  ** to all new fogs.
4921  **
4922  *b Callable From:
4923  **
4924  *- - C++
4925  */
4926  int add_default_fog_callback(int callback_id,
4927  diguyViewFogCallback* callback,
4928  void* callback_params,
4929  void* callback_user_data,
4930  int add_to_existing_objects_flag = 0,
4931  int remove_on_scenario_load = 1);
4932 
4933  /*l
4934  *b Description:
4935  **
4936  ** This function removes a user callback. All default fog
4937  ** callbacks matching the specified callback_id and callback function
4938  ** will be removed.
4939  **
4940  *b Arguments:
4941  **
4942  *a callback_id - integer id of callback
4943  *a callback - pointer to function with prototype
4944  *a diguyCharacterCallback (typedefed above)
4945  **
4946  *b Callable From:
4947  **
4948  *- - C++
4949  */
4950  int remove_default_fog_callback(int callback_id,
4951  diguyViewFogCallback* callback);
4952 
4953  /*l
4954  *b Description:
4955  **
4956  ** This function removes a default user callback. All default fog
4957  ** callbacks matching the specified callback_id and callback_user_data
4958  ** pointer will be removed.
4959  **
4960  *b Arguments:
4961  **
4962  *a callback_id - integer id of callback
4963  *a callback_user_data - pointer for user's own use
4964  **
4965  *b Callable From:
4966  **
4967  *- - C++
4968  */
4969  int remove_default_fog_callback_with_user_data(int callback_id,
4970  void* callback_user_data);
4971 
4972  /*l
4973  *b Description:
4974  **
4975  ** This function adds a default user callback that will be added
4976  ** to all new lights.
4977  **
4978  *b Callable From:
4979  **
4980  *- - C++
4981  */
4982  int add_default_light_callback(int callback_id,
4983  diguyViewLightCallback* callback,
4984  void* callback_params,
4985  void* callback_user_data,
4986  int add_to_existing_objects_flag = 0,
4987  int remove_on_scenario_load = 1);
4988 
4989  /*l
4990  *b Description:
4991  **
4992  ** This function removes a user callback. All default light
4993  ** callbacks matching the specified callback_id and callback function
4994  ** will be removed.
4995  **
4996  *b Arguments:
4997  **
4998  *a callback_id - integer id of callback
4999  *a callback - pointer to function with prototype
5000  *a diguyCharacterCallback (typedefed above)
5001  **
5002  *b Callable From:
5003  **
5004  *- - C++
5005  */
5006  int remove_default_light_callback(int callback_id,
5007  diguyViewLightCallback* callback);
5008 
5009  /*l
5010  *b Description:
5011  **
5012  ** This function removes a default user callback. All default light
5013  ** callbacks matching the specified callback_id and callback_user_data
5014  ** pointer will be removed.
5015  **
5016  *b Arguments:
5017  **
5018  *a callback_id - integer id of callback
5019  *a callback_user_data - pointer for user's own use
5020  **
5021  *b Callable From:
5022  **
5023  *- - C++
5024  */
5025  int remove_default_light_callback_with_user_data(int callback_id,
5026  void* callback_user_data);
5027 
5028 #endif
5029 
5030  /*l
5031  *b Description:
5032  **
5033  ** This function causes all of the scenario callbacks with the given
5034  ** callback_id to be called now.
5035  **
5036  *b Arguments:
5037  **
5038  *a callback_id - integer id of callback
5039  */
5040  void manually_invoke_callbacks_now(int callback_id);
5041 
5042  /*l
5043  *b Description:
5044  **
5045  ** This function adds a user callback script. Callback scripts can
5046  ** be removed with remove_callback_script().
5047  **
5048  ** See diguyCharacter::add_callback_script() for an example
5049  ** of use.
5050  **
5051  *b Arguments:
5052  **
5053  *a callback_id - integer id of the callback
5054  *a callback_script - Script text of callback to be added
5055  *a callback_script_type - the type of script contained in
5056  *a callback_script
5057  *a remove_on_scenario_load - if the callback is removed when a new
5058  *a scenario is loaded
5059  **
5060  ** If NULL is passed for callback_script_type, a default script type
5061  ** will be derived based on the default script interpreter of the
5062  ** scenario.
5063  **
5064  *i Lua specific:
5065  **
5066  ** When the script is called, the object for which it is being called
5067  ** will be in the callback_object global.
5068  **
5069  ** To pass NULL when calling from a lua script, use nil.
5070  **
5071  *b Returns:
5072  **
5073  ** 0 on success, -1 on failure
5074  */
5075  int add_callback_script(int callback_id,
5076  const char* callback_script,
5077  const char* callback_script_type = NULL,
5078  int remove_on_scenario_load = 1);
5079 
5080  /*l
5081  *b Description:
5082  **
5083  ** This function removes a user callback script previously added with
5084  ** add_callback_script().
5085  **
5086  ** See diguyCharacter::remove_callback_script() for an example
5087  ** of use.
5088  **
5089  *b Arguments:
5090  **
5091  *a callback_id - integer id of the callback
5092  *a callback_script - Script text of callback previously added
5093  *a callback_script_type - the type of script contained in
5094  *a callback_script
5095  **
5096  ** If NULL is passed for callback_script, all callback
5097  ** scripts whose ids match callback_id and whose types match
5098  ** callback_script_type will be removed.
5099  **
5100  ** If NULL is passed for callback_script_type, a default script type
5101  ** will be derived based on the default script interpreter of the
5102  ** scenario.
5103  **
5104  *i Lua specific:
5105  **
5106  ** To pass NULL when calling from a lua script, use nil.
5107  **
5108  *b Returns:
5109  **
5110  ** 0 on success, -1 on failure
5111  */
5112  int remove_callback_script(int callback_id,
5113  const char* callback_script,
5114  const char* callback_script_type = NULL);
5115 
5116  /*l
5117  *b Description:
5118  **
5119  ** This function adds a default character callback script.
5120  ** The callback script will be added to all new characters.
5121  ** See diguyCharacter::add_callback_script() for
5122  ** more details.
5123  **
5124  *b Returns:
5125  **
5126  ** 0 on success, -1 on failure
5127  */
5128  int add_default_character_callback_script(int callback_id,
5129  const char* callback_script,
5130  const char* callback_script_type = NULL,
5131  int add_to_existing_objects_flag = 0,
5132  int remove_on_scenario_load = 1);
5133 
5134  /*l
5135  *b Description:
5136  **
5137  ** This function removes a default character callback script.
5138  ** See diguyCharacter::remove_callback_script() for
5139  ** more details.
5140  **
5141  *b Returns:
5142  **
5143  ** 0 on success, -1 on failure
5144  */
5145  int remove_default_character_callback_script(int callback_id,
5146  const char* callback_script,
5147  const char* callback_script_type = NULL);
5148 
5149  /*l
5150  *b Description:
5151  **
5152  ** This function adds a default sensor region callback script.
5153  ** The callback script will be added to all new sensor regions.
5154  ** See diguySensorRegion::add_callback_script() for
5155  ** more details.
5156  **
5157  *b Returns:
5158  **
5159  ** 0 on success, -1 on failure
5160  */
5161  int add_default_sensor_region_callback_script(int callback_id,
5162  const char* callback_script,
5163  const char* callback_script_type = NULL,
5164  int add_to_existing_objects_flag = 0,
5165  int remove_on_scenario_load = 1);
5166 
5167  /*l
5168  *b Description:
5169  **
5170  ** This function removes a default sensor region callback script.
5171  ** See diguySensorRegion::remove_callback_script() for
5172  ** more details.
5173  **
5174  *b Returns:
5175  **
5176  ** 0 on success, -1 on failure
5177  */
5178  int remove_default_sensor_region_callback_script(int callback_id,
5179  const char* callback_script,
5180  const char* callback_script_type = NULL);
5181 
5182  /*l
5183  *b Description:
5184  **
5185  ** This function adds a default signal callback script.
5186  ** The callback script will be added to all new signals.
5187  ** See diguySignal::add_callback_script() for
5188  ** more details.
5189  **
5190  *b Returns:
5191  **
5192  ** 0 on success, -1 on failure
5193  */
5194  int add_default_signal_callback_script(int callback_id,
5195  const char* callback_script,
5196  const char* callback_script_type = NULL,
5197  int add_to_existing_objects_flag = 0,
5198  int remove_on_scenario_load = 1);
5199 
5200  /*l
5201  *b Description:
5202  **
5203  ** This function removes a default signal callback script.
5204  ** See diguySignal::remove_callback_script() for
5205  ** more details.
5206  **
5207  *b Returns:
5208  **
5209  ** 0 on success, -1 on failure
5210  */
5211  int remove_default_signal_callback_script(int callback_id,
5212  const char* callback_script,
5213  const char* callback_script_type = NULL);
5214 
5215  /*l
5216  *b Description:
5217  **
5218  ** This function adds a default variable callback script.
5219  ** The callback script will be added to all new variables.
5220  ** See diguySignal::add_callback_script() for
5221  ** more details.
5222  **
5223  *b Returns:
5224  **
5225  ** 0 on success, -1 on failure
5226  */
5227  int add_default_variable_callback_script(int callback_id,
5228  const char* callback_script,
5229  const char* callback_script_type = NULL,
5230  int add_to_existing_objects_flag = 0,
5231  int remove_on_scenario_load = 1);
5232 
5233  /*l
5234  *b Description:
5235  **
5236  ** This function removes a default variable callback script.
5237  ** See diguySignal::remove_callback_script() for
5238  ** more details.
5239  **
5240  *b Returns:
5241  **
5242  ** 0 on success, -1 on failure
5243  */
5244  int remove_default_variable_callback_script(int callback_id,
5245  const char* callback_script,
5246  const char* callback_script_type = NULL);
5247 
5248  /*l
5249  *b Description:
5250  **
5251  ** This function adds a default view callback script.
5252  ** The callback script will be added to all new views.
5253  ** See diguyView::add_callback_script() for
5254  ** more details.
5255  **
5256  *b Returns:
5257  **
5258  ** 0 on success, -1 on failure
5259  */
5260  int add_default_view_callback_script(int callback_id,
5261  const char* callback_script,
5262  const char* callback_script_type = NULL,
5263  int add_to_existing_objects_flag = 0,
5264  int remove_on_scenario_load = 1);
5265 
5266  /*l
5267  *b Description:
5268  **
5269  ** This function removes a default character view script.
5270  ** See diguyView::remove_callback_script() for
5271  ** more details.
5272  **
5273  *b Returns:
5274  **
5275  ** 0 on success, -1 on failure
5276  */
5277  int remove_default_view_callback_script(int callback_id,
5278  const char* callback_script,
5279  const char* callback_script_type = NULL);
5280 
5281  /*l
5282  *b Description:
5283  **
5284  ** This function adds a default camera callback script.
5285  ** The callback script will be added to all new cameras.
5286  ** See diguyViewCamera::add_callback_script() for
5287  ** more details.
5288  **
5289  *b Returns:
5290  **
5291  ** 0 on success, -1 on failure
5292  */
5293  int add_default_camera_callback_script(int callback_id,
5294  const char* callback_script,
5295  const char* callback_script_type = NULL,
5296  int add_to_existing_objects_flag = 0,
5297  int remove_on_scenario_load = 1);
5298 
5299  /*l
5300  *b Description:
5301  **
5302  ** This function removes a default camera callback script.
5303  ** See diguyViewCamera::remove_callback_script() for
5304  ** more details.
5305  **
5306  *b Returns:
5307  **
5308  ** 0 on success, -1 on failure
5309  */
5310  int remove_default_camera_callback_script(int callback_id,
5311  const char* callback_script,
5312  const char* callback_script_type = NULL);
5313 
5314  /*l
5315  *b Description:
5316  **
5317  ** This function adds a default fog callback script.
5318  ** The callback script will be added to all new fogs.
5319  ** See diguyViewFog::add_callback_script() for
5320  ** more details.
5321  **
5322  *b Returns:
5323  **
5324  ** 0 on success, -1 on failure
5325  */
5326  int add_default_fog_callback_script(int callback_id,
5327  const char* callback_script,
5328  const char* callback_script_type = NULL,
5329  int add_to_existing_objects_flag = 0,
5330  int remove_on_scenario_load = 1);
5331 
5332  /*l
5333  *b Description:
5334  **
5335  ** This function removes a default fog callback script.
5336  ** See diguyViewFog::remove_callback_script() for
5337  ** more details.
5338  **
5339  *b Returns:
5340  **
5341  ** 0 on success, -1 on failure
5342  */
5343  int remove_default_fog_callback_script(int callback_id,
5344  const char* callback_script,
5345  const char* callback_script_type = NULL);
5346 
5347  /*l
5348  *b Description:
5349  **
5350  ** This function adds a default light callback script.
5351  ** The callback script will be added to all new lights.
5352  ** See diguyViewLight::add_callback_script() for
5353  ** more details.
5354  **
5355  *b Returns:
5356  **
5357  ** 0 on success, -1 on failure
5358  */
5359  int add_default_light_callback_script(int callback_id,
5360  const char* callback_script,
5361  const char* callback_script_type = NULL,
5362  int add_to_existing_objects_flag = 0,
5363  int remove_on_scenario_load = 1);
5364 
5365  /*l
5366  *b Description:
5367  **
5368  ** This function removes a default light callback script.
5369  ** See diguyViewLight::remove_callback_script() for
5370  ** more details.
5371  **
5372  *b Returns:
5373  **
5374  ** 0 on success, -1 on failure
5375  */
5376  int remove_default_light_callback_script(int callback_id,
5377  const char* callback_script,
5378  const char* callback_script_type = NULL);
5379 
5380 
5381 /*****************************************************************************/
5397  /*l
5398  *b Description:
5399  **
5400  ** This function maps the event handler with the given name
5401  ** to a callback id. This mapping will be saved in the .dss
5402  ** file and restored when the .dss file is loaded.
5403  **
5404  ** Mappings can also be made via the DI-Guy Scenario UI.
5405  **
5406  ** The event handler is one of the following:
5407  **
5408  *- - a scenario callback function registered by
5409  *- diguyApp::register_scenario_event_handler() or
5410  *- diguyApp::register_scenario_event_handler_from_library()
5411  *- - a script registered by
5412  *- diguyApp::register_scenario_event_handler_script()
5413  *- - a Script, Decision, or Library Function in the scenario
5414  *- whose "Event Type" is "Scenario"
5415  **
5416  *b Arguments:
5417  **
5418  *a callback_id - integer id of callback
5419  *a handler_name - name of the event handler to map
5420  **
5421  *b Returns:
5422  **
5423  ** 0 on success, -1 on failure
5424  */
5425  int map_event_handler_to_callback_id(int callback_id,
5426  const char* handler_name);
5427 
5428  /*l
5429  *b Description:
5430  **
5431  ** This function unmaps the event handler with the given name
5432  ** from a callback id.
5433  **
5434  *b Arguments:
5435  **
5436  *a callback_id - integer id of callback
5437  *a handler_name - name of the event handler to map
5438  *a unmap_all_matches - pass 0 to unmap only the first match,
5439  *a pass 1 to unmap all matches
5440  **
5441  *b Returns:
5442  **
5443  ** 0 on success, -1 on failure
5444  */
5445  int unmap_event_handler_from_callback_id(int callback_id,
5446  const char* handler_name,
5447  int unmap_all_matches = 0);
5448 
5449  /*l
5450  *b Description:
5451  **
5452  ** This function manually invokes the named scenario event handler.
5453  ** The callback_id that will be passed to the event handler will
5454  ** be CALLBACK_ID_MANUALLY_INVOKED.
5455  **
5456  ** Note that care should be taken not to end up in an infinite loop
5457  ** of event calls. In general an event handler should not end up
5458  ** directly or indirectly invoking itself.
5459  **
5460  ** The event handler is one of the following:
5461  **
5462  *- - a scenario callback function registered by
5463  *- diguyApp::register_scenario_event_handler() or
5464  *- diguyApp::register_scenario_event_handler_from_library()
5465  *- - a script registered by
5466  *- diguyApp::register_scenario_event_handler_script()
5467  *- - a Script, Decision, or Library Function in the scenario
5468  *- whose "Event Type" is "Scenario"
5469  **
5470  *b Arguments:
5471  **
5472  *a handler_name - name of the event handler to invoke
5473  **
5474  *b Returns:
5475  **
5476  ** DIGUY_CALLBACK_CONTINUE or DIGUY_CALLBACK_STOP
5477  **
5478  *b Callable From:
5479  **
5480  *- - C++
5481  *- - Script
5482  *- - Decision
5483  */
5484  diguyCallbackReturn manually_invoke_event_handler(const char* handler_name);
5485 
5486 #ifdef CPLUSPLUS_ONLY
5487 
5488  /*l
5489  *b Description:
5490  **
5491  ** This function registers a character event handler
5492  ** function that can later be mapped via a call to
5493  ** diguyCharacter::map_event_handler_to_callback_id().
5494  **
5495  ** Call unregister_character_event_handler() to
5496  ** unregister the function.
5497  **
5498  *b Arguments:
5499  **
5500  *a handler_name - name of the event handler
5501  *a callback - pointer to handler function
5502  *a callback_user_data - pointer for user's own use; DI-Guy will
5503  *a do nothing to the contents of this pointer
5504  *a beyond passing it back when the handler
5505  *a function is called
5506  **
5507  *b Returns:
5508  **
5509  ** 0 on success, -1 on failure
5510  **
5511  *b Callable From:
5512  **
5513  *- - C++
5514  */
5515  int register_character_event_handler(const char* handler_name,
5516  diguyCharacterCallback* callback,
5517  void* callback_user_data = 0);
5518 
5519 #endif
5520 
5521  /*l
5522  *b Description:
5523  **
5524  ** This function registers a character event handler
5525  ** function that can later be mapped via a call to
5526  ** diguyCharacter::map_event_handler_to_callback_id().
5527  **
5528  ** Unlike register_character_event_handler(), which directly
5529  ** passes a function pointer, this function looks up the
5530  ** function pointer from a shared library (a .dll under
5531  ** Windows, a .so under Unix).
5532  **
5533  ** The passed library_name should not include the
5534  ** .dll or .so extension; these will be added automatically.
5535  ** This allows for cross-platform scenarios that don't
5536  ** have differing dynamic library extensions built into
5537  ** them.
5538  **
5539  ** Call unregister_character_event_handler() to
5540  ** unregister the function.
5541  **
5542  *b Arguments:
5543  **
5544  *a handler_name - name of the event handler
5545  *a library_name - pointer to handler function
5546  *a function_name - pointer to handler function
5547  *a callback_user_data - pointer for user's own use; DI-Guy will
5548  *a do nothing to the contents of this pointer
5549  *a beyond passing it back when the handler
5550  *a function is called
5551  **
5552  *b Returns:
5553  **
5554  ** 0 on success, -1 on failure
5555  */
5556  int register_character_event_handler_from_library(const char* handler_name,
5557  const char* library_name,
5558  const char* function_name,
5559  void* callback_user_data = 0);
5560 
5561  /*l
5562  *b Description:
5563  **
5564  ** This function registers a character event handler
5565  ** script that can later be mapped via a call to
5566  ** diguyCharacter::map_event_handler_to_callback_id().
5567  **
5568  ** Call unregister_character_event_handler() to
5569  ** unregister the script.
5570  **
5571  *b Arguments:
5572  **
5573  *a handler_name - name of the event handler
5574  *a handler_script - Script text
5575  *a handler_script_type - type of script; pass NULL
5576  *a for scenario to use the default
5577  *a script interpreter
5578  **
5579  *b Returns:
5580  **
5581  ** 0 on success, -1 on failure
5582  */
5583  int register_character_event_handler_script(const char* handler_name,
5584  const char* handler_script,
5585  const char* handler_script_type = 0);
5586 
5587  /*l
5588  *b Returns:
5589  **
5590  ** 1 if there is a character event handler with the given
5591  ** name, 0 if not
5592  **
5593  *b Arguments:
5594  **
5595  *a handler_name - name of the event handler
5596  */
5597  int has_registered_character_event_handler(const char* handler_name);
5598 
5599  /*l
5600  *b Description:
5601  **
5602  ** This function unregisters a character event handler.
5603  ** This will unmap the event handler from any mappings
5604  ** it is a part of.
5605  **
5606  *b Arguments:
5607  **
5608  *a handler_name - name of the event handler
5609  **
5610  *b Returns:
5611  **
5612  ** 0 on success, -1 on failure
5613  */
5614  int unregister_character_event_handler(const char* handler_name);
5615 
5616 #ifdef CPLUSPLUS_ONLY
5617 
5618  /*l
5619  *b Description:
5620  **
5621  ** This function is analogous to the
5622  ** register_character_event_handler() function,
5623  ** but is for signals rather than characters.
5624  **
5625  *b Callable From:
5626  **
5627  *- - C++
5628  */
5629  int register_signal_event_handler(const char* handler_name,
5630  diguySignalCallback* callback,
5631  void* callback_user_data = 0);
5632 
5633 #endif
5634 
5635  /*l
5636  *b Description:
5637  **
5638  ** This function is analogous to the
5639  ** register_character_event_handler_from_library() function,
5640  ** but is for signals rather than characters.
5641  */
5642  int register_signal_event_handler_from_library(const char* handler_name,
5643  const char* library_name,
5644  const char* function_name,
5645  void* callback_user_data = 0);
5646 
5647  /*l
5648  *b Description:
5649  **
5650  ** This function is analogous to the
5651  ** register_character_event_handler_script() function,
5652  ** but is for signals rather than characters.
5653  */
5654  int register_signal_event_handler_script(const char* handler_name,
5655  const char* handler_script,
5656  const char* handler_script_type = 0);
5657 
5658  /*l
5659  *b Description:
5660  **
5661  ** This function is analogous to the
5662  ** has_registered_character_event_handler() function,
5663  ** but is for signals rather than characters.
5664  */
5665  int has_registered_signal_event_handler(const char* handler_name);
5666 
5667  /*l
5668  *b Description:
5669  **
5670  ** This function is analogous to the
5671  ** unregister_character_event_handler() function,
5672  ** but is for signals rather than characters.
5673  */
5674  int unregister_signal_event_handler(const char* handler_name);
5675 
5676 #ifdef CPLUSPLUS_ONLY
5677 
5678  /*l
5679  *b Description:
5680  **
5681  ** This function is analogous to the
5682  ** register_character_event_handler() function,
5683  ** but is for sensor regions rather than characters.
5684  **
5685  *b Callable From:
5686  **
5687  *- - C++
5688  */
5689  int register_sensor_region_event_handler(const char* handler_name,
5690  diguySensorRegionCallback* callback,
5691  void* callback_user_data = 0);
5692 
5693 #endif
5694 
5695  /*l
5696  *b Description:
5697  **
5698  ** This function is analogous to the
5699  ** register_character_event_handler_from_library() function,
5700  ** but is for sensor regions rather than characters.
5701  */
5702  int register_sensor_region_event_handler_from_library(const char* handler_name,
5703  const char* library_name,
5704  const char* function_name,
5705  void* callback_user_data = 0);
5706 
5707  /*l
5708  *b Description:
5709  **
5710  ** This function is analogous to the
5711  ** register_character_event_handler_script() function,
5712  ** but is for sensor regions rather than characters.
5713  */
5714  int register_sensor_region_event_handler_script(const char* handler_name,
5715  const char* handler_script,
5716  const char* handler_script_type = 0);
5717 
5718  /*l
5719  *b Description:
5720  **
5721  ** This function is analogous to the
5722  ** has_registered_character_event_handler() function,
5723  ** but is for sensor regions rather than characters.
5724  */
5725  int has_registered_sensor_region_event_handler(const char* handler_name);
5726 
5727  /*l
5728  *b Description:
5729  **
5730  ** This function is analogous to the
5731  ** unregister_character_event_handler() function,
5732  ** but is for sensor regions rather than characters.
5733  */
5734  int unregister_sensor_region_event_handler(const char* handler_name);
5735 
5736 #ifdef CPLUSPLUS_ONLY
5737 
5738  /*l
5739  *b Description:
5740  **
5741  ** This function is analogous to the
5742  ** register_character_event_handler() function,
5743  ** but is for variables rather than characters.
5744  **
5745  *b Callable From:
5746  **
5747  *- - C++
5748  */
5749  int register_variable_event_handler(const char* handler_name,
5750  diguyVariableCallback* callback,
5751  void* callback_user_data = 0);
5752 
5753 #endif
5754 
5755  /*l
5756  *b Description:
5757  **
5758  ** This function is analogous to the
5759  ** register_character_event_handler_from_library() function,
5760  ** but is for variables rather than characters.
5761  */
5762  int register_variable_event_handler_from_library(const char* handler_name,
5763  const char* library_name,
5764  const char* function_name,
5765  void* callback_user_data = 0);
5766 
5767  /*l
5768  *b Description:
5769  **
5770  ** This function is analogous to the
5771  ** register_character_event_handler_script() function,
5772  ** but is for variables rather than characters.
5773  */
5774  int register_variable_event_handler_script(const char* handler_name,
5775  const char* handler_script,
5776  const char* handler_script_type = 0);
5777 
5778  /*l
5779  *b Description:
5780  **
5781  ** This function is analogous to the
5782  ** has_registered_character_event_handler() function,
5783  ** but is for variables rather than characters.
5784  */
5785  int has_registered_variable_event_handler(const char* handler_name);
5786 
5787  /*l
5788  *b Description:
5789  **
5790  ** This function is analogous to the
5791  ** unregister_character_event_handler() function,
5792  ** but is for variables rather than characters.
5793  */
5794  int unregister_variable_event_handler(const char* handler_name);
5795 
5796 
5797 
5798 /*****************************************************************************/
5808  /*l
5809  *b Description:
5810  **
5811  ** This function saves the current run of the scenario to the
5812  ** specified file, and other files whose names are derived from
5813  ** the passed filename. The passed filename should end with the
5814  ** extension ".dsr" (DI-Guy Review).
5815  **
5816  ** The review data can be reloaded later by calling the load()
5817  ** function, and passing the same filename.
5818  **
5819  ** The following is saved for later review:
5820  **
5821  *- - all character positions and poses
5822  *- - sounds played by characters due to play_sound() and
5823  ** fire_weapon_n_times() calls
5824  **
5825  ** Note that Paths, Waypoints, and Event Beads per se are *not* saved,
5826  ** but rather their effects on the characters' positions and poses.
5827  **
5828  *b Arguments:
5829  **
5830  *a filename - file in which to save review data
5831  **
5832  *b Returns:
5833  **
5834  ** 0 on success, -1 on failure
5835  *b C++ Example:
5836  **
5837  *e // when shutting down the current run:
5838  *e scenario->save_review_data("review0.dsr");
5839  *e
5840  *e // when after action review is needed:
5841  *e scenario->load("review0.dsr");
5842  */
5843  int save_review_data(const char* filename);
5844 
5845  /*l
5846  *b Returns:
5847  **
5848  ** 1 if scenario was loaded from review data (from a .dsr file);
5849  ** 0 if not (from a .dss file)
5850  */
5851  int get_loaded_from_review_data();
5852 
5853  /*l
5854  *b Description:
5855  **
5856  ** This function sets what type of "history" will be kept for the
5857  ** scenario.
5858  **
5859  ** If time is run backwards in a scenario with history,
5860  ** the following will be "remembered" and replayed:
5861  **
5862  *- - camera settings currently in the primary view's camera
5863  *- - signal trigger counts
5864  *- - enabled/disabled status of scene objects
5865  *- - sounds
5866  **
5867  ** The default is DIGUY_HISTORY_TYPE_NONE for scenarios created
5868  ** using the DI-Guy API, and DIGUY_HISTORY_TYPE_COMPLETE for scenarios
5869  ** created using the DI-Guy Scenario editor.
5870  **
5871  *b Arguments:
5872  **
5873  *a history_type - history type to be used for the scenario
5874  **
5875  ** history_type should be one of the following values:
5876  **
5877  *i DIGUY_HISTORY_TYPE_NONE
5878  **
5879  ** This history type saves no history.
5880  **
5881  *i DIGUY_HISTORY_TYPE_COMPLETE
5882  **
5883  ** This history type saves a complete history.
5884  **
5885  ** DIGUY_HISTORY_TYPE_LAST and DIGUY_HISTORY_TYPE_FIRST are not
5886  ** supported for scenario history.
5887  **
5888  *b Returns:
5889  **
5890  ** 0 on success, -1 on failure
5891  */
5892  int set_history_type(diguyHistoryType history_type);
5893 
5894  /*l
5895  *b Returns:
5896  **
5897  ** the current history type of the scenario; see
5898  ** set_history_type()
5899  */
5900  diguyHistoryType get_history_type();
5901 
5902  /*l
5903  *b Description:
5904  **
5905  ** This function sets the history type for this scenario, as well as
5906  ** the history types of all characters.
5907  **
5908  ** See also diguyScenario::set_history_type() and
5909  ** diguyCharacter::set_history_type().
5910  **
5911  *b Arguments:
5912  **
5913  *a history_type - history type to be used for the scenario and all
5914  *a characters
5915  */
5916  void set_overall_history_type(diguyHistoryType overall_history_type);
5917 
5918  /*l
5919  *b Description:
5920  **
5921  ** This function returns the overall history type of the scenario.
5922  **
5923  ** The return value will be:
5924  **
5925  *- - DIGUY_HISTORY_TYPE_COMPLETE if history is enabled for the
5926  *- scenario and *all* characters
5927  *- - DIGUY_HISTORY_TYPE_PARTIAL if history is enabled for at least
5928  *- one of the scenario or any character, but not all
5929  *- - DIGUY_HISTORY_TYPE_NONE if history is not enabled for the
5930  *- scenario or any character
5931  **
5932  ** See also diguyScenario::get_history_type() and
5933  ** diguyCharacter::get_history_type().
5934  */
5935  diguyHistoryType get_overall_history_type();
5936 
5937  /*l
5938  *b Returns:
5939  **
5940  ** whether the scenario is playing back stored history
5941  */
5942  int get_replaying_history();
5943 
5944  /*l
5945  *b Description:
5946  **
5947  ** This function sets how many sound instances are kept in memory when
5948  ** history is enabled. By keeping them in memory, users can "scrub"
5949  ** backwards in time and hear sounds that were started earlier in time
5950  ** and will be resumed at the proper offset into the sound. This
5951  ** function lets users balance that need with memory management.
5952  **
5953  *b Arguments:
5954  **
5955  *a num_sound_instances - override system default of 100
5956  **
5957  *b Returns:
5958  **
5959  ** none
5960  */
5961  void set_history_max_sound_instances(int num_sound_instances);
5962 
5963 
5964 /*****************************************************************************/
5974  /*l
5975  *b Description:
5976  **
5977  ** This function sets whether automatic graphics LOD switching
5978  ** should be enabled for certain graphics environments (see below).
5979  **
5980  ** By default it is enabled.
5981  **
5982  ** There are two ways that DI-Guy calculates the proper
5983  ** graphics LOD. For some graphics environments the calculation
5984  ** is done "manually", using data from a diguyViewCamera.
5985  ** In other environments the calculation is done by the graphics
5986  ** environment itself. The method used in each graphics
5987  ** environment is noted below.
5988  **
5989  *i OpenGL Version:
5990  **
5991  ** This function enables or disables automatic LOD switching.
5992  ** In this graphics environment LOD calculations are done by
5993  ** the renderer; information from the diguyViewCamera is not
5994  ** used.
5995  **
5996  *i DI-Guy Graphics API Version:
5997  **
5998  ** This function enables or disables automatic LOD switching.
5999  ** In this graphics environment LOD calculations are done by
6000  ** the renderer; information from the diguyViewCamera is not
6001  ** used.
6002  */
6003  void set_automatic_graphics_lod_switching(int enable_graphics_lod_switching);
6004 
6006  int get_automatic_graphics_lod_switching();
6007 
6010  int set_character_culling_distance(float dist);
6011 
6013  float get_character_culling_distance();
6014 
6018  void set_cull_bounds_scale_factor(float size);
6019 
6021  float get_cull_bounds_scale_factor();
6022 
6023 
6026  int set_vehicle_culling_distance(float dist);
6027 
6029  float get_vehicle_culling_distance();
6030 
6033  int set_prop_culling_distance(float dist);
6035  float get_prop_culling_distance();
6036 
6037  /*l
6038  *b Description:
6039  **
6040  ** Turns on instancing system. This can yield much faster rendering, but can make
6041  ** rendering pipeline much more complex. This value is initially
6042  ** set by use_shader_instancing in the diguy graphics init structure.
6043  */
6044  void set_instancing_enabled(int val);
6045 
6047  int get_instancing_enabled() const;
6048 
6049  /*l
6050  *b Description:
6051  **
6052  ** Sets the minimum LOD that the instancing system turns on this defaults to LOD 4.
6053  */
6054  void set_instancing_min_lod(int val);
6055 
6057  int get_instancing_min_lod() const;
6058 
6060  void set_visualize_instance_groups(int val);
6061 
6063  int get_visualize_instance_groups() const;
6064 
6065  /*l
6066  *b Description:
6067  ** For scene graph renderers, it can be necessary to patch the texture buffer object after
6068  ** the scene graph finishes updating various post processes (ground clamping for instance),
6069  ** or modifying the TBO with a local space camera. This function lets DI-Guy knows to keep
6070  ** track of TBO shape index data, and not fill out the positions in the TBO data.
6071  **
6072  ** This function allows the end user to set the matrix in the TBO for each shape
6073  ** the character has. It requires diguyCharacter::set_final_tbo_position_matrix() is called
6074  ** after build_instance_groups() and before update_instancing_data()
6075  */
6076  void set_instancing_tbo_patching_enabled(int enable_patching);
6077  int get_instancing_tbo_patching_enabled() const;
6078 
6082  void set_instancing_position_callback_enabled(int use_user_position_matrices);
6083  int get_instancing_position_callback_enabled() const;
6084 
6091  void set_num_extra_per_instance_data_floats(int number);
6092  int get_num_extra_per_instance_data_floats() const;
6093 
6095  void build_instance_groups();
6096 
6099  void update_instancing_data();
6100 
6102  void get_tbo_instance_data(int & num_floats, const float*& data);
6103 
6104 #ifdef CPLUSPLUS_ONLY
6105 
6106  /*l
6107  *b Description:
6108  **
6109  ** Sets the distances at which level of detail switching occurs
6110  ** for characters of the specified type. Existing characters
6111  ** are not affected; only newly created characters will have the
6112  ** specified LOD switching ranges.
6113  **
6114  ** Characters will display with the highest level of detail when
6115  ** viewed from a distance between ranges[0] and ranges[1].
6116  ** Characters will not display at all when viewed from further
6117  ** away than the highest switching range.
6118  **
6119  ** Note: ranges[0] should almost always be 0.0.
6120  **
6121  *b Arguments:
6122  **
6123  *a character_type - character type name, as returned by
6124  *a get_character_type_at_index()
6125  *a ranges - an array of 8 non-negative floating point numbers,
6126  *a each larger than the one before, specifying the
6127  *a LOD switching ranges in meters
6128  **
6129  ** Pass "all" for character_type to set the default ranges of all
6130  ** character types.
6131  **
6132  ** The table below indicates the number of polygons for one of the
6133  ** default soldier models in each level of detail, and the LOD
6134  ** switching ranges in effect before this function is called.
6135  **
6136  *e lod polys min max
6137  *e --------------------------
6138  *e 1 2300 0 5
6139  *e 2 900 5 10
6140  *e 3 550 10 20
6141  *e 4 280 20 40
6142  *e 5 130 40 70
6143  *e 6 60 70 100
6144  *e 7 40 100 1000
6145  **
6146  *b Callable From:
6147  **
6148  *- - C++
6149  */
6150  void set_default_lod_ranges(const char* character_type, float* ranges);
6151 
6152 #endif
6153 
6154  /*l
6155  *b Description:
6156  **
6157  ** This function sets whether view and camera settings such as
6158  ** field-of-view (FOV) and window size should be taken into account
6159  ** when determining the graphics LOD from a character's LOD ranges.
6160  **
6161  ** The camera settings that are used are taken from the current
6162  ** render camera, as set by set_render_camera(). This happens
6163  ** automatically in DI-Guy Scenario, but must be set manually
6164  ** in the DI-Guy SDK.
6165  **
6166  ** DI-Guy graphics LODs are distance-based, but this approach can
6167  ** be problematic if the current camera's FOV is very narrow; a
6168  ** narrow FOV essentially acts like a telephoto lens. In this case
6169  ** a character that is far away, and would therefore be rendered
6170  ** with few polygons, can actually be quite large in the 3D view.
6171  **
6172  ** Setting this flag to 1 will cause the FOV to be taken into account
6173  ** when calculating the effective distance of a character from the
6174  ** camera.
6175  **
6176  ** Many DI-Guy LOD distances assume that the vertical FOV of the
6177  ** view is around 40. Smaller FOVs will scale the distances larger
6178  ** so that LOD changes happen further out. Likewise larger FOVs
6179  ** will scale the distances smaller; in this case even nearby
6180  ** characters will appear small and therefore need less resolution.
6181  **
6182  *b Arguments:
6183  **
6184  ** do_scale - pass 1 to enable scaling, 0 to disable
6185  */
6186  void set_scale_graphics_lod_ranges_from_view_settings(int do_scale);
6187 
6188  /*l
6189  *b Returns:
6190  **
6191  ** most recent setting of
6192  ** set_scale_graphics_lod_ranges_from_view_settings()
6193  */
6194  int get_scale_graphics_lod_ranges_from_view_settings();
6195 
6196  /*l
6197  *b Description:
6198  **
6199  ** This function sets whether automatic motion LOD switching
6200  ** should be enabled.
6201  **
6202  ** By default it is enabled in DI-Guy Scenario, and disabled in a
6203  ** DI-Guy API application.
6204  **
6205  ** When running in a user application that uses the DI-Guy
6206  ** API, the primary view's camera's position and orientation
6207  ** must be kept consistent with the application's perception
6208  ** of current camera settings. A pointer to the primary view's
6209  ** camera can be obtained by calling get_scenario_camera().
6210  **
6211  ** The following describes the algorithm used by automatic motion
6212  ** LOD switching:
6213  **
6214  *- - if a character is in front of the primary view's camera,
6215  *- the motion LOD is set to 1 (animate all joints)
6216  *- - else set motion LOD to 5 (stop animating everything but
6217  *- base position)
6218  **
6219  ** Note that if there are multiple views open on the scenario,
6220  ** the character must be behind *all* cameras for the motion
6221  ** LOD to be set to 5.
6222  **
6223  ** Also, if the history type of the character (as set by
6224  ** diguyCharacter::set_history_type()) is anything but
6225  ** DIGUY_HISTORY_TYPE_NONE, motion LOD 1 will be used since
6226  ** during scenario playback the character might be in front
6227  ** of any camera.
6228  */
6229  void set_automatic_motion_lod_switching(int enable_motion_lod_switching);
6230 
6231  /*l
6232  *b Description:
6233  **
6234  ** This function returns whether automatic motion LOD switching
6235  ** is be enabled for characters in the scenario, as set by
6236  ** set_automatic_motion_lod_switching().
6237  **
6238  *b Returns:
6239  **
6240  ** 1 if LODs enabled; 0 if not
6241  */
6242  int get_automatic_motion_lod_switching();
6243 
6244 
6245 /*****************************************************************************/
6255  /*l
6256  *b Description:
6257  **
6258  ** This function sends the passed string through the script
6259  ** interpreter.
6260  **
6261  *b Arguments:
6262  **
6263  *a script_text - string to be evaluated
6264  *a save_as_transient - flag stating whether script_text should
6265  *a be remembered as a transient event at
6266  *a the current scenario t; see
6267  *a push_transient_script_event()
6268  *a script_type - type of script contained in script_text; pass
6269  *a NULL to use scenario's default interpreter
6270  *a script_source - string identifying the 'source' of the script;
6271  *a will be printed in error output if there are
6272  *a syntax errors in the script
6273  **
6274  *b Returns:
6275  **
6276  ** 0 on success, -1 on failure
6277  **
6278  *b C++ Example:
6279  **
6280  *e scenario->eval_script("signal1:trigger();",
6281  *e 0,
6282  *e "lua",
6283  *e "User Script");
6284  */
6285  int eval_script(const char* script_text,
6286  int save_as_transient = 0,
6287  const char* script_type = NULL,
6288  const char* script_source = NULL);
6289 
6290  /*l
6291  *b Description:
6292  **
6293  ** This function sends the contents of the specified file through
6294  ** the script interpreter.
6295  **
6296  *b Arguments:
6297  **
6298  *a filename - filename of script to be evaluated
6299  *a script_type - type of script contained in file; pass NULL
6300  *a to use the scenario's default interpreter
6301  **
6302  *b Returns:
6303  **
6304  ** 0 on success, -1 on failure
6305  **
6306  *b C++ Example:
6307  **
6308  *e scenario->eval_script_file("my_scripts.pl");
6309  */
6310  int eval_script_file(const char* filename,
6311  const char* script_type = NULL);
6312 
6313  /*l
6314  *b Description:
6315  **
6316  ** This function manually triggers a script.
6317  **
6318  *b Arguments:
6319  **
6320  *a script_name - name of the script to be triggered
6321  **
6322  *b Returns:
6323  **
6324  ** return result of script; 0 if script not found
6325  **
6326  *b Callable From:
6327  **
6328  *- - C++
6329  *- - Script
6330  *- - Decision
6331  */
6332  int trigger_script(const char* script_name);
6333 
6334  /*l
6335  *b Description:
6336  **
6337  ** This function is similar to trigger_script(), but delays the
6338  ** trigger by the specified time.
6339  **
6340  *b Arguments:
6341  **
6342  *a script_name - name of the script to be triggered
6343  *a t_delay - how many seconds to delay trigger
6344  **
6345  *b Callable From:
6346  **
6347  *- - C++
6348  *- - Script
6349  *- - Decision
6350  */
6351  void trigger_script_delayed(const char* script_name, float t_delay);
6352 
6353  /*l
6354  *b Description:
6355  **
6356  ** This function manually triggers a decision.
6357  **
6358  *b Arguments:
6359  **
6360  *a decision_name - name of the decision to be triggered
6361  **
6362  *b Returns:
6363  **
6364  ** return result of decision; 0 if decision not found
6365  **
6366  *b Callable From:
6367  **
6368  *- - C++
6369  *- - Script
6370  *- - Decision
6371  */
6372  int trigger_decision(const char* decision_name);
6373 
6374  /*l
6375  *b Description:
6376  **
6377  ** This function is similar to trigger_decision(), but delays the
6378  ** trigger by the specified time.
6379  **
6380  *b Arguments:
6381  **
6382  *a decision_name - name of the decision to be triggered
6383  *a t_delay - how many seconds to delay trigger
6384  **
6385  *b Callable From:
6386  **
6387  *- - C++
6388  *- - Script
6389  *- - Decision
6390  */
6391  void trigger_decision_delayed(const char* decision_name, float t_delay);
6392 
6393  /*l
6394  *b Description:
6395  **
6396  ** This function places the passed script text on a list of scripts
6397  ** that should be re-evaluated when the scenario is replayed from
6398  ** review data.
6399  **
6400  ** Note that the script is *not* evaluated at this time. This can be
6401  ** done by calling eval_script() and passing 1 for the
6402  ** save_as_transient argument.
6403  **
6404  ** If the scenario is reset (as in a call to reset()), all transient
6405  ** scripts will be deleted. The transient script events can be saved
6406  ** and restored by calling save_transient_script_events() and
6407  ** load_transient_script_events(), respectively.
6408  **
6409  *b Arguments:
6410  **
6411  *a t - time at which script should be re-evaluated
6412  *a during scenario playback
6413  *a script_text - Script to be evaluated
6414  *a script_type - Scripting language to use (lua)
6415  **
6416  ** A copy of the passed script text is made.
6417  **
6418  *b Returns:
6419  **
6420  ** 0 on success, -1 on failure
6421  */
6422  void push_transient_script_event(float t, const char* script_text, const char* script_type);
6423 
6424  /*l
6425  *b Description:
6426  **
6427  ** This function deletes all transient script events.
6428  */
6429  void clear_transient_script_events();
6430 
6431  /*l
6432  *b Description:
6433  **
6434  ** This function saves the transient script events to the specified
6435  ** file. They can be restored by calling
6436  ** load_transient_script_events() with the same filename.
6437  **
6438  *b Arguments:
6439  **
6440  *a filename - file in which transient script events should be saved
6441  **
6442  *b Returns:
6443  **
6444  ** 0 on success, -1 on failure
6445  */
6446  int save_transient_script_events(const char* filename);
6447 
6448  /*l
6449  *b Description:
6450  **
6451  ** This function loads transient script events saved by a call to
6452  ** save_transient_script_events().
6453  **
6454  *b Arguments:
6455  **
6456  *a filename - file from which transient script events should be
6457  *a loaded
6458  **
6459  *b Returns:
6460  **
6461  ** 0 on success, -1 on failure
6462  */
6463  int load_transient_script_events(const char* filename);
6464 
6465  /*l
6466  *b Description:
6467  **
6468  ** This function creates a package object that points to an external
6469  ** file. If the language is not specified it will be determined based
6470  ** on the filename's extension. DI-Guy will attempt to derive an
6471  ** appropriate name for the package. In DI-Guy Scenario package
6472  ** dependencies are also extracted and loaded; currently this must be
6473  ** done manually in the SDK.
6474  */
6475  int load_package( const char* filename, const char* language = NULL,
6476  int warn_if_not_found = 1 );
6477 
6478  /*l
6479  *b Description:
6480  **
6481  ** This function creates a package object that points to an external
6482  ** file. If the language is not specified it will be determined based
6483  ** on the filename's extension. DI-Guy will attempt to derive an
6484  ** appropriate name for the package. Dependency package will also be loaded.
6485  **
6486  */
6487  int load_package_with_dependency( const char* filename, const char* depends_on_package,
6488  const char* language = NULL, int warn_if_not_found = 1 );
6489 
6490 
6491 /*****************************************************************************/
6501  /*l
6502  *b Description:
6503  **
6504  ** This function returns the number of postures the specified
6505  ** character type's actions support.
6506  **
6507  ** Use this function along with get_character_type_posture_at_index()
6508  ** to enumerate the character's postures.
6509  **
6510  *b Arguments:
6511  **
6512  *a character_type - character type name, as returned by
6513  *a get_character_type_at_index(), for example
6514  **
6515  *b Returns:
6516  **
6517  ** the number of postures the specified character type's actions
6518  ** support
6519  */
6520  int get_character_type_num_postures(const char* character_type);
6521 
6522  /*l
6523  *b Description:
6524  **
6525  ** This function returns the posture at the specified index.
6526  **
6527  ** Use this function along with get_character_type_num_postures()
6528  ** to enumerate the character's postures.
6529  **
6530  *b Arguments:
6531  **
6532  *a character_type - character type name, as returned by
6533  *a get_character_type_at_index(), for example
6534  *a index - index of the posture; indices start at 0
6535  **
6536  *b Returns:
6537  **
6538  ** the posture at the specified index
6539  */
6540  diguyMotionPosture get_character_type_posture_at_index(const char* character_type,
6541  int index);
6542 
6543  /*l
6544  *b Description:
6545  **
6546  ** This function returns the overall posture of the specified action.
6547  **
6548  ** The results of this function call can be useful in calls to the
6549  ** diguyCharacter::get_action_from_description() function, if
6550  ** for example an action with the same posture but a faster speed
6551  ** is desired.
6552  **
6553  *b Arguments:
6554  **
6555  *a character_type - character type name, as returned by
6556  *a get_character_type_at_index(), for example
6557  *a action_name - the action to query
6558  **
6559  *b Returns:
6560  **
6561  ** the overall posture of the specified action
6562  */
6563  diguyMotionPosture get_character_type_action_posture(const char* character_type,
6564  const char* action_name);
6565 
6566  /*l
6567  *b Description:
6568  **
6569  ** This function returns the number of variants the specified
6570  ** character type's actions support.
6571  **
6572  ** Use this function along with get_character_type_variant_at_index()
6573  ** to enumerate the character's variants.
6574  **
6575  ** This function differs from
6576  ** get_character_type_action_num_variants() in that this function
6577  ** returns the number of variants of *all* actions of the
6578  ** character. The other function returns the number of variants
6579  ** of a single action.
6580  **
6581  *b Arguments:
6582  **
6583  *a character_type - character type name, as returned by
6584  *a get_character_type_at_index(), for example
6585  **
6586  *b Returns:
6587  **
6588  ** the number of variants the specified character type's actions
6589  ** support
6590  */
6591  int get_character_type_num_variants(const char* character_type);
6592 
6593  /*l
6594  *b Description:
6595  **
6596  ** This function returns the variant at the specified index.
6597  **
6598  ** Use this function along with get_character_type_num_variants()
6599  ** to enumerate the character's variants.
6600  **
6601  ** This function differs from
6602  ** get_character_type_action_variant_at_index() in that this function
6603  ** returns one of the variants of *all* actions of the
6604  ** character. The other function returns one of the 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  *a index - index of the posture; indices start at 0
6612  **
6613  *b Returns:
6614  **
6615  ** the variant at the specified index
6616  */
6617  diguyMotionVariant get_character_type_variant_at_index(const char* character_type,
6618  int index);
6619 
6620  /*l
6621  *b Description:
6622  **
6623  ** This function returns the primary variant of the specified action.
6624  **
6625  *b Arguments:
6626  **
6627  *a character_type - character type name, as returned by
6628  *a get_character_type_at_index(), for example
6629  *a action_name - the action to query
6630  **
6631  *b Returns:
6632  **
6633  ** the overall variant of the specified action
6634  */
6635  diguyMotionVariant get_character_type_action_primary_variant(const char* character_type,
6636  const char* action_name);
6637 
6638  /*l
6639  *b Description:
6640  **
6641  ** This function returns the number of variants the specified
6642  ** action of the specified character type has.
6643  **
6644  ** Use this function along with
6645  ** get_character_type_action_variant_at_index()
6646  ** to enumerate the character's variants.
6647  **
6648  ** This function differs from
6649  ** get_character_type_num_variants() in that this function
6650  ** returns the number of variants of a single action of the
6651  ** character. The other function returns the number of variants
6652  ** of *all* actions.
6653  **
6654  *b Arguments:
6655  **
6656  *a character_type - character type name, as returned by
6657  *a get_character_type_at_index(), for example
6658  *a action_name - the action to query
6659  **
6660  *b Returns:
6661  **
6662  ** the number of variants of the specified action of the specified
6663  ** character type
6664  */
6665  int get_character_type_action_num_variants(const char* character_type,
6666  const char* action_name);
6667 
6668  /*l
6669  *b Description:
6670  **
6671  ** This function returns the variant at the specified index.
6672  **
6673  ** Use this function along with
6674  ** get_character_type_action_num_variants()
6675  ** to enumerate the character's variants.
6676  **
6677  ** This function differs from
6678  ** get_character_type_variant_at_index() in that this function
6679  ** returns one of the variants of a single action of the
6680  ** character. The other function returns one of the variants
6681  ** of *all* actions.
6682  **
6683  *b Arguments:
6684  **
6685  *a character_type - character type name, as returned by
6686  *a get_character_type_at_index(), for example
6687  *a index - index of the variant; indices start at 0
6688  **
6689  *b Returns:
6690  **
6691  ** the variant at the specified index
6692  */
6693  diguyMotionVariant get_character_type_action_variant_at_index(const char* character_type,
6694  const char* action_name,
6695  int index);
6696 
6697  /*l
6698  *b Description:
6699  **
6700  ** This function returns the number of action compatibility names the specified
6701  ** action of the specified character type has.
6702  **
6703  ** Use this function along with get_character_type_action_compatibility_name_at_index()
6704  ** to enumerate the character's compatible action names.
6705  **
6706  *b Arguments:
6707  **
6708  *a character_type - character type name, as returned by get_character_type_at_index(), for example
6709  *a action_name - the action to query
6710  **
6711  *b Returns:
6712  **
6713  ** the number of compatible action names for the specified action of the specified character type
6714  */
6715  int get_character_type_num_action_compatibility_names( const char* character_type, const char* action_name );
6716 
6717  /*l
6718  *b Description:
6719  **
6720  ** This function returns the action compatibility name at the specified index.
6721  **
6722  ** Use this function along with get_character_type_num_action_compatibility_names()
6723  ** to enumerate the character's compatible action names.
6724  **
6725  *b Arguments:
6726  **
6727  *a character_type - character type name, as returned by get_character_type_at_index(), for example
6728  *a index - index of the action; indices start at 0
6729  **
6730  *b Returns:
6731  **
6732  ** the action compatibility name at the specified index
6733  */
6734  const char* get_character_type_action_compatibility_name_at_index( const char* character_type,
6735  const char* action_name, int index );
6736 
6737  /*l
6738  *b Description:
6739  **
6740  ** This function returns the number of directions the specified
6741  ** character type's actions can move.
6742  **
6743  ** Use the get_character_type_direction_at_index() function to
6744  ** enumerate the directions available to a character.
6745  **
6746  ** The results of this function call can be useful in calls to the
6747  ** diguyCharacter::get_action_from_description() function.
6748  **
6749  *b Arguments:
6750  **
6751  *a character_type - character type name, as returned by
6752  *a get_character_type_at_index(), for example
6753  **
6754  *b Returns:
6755  **
6756  ** the number of directions the specified character type's actions
6757  ** can move
6758  */
6759  int get_character_type_num_directions(const char* character_type);
6760 
6761  /*l
6762  *b Description:
6763  **
6764  ** Use the get_character_type_num_directions() function to
6765  ** get the number of directions available to a character.
6766  **
6767  ** The results of this function call can be useful in calls to the
6768  ** diguyCharacter::get_action_from_description() function.
6769  **
6770  *b Arguments:
6771  **
6772  *a character_type - character type name, as returned by
6773  *a get_character_type_at_index(), for example
6774  *a index - index of the direction; indices start at 0
6775  **
6776  *b Returns:
6777  **
6778  ** the direction at the specified index
6779  */
6780  diguyMotionDirection get_character_type_direction_at_index(const char* character_type,
6781  int index);
6782 
6783 
6784 /*****************************************************************************/
6810  /*l
6811  *b Returns:
6812  **
6813  ** number of interaction machines in the scenario
6814  */
6815  int get_num_interaction_machines();
6816 
6817  /*l
6818  *b Description:
6819  **
6820  ** This function creates a new interaction machine and returns a
6821  ** pointer to it.
6822  **
6823  ** Note that there is a shared interaction machine that always
6824  ** exists; a pointer to it can be obtained by calling
6825  ** get_shared_interaction_machine(). See that function for more
6826  ** details.
6827  **
6828  *b Arguments:
6829  **
6830  *a name - name of the new interaction machine
6831  **
6832  *b Returns:
6833  **
6834  ** pointer of type diguyInteractionMachine; NULL if creation failed
6835  */
6836  diguyInteractionMachine* create_interaction_machine(const char* name);
6837 
6838  /*l
6839  *b Description:
6840  **
6841  ** This function destroys the passed interaction machine.
6842  **
6843  ** NOTE: This function should not be called on the shared
6844  ** interaction machine returned by get_shared_interaction_machine().
6845  **
6846  *b Arguments:
6847  **
6848  *a interaction_machine - pointer to a diguyInteractionMachine
6849  *a to be destroyed
6850  */
6851  void destroy_interaction_machine(diguyInteractionMachine* interaction_machine);
6852 
6853  /*l
6854  *b Returns:
6855  **
6856  ** pointer of type diguyInteractionMachine; NULL if no interaction
6857  ** machine at the specified index
6858  **
6859  *b Arguments:
6860  **
6861  *a index - index of the interaction machine; indices start at 0
6862  */
6863  diguyInteractionMachine* get_interaction_machine_at_index(int index);
6864 
6865  /*l
6866  *b Description:
6867  **
6868  ** This function returns a pointer to the specified interaction
6869  ** machine.
6870  **
6871  *b Arguments:
6872  **
6873  *a name - name of interaction machine to be found
6874  **
6875  *b Returns:
6876  **
6877  ** pointer of type diguyInteractionMachine; NULL if not found
6878  */
6879  diguyInteractionMachine* find_interaction_machine(const char* name);
6880 
6881  /*l
6882  *b Description:
6883  **
6884  ** This function returns a pointer to the "active" interaction
6885  ** machine. Only one interaction machine can be showing and
6886  ** accepting input at a time.
6887  **
6888  *b Returns:
6889  **
6890  ** pointer of type diguyInteractionMachine; NULL if no interaction
6891  ** machine is active.
6892  */
6893  diguyInteractionMachine* get_active_interaction_machine();
6894 
6895  /*l
6896  *b Description:
6897  **
6898  ** This function returns a pointer to the shared interaction machine
6899  ** that is always available.
6900  **
6901  ** This shared interaction machine is convenient for quick
6902  ** alerts, notifications, or questions. Because it is shared,
6903  ** however, most or all of its parameters need to be set each
6904  ** time it is to be shown.
6905  **
6906  ** Do not call destroy_interaction_machine() on the returned
6907  ** object. It is owned by the scenario.
6908  **
6909  *b Returns:
6910  **
6911  ** pointer of type diguyInteractionMachine; should never be NULL
6912  */
6913  diguyInteractionMachine* get_shared_interaction_machine();
6914 
6915  /*l
6916  *b Description:
6917  **
6918  ** This is a convenience function for using the shared interaction
6919  ** machine to show a notification to the user. It sets parameters
6920  ** of the shared interaction machine based on the passed info and
6921  ** shows/activates the machine.
6922  **
6923  *b Arguments:
6924  **
6925  *a heading - text that will be at the top of the dialog
6926  *a info - informational text
6927  *a pause_scenario - pass 1 to pause the scenario while the
6928  *a interaction machine is active, 0 to leave
6929  *a the scenario running if it was when this
6930  *a function was called
6931  *a input_text - text that user will have to click to dismiss
6932  *a the interaction machine; something like "Ok"
6933  *a is typical
6934  *a ui_appearance - the color theme of the interaction machine
6935  **
6936  ** See the diguyInteractionMachine documentation for more information
6937  ** on what the various parameters mean.
6938  **
6939  *b Returns:
6940  **
6941  ** 0 on success, -1 on failure
6942  **
6943  *b Lua Example:
6944  **
6945  *e this_scenario:show_notification_with_shared_interaction_machine(
6946  *e "WARNING!",
6947  *e "Moving any closer to the harmful gas is not advised.",
6948  *e 0,
6949  *e "Ok",
6950  *e diguyInteractionMachine_UI_APPEARANCE_NOTIFICATION);
6951  **
6952  */
6953  int show_notification_with_shared_interaction_machine(const char* heading,
6954  const char* info,
6955  int pause_scenario = 0,
6956  const char* input_text = NULL,
6958 
6959 
6960 /*****************************************************************************/
6970  /*l
6971  *b Description:
6972  **
6973  ** This function returns a pointer to the I-Guy controller object
6974  ** of the scenario.
6975  **
6976  *b Returns:
6977  **
6978  ** pointer of type diguyIGuyController; should never be NULL
6979  */
6980  diguyIGuyController* get_iguy_controller();
6981 
6982 
6983 /*****************************************************************************/
6993  /*l
6994  *b Description:
6995  **
6996  ** This function finds the diguyViewLabel with the given name or
6997  ** creates it if it doesn't exist.
6998  **
6999  *b Arguments:
7000  **
7001  *a name - name of the diguyViewLabel to find or create
7002  **
7003  *b Returns:
7004  **
7005  ** pointer of type diguyViewLabel; should never be NULL
7006  */
7007  diguyViewLabel* find_or_create_label(const char* name);
7008 
7009  /*l
7010  *b Description:
7011  **
7012  ** This function returns a pointer to the specified diguyViewLabel.
7013  **
7014  *b Arguments:
7015  **
7016  *a name - name of diguyViewLabel to be found
7017  **
7018  *b Returns:
7019  **
7020  ** pointer of type diguyViewLabel; NULL if not found
7021  */
7022  diguyViewLabel* find_label(const char* name);
7023 
7024  /*l
7025  *b Description:
7026  **
7027  ** This function destroys the passed in diguyViewLabel.
7028  **
7029  *b Arguments:
7030  **
7031  *a label - pointer to a diguyViewLabel
7032  **
7033  *b Returns:
7034  **
7035  ** 0 on success, -1 on failure
7036  */
7037  int destroy_label(diguyViewLabel* label);
7038 
7039  /*l
7040  *b Returns:
7041  **
7042  ** The number of diguyViewLabel objects in the scenario.
7043  */
7044  int get_num_labels();
7045 
7046  /*l
7047  *b Returns:
7048  **
7049  ** The diguyViewLabel at the given index.
7050  **
7051  *b Arguments:
7052  **
7053  *a index - index of the diguyViewLabel; indices start at 0
7054  */
7055  diguyViewLabel* get_label_at_index(int index);
7056 
7057  /*l
7058  *b Description:
7059  **
7060  ** This function removes all diguyViewLabels in the scenario.
7061  */
7062  void reset_labels();
7063 
7064  /*l
7065  *b Description:
7066  **
7067  ** This function moves the specified diguyViewLabel to the front of
7068  ** the drawing list. This is sometimes necessary if labels overlap.
7069  **
7070  *b Arguments:
7071  **
7072  *a label - pointer to diguyViewLabel to move
7073  */
7074  void send_label_to_front(diguyViewLabel* label);
7075 
7076  /*l
7077  *b Description:
7078  **
7079  ** This function moves the specified diguyViewLabel to the back of
7080  ** the drawing list. This is sometimes necessary if labels overlap.
7081  **
7082  *b Arguments:
7083  **
7084  *a label - pointer to diguyViewLabel to move
7085  */
7086  void send_label_to_back(diguyViewLabel* label);
7087 
7088  /*l
7089  *b Description:
7090  **
7091  ** Functions that allow the built-in OGL renderer to draw labels on screen for
7092  ** debugging use, update_character_labels must be called first.
7093  **
7094  *e scenario->update_character_labels();
7095  *e scenario->draw_character_labels();
7096  **
7097  *b Returns:
7098  **
7099  ** -1 if not possible to draw labels
7100  */
7101  int draw_character_labels();
7102 
7104  void update_character_labels();
7105 
7106 /*****************************************************************************/
7116  /*l
7117  *b Description:
7118  **
7119  ** This function finds the diguyViewButtonPanel with the given name or
7120  ** creates it if it doesn't exist.
7121  **
7122  *b Arguments:
7123  **
7124  *a name - name of the diguyViewButtonPanel to find or create
7125  **
7126  *b Returns:
7127  **
7128  ** pointer of type diguyViewButtonPanel; should never be NULL
7129  */
7130  diguyViewButtonPanel* find_or_create_panel(const char* name,
7131  int horizontal = 0,
7132  int title = 1);
7133 
7134  /*l
7135  *b Description:
7136  **
7137  ** This function returns a pointer to the specified
7138  ** diguyViewButtonPanel.
7139  **
7140  *b Arguments:
7141  **
7142  *a name - name of diguyViewButtonPanel to be found
7143  **
7144  *b Returns:
7145  **
7146  ** pointer of type diguyViewButtonPanel; NULL if not found
7147  */
7148  diguyViewButtonPanel* find_panel(const char* name);
7149 
7150  /*l
7151  *b Description:
7152  **
7153  ** This function destroys the passed in diguyViewButtonPanel.
7154  **
7155  *b Arguments:
7156  **
7157  *a panel - pointer to a diguyViewButtonPanel
7158  **
7159  *b Returns:
7160  **
7161  ** 0 on success, -1 on failure
7162  */
7163  int destroy_panel(diguyViewButtonPanel* panel);
7164 
7165  /*l
7166  *b Returns:
7167  **
7168  ** The number of diguyViewButtonPanel objects in the scenario.
7169  */
7170  int get_num_panels();
7171 
7172  /*l
7173  *b Returns:
7174  **
7175  ** The diguyViewButtonPanel at the given index.
7176  **
7177  *b Arguments:
7178  **
7179  *a index - index of the diguyViewButtonPanel; indices start at 0
7180  */
7181  diguyViewButtonPanel* get_panel_at_index(int index);
7182 
7183 
7184 /*****************************************************************************/
7197  /*l
7198  *b Description:
7199  **
7200  ** This function returns the number of AI minds that are available to
7201  ** AI agent characters.
7202  **
7203  *b Returns:
7204  **
7205  ** number of available minds
7206  */
7207  int get_num_minds();
7208 
7209  /*l
7210  *b Returns:
7211  **
7212  ** name of the AI mind at the specified index
7213  */
7214  const char* get_mind_name_at_index(int index);
7215 
7216  /*l
7217  *b Description:
7218  **
7219  ** This function tests if a diguyCharacter pointer is a valid pointer.
7220  ** This is done by comparing the passed address to those of all
7221  ** characters in the scenario. The function is not exceedingly fast
7222  ** but can be useful when building AI that functions in a networked
7223  ** environment.
7224  **
7225  *b Returns:
7226  **
7227  ** 0 if invalid, 1 if valid
7228  */
7229  int is_valid_character_pointer(diguyCharacter* character);
7230 
7231  /*l
7232  *b Description:
7233  **
7234  ** This function tests if a diguyCharacterGroup pointer is a valid
7235  ** pointer. This is done by comparing the passed address to those of
7236  ** all groups in the scenario. The function is not exceedingly fast
7237  ** but can be useful when building AI that functions in a networked
7238  ** environment.
7239  **
7240  *b Returns:
7241  **
7242  ** 0 if invalid, 1 if valid
7243  */
7244  int is_valid_character_group_pointer(diguyCharacterGroup* character_group);
7245 
7246 /*****************************************************************************/
7262  /*l
7263  *b Description:
7264  **
7265  ** This function creates a new crowd and returns a pointer to it.
7266  **
7267  ** A Lua object is also created that has a pointer to this crowd.
7268  ** This object can be retrieved by calling find_lua_crowd(crowd_name)
7269  ** or find_lua_crowd(diguyCrowd* pointer) in lua.
7270  **
7271  *b Arguments:
7272  **
7273  *a name - name of crowd to be created
7274  *a make_companion_of_all - pass 1 to make this crowd a companion
7275  *a of all existing crowds
7276  **
7277  *b Returns:
7278  **
7279  ** pointer of type diguyCrowd
7280  */
7281  diguyCrowd* create_crowd(const char* name,
7282  int make_companion_of_all = 1);
7283 
7284  /*l
7285  *b Description:
7286  **
7287  ** This function destroys a crowd. It can also optionally destroy the
7288  ** characters that are crowd members, and the path shape that is
7289  ** associated with the crowd.
7290  **
7291  *b Arguments:
7292  **
7293  *a crowd - pointer to a diguyCrowd
7294  *a also_destroy_crowd_members - pass 1 to also destroy crowd member
7295  *a characters
7296  *a also_destroy_path_shapes - pass 1 to also destroy crowd-
7297  *a associated path shapes
7298  *a delay_destruction - pass 1 to wait till the next update
7299  *a call to destroy the crowd; can avoid
7300  *a crashes when AI's receive destruction
7301  *a messages
7302  **
7303  *b Returns:
7304  **
7305  ** 0 on success, -1 on failure
7306  */
7307  int destroy_crowd(diguyCrowd* crowd,
7308  int also_destroy_crowd_members = 0,
7309  int also_destroy_path_shapes = 0,
7310  int delay_destruction = 0);
7311 
7312  /*l
7313  *b Returns:
7314  **
7315  ** the number of crowds in the scenario
7316  */
7317  int get_num_crowds();
7318 
7319  /*l
7320  *b Returns:
7321  **
7322  ** pointer of type diguyCrowd; NULL if no crowd at the specified index
7323  **
7324  *b Arguments:
7325  **
7326  *a index - index of the crowd; indices start at 0
7327  */
7328  diguyCrowd* get_crowd_at_index(int index);
7329 
7330  /*l
7331  *b Returns:
7332  **
7333  ** A unique name based on base_name, e.g. "my_crowd7" from "my_crowd".
7334  **
7335  *b Arguments:
7336  **
7337  *a base_name - base string from which to build a unique name
7338  */
7339  const char* get_unique_crowd_name(const char* base_name);
7340 
7341  /*l
7342  *b Description:
7343  **
7344  ** This function returns a pointer to the specified crowd.
7345  **
7346  *b Arguments:
7347  **
7348  *a name - name of crowd to be found
7349  **
7350  *b Returns:
7351  **
7352  ** pointer of type diguyCrowd; NULL if not found
7353  */
7354  diguyCrowd* find_crowd(const char* crowd_name);
7355 
7356  /*l
7357  *b Description:
7358  **
7359  ** This function returns a pointer to the crowd with the given
7360  ** name. A new crowd with the given name will be created if
7361  ** it doesn't already exist.
7362  **
7363  *b Arguments:
7364  **
7365  *a name - name of the crowd to find or create
7366  *a make_companion_of_all - pass 1 to make this crowd a companion
7367  *a of all existing crowds
7368  **
7369  *b Returns:
7370  **
7371  ** pointer of type diguyCrowd; should never be NULL
7372  */
7373  diguyCrowd* find_or_create_crowd(const char* crowd_name,
7374  int make_companion_of_all = 1);
7375 
7376  /*l
7377  *b Description:
7378  **
7379  ** This function sets whether crowds should be created for
7380  ** incoming network entities.
7381  **
7382  *b Arguments:
7383  **
7384  *a do_create - pass 1 to create network crowds; 0 to not
7385  */
7386  void set_create_network_crowds(int do_create);
7387 
7388  /*l
7389  *b Returns:
7390  **
7391  *a 1 if network crowds will be created; 0 if not
7392  **
7393  */
7394  int get_create_network_crowds();
7395 
7396 
7397 /*****************************************************************************/
7412  /*l
7413  *b Description:
7414  **
7415  ** This function creates a new crowd profile and returns a
7416  ** pointer to it.
7417  **
7418  *b Arguments:
7419  **
7420  *a name - name of crowd profile to be created
7421  **
7422  *b Returns:
7423  **
7424  ** pointer of type diguyCrowdProfile
7425  */
7426  diguyCrowdProfile* create_crowd_profile(const char* name);
7427 
7428  /*l
7429  *b Description:
7430  **
7431  ** This function destroys a crowd profile.
7432  **
7433  *b Arguments:
7434  **
7435  *a crowd_profile - pointer to a diguyCrowdProfile
7436  **
7437  *b Returns:
7438  **
7439  ** 0 on success, -1 on failure
7440  */
7441  int destroy_crowd_profile(diguyCrowdProfile* crowd_profile);
7442 
7443  /*l
7444  *b Returns:
7445  **
7446  ** The number of crowd profiles in the scenario.
7447  */
7448  int get_num_crowd_profiles();
7449 
7450  /*l
7451  *b Returns:
7452  **
7453  ** pointer of type diguyCrowdProfile; NULL if no crowd profile
7454  ** at the specified index
7455  **
7456  *b Arguments:
7457  **
7458  *a index - index of the crowd profile; indices start at 0
7459  */
7460  diguyCrowdProfile* get_crowd_profile_at_index(int index);
7461 
7462  /*l
7463  *b Description:
7464  **
7465  ** This function returns a pointer to the specified crowd profile.
7466  **
7467  *b Arguments:
7468  **
7469  *a name - name of crowd profile to be found
7470  **
7471  *b Returns:
7472  **
7473  ** pointer of type diguyCrowdProfile; NULL if not found
7474  */
7475  diguyCrowdProfile* find_crowd_profile(const char* name);
7476 
7477 
7478 /*****************************************************************************/
7488  /*l
7489  *b Returns:
7490  **
7491  ** pointer of type diguyLoadManager; this scenario's character
7492  ** load manager
7493  */
7494  diguyLoadManager* get_character_load_manager();
7495 
7496 
7497 /*****************************************************************************/
7507  /*l
7508  *b Description:
7509  **
7510  ** This function forces the octtree to rebuild if it's out of date.
7511  */
7512  int force_octtree_generation();
7513 
7514  /*l
7515  *b Description:
7516  **
7517  ** Adds the given character to the octtree. If use_bounding_box_only is true,
7518  ** the bounding box will be used instead of using full link data.
7519  **
7520  */
7521  void add_character_to_octtree(diguyCharacter* character,
7522  int use_bounding_box_only = 0);
7523 
7524  /*l
7525  *b Description:
7526  **
7527  ** Removes the given character from the octtree.
7528  **
7529  */
7530  void remove_character_from_octtree(diguyCharacter* character);
7531 
7532  /*l
7533  *b Description:
7534  **
7535  ** Preloads the given appearance for the character with octtree data.
7536  ** Uses more memory, but avoids needing to build data as characters are instantiated.
7537  **
7538  */
7539  int preload_octtree(const char* character_type, const char* appearance);
7540 
7541  /*l
7542  *b Description:
7543  **
7544  ** This function uses the octtree to check if the path between x1,
7545  ** y1, z1 and x2, y2, z2 has any static obstructions.
7546  **
7547  *b Returns:
7548  **
7549  ** 1 if the path is clear, 0 if static obstructions are present.
7550  */
7551  int check_visibility(float x1, float y1, float z1,
7552  float x2, float y2, float z2);
7553 
7554 
7555 /*****************************************************************************/
7565 #ifdef CPLUSPLUS_ONLY
7566 
7567  /*l
7568  *b Description:
7569  **
7570  ** This function sets a default altitude function that will be added
7571  ** to all characters that are subsequently created. It can be overridden
7572  ** on a per-character basis by a call to diguyCharacter::set_altitude_function().
7573  ** See that function for details.
7574  **
7575  *b Callable From:
7576  **
7577  *- - C++
7578  */
7579  int set_default_character_altitude_function(diguyAltitudeFunction* altitude_function);
7580 
7581  /*l
7582  *b Description:
7583  **
7584  ** This function sets a generic altitude function for the scenario
7585  ** that is used for local path clamping and other operations that
7586  ** require the altitude at specific x, y coordinates to be calculated.
7587  ** This is for the benefit of SDK users who have their own representation
7588  ** of terrain and structures.
7589  **
7590  ** diguyScenario::ground_clamp() can be told to use the registered
7591  ** function, but this is optional.
7592  **
7593  ** DI-Guy Scenario has a default altitude function; replacing the
7594  ** default function is not recommended.
7595  **
7596  *b Callable From:
7597  **
7598  *- - C++
7599  */
7600  void set_altitude_function(diguyScenarioAltitudeFunction* altitude_function);
7601 
7602  /*l
7603  *b Returns:
7604  **
7605  ** the altitude function for the scenario as set by
7606  ** set_altitude_function()
7607  **
7608  *b Callable From:
7609  **
7610  *- - C++
7611  */
7612  diguyScenarioAltitudeFunction* get_altitude_function();
7613 
7614 #endif
7615 
7618  void set_altitude_max_climb(float altitude_max_climb);
7619  float get_altitude_max_climb();
7620 
7623  void set_altitude_max_drop(float altitude_max_drop);
7624  float get_altitude_max_drop();
7625 
7626 
7627 /*****************************************************************************/
7637  /*l
7638  *b Description:
7639  **
7640  ** Sets the default intersection function. This function will be used to determine
7641  ** whether there is an intersection between a specified ray and the world.
7642  */
7643  static void set_default_intersection_function(diguyScenarioIntersectionFunction* intersection_function);
7644  void set_intersection_function(diguyScenarioIntersectionFunction* intersection_function);
7645 
7646  /*l
7647  *b Description:
7648  **
7649  ** Creates a detonation using the specified munition name. If the
7650  ** DI-Guy networking module is enabled the detonation is broadcast
7651  ** over the network.
7652  **
7653  *b Arguments:
7654  **
7655  *a munition_name - name of the munition to detonate; this will
7656  *a potentially trigger special effects depending
7657  *a on the munition
7658  *a x, y, z - location of the detonation
7659  *a attacker_name - this MUST be specified if the detonation is being
7660  *a broadcast over the network
7661  *a radius_override - defaults to the data in the munition config file
7662  *a broadcast_on_network - pass 0 to not broadcast detonation on DIS
7663  *a network
7664  *a ground_clamp_impact - 13.2.1 change, make it posible to not ground clamp this,
7665  *a was default behavior :-(
7666  **
7667  ** Note: Overriding the detonation radius will NOT work on broadcast
7668  ** detonations since the override value is not transmitted.
7669  */
7670  int trigger_detonation(const char* munition_name,
7671  float x, float y, float z,
7672  const char* attacker_name = NULL,
7673  float radius_override = -1.0f,
7674  int broadcast_on_network = 1,
7675  int ground_clamp_impact = 1 );
7676 
7677  /*l
7678  *b Description:
7679  **
7680  ** This function checks for intersection against characters in the
7681  ** specified view.
7682  **
7683  ** To check for intersections against both characters and scene
7684  ** objects, call get_intersection_at_screen_coords().
7685  **
7686  ** The returned diguyImpact pointer is owned by the scenario and
7687  ** should not be deleted. It will remain valid until the next call
7688  ** to any one of the following functions:
7689  **
7690  *- - find_character_at_screen_coords()
7691  *- - get_impact_at_screen_coords()
7692  *- - get_intersection_at_screen_coords()
7693  **
7694  *i This function should only be called from a DI-Guy Scenario Plugin.
7695  **
7696  *b Arguments:
7697  **
7698  *a view - view to check
7699  *a sx, sy - view coordinates to check
7700  **
7701  *b Returns:
7702  **
7703  ** pointer of type diguyImpact; NULL if no character intersected
7704  **
7705  *b Callable From:
7706  **
7707  *- - DI-Guy Scenario Plugin
7708  */
7709  diguyImpact* find_character_at_screen_coords(diguyView* view,
7710  float sx,
7711  float sy);
7712 
7713  /*l
7714  *b Description:
7715  **
7716  ** This function creates an impact object based on the sx and sy in
7717  ** the specified view. This function will trigger an impact callback
7718  ** on individuals who are touched, (it will not however kill
7719  ** characters who don't have impact callbacks.
7720  **
7721  ** The returned diguyImpact pointer is owned by the scenario and
7722  ** should not be deleted. It will remain valid until the next call
7723  ** to any one of the following functions:
7724  **
7725  *- - find_character_at_screen_coords()
7726  *- - get_impact_at_screen_coords()
7727  *- - get_intersection_at_screen_coords()
7728  **
7729  *i This function should only be called from a DI-Guy Scenario Plugin.
7730  **
7731  *b Arguments:
7732  **
7733  *a view - view to check
7734  *a sx, sy - view coordinates to check
7735  *a use_octtree - use the octtree; will not test against all
7736  *a characters unless they are explicitly added,
7737  *a but much faster
7738  **
7739  *b Returns:
7740  **
7741  ** pointer of type diguyImpact;
7742  **
7743  *b Callable From:
7744  **
7745  *- - DI-Guy Scenario Plugin
7746  */
7747  diguyImpact* get_impact_at_screen_coords(diguyView* view,
7748  float sx,
7749  float sy,
7750  int use_octtree = 0);
7751 
7752  /*l
7753  *b Description:
7754  **
7755  ** This function checks for intersection against the world *and*
7756  ** characters in the specified view. Unlike the function
7757  ** get_impact_at_screen_coords(), this function doesn't trigger
7758  ** callbacks; instead, it just fills out the impact info.
7759  **
7760  ** The returned diguyImpact pointer is owned by the scenario and
7761  ** should not be deleted. It will remain valid until the next call to
7762  ** any one of the following functions:
7763  **
7764  *- - find_character_at_screen_coords()
7765  *- - get_impact_at_screen_coords()
7766  *- - get_intersection_at_screen_coords()
7767  **
7768  *i This function should only be called from a DI-Guy Scenario Plugin.
7769  **
7770  *b Arguments:
7771  **
7772  *a view - view to check
7773  *a sx, sy - view coordinates to check
7774  *a use_octtree - use the octtree; will not test against all
7775  *a characters unless they are explicitly added,
7776  *a but much faster
7777  **
7778  *b Returns:
7779  **
7780  ** diguyImpact with the xyz location of the intersection; NULL if
7781  ** there was nothing to intersect there
7782  **
7783  *b Callable From:
7784  **
7785  *- - DI-Guy Scenario Plugin
7786  */
7787  diguyImpact* get_intersection_at_screen_coords(diguyView* view,
7788  float sx,
7789  float sy,
7790  int use_octtree = 0);
7791 
7792  /*l
7793  *b Description:
7794  **
7795  ** This function checks for intersection against the world and returns
7796  ** basic collision results.
7797  **
7798  ** This function will only return valid results in environments where
7799  ** the DI-Guy geometry octtree is available; currently that is when
7800  ** using OpenGL and the DI-Guy flight geometry loader. DI-Guy
7801  ** Scenario is such a case.
7802  **
7803  *b Arguments:
7804  **
7805  *a origin_x, origin_y, origin_z - starting location of the ray trace
7806  *a dir_x, dir_y, dir_z - direction of ray trace (should be normalized)
7807  *a max_distance_to_test - max distance ray will travel;
7808  *a -1.0 will test an infinitely long ray
7809  *a intersection_x, _y, and _z - world location of intersection
7810  *a normal_x, normal_y, normal_z - normal of intersection surface
7811  **
7812  ** Smaller values for max_distance_to_test will result in better
7813  ** performance.
7814  **
7815  ** The location of the intersection point is returned in the
7816  ** intersection x, y, and z pointers.
7817  **
7818  ** The normal of the surface intersected is returned in the normal
7819  ** x, y, and z pointers.
7820  **
7821  *b Returns:
7822  **
7823  ** 1 if intersection occurred, 0 if not.
7824  */
7825  int intersect_static_geometry(
7826  float origin_x, float origin_y, float origin_z,
7827  float dir_x, float dir_y, float dir_z,
7828  float max_distance_to_test,
7829  float* intersection_x, float* intersection_y, float* intersection_z,
7830  float* normal_x = NULL, float* normal_y = NULL, float* normal_z = NULL,
7831  int use_callback = 1);
7832 
7833  /*l
7834  *b Description:
7835  **
7836  ** This function returns the z height, or altitude, of the uppermost
7837  ** piece of terrain under the passed x, y, z point.
7838  **
7839  ** Two methods can be used to determine the altitude: a custom scenario
7840  ** altitude function set by the user, or by testing against DI-Guy's
7841  ** internal octtree calculated from terrain geometry.
7842  **
7843  ** See set_altitude_function() for information on the scenario
7844  ** altitude function. DI-Guy Scenario has its own version of this function,
7845  ** which defaults to using the octtree when it's available, and falls back on
7846  ** using a screen render and Z-buffer check when it's not.
7847  **
7848  ** Note that the octtree is not always available. In general, it is
7849  ** available only in DI-Guy Scenario, or when the built-in OpenGL
7850  ** renderer and DI-Guy flight geometry loader are in use. Users of the SDK
7851  ** typically have their own representations of terrain and structures.
7852  **
7853  *b Arguments:
7854  **
7855  *a x, y, z - world location to ground clamp
7856  *a valid - optional pointer to get an explicit result if anything
7857  *a was hit
7858  *a use_altitude_function - pass 1 to use scenario altitude function
7859  *a (tried first)
7860  *a use_octtree - pass 1 to use internal octtree
7861  **
7862  *b Returns:
7863  **
7864  ** new_z if ground clamp was possible, original z if not
7865  */
7866  float ground_clamp(float x, float y, float z,
7867  int* valid = NULL,
7868  int use_altitude_function = 1,
7869  int use_octtree = 0);
7870 
7871 
7872 #ifdef CPLUSPLUS_ONLY
7873 
7874  /******************************************************
7875  **
7876  *4 Impact Callback Functions:
7877  **
7878  ** Unless otherwise specified, callable from:
7879  **
7880  *- - C++
7881  *- - Script
7882  */
7883 
7884  /*l
7885  *b Description:
7886  **
7887  ** The following prototype should be used for the impact
7888  ** function:
7889  **
7890  *e int impact_func(diguyImpact* impact,
7891  *e float from_x,
7892  *e float from_y,
7893  *e float from_z,
7894  *e float to_x,
7895  *e float to_y,
7896  *e float to_z,
7897  *e diguyScenario* s);
7898  **
7899  ** When a character fires their weapon, DI-Guy calls this function
7900  ** with a pointer to the diguyImpact that must be filled out, the x,
7901  ** y, z position of the shot, and the target x, y, z.
7902  **
7903  ** The impact function should then do an intersection test and return
7904  ** 1 if a hit occurred.
7905  **
7906  ** By default the impact should have both the attacker and the
7907  ** munition type already specified. The intersection function must at
7908  ** least call diguyImpact::set_valid_impact() for the system to
7909  ** consider the impact valid. See diguyImpact for a sample function.
7910  **
7911  *b Callable From:
7912  **
7913  *- - C++
7914  */
7915  int set_fire_weapon_intersection_function(diguyScenarioFindImpactOnLineFunction* impact_function);
7916 
7917  /*l
7918  *b Description:
7919  **
7920  ** This function sets an impact function that will be added to all new
7921  ** scenarios. It can be overridden by an explicit call to
7922  ** diguyScenario::set_fire_weapon_intersection_function(). See that
7923  ** function for details.
7924  **
7925  *b Callable From:
7926  **
7927  *- - C++
7928  */
7929  static void set_default_fire_weapon_intersection_function(diguyScenarioFindImpactOnLineFunction* impact_function);
7930 
7931 #endif
7932 
7933  /*l
7934  *b Description:
7935  **
7936  ** Most DI-Guy visual objects (e.g., characters, path shapes,
7937  ** waypoints) have a unique identified, or UID. In many cases these
7938  ** UID values can be coded into 24-bit color values. This can be
7939  ** useful for implementing some types of intersection detection
7940  ** functions, in which each visual object is rendered with a different
7941  ** color.
7942  **
7943  ** This function will take the passed color values and update internal
7944  ** DI-Guy state of which objects objects have been hit.
7945  **
7946  ** It will also return an impact record containing information a
7947  ** subset of that information.
7948  **
7949  ** This can include:
7950  **
7951  *- - the hit character, if one was hit
7952  *- - the hit link and shape of the character
7953  *- - the hit scene object, if one was hit
7954  **
7955  ** Note that the returned impact pointer is owned by DI-Guy and is
7956  ** temporary. The information you need from it should be immediately
7957  ** read, and the pointer should not be stored.
7958  */
7959  diguyImpact* map_color_to_impact(char r, char g, char b);
7960 
7961  /*l
7962  *b Description:
7963  **
7964  ** When the callback with id diguyScenario::CALLBACK_ID_SCENE_OBJECT_IMPACT
7965  ** is called, this function will return the impact object containing
7966  ** information about that impact.
7967  **
7968  ** There may be multiple impacts that result from some operations.
7969  ** In this case this function should be called multiple times, until
7970  ** it returns NULL. When processing of data from each successive
7971  ** impact is done, call set_last_impact_been_processed() to queue up
7972  ** the next impact object for processing.
7973  **
7974  ** The maximum number of unprocessed impacts is finite, and set by
7975  ** the function set_max_unprocessed_impacts().
7976  **
7977  ** Note that the returned impact pointers are owned by DI-Guy and are
7978  ** temporary. The information you need from them should be
7979  ** immediately read, and the pointers should not be stored.
7980  */
7981  diguyImpact* get_last_env_impact_info();
7982 
7983  /*l
7984  *b Description:
7985  **
7986  ** Reading of data from the last impact information will be considered
7987  ** complete when this function is called.
7988  */
7989  void set_last_impact_been_processed();
7990 
7991  /*l
7992  *b Description:
7993  **
7994  ** This function will add the passed impact object to the list of
7995  ** impact objects to be processed by calls to
7996  ** get_last_env_impact_info(). An internal copy of the impact object
7997  ** is made.
7998  */
7999  void set_last_env_impact_info(const diguyImpact& impact);
8000 
8001  /*l
8002  *b Description:
8003  **
8004  ** Sets the maximum number of unprocessed impacts there can be.
8005  **
8006  ** The unprocessed impact array is a first-in-first-out queue. If an
8007  ** impact occurs that pushes the number of unprocessed impacts past
8008  ** this maximum number, earlier impacts will be dropped from the
8009  ** array.
8010  **
8011  ** The initial value is 10.
8012  */
8013  void set_max_unprocessed_impacts(int max_unprocessed_impacts);
8014 
8015 
8016 #ifdef CPLUSPLUS_ONLY
8017 
8018 
8019 /*****************************************************************************/
8039  /*l
8040  *b Description:
8041  **
8042  ** This function sets a default point line of sight function that
8043  ** will be added to all new characters. It can be overridden by an
8044  ** explicit call to diguyCharacter::set_point_los_function(). See
8045  ** that function for details.
8046  **
8047  *b Callable From:
8048  **
8049  *- - C++
8050  */
8051  int set_default_point_los_function(diguyPointLOSFunction* point_los_function);
8052 
8053  /*l
8054  *b Description:
8055  **
8056  ** This function sets a default character line of sight function that
8057  ** will be added to all new characters. It can be overridden by an
8058  ** explicit call to diguyCharacter::set_character_los_function().
8059  ** See that function for details.
8060  **
8061  *b Callable From:
8062  **
8063  *- - C++
8064  */
8065  int set_default_character_los_function(diguyCharacterLOSFunction* character_los_function);
8066 
8067  /*l
8068  *b Description:
8069  **
8070  ** This function sets a default feeler function that will be added
8071  ** to all new DI-Guy AI agents. It can be overridden by an explicit
8072  ** call to diguyCharacter::agent_set_feeler_function().
8073  **
8074  ** See the "User-Defined Feelers" section in diguyCharacter.h for
8075  ** more information.
8076  **
8077  *b Arguments:
8078  **
8079  *a feeler_function - pointer to user-defined feeler function
8080  **
8081  *b Returns:
8082  **
8083  ** 0 on success, -1 on failure
8084  **
8085  *b Callable From:
8086  **
8087  *- - C++
8088  */
8089  int set_default_agent_feeler_function(diguyFeelerFunction* feeler_function);
8090 
8091 #endif
8092 
8093  /*l
8094  *b Description:
8095  **
8096  ** Experimental intersection-detection function.
8097  **
8098  *b Arguments:
8099  **
8100  *a origin_x,origin_y,origin_z - starting point
8101  *a dir_x,dir_y,dir_z - direction vector
8102  *a max_distance_to_test - distance to test to
8103  *a use_callback - 1 to use
8104  **
8105  *b Returns:
8106  **
8107  ** diguyIntersectionResult structure
8108  */
8109  diguyIntersectionResult exp_intersect_geometry(
8110  float origin_x, float origin_y, float origin_z,
8111  float dir_x, float dir_y, float dir_z,
8112  float max_distance_to_test,
8113  int use_callback = 1);
8114 
8115 /*****************************************************************************/
8125  /*l
8126  *b Description:
8127  **
8128  ** This function returns a pointer to the region with the given
8129  ** name. A new region with the given name will be created if
8130  ** it doesn't already exist.
8131  **
8132  *b Arguments:
8133  **
8134  *a name - name of the region to find or create
8135  **
8136  *b Returns:
8137  **
8138  ** pointer of type diguyRegion; should never be NULL
8139  */
8140  diguyRegion* find_or_create_region(const char* name);
8141 
8142  /*l
8143  *b Description:
8144  **
8145  ** This function returns a pointer to the specified region.
8146  **
8147  *b Arguments:
8148  **
8149  *a name - name of region to be found
8150  **
8151  *b Returns:
8152  **
8153  ** pointer of type diguyRegion; NULL if not found
8154  */
8155  diguyRegion* find_region(const char* name);
8156 
8157  /*l
8158  *b Description:
8159  **
8160  ** This function creates a new diguyRegion and returns a pointer to
8161  ** it.
8162  **
8163  *b Arguments:
8164  **
8165  *a name - name of the new region object
8166  **
8167  *b Returns:
8168  **
8169  ** pointer of type diguyRegion
8170  */
8171  diguyRegion* create_region(const char* name);
8172 
8173  /*l
8174  *b Description:
8175  **
8176  ** This function destroys the passed region.
8177  **
8178  *b Arguments:
8179  **
8180  *a region - region to destroy
8181  */
8182  void destroy_region(diguyRegion* region);
8183 
8184  /*l
8185  *b Returns:
8186  **
8187  ** number of regions in the scenario
8188  */
8189  int get_num_regions();
8190 
8191  /*l
8192  *b Returns:
8193  **
8194  ** pointer of type diguyRegion; NULL if no region at the
8195  ** specified index
8196  **
8197  *b Arguments:
8198  **
8199  *a index - index of the region; indices start at 0
8200  */
8201  diguyRegion* get_region_at_index(int index);
8202 
8203  /*l
8204  *b Description:
8205  **
8206  ** The scenario will attempt to create a navigation path on the
8207  ** via_region. An A* path planning algorithm is used to find the
8208  ** path. See also diguyCharacter::agent_move_to_point() and
8209  ** diguyCharacter::agent_move_to_point_via_subregions().
8210  **
8211  *b Arguments:
8212  **
8213  *a x1, y1, z1 - start location
8214  *a x2, y2, z2 - end location
8215  *a via_region - name of the region to run A* on
8216  *a path_shape - path shape that stores the created path
8217  *a preferred_subregions_mask - diguySubregionMask value of regions
8218  *a preferred for travel
8219  *a cost_bias_for_preferred_regions - how much cheaper it will be
8220  *a to cross spaces that are part of desired subregion;
8221  *a should be < 1.0
8222  *a cost_bias_for_neutral_regions - how much more expensive it will be
8223  *a to cross spaces that are not part of desired subregion; see
8224  *a below for more information
8225  *a repulsed_regions_mask - diguySubregionMask value of regions *not*
8226  *a preferred for travel
8227  *a cost_bias_for_repulsed_regions - how much more expensive it will be
8228  *a to cross regions that are marked as repulsive; pass
8229  *a DIGUY_DEFAULT_FLOAT to avoid completely
8230  **
8231  ** Pass DIGUY_DEFAULT_FLOAT for cost_bias_for_neutral_regions and
8232  ** cost_bias_for_repulsed_regions to specify that they should be
8233  ** avoided completely.
8234  **
8235  ** The preferred_subregions_mask and repulsed_regions_mask use
8236  ** DI-Guy subregion mask values combined together. For example,
8237  ** DIGUY_SUBREGION_MASK_SIDEWALK | DIGUY_SUBREGION_MASK_CROSSWALK.
8238  **
8239  ** For cost_bias_for_neutral_regions, specifying a non-zero value for
8240  ** this lowers the likelihood that searches fail on disjointed
8241  ** subregions. A value < 1 will cause the planner to run faster but
8242  ** explore fewer points, possibly missing preferred regions. Values
8243  ** greater then 1 will explore more points but will be slower.
8244  **
8245  *b Returns:
8246  **
8247  ** 0 on success, -1 on failure
8248  */
8249  int find_navigation_path(float x1, float y1, float z1,
8250  float x2, float y2, float z2,
8251  const char* via_region,
8252  diguyPathShape* path_shape,
8253  float cost_bias_for_preferred_regions = 0.25f,
8254  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
8255  float cost_bias_for_neutral_regions = 1.1f,
8256  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
8257  float cost_bias_for_repulsive_regions = 100.0f);
8258 
8259  /*l
8260  *b Description:
8261  **
8262  ** Sets an upper limit on how far a character is willing to travel as
8263  ** a multiple of the straight line distance between point A and point
8264  ** B before declaring that it can't get to a location.
8265  **
8266  ** Note that internally the straight line distance is forced to have a
8267  ** lower bound of 10 meters, so a character is always willing to
8268  ** travel a minimum of 10 * max_distance_planning_multiplier meters.
8269  **
8270  ** Defaults to -1, which means off.
8271  */
8272  void set_max_distance_planning_multiplier(float mul);
8273 
8274  /*l
8275  *b Returns:
8276  **
8277  ** float constant that's used to decide if planner should give up;
8278  ** -1 means off
8279  */
8280  float get_max_distance_planning_multiplier();
8281 
8282  /*l
8283  *b Description:
8284  **
8285  ** This function returns in seconds how much time has been spent path
8286  ** planning during the current frame. It can be used to avoid 100
8287  ** characters simultaneously hitting the path planner.
8288  **
8289  *b Returns:
8290  **
8291  ** time in seconds
8292  */
8293  float get_time_spent_path_planning_this_frame();
8294 
8295  /*l
8296  *b Description:
8297  **
8298  ** This function enables the path planner to run in a background
8299  ** thread. Note this only occurs if the
8300  ** diguyCharacter::agent_move_to_point_bg() or
8301  ** diguyCharacter::agent_move_to_point_via_subregions_bg() api
8302  ** functions are used.
8303  **
8304  ** By default the multi-threaded path planner is on.
8305  */
8306  void set_multithreaded_path_planning_enabled(int value);
8307  /*l
8308  *b Returns:
8309  **
8310  ** Returns 1 if the path planner is enabled to run in a background
8311  ** thread. By default the multi-threaded path planner is on.
8312  */
8313  int get_multithreaded_path_planning_enabled();
8314 
8315 
8316 /*****************************************************************************/
8326  /*l
8327  *b Returns:
8328  **
8329  ** number of formations in the scenario
8330  */
8331  int get_num_formations();
8332 
8333  /*l
8334  *b Returns:
8335  **
8336  ** pointer of type diguyFormation; NULL if no
8337  ** formation at the specified index
8338  **
8339  *b Arguments:
8340  **
8341  *a index - index of the formation; indices start at 0
8342  */
8343  diguyFormation* get_formation_at_index(int index);
8344 
8345  /*l
8346  *b Description:
8347  **
8348  ** This function returns a pointer to the specified formation.
8349  **
8350  *b Arguments:
8351  **
8352  *a name - name of formation to be found
8353  **
8354  *b Returns:
8355  **
8356  ** pointer of type diguyFormation; NULL if not found
8357  */
8358  diguyFormation* find_formation(const char* name);
8359 
8360  /*l
8361  *b Description:
8362  **
8363  ** This function returns a pointer to the first formation it finds of
8364  ** a given size.
8365  **
8366  *b Arguments:
8367  **
8368  *a size - size of formation to be found
8369  **
8370  *b Returns:
8371  **
8372  ** pointer of type diguyFormation; NULL if not found
8373  */
8374  diguyFormation* find_formation_of_size(int size);
8375 
8376  /*l
8377  *b Description:
8378  **
8379  ** This function creates a new formation and returns a
8380  ** pointer to it.
8381  **
8382  *b Arguments:
8383  **
8384  *a name - name of the new formation
8385  **
8386  *b Returns:
8387  **
8388  ** pointer of type diguyFormation
8389  */
8390  diguyFormation* create_formation(const char* name);
8391 
8392  /*l
8393  *b Description:
8394  **
8395  ** This function finds the formation with the given name or
8396  ** creates it if it doesn't exist.
8397  **
8398  *b Arguments:
8399  **
8400  *a name - name of the formation to find or create
8401  **
8402  *b Returns:
8403  **
8404  ** pointer of type diguyFormation; should never be NULL
8405  */
8406  diguyFormation* find_or_create_formation(const char* name);
8407 
8408  /*l
8409  *b Description:
8410  **
8411  ** This function destroys a formation.
8412  **
8413  *b Arguments:
8414  **
8415  *a formation - pointer to a diguyFormation
8416  **
8417  *b Returns:
8418  **
8419  ** 0 on success, -1 on failure
8420  */
8421  int destroy_formation(diguyFormation* formation);
8422 
8423 
8424 /*****************************************************************************/
8440  void set_draw_authoring_visuals(int visible);
8442  int get_draw_authoring_visuals();
8443 
8444  void set_action_bead_labels_visible(diguyVisibleFlag vflag);
8445  void set_aim_trajectories_visible(diguyVisibleFlag vflag);
8446  void set_author_selection_handles_visible(diguyVisibleFlag vflag);
8447  void set_bead_array_visible(diguyVisibleFlag vflag);
8448  void set_character_labels_visible(diguyVisibleFlag vflag);
8449  void set_character_visible(diguyVisibleFlag vflag);
8450  void set_crowd_behavior_visible(diguyVisibleFlag flag);
8451  void set_crowd_feelers_visible(diguyVisibleFlag flag);
8452  void set_crowd_influence_visible(diguyVisibleFlag flag);
8453  void set_crowd_regions_visible(diguyVisibleFlag flag);
8454  void set_gaze_vector_visible(diguyVisibleFlag flag);
8455  void set_light_array_visible(diguyVisibleFlag vflag);
8456  void set_lua_objects_visible(diguyVisibleFlag flag);
8457  void set_mesh_region_array_visible(diguyVisibleFlag vflag);
8458  void set_sensor_region_array_visible(diguyVisibleFlag vflag);
8459  void set_spath_visible(diguyVisibleFlag vflag);
8460  void set_waypoint_array_visible(diguyVisibleFlag vflag);
8461 
8462  diguyVisibleFlag get_action_bead_labels_visible();
8463  diguyVisibleFlag get_aim_trajectories_visible();
8464  diguyVisibleFlag get_author_selection_handles_visible();
8465  diguyVisibleFlag get_bead_array_visible();
8466  diguyVisibleFlag get_character_labels_visible();
8467  diguyVisibleFlag get_character_visible();
8468  diguyVisibleFlag get_crowd_behavior_visible();
8469  diguyVisibleFlag get_crowd_feelers_visible();
8470  diguyVisibleFlag get_crowd_influence_visible();
8471  diguyVisibleFlag get_crowd_regions_visible();
8472  diguyVisibleFlag get_gaze_vectors_visible();
8473  diguyVisibleFlag get_light_array_visible();
8474  diguyVisibleFlag get_lua_objects_visible();
8475  diguyVisibleFlag get_mesh_region_array_visible();
8476  diguyVisibleFlag get_sensor_region_array_visible();
8477  diguyVisibleFlag get_spath_visible();
8478  diguyVisibleFlag get_waypoint_array_visible();
8479 
8480  void set_hide_author_selection_handles_during_play(int visible);
8481  int get_hide_author_selection_handles_during_play();
8482 
8483 
8484 /*****************************************************************************/
8494  /*l
8495  *b Returns:
8496  **
8497  ** If weapon fire will show flash geometry, (depending on munition configuration)
8498  */
8499  int get_weapon_flash_enabled();
8500 
8501  /*l
8502  *b Description:
8503  **
8504  ** Sets if weapon fire will create weapon geometry, (depending on munition configuration)
8505  */
8506  int set_weapon_flash_enabled(int enabled);
8507 
8508  /*l
8509  *b Returns:
8510  **
8511  ** If weapon fire will create light flashes, smoke and shell ejections, (depending on munition configuration)
8512  */
8513  int get_weapon_fire_effects_enabled();
8514 
8515  /*l
8516  *b Description:
8517  **
8518  ** Sets if weapon fire will create light flashes, smoke and shell ejections, (depending on munition configuration)
8519  */
8520  int set_weapon_fire_effects_enabled(int enabled);
8521 
8522  /*l
8523  *b Returns:
8524  **
8525  ** The number of light flashes that are currently active
8526  */
8527  int get_num_active_fire_effects();
8528 
8529  /*l
8530  *b Description:
8531  **
8532  ** This function gets the data needed for producing a weapon flash
8533  ** light source in the world. The convenience function diguyOglUtils::update_lighting()
8534  ** shows sample implementation for feeding this data into uniform buffers.
8535  **/
8536  int get_weapon_fire_effect_data(int index, float * radius,
8537  double * position_x, double * position_y, double * position_z,
8538  float * color_r, float * color_g, float * color_b,
8539  float * falloff_r,
8540  float * falloff_rsq);
8541 
8543  int get_num_active_lights();
8544 
8546  int sort_active_lights();
8547 
8548  /*l
8549  *b Description:
8550  **
8551  ** This function gets the data needed for producing a particle system or vehicle light.
8552  ** The convenience function diguyOglUtils::update_lighting()
8553  ** shows sample implementation for feeding this data into uniform buffers.
8554  **/
8555  int get_active_light_data(int index, diguyLightRenderDesc * light_desc);
8556 
8557 /*****************************************************************************/
8572  /*l
8573  *b Description:
8574  **
8575  ** Sets the current selected character in scenario
8576  **
8577  *b Returns:
8578  **
8579  ** 0 on success, -1 on failure
8580  **/
8581  int set_current_character(diguyCharacter* current_character);
8582 
8583  /*l
8584  *b Returns:
8585  **
8586  ** The current selected character in scenario
8587  **/
8588  diguyCharacter* get_current_character();
8589 
8591  int get_current_character_index();
8592 
8593  /*l
8594  *b Description:
8595  **
8596  ** Sets the current selected crowd in scenario
8597  **
8598  *b Returns:
8599  **
8600  ** 0 on success, -1 on failure
8601  **/
8602  int set_current_crowd(diguyCrowd* current_crowd);
8603  /*l
8604  *b Returns:
8605  **
8606  ** The current selected crowd in scenario
8607  **/
8608  diguyCrowd* get_current_crowd();
8609 
8610  /*l
8611  *b Description:
8612  **
8613  ** Sets the active crowd profile, which determines the attributes
8614  ** of subsequently-created crowds. See diguyCrowdProfile.
8615  **
8616  *b Returns:
8617  **
8618  ** 0 on success, -1 on failure
8619  **/
8620  int set_current_crowd_profile(diguyCrowdProfile* current_profile);
8621  /*l
8622  *b Description:
8623  **
8624  ** Sets the active crowd profile by name.
8625  **
8626  *b Returns:
8627  **
8628  ** 0 on success, -1 on failure
8629  **/
8630  int set_current_crowd_profile_by_name(const char* crowd_profile_name);
8631  /*l
8632  *b Returns:
8633  **
8634  ** Active crowd profile
8635  **/
8636  diguyCrowdProfile* get_current_crowd_profile();
8637 
8638  /*l
8639  *b Description:
8640  **
8641  ** Sets the current region. See diguyRegion.
8642  **
8643  *b Returns:
8644  **
8645  ** 0 on success, -1 on failure
8646  **/
8647  int set_current_region(diguyRegion* current_region);
8648  /*l
8649  *b Returns:
8650  **
8651  ** Current region.
8652  **/
8653  diguyRegion* get_current_region();
8654 
8655 
8656 /*****************************************************************************/
8661  /*l
8662  *b Description:
8663  **
8664  ** This function enables or disables the particle module.
8665  ** By default the particle module is enabled.
8666  */
8667  void set_particle_module_disabled(int disable_particle_module);
8668 
8669  /*l
8670  *b Description:
8671  **
8672  ** This function creates a particle system with type description_name
8673  ** at x, y, z. If duration is specified the system will automatically
8674  ** stop emitting after that amount of time.
8675  **
8676  *b Arguments:
8677  **
8678  *a description_name - name of particle description to create
8679  *a x, y, z - the world space position of the system
8680  *a record_transient_event - pass 1 to have this particle system
8681  *a play in history playback
8682  *a duration - how long the emitter should emit; if -1 is
8683  *a specified then the description must have a
8684  *a lifetime specified
8685  */
8686  int create_particle_system(const char* description_name,
8687  float x, float y, float z,
8688  int record_transient_event = 1,
8689  float duration = -1.0f);
8690 
8691  /*l
8692  *b Description:
8693  **
8694  ** Similar to create_particle_system(), but allows orientation to be set.
8695  **
8696  *b Arguments:
8697  **
8698  *a rz, rx, ry - orientation axes
8699  **
8700  ** (See create_particle_system() for other parameters)
8701  */
8702  int create_particle_system_with_orientation(const char* description_name,
8703  float x, float y, float z,
8704  float rz, float rx, float ry,
8705  int record_transient_event = 1,
8706  float duration = -1.0f);
8707 
8708  /*l
8709  *b Returns:
8710  **
8711  ** 1 if the particle description named description_name exists,
8712  ** else 0
8713  */
8714  int has_particle_description(const char* description_name);
8715 
8716  /*l
8717  *b Description:
8718  **
8719  ** Set wind velocity vector for particle system
8720  */
8721  void set_global_wind(float x, float y, float z);
8722 
8723 
8724 /*****************************************************************************/
8730 // These should probably be C++ only. Not sure how much they make sense for
8731 // exposure to the scripting languages, unless you want perl to call lua
8732 // via C++.
8733 
8734  /*l
8735  *b Returns:
8736  **
8737  ** string representation of lua_object.field_name
8738  **
8739  ** Note that the returned string pointer will not remain valid, so
8740  ** the returned string should be copied.
8741  **
8742  *b Arguments:
8743  **
8744  *a lua_object - a global lua object
8745  *a field_name - name of the field; field_name can include ".",
8746  *a allowing retrieval of fields in complex data
8747  *a structures
8748  **/
8749  const char* lua_get_object_field_as_string(const char* lua_object,
8750  const char* field_name);
8751 
8752  /*l
8753  **
8754  *b Description:
8755  **
8756  ** Runs a member function of a lua object.
8757  **
8758  *b Arguments:
8759  **
8760  *a lua_object - a lua object in the global scope, object names with fields should be properly handled
8761  *a ie object.subobject.blah should get properly parsed
8762  *a function_name - name of the function to call
8763  *a argument - optional string argument
8764  *a has_return_string - if set to 1 function will pop the top value of
8765  *a the lua stack and return it as a string
8766  **
8767  *b Returns:
8768  **
8769  ** NULL or string representation of
8770  ** lua_object:function_name(argument).
8771  **
8772  ** The returned string should be copied if it needs to be used later.
8773  **/
8774  const char* lua_evaluate_object_function(const char* lua_object,
8775  const char* function_name,
8776  const char* argument = NULL,
8777  int has_return_string = 0);
8778 
8779  /*l
8780  *b Description:
8781  **
8782  ** A two argument version of lua_evaluate_object_function().
8783  */
8784  const char* lua_evaluate_object_function_2a(const char* lua_object,
8785  const char* function_name,
8786  const char* argument,
8787  const char* argument2,
8788  int has_return_string = 0);
8789 
8790  /*l
8791  *b Description:
8792  **
8793  ** A three argument version of lua_evaluate_object_function().
8794  */
8795  const char* lua_evaluate_object_function_3a(const char* lua_object,
8796  const char* function_name,
8797  const char* argument,
8798  const char* argument2,
8799  const char* argument3,
8800  int has_return_string = 0);
8801 
8802  /*l
8803  *b Description:
8804  **
8805  ** A four argument version of lua_evaluate_object_function().
8806  */
8807  const char* lua_evaluate_object_function_4a(const char* lua_object,
8808  const char* function_name,
8809  const char* argument,
8810  const char* argument2,
8811  const char* argument3,
8812  const char* argument4,
8813  int has_return_string = 0);
8814 
8815 
8816  /*l
8817  *b Description:
8818  **
8819  ** Executes a lua_object:state_manager() function call. Useful for
8820  ** creating sleep-able coroutine based objects that aren't
8821  ** characters.
8822  **/
8823  int lua_send_message_to_object(const char* lua_object,
8824  const char* sender,
8825  const char* message_type,
8826  const char* message,
8827  const char* message_params = NULL);
8828 
8829 #ifdef CPLUSPLUS_ONLY
8830 
8831  /*l
8832  *b Description:
8833  **
8834  ** This function allows low level access to the lua_State pointer.
8835  ** This pointer can be used by a programmer to query and run functions
8836  ** on the Lua virtual machine. This object can also be used to
8837  ** register new C functions to lua, which allows you to instrument and
8838  ** create callbacks from script to your code. See luaL_register
8839  ** on-line.
8840  **
8841  ** For more information on how the Lua C api works see:
8842  ** http://www.lua.org/pil/24.html
8843  **
8844  *b NOTE:
8845  **
8846  ** Currently all scenarios share the same underlying Lua state object.
8847  ** This may cause issues in applications with multiple scenarios.
8848  **
8849  *b Callable From:
8850  **
8851  *- - C++
8852  */
8853  void* get_lua_state();
8854 
8855  /*l
8856  *b Description:
8857  **
8858  ** Mainly used to pass a qt pointer to lua so lqt can be used to
8859  ** modify/read from the widget. This requires the that the lqt package
8860  ** is loaded; see the lqt.lua utility package for more info.
8861  **
8862  *b Arguments:
8863  **
8864  *a lua_state - a Lua_State pointer, might be the same as get_lua_state();
8865  *a depends if the calling function is inside a coroutine
8866  *a class_name - class name should be a core class of qt with a star
8867  *a after it; i.e. "QWidget*" or "QLineEdit*"
8868  *a ptr - pointer to that is returned to the calling function in lua
8869  **
8870  *b Callable From:
8871  **
8872  *- - C++
8873  **
8874  *b C++ Example:
8875  **
8876  *e int push_graphics_view_to_lua(lua_State *L)
8877  *e {
8878  *e bdiQGraphicsView* graphics_view = get_primary_3d_window_graphics_view();
8879  *e if (m_scenario->push_qt_pointer_to_lua(L, "QGraphicsView*", graphics_view) == -1)
8880  *e {
8881  *e return 0;
8882  *e }
8883  *e return 1;
8884  *e }
8885  **
8886  ** Plug-in init code:
8887  **
8888  *e lua_State* L = (lua_State*)scenario->get_lua_state();
8889  *e if (L)
8890  *e {
8891  *e lua_register(L, "get_graphics_view", push_graphics_view_to_lua);
8892  *e }
8893  **
8894  ** In lua:
8895  **
8896  *e local graphics_view = get_graphics_view();
8897  **
8898  **/
8899  int push_qt_pointer_to_lua(void* lua_state,
8900  const char* class_name,
8901  void* ptr);
8902 
8903  /*l
8904  *b Description:
8905  **
8906  ** The most open function calling function available, if this doesn't
8907  ** manage to accomplish what you need you probably want to start
8908  ** using the lua interpreter directly.
8909  **
8910  ** The type arguments are string versions of the type being sent to
8911  ** lua, options include:
8912  *>
8913  *- - '' - empty argument
8914  *- - 'b' boolean - void* argument1 is assumed to be an int
8915  *- - 'f' field - void* argument1 assumed to be character string of
8916  *- a field of a global lua object; supports nested
8917  *- fields like foo.bar.a
8918  *- - 's' string - void* argument1 assumed to be character string
8919  *- - 'd' double - void* argument is assumed to be a double
8920  *- - diguy... - void* argument assumed to be a diguy class
8921  *- pointer ie "diguyCharacter", "diguyCrowd" (no
8922  *- star used for diguy classes)
8923  *- - Q...* - void* argument is assumed to be a pointer to a
8924  *- child of QObject; the class name should be a core
8925  *- class of qt with a star after it, e.g. "QWidget*"
8926  *- or "QLineEdit*"
8927  *<
8928  *b Arguments:
8929  **
8930  *a lua_object - a global lua object
8931  *a function_name - name of the function to call
8932  *a arg(1/2/3/4)_type - is the data type
8933  *a argument(1/2/3/4) - void* pointers to data
8934  *a has_return_string - if set to 1 function will pop the top value of
8935  *a the lua stack and return it as a string
8936  **
8937  *b Returns:
8938  **
8939  ** NULL or string representation of lua_object:function_name(argument)
8940  **
8941  ** The returned string should be copied if it needs to be used later.
8942  **
8943  *b Callable From:
8944  **
8945  *- - C++
8946  **/
8947  const char* lua_evaluate_object_function_4a_flex(const char* lua_object,
8948  const char* function_name,
8949  const char* arg1_type, void* argument1,
8950  const char* arg2_type, void* argument2,
8951  const char* arg3_type, void* argument3,
8952  const char* arg4_type, void* argument4,
8953  int has_return_string = 0);
8954 
8955  /*l
8956  *b Description:
8957  **
8958  ** Effectively the same as diguyScenario::lua_evaluate_object_function_4a_flex()
8959  ** but works on global functions.
8960  **
8961  *b Callable From:
8962  **
8963  *- - C++
8964  */
8965  const char* lua_evaluate_global_function_4a_flex(const char* function_name,
8966  const char* arg_type, void* argument,
8967  const char* arg_type2, void* argument2,
8968  const char* arg_type3, void* argument3,
8969  const char* arg_type4, void* argument4,
8970  int has_return_string = 0);
8971 
8972 #endif
8973 
8974  /*l
8975  *b Description:
8976  **
8977  ** Prints a message to lua interpreter log object. In DI-Guy
8978  ** Scenario this is sent to the AI Mind Editor and used to fill out
8979  ** the error log. The Mind editor log parses debug.traceback()
8980  ** calls.
8981  **/
8982  int lua_log_printf(int notify_level, const char* string);
8983 
8984  /*l
8985  *b Returns:
8986  **
8987  ** package meta data as a formatted string; useful for debugging,
8988  ** only valid inside DI-Guy Scenario
8989  */
8990  const char* dump_package_info(const char* package_name);
8991 
8992 /*****************************************************************************/
8998  /*l
8999  **
9000  *b Description:
9001  **
9002  ** Sends a message to specified diguyCharacter. The recipient must have a
9003  ** Lua mind that is capable of handling the message. The message will wake up
9004  ** the sleep() function in the mind that last relinquished control
9005  ** from the mind's coroutine.
9006  **
9007  *b Arguments:
9008  **
9009  *a to_character - the diguyCharacter to receive the message
9010  *a from_character - the diguyCharacter from whom the message originates
9011  *a message_type - should properly be "signal", but other settings may be used
9012  *a message - the actual name of the message, e.g. "detonation"
9013  *a message_params - comma-separated parameters, for use by the message handler
9014  **
9015  *b Returns:
9016  **
9017  ** 1 if message delivery successful, otherwise 0
9018  **
9019  *b Callable From:
9020  **
9021  *- - C++ and Lua
9022  **/
9023  int send_message(diguyCharacter *to_character,
9024  diguyCharacter *from_character,
9025  const char* message_type,
9026  const char* message,
9027  const char* message_params = NULL);
9028 
9029  /*l
9030  **
9031  *b Description:
9032  **
9033  ** Broadcasts a message to all other diguyCharacters within a certain
9034  ** radius of the from_character. The recipients must have Lua minds
9035  ** that are capable of handling the message. The message will wake up
9036  ** the sleep() function in the mind that last relinquished control
9037  ** from the mind's coroutine.
9038  **
9039  *b Arguments:
9040  **
9041  *a from_character - the diguyCharacter from whom the message originates
9042  *a radius - how far the broadcast goes (in meters) from the from_character
9043  *a message_type - should properly be "broadcast", but other settings may be used
9044  *a message - the actual name of the message, e.g. "detonation"
9045  *a message_params - comma-separated parameters, for use by the message handler
9046  **
9047  *b Returns:
9048  **
9049  ** -1 for failure, >= 0 for number of successful receptions
9050  **
9051  *b Callable From:
9052  **
9053  *- - C++ and Lua
9054  **/
9055  int broadcast_message(diguyCharacter *from_character,
9056  float radius,
9057  const char* message_type,
9058  const char* message,
9059  const char* message_params = NULL);
9060 
9061  /*l
9062  **
9063  *b Description:
9064  **
9065  ** Broadcasts a message to all diguyCharacters within named group, who
9066  ** are within given radius of the from_character. See comments for
9067  ** broadcast_message() above.
9068  **
9069  *b Arguments:
9070  **
9071  *a from_character - the diguyCharacter from whom the message originates
9072  *a group_name - name of group to broadcast to
9073  *a radius - how far the broadcast goes (in meters) from the from_character
9074  *a message_type - should properly be "broadcast", but other settings may be used
9075  *a message - the actual name of the message, e.g. "detonation"
9076  *a message_params - comma-separated parameters, for use by the message handler
9077  **
9078  *b Returns:
9079  **
9080  ** -1 for failure, >= 0 for number of successful receptions
9081  **
9082  *b Callable From:
9083  **
9084  *- - C++ and Lua
9085  **/
9086  int broadcast_message_to_group(diguyCharacter *from_character,
9087  const char* group_name,
9088  float radius,
9089  const char* message_type,
9090  const char* message,
9091  const char* message_params = NULL);
9092 
9093 /****************************************************************************/
9094 /****************************************************************************/
9095 /****************************************************************************/
9102 /****************************************************************************/
9103 /****************************************************************************/
9104 /****************************************************************************/
9105 
9106  /*l
9107  *b Returns:
9108  **
9109  ** value set by last call to set_eval_decisions_as_scripts()
9110  */
9111  int get_eval_decisions_as_scripts();
9112 
9113  /*l
9114  *b Description:
9115  **
9116  ** If called with an argument of 1, all decision beads and decision beads will
9117  ** be converted to scripts before being run.
9118  */
9119  void set_eval_decisions_as_scripts(int eval_decisions_as_scripts);
9120 
9121  /*l
9122  *b Description:
9123  **
9124  ** Gets the point of impact with the world along specified line segment
9125  **
9126  *b Returns:
9127  **
9128  ** pointer to diguyImpact object or NULL
9129  */
9130  diguyImpact* get_impact_on_line(float from_x,
9131  float from_y,
9132  float from_z,
9133  float to_x,
9134  float to_y,
9135  float to_z);
9136 
9137  /*l
9138  *b Description:
9139  **
9140  ** Increments wait cursor counter. If non-zero, then wait cursor is displayed
9141  ** in DI-GUY scenario.
9142  */
9143  void wait_cursor_push();
9144  /*l
9145  *b Description:
9146  **
9147  ** Decrements wait cursor counter.
9148  */
9149  void wait_cursor_pop();
9150 
9152  diguyParticleSystemRenderer * get_particle_renderer();
9153 
9155  void set_character_sorting_enabled(int enabled);
9156  int get_character_sorting_enabled();
9157 
9158 #ifdef CPLUSPLUS_ONLY
9159 
9160  /*l
9161  *b Description:
9162  **
9163  ** This function sets a generic node pointer that can later be
9164  ** retrieved by the get_graphics_api_node_ptr() call. The pointer is
9165  ** otherwise not used.
9166  **
9167  *b Arguments:
9168  **
9169  *a node_ptr - generic void* pointer
9170  **
9171  *b Callable From:
9172  **
9173  *- - C++
9174  */
9175  void set_graphics_api_node_ptr(void* node_ptr);
9176 
9177  /*l
9178  *b Returns:
9179  **
9180  ** pointer set by most recent call to set_graphics_api_node_ptr
9181  **
9182  *b Callable From:
9183  **
9184  *- - C++
9185  */
9186  void* get_graphics_api_node_ptr();
9187 
9188 #endif
9189 
9190  /*l
9191  *b Description:
9192  **
9193  ** Sets whether shadow disks are drawn for characters. Call with 1 to turn on,
9194  ** 0 to turn off.
9195  */
9196  void set_draw_character_shadow_disks(int draw_character_shadow_disks);
9197 
9198  /*l
9199  *b Returns:
9200  **
9201  ** 1 if shadow disks are drawn, 0 if not
9202  */
9203  int get_draw_character_shadow_disks();
9204 
9205  /*l
9206  *b Returns:
9207  **
9208  ** size of texture map for shadows
9209  */
9210  int get_shadow_map_size();
9211 
9212  /*l
9213  *b Description:
9214  **
9215  ** Sets size of texture map for shadows. Defaults to 1024. Allowed values
9216  ** are powers of two up to 4096.
9217  */
9218  int set_shadow_map_size(int shadow_size);
9219 
9220  /*l
9221  *b Description:
9222  **
9223  ** Used for DI-Guy OSG Author Programming Example. Sets the default value
9224  ** used for characters. See also diguyCharacter::set_scene_graph_mask()
9225  */
9226  void set_default_character_scene_graph_mask(unsigned long mask);
9227  unsigned long get_default_character_scene_graph_mask();
9228 
9229  /*l
9230  *b Description:
9231  **
9232  ** Used for DI-Guy OSG Author Programming Example. Sets the default value
9233  ** used for characters. See also diguySceneObject::set_scene_graph_mask()
9234  */
9235  void set_default_scene_object_scene_graph_mask(unsigned long mask);
9236  unsigned long get_default_scene_object_scene_graph_mask();
9237 
9238  /*l
9239  *b Description:
9240  **
9241  ** For internal use.
9242  */
9243  void set_internal_int(int var, int val);
9244  void set_internal_float(int var, float val);
9245 
9246  /*l
9247  *b Description:
9248  **
9249  ** This sets the number of point lights that get handed down to
9250  ** diguyGraphicsShaderTechnique::pick_shader_program().
9251  */
9252  int set_num_active_point_lights(int active_lights);
9253 
9254  /*l
9255  *b Description:
9256  ** This gets the number of point lights that get handed down to
9257  ** diguyGraphicsShaderTechnique::pick_shader_program() the default is 0.
9258  ** The convenience function diguyOglUtils::update_lighting()
9259  ** shows sample implementation for feeding this data into uniform buffers.
9260  **/
9261  int get_num_active_point_lights();
9262 
9263 /****************************************************************************/
9264 /****************************************************************************/
9265 /****************************************************************************/
9269 /****************************************************************************/
9270 /****************************************************************************/
9271 /****************************************************************************/
9272 
9273  /*l
9274  *b Description:
9275  **
9276  ** Sets bounding box of world
9277  **
9278  *b Arguments:
9279  **
9280  *a x_min,y_min,z_min,x_max,y_max,z_max - bounds
9281  **
9282  *b Returns:
9283  **
9284  ** 0 on success, -1 on failure
9285  ** (float * arguments converted to return values in Lua)
9286  */
9287  int set_world_bounds(float x_min, float y_min, float z_min,
9288  float x_max, float y_max, float z_max);
9289 
9290  /*l
9291  *b Description:
9292  **
9293  ** Gets bounding box of world
9294  **
9295  *b Arguments:
9296  **
9297  *a x_min,y_min,z_min,x_max,y_max,z_max - output parameters
9298  **
9299  *b Returns:
9300  **
9301  ** 0 on success, -1 on failure
9302  ** (float * arguments converted to return values in Lua)
9303  */
9304  int get_world_bounds(float* x_min, float* y_min, float* z_min,
9305  float* x_max, float* y_max, float* z_max);
9306 
9307 
9308 
9309 /****************************************************************************/
9310 /****************************************************************************/
9311 /****************************************************************************/
9315 /****************************************************************************/
9316 /****************************************************************************/
9317 /****************************************************************************/
9318 
9319  /*l
9320  *b Description:
9321  **
9322  ** Internal use
9323  */
9324  void set_checkpoint_frequency(float freq);
9325  /*l
9326  *b Description:
9327  **
9328  ** Internal use
9329  */
9330  float get_checkpoint_frequency();
9331  /*l
9332  *b Description:
9333  **
9334  ** Internal use
9335  */
9336  void set_checkpointing_enabled(int enable_checkpointing);
9337  /*l
9338  *b Description:
9339  **
9340  ** Internal use
9341  */
9342  int get_checkpointing_enabled();
9343 
9344  // should be removed, only for testing
9345  //void checkpoint();
9346  //void load_checkpoint();
9347 
9348 /****************************************************************************/
9349 /****************************************************************************/
9350 /****************************************************************************/
9354 /****************************************************************************/
9355 /****************************************************************************/
9356 /****************************************************************************/
9357 
9358  /*l
9359  *b Description:
9360  **
9361  ** Sets initial render mode
9362  **
9363  *b Arguments:
9364  **
9365  *a render_mode - string containing render mode setting name
9366  **
9367  ** Built-in render modes:
9368  **
9369  *- "normal"
9370  *- "shadow"
9371  *- "glow"
9372  *- "alternate1"
9373  *- "alternate2"
9374  *- "alternate3"
9375  */
9376  void set_initial_render_mode(const char* render_mode);
9377 
9378  /*l
9379  *b Returns:
9380  **
9381  ** initial render mode, as string
9382  **
9383  */
9384  const char* get_initial_render_mode();
9385 
9386  /*l
9387  *b Description:
9388  **
9389  ** Sets current render mode. See set_initial_render_mode()
9390  **
9391  */
9392  void set_current_render_mode(const char* render_mode);
9393 
9394  /*l
9395  *b Returns:
9396  **
9397  ** render mode, as string, derived from current light settings
9398  **
9399  *b Arguments:
9400  **
9401  *a set_current_to_derived - if 1, current render mode becomes derived
9402  *- mode
9403  **
9404  */
9405  const char* derive_render_mode_from_light_settings(int set_current_to_derived = 1);
9406 
9408  const char* get_current_render_mode();
9409 
9410  /*l
9411  *b Description:
9412  **
9413  ** Sets default shader for characters
9414  **
9415  *b Arguments:
9416  **
9417  *a render_mode - string containing render mode name
9418  *a shader_name - string containing name of shader technique
9419  *- (there should be a _glsl.cfg file of the same name)
9420  *a update_existing_characters - if 1, all existing characters will now
9421  *- be drawn using this shader
9422  */
9423  void set_default_character_shader(const char* render_mode,
9424  const char* shader_name,
9425  int update_existing_characters = 1);
9426 
9428  const char* get_default_character_shader(const char* render_mode);
9429 
9430  /*l
9431  *b Description:
9432  **
9433  ** Sets default shader for scene objects
9434  **
9435  *b Arguments:
9436  **
9437  *a render_mode - string containing render mode name
9438  *a shader_name - string containing name of shader technique
9439  *- (there should be a _glsl.cfg file of the same name)
9440  *a update_existing_scene_objects - if 1, all existing scene objects will now
9441  *- be drawn using this shader
9442  */
9443  void set_default_scene_object_shader(const char* render_mode,
9444  const char* shader_name,
9445  int update_existing_scene_objects = 1);
9446 
9448  const char* get_default_scene_object_shader(const char* render_mode);
9449 
9450  /*l
9451  *b Description:
9452  **
9453  ** Sets default shader for particle systems
9454  **
9455  *b Arguments:
9456  **
9457  *a render_mode - string containing render mode name
9458  *a shader_name - string containing name of shader technique
9459  *- (there should be a _glsl.cfg file of the same name)
9460  *a update_existing_particle_systems - if 1, all existing particle systems will now
9461  *- be drawn using this shader
9462  */
9463  void set_default_particle_system_shader(const char* render_mode,
9464  const char* shader_name,
9465  int update_existing_particle_systems = 1);
9466 
9468  const char* get_default_particle_system_shader(const char* render_mode);
9469 
9470  /*l
9471  *b Description:
9472  **
9473  ** Sets FaceFX animation set for a given actor.
9474  **
9475  *b Arguments:
9476  **
9477  *a actor_name - actor's name
9478  *a file_name - fully qualified file name ending in ".animset_ingame"
9479  */
9480  int facefx_mount_animset(const char* actor_name, const char* file_name);
9481 
9482  /*l
9483  *b Description:
9484  **
9485  ** Sets vehicle smoothing on or off. If 1, vehicle will be updated
9486  ** at a higher rate than frame dt
9487  **
9488  ** Default is on.
9489  */
9490  int set_vehicle_smoothing_enabled(int enable_smoothing);
9491  int get_vehicle_smoothing_enabled();
9492 
9493  /*l
9494  *b Description:
9495  **
9496  ** Sets realtime IK on or off. Experimental.
9497  **
9498  */
9499  int set_realtime_ik_enabled( int val );
9500  int get_realtime_ik_enabled();
9501 
9502  int set_draw_ik_visuals( int val );
9503  int get_draw_ik_visuals();
9504 
9505  int set_draw_skeletons( int val );
9506  int get_draw_skeletons();
9507 
9508  float get_last_update_time()
9509  {
9510  if ( m_last_update_time == -9999.0f )
9511  {
9512  return 0.0f;
9513  }
9514  return m_last_update_time;
9515  }
9516 
9517  void set_disable_profiler();
9518 
9519 
9520  const char* get_lua_field_as_string(const char* lua_object, const char* field_name,
9521  int warn_if_no_field = 1);
9522 
9523  float get_lua_field_as_float(const char* lua_object, const char* field_name,
9524  int warn_if_no_field = 1,
9525  int* found_field = NULL);
9526 
9527  void update_particle_preview(float time);
9528 
9529 
9530 /****************************************************************************/
9531 /****************************************************************************/
9532 /****************************************************************************/
9543 /****************************************************************************/
9544 /****************************************************************************/
9545 /****************************************************************************/
9546 
9548  int get_character_type_num_head_appearances( const char* character_type );
9549 
9551  const char* get_character_type_head_appearance_at_index( const char* character_type, int index );
9552 
9553 #ifdef CPLUSPLUS_ONLY
9554 
9555  /*l
9556  *b Description:
9557  **
9558  ** Deprecated; use diguyApp::add_default_scenario_callback() instead.
9559  */
9560  static int add_default_callback(int callback_id,
9561  diguyScenarioCallback* callback,
9562  void* callback_params = 0,
9563  void* callback_user_data = 0);
9564 
9565  /*l
9566  *b Description:
9567  **
9568  ** Deprecated; use diguyApp::remove_default_scenario_callback() instead.
9569  */
9570  static int remove_default_callback(int callback_id,
9571  diguyScenarioCallback* callback);
9572 
9573 #endif
9574 
9575  /*l
9576  *b Description:
9577  **
9578  ** Deprecated;
9579  ** use diguyApp::remove_default_scenario_callback_with_User_data()
9580  ** instead.
9581  */
9582  static int remove_default_callback_with_user_data(int callback_id,
9583  void* callback_user_data);
9584 
9585  /*l
9586  *b Description:
9587  **
9588  ** Deprecated; use diguyApp::add_default_scenario_callback_script()
9589  ** instead.
9590  */
9591  static int add_default_callback_script(int callback_id,
9592  const char* callback_script,
9593  const char* callback_script_type);
9594 
9595  /*l
9596  *b Description:
9597  **
9598  ** Deprecated; use diguyApp::remove_default_scenario_callback_script()
9599  ** instead.
9600  */
9601  static int remove_default_callback_script(int callback_id,
9602  const char* callback_script,
9603  const char* callback_script_type);
9604 
9605  /*l
9606  *b Description:
9607  **
9608  ** Deprecated as of 10.0.0; use get_character_type_map() intead,
9609  ** and then call
9610  ** diguyCharacterTypeMap::get_field_value(DIGUY_CHARACTER_TYPE_MAP_FIELD_CHARACTER_CLASS)
9611  */
9612  const char* get_character_type_class(const char* character_type);
9613 
9614  /*l
9615  *b Description:
9616  **
9617  ** Deprecated as of 10.5.1; use merge_object() intead.
9618  */
9619  int merge_asset(const char* string);
9620 
9621  /*l
9622  *b Description:
9623  **
9624  ** Deprecated as of 12.0.0; use bdi_log_print() from libbdilog.h
9625  ** instead.
9626  */
9627  void print_to_log(int notify_level, const char* string);
9628 
9629 
9630 #ifdef CPLUSPLUS_ONLY
9631 
9632  /*
9633  *2 VegaPrime Helper Functions
9634  */
9635  diguyCharacter* create_pending_reflected_character(const char* name,
9636  const char* character_type,
9637  const char* appearance = NULL);
9638 
9639  int set_network_translation(float x, float y, float z);
9640  int get_network_translation(float* x, float* y, float* z);
9641 
9642  /*l
9643  *b Description:
9644  **
9645  ** Deprecated as of 12.0.0; use save_as() instead.
9646  */
9647  void set_project_filename(const char* project_filename);
9648 
9649  /*l
9650  *b Description:
9651  **
9652  ** Deprecated as of 12.0.0; use get_filename() or
9653  ** get_filename_without_directory() intead.
9654  */
9655  const char* get_project_filename();
9656 
9662  bdiScenario* get_scripted_object();
9663 
9664 
9665 private:
9666 
9667  /*l
9668  ** A private constructor. Use the DI-Guy function
9669  ** diguy_create_scenario() to obtain a diguyScenario object pointer.
9670  */
9671  diguyScenario(bdiScenario* scenario);
9672 
9673  /*l
9674  ** A private destructor. Use the DI-Guy function
9675  ** diguy_destroy_scenario() to delete a diguyScenario object pointer.
9676  */
9677  virtual ~diguyScenario();
9678 
9679  /*l
9680  ** A pointer to internal data.
9681  */
9682  bdiScenario* m_scenario;
9683  float m_last_update_time;
9684 
9685  friend class bdiScenario;
9686 
9687 #endif
9688 
9689 };
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
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:46
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