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