DI-Guy SDK Documentation  13.6
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 Returns:
3555  **
3556  ** number of secondary views in the scenario
3557  */
3558  int get_num_secondary_views();
3559 
3560  /*l
3561  *b Returns:
3562  **
3563  ** pointer of type diguyView; NULL if no
3564  ** secondary view at the specified index
3565  **
3566  *b Arguments:
3567  **
3568  *a index - index of the secondary view; indices start at 0
3569  */
3570  diguyView* get_secondary_view_at_index(int index);
3571 
3572  /*l
3573  *b Description:
3574  **
3575  ** This function returns a pointer to the view with
3576  ** the given name. The primary view and all of the
3577  ** secondary views are checked for a name match.
3578  **
3579  *b Returns:
3580  **
3581  ** pointer of type diguyView; NULL if not found
3582  */
3583  diguyView* find_view(const char* name);
3584 
3585 
3586 /*****************************************************************************/
3596  /*l
3597  *b Description:
3598  **
3599  ** This function returns a pointer to the primary view's camera.
3600  ** This is equivalent to:
3601  **
3602  *e diguyView* v = scenario->get_primary_view();
3603  *e return v->get_camera();
3604  **
3605  *b Returns:
3606  **
3607  ** pointer of type diguyViewCamera; should never be NULL
3608  */
3609  diguyViewCamera* get_scenario_camera();
3610 
3611  /*l
3612  *b Description:
3613  **
3614  ** This function returns a pointer to the camera with
3615  ** the given name. The primary view's camera and all of the
3616  ** secondary views' cameras are checked for a name match.
3617  **
3618  *b Returns:
3619  **
3620  ** pointer of type diguyViewCamera; NULL if not found
3621  */
3622  diguyViewCamera* find_camera(const char* name);
3623 
3624  /*l
3625  *b Description:
3626  **
3627  ** This function sets a flag that determines whether script
3628  ** calls can set the primary view's camera settings.
3629  ** Specifically, if flag is 0, calls to diguyViewCamera::load()
3630  ** will have no effect; the camera should remain completely under
3631  ** user control.
3632  **
3633  *b Arguments:
3634  **
3635  *a flag - 1 to enable, 0 to disable
3636  */
3637  void set_scenario_camera_affected_by_script_events(int flag);
3638 
3639  /*l
3640  *b Returns:
3641  **
3642  ** the most recent setting made by
3643  ** set_scenario_camera_affected_by_script_events()
3644  */
3645  int get_scenario_camera_affected_by_script_events();
3646 
3647  /*l
3648  *b Description:
3649  **
3650  ** This function, like
3651  ** set_scenario_camera_affected_by_script_events(), determines
3652  ** whether script calls can set the primary view's camera settings,
3653  ** but only disables camera changes if there is an active I-Guy
3654  ** character as set by the set_iguy_character() call.
3655  **
3656  ** If set_scenario_camera_affected_by_script_events() has been called
3657  ** with a value of 0, then this function has no effect.
3658  **
3659  *b Arguments:
3660  **
3661  *a flag - 1 to enable, 0 to disable
3662  */
3663  void set_scenario_camera_affected_by_script_events_when_iguy_active(int flag);
3664 
3665  /*l
3666  *b Returns:
3667  **
3668  ** the most recent setting made by
3669  ** set_scenario_camera_affected_by_script_events()
3670  */
3671  int get_scenario_camera_affected_by_script_events_when_iguy_active();
3672 
3673  /*l
3674  *b Returns:
3675  **
3676  ** number of camera settings saved in the scenario
3677  */
3678  int get_num_camera_settings();
3679 
3680  /*l
3681  *b Returns:
3682  **
3683  ** pointer of type diguyViewCameraSettings; NULL if no
3684  ** camera settings at the specified index
3685  **
3686  *b Arguments:
3687  **
3688  *a index - index of the camera settings; indices start at 0
3689  */
3690  diguyViewCameraSettings* get_camera_settings_at_index(int index);
3691 
3692  /*l
3693  *b Description:
3694  **
3695  ** This function returns a pointer to the specified camera settings.
3696  **
3697  *b Arguments:
3698  **
3699  *a settings_name - name of camera settings to be found
3700  **
3701  *b Returns:
3702  **
3703  ** pointer of type diguyViewCamera; NULL if not found
3704  */
3705  diguyViewCameraSettings* find_camera_settings(const char* settings_name);
3706 
3707  /*l
3708  *b Description:
3709  **
3710  ** This function loads the specified camera settings into
3711  ** the primary view's camera.
3712  **
3713  *b Arguments:
3714  **
3715  *a settings_name - name of camera settings to be loaded
3716  *a update_current_camera - whether the current camera should be
3717  *a updated; defaults to 1
3718  **
3719  ** Not updating the current camera will cause the camera history
3720  ** to be lost.
3721  **
3722  *b Returns:
3723  **
3724  ** 0 on success, -1 on failure
3725  */
3726  int load_camera_settings(const char* settings_name, int update_current_camera = 1);
3727 
3728  /*l
3729  *b Description:
3730  **
3731  ** This function sets camera that will be used for down-stream
3732  ** camera-related operations. This includes:
3733  **
3734  *- - far position rendering in the OpenGL renderer
3735  *- - various culling operations (e.g. set_character_culling_enabled())
3736  *- - graphics LOD range scaling; see
3737  *- set_scale_graphics_lod_ranges_from_view_settings()
3738  **
3739  ** Typically the passed camera should be the primary view's camera.
3740  **
3741  ** A render camera does not always need to be set. If one is not
3742  ** set, the above camera-related operations will not be performed.
3743  **
3744  ** If a render camera is set the actual rendering environment
3745  ** camera settings (e.g. as set by gluLookAt() in OpenGL)
3746  ** should match the settings in the render camera, or there
3747  ** may be unexpected visual results.
3748  **
3749  *b Arguments:
3750  **
3751  *a camera - camera to use for camera-related operations
3752  */
3753  void set_render_camera(diguyViewCamera* camera);
3754  diguyViewCamera* get_render_camera();
3755 
3756 /*****************************************************************************/
3766  /*l
3767  *b Description:
3768  **
3769  ** This function returns a pointer to the scenario fog.
3770  ** This is the fog of the primary view.
3771  **
3772  *b Returns:
3773  **
3774  ** pointer of type diguyViewFog; should never be NULL
3775  */
3776  diguyViewFog* get_scenario_fog();
3777 
3778  /*l
3779  *b Description:
3780  **
3781  ** This function returns a pointer to the fog with
3782  ** the given name. The primary view's fog and all of the
3783  ** secondary views' fogs are checked for a name match.
3784  **
3785  *b Returns:
3786  **
3787  ** pointer of type diguyViewFog; NULL if not found
3788  */
3789  diguyViewFog* find_fog(const char* name);
3790 
3791  /*l
3792  *b Description:
3793  **
3794  ** This function returns the fog object with the given name, or
3795  ** creates one if not found.
3796  **
3797  *b Returns:
3798  **
3799  ** pointer of type diguyViewFog
3800  **
3801  *b Arguments:
3802  **
3803  *a name
3804  */
3805  diguyViewFog* find_or_create_fog(const char* name);
3806 
3807  /*l
3808  *b Description:
3809  **
3810  ** This function loads the named fog settings the currently active
3811  ** one.
3812  **
3813  *b Arguments:
3814  **
3815  *a name
3816  */
3817  void load_current_fog(const char* name);
3818 
3819  /*l
3820  *b Returns:
3821  **
3822  ** number of fog settings in the scenario
3823  */
3824  int get_num_fog_settings();
3825 
3826  /*l
3827  *b Returns:
3828  **
3829  ** pointer of type diguyViewFogSettings; NULL if no
3830  ** fog at the specified index
3831  **
3832  *b Arguments:
3833  **
3834  *a index - index of the fog settings; indices start at 0
3835  */
3836  diguyViewFogSettings* get_fog_settings_at_index(int index);
3837 
3838  /*l
3839  *b Description:
3840  **
3841  ** This function returns a pointer to the specified fog settings.
3842  **
3843  *b Arguments:
3844  **
3845  *a settings_name - name of fog settings to be found
3846  **
3847  *b Returns:
3848  **
3849  ** pointer of type diguyViewFogSettings; NULL if not found
3850  */
3851  diguyViewFogSettings* find_fog_settings(const char* settings_name);
3852 
3853  /*l
3854  *b Description:
3855  **
3856  ** This function loads the specified fog settings into
3857  ** the scenario fog.
3858  **
3859  *b Arguments:
3860  **
3861  *a settings_name - name of fog settings to be loaded
3862  **
3863  *b Returns:
3864  **
3865  ** pointer of type diguyViewFog; NULL if not found
3866  */
3867  int load_fog_settings(const char* settings_name);
3868 
3869 
3870 /*****************************************************************************/
3880  /*l
3881  *b Description:
3882  **
3883  ** This function returns a pointer to the scenario light.
3884  ** These are the lights of the primary view.
3885  **
3886  *b Arguments:
3887  **
3888  *a number - number of light to be found
3889  **
3890  *b Returns:
3891  **
3892  ** pointer of type diguyViewLight; can be null if asked for a
3893  ** non-existent light
3894  */
3895  diguyViewLight* get_scenario_light(int i = 0);
3896 
3897  /*l
3898  *b Description:
3899  **
3900  ** This function returns a pointer to the light with
3901  ** the given name. The primary view's light and all of the
3902  ** secondary views' lights are checked for a name match.
3903  **
3904  *b Returns:
3905  **
3906  ** pointer of type diguyViewLight; NULL if not found
3907  */
3908  diguyViewLight* find_light(const char* name);
3909 
3910  /*l
3911  *b Returns:
3912  **
3913  ** number of light settings in the scenario
3914  */
3915  int get_num_light_settings();
3916 
3917  /*l
3918  *b Returns:
3919  **
3920  ** pointer of type diguyViewLightSettings; NULL if no
3921  ** light settings at the specified index
3922  **
3923  *b Arguments:
3924  **
3925  *a index - index of the light settings; indices start at 0
3926  */
3927  diguyViewLightSettings* get_light_settings_at_index(int index);
3928 
3929  /*l
3930  *b Description:
3931  **
3932  ** This function returns a pointer to the specified light settings.
3933  **
3934  *b Arguments:
3935  **
3936  *a name - name of light settings to be found
3937  **
3938  *b Returns:
3939  **
3940  ** pointer of type diguyViewLightSettings; NULL if not found
3941  */
3942  diguyViewLightSettings* find_light_settings(const char* settings_name);
3943 
3944  /*l
3945  *b Description:
3946  **
3947  ** This function loads the specified light settings into
3948  ** the scenario light.
3949  **
3950  *b Arguments:
3951  **
3952  *a settings_name - name of light settings to be loaded
3953  *a light_num - which light to load into
3954  **
3955  *b Returns:
3956  **
3957  ** pointer of type diguyViewLight; NULL if not found
3958  */
3959  int load_light_settings(const char* settings_name, int light_num = 0);
3960 
3966  void set_use_override_ambient_material(int enabled);
3967 
3969  int get_use_override_ambient_material();
3970 
3972  void set_global_ambient_material(float value);
3973 
3975  float get_global_ambient_material();
3976 
3977 /*****************************************************************************/
3987  /*l
3988  *b Returns:
3989  **
3990  ** number of info popups in the scenario
3991  */
3992  int get_num_info_popups();
3993 
3994  /*l
3995  *b Returns:
3996  **
3997  ** pointer of type diguyInfoPopup; NULL if no
3998  ** info popup at the specified index
3999  **
4000  *b Arguments:
4001  **
4002  *a index - index of the info popup; indices start at 0
4003  */
4004  diguyInfoPopup* get_info_popup_at_index(int index);
4005 
4006  /*l
4007  *b Description:
4008  **
4009  ** This function returns a pointer to the specified info popup.
4010  **
4011  *b Arguments:
4012  **
4013  *a name - name of info popup to be found
4014  **
4015  *b Returns:
4016  **
4017  ** pointer of type diguyInfoPopup; NULL if not found
4018  */
4019  diguyInfoPopup* find_info_popup(const char* name);
4020 
4021  /*l
4022  *b Description:
4023  **
4024  ** This function sets the default encoding for info popups
4025  ** that do not have an encoding specified.
4026  **
4027  *b Arguments:
4028  **
4029  *a info_popup_default_encoding - new default encoding
4030  **
4031  *b Returns:
4032  **
4033  ** 0 on success, -1 on failure
4034  */
4035  int set_info_popup_default_encoding(const char* info_popup_default_encoding);
4037  /*l
4038  *b Description:
4039  **
4040  ** This function returns the default encoding of info popups.
4041  **
4042  *b Returns:
4043  **
4044  ** default encoding; value will never be NULL, but may be
4045  ** the empty string ("") if no default encoding has been
4046  ** specified
4047  */
4048  const char* get_info_popup_default_encoding();
4051 /*****************************************************************************/
4061  /*l
4062  *b Returns:
4063  **
4064  ** number of variables in the scenario
4065  */
4066  int get_num_variables();
4067 
4068  /*l
4069  *b Returns:
4070  **
4071  ** pointer of type diguyVariable; NULL if no
4072  ** variable at the specified index
4073  **
4074  *b Arguments:
4075  **
4076  *a index - index of the variable; indices start at 0
4077  */
4078  diguyVariable* get_variable_at_index(int index);
4079 
4080  /*l
4081  *b Description:
4082  **
4083  ** This function returns a pointer to the specified variable.
4084  **
4085  *b Arguments:
4086  **
4087  *a name - name of variable to be found
4088  **
4089  *b Returns:
4090  **
4091  ** pointer of type diguyVariable; NULL if not found
4092  */
4093  diguyVariable* find_variable(const char* name);
4094 
4095  /*l
4096  *b Description:
4097  **
4098  ** This function finds the variable with the given name or
4099  ** creates it if it doesn't exist.
4100  **
4101  *b Arguments:
4102  **
4103  *a name - name of the variable to find or create
4104  **
4105  *b Returns:
4106  **
4107  ** pointer of type diguyVariable; should never be NULL
4108  */
4109  diguyVariable* find_or_create_variable(const char* name);
4110 
4111  /*l
4112  *b Description:
4113  **
4114  ** This function destroys the passed variable.
4115  **
4116  *b Arguments:
4117  **
4118  *a variable - pointer to a diguyVariable
4119  **
4120  *b Returns:
4121  **
4122  ** 0 on success, -1 on failure
4123  */
4124  int destroy_variable(diguyVariable* variable);
4125 
4126 
4127 /*****************************************************************************/
4137  /*l
4138  *b Returns:
4139  **
4140  ** number of face_expressions in the scenario
4141  */
4142  int get_num_face_expressions();
4143 
4144  /*l
4145  *b Returns:
4146  **
4147  ** pointer of type diguyCharacterFaceExpression; NULL if no
4148  ** info popup at the specified index
4149  **
4150  *b Arguments:
4151  **
4152  *a index - index of the face_expression; indices start at 0
4153  */
4154  diguyCharacterFaceExpression* get_face_expression_at_index(int index);
4155 
4156  /*l
4157  *b Description:
4158  **
4159  ** This function returns a pointer to the specified face expression.
4160  **
4161  *b Arguments:
4162  **
4163  *a name - name of face_expression to be found
4164  **
4165  *b Returns:
4166  **
4167  ** pointer of type diguyCharacterFaceExpression; NULL if not found
4168  */
4169  diguyCharacterFaceExpression* find_face_expression(const char* name);
4170 
4171  /*l
4172  *b Description:
4173  **
4174  ** This function creates a new face expression with the given name.
4175  **
4176  *b Arguments:
4177  **
4178  *a name - name of the new face expression
4179  *a target_actor - name of the actor to use as template; defaults to
4180  *a "exface" for backwards compatiblity
4181  **
4182  *b Returns:
4183  **
4184  ** pointer of type diguyCharacterFaceExpression
4185  */
4186  diguyCharacterFaceExpression* create_face_expression(const char* name,
4187  const char* target_actor = "exface");
4188 
4189  /*l
4190  *b Description:
4191  **
4192  ** This function destroys the passed face expression.
4193  **
4194  *b Arguments:
4195  **
4196  *a face_expression - pointer to a diguyCharacterFaceExpression
4197  **
4198  *b Returns:
4199  **
4200  ** 0 on success, -1 on failure
4201  */
4202  int destroy_face_expression(diguyCharacterFaceExpression* face_expression);
4203 
4204 
4205 /*****************************************************************************/
4215  /*l
4216  *b Returns:
4217  **
4218  ** number of chain settings in the scenario
4219  */
4220  int get_num_chain_settings();
4221 
4222  /*l
4223  *b Returns:
4224  **
4225  ** pointer of type diguyChainSettings; NULL if no
4226  ** chain settings at the specified index
4227  **
4228  *b Arguments:
4229  **
4230  *a index - index of the chain settings; indices start at 0
4231  */
4232  diguyChainSettings* get_chain_settings_at_index(int index);
4233 
4234  /*l
4235  *b Description:
4236  **
4237  ** This function returns a pointer to the specified chain settings.
4238  **
4239  *b Arguments:
4240  **
4241  *a name - name of chain settings to be found
4242  **
4243  *b Returns:
4244  **
4245  ** pointer of type diguyChainSettings; NULL if not found
4246  */
4247  diguyChainSettings* find_chain_settings(const char* name);
4248 
4249  /*l
4250  *b Description:
4251  **
4252  ** This function creates a new chain settings and returns a
4253  ** pointer to it.
4254  **
4255  *b Arguments:
4256  **
4257  *a name - name of the new chain settings
4258  **
4259  *b Returns:
4260  **
4261  ** pointer of type diguyChainSettings
4262  */
4263  diguyChainSettings* create_chain_settings(const char* name);
4264 
4265  /*l
4266  *b Description:
4267  **
4268  ** This function destroys a chain settings.
4269  **
4270  *b Arguments:
4271  **
4272  *a chain settings - pointer to a diguyChainSettings
4273  **
4274  *b Returns:
4275  **
4276  ** 0 on success, -1 on failure
4277  */
4278  int destroy_chain_settings(diguyChainSettings* chain_settings);
4279 
4280 
4281 /*****************************************************************************/
4291  /*l
4292  *b Description:
4293  **
4294  ** This is an enumeration of the different callbacks
4295  ** that can be registered with add_callback() and
4296  ** add_callback_script().
4297  **
4298  ** Callbacks return a value of type diguyCallbackReturn,
4299  ** which will be DIGUY_CALLBACK_STOP or DIGUY_CALLBACK_CONTINUE.
4300  ** If the callback returns DIGUY_CALLBACK_STOP, the default handler
4301  ** of the function will not be called; the callback is asserting
4302  ** that it has done everything necessary for the function call.
4303  ** If the callback returns DIGUY_CALLBACK_CONTINUE, the default
4304  ** handler for the function will be called after the callback.
4305  **
4306  *************************************************************************
4307  *4 Callback Enums:
4308  **
4309  *i CALLBACK_ID_CREATE
4310  **
4311  ** This callback will be called when a new scenario is created.
4312  ** It should only be used by
4313  ** diguyApp::add_default_scenario_callback(). Using it in
4314  ** set_callback() will have no effect, as by that time the
4315  ** scenario has already been created.
4316  **
4317  *i CALLBACK_ID_RESET
4318  **
4319  ** This callback will be called when the scenario is reset.
4320  **
4321  *i CALLBACK_ID_WAIT_CURSOR_SHOW
4322  **
4323  ** This callback will be called when a diguy operation
4324  ** is likely to take some time, allowing an application to
4325  ** display a wait cursor.
4326  **
4327  *i CALLBACK_ID_WAIT_CURSOR_HIDE
4328  **
4329  ** This callback will be called when a diguy operation
4330  ** that caused a wait cursor to be shown has completed,
4331  ** allowing an application to hide the wait cursor.
4332  **
4333  *i CALLBACK_ID_LOAD
4334  **
4335  ** This callback will be called when a scenario is loaded, thereby
4336  ** giving a chance for custom code to read extra elements from the
4337  ** loaded file.
4338  **
4339  *i CALLBACK_ID_SAVE
4340  **
4341  ** This callback will be called when a scenario is saved, thereby
4342  ** giving a chance for custom code to insert extra elements into the
4343  ** saved file.
4344  **
4345  *i CALLBACK_ID_LOAD_SCENARIO_FILE
4346  **
4347  ** This callback will be called just before a scenario loads
4348  ** a new file.
4349  **
4350  *i CALLBACK_ID_SAVE_SCENARIO_FILE
4351  **
4352  ** This callback will be called just after a scenario saves
4353  ** a new file. With a char * pointer to the file name.
4354  **
4355  *i CALLBACK_ID_MANUALLY_INVOKED
4356  **
4357  ** This callback id will be supplied to event handlers invoked
4358  ** by a call to manually_invoke_event_handler().
4359  **
4360  ** The user's returned diguyCallbackReturn value will be ignored.
4361  **
4362  *i CALLBACK_ID_POST_DRAW
4363  **
4364  ** This callback will be called just after a scenario finishes it's
4365  ** draw commands. The diguyViewPainter class can be used to issue
4366  ** abstract draw commands in DI-Guy Scenario.
4367  **
4368  *i Lua Example:
4369  **
4370  *e local painter = this_app:get_view_painter();
4371  *e painter:set_pen_color(1,1,0);
4372  *e painter:draw_line(0,0,0, 1,1,1);
4373  **
4374  *i CALLBACK_ID_PLAYBACK_MODE_CHANGED
4375  **
4376  ** This callback will be called when the playback mode of the
4377  ** scenario has changed. For example, the Play or Stop buttons are
4378  ** pressed in DI-Guy Scenario, or set_playback_mode() is called.
4379  **
4380  ** The user's returned diguyCallbackReturn value will be ignored.
4381  **
4382  *i CALLBACK_ID_INPUT_MODE_CHANGED
4383  **
4384  ** This callback will be called when the input mode of the
4385  ** scenario has changed. For example, when an Input Mode button is
4386  ** pressed in DI-Guy Scenario, or diguyApp::set_base_input_mode()
4387  ** is called.
4388  **
4389  ** The user's returned diguyCallbackReturn value will be ignored.
4390  **
4391  *i CALLBACK_ID_RENDER_MODE_CHANGED
4392  **
4393  ** This callback will be called if the render mode of the scenario
4394  ** changes, typically due to a set_current_render_mode().
4395  **
4396  ** The user's returned diguyCallbackReturn value will be ignored.
4397  **
4398  *i CALLBACK_ID_POST_LOAD_CHECKPOINT
4399  **
4400  ** This callback will be called just after a scenario finishes
4401  ** loading a checkpoint file.
4402  */
4403  enum {
4404  CALLBACK_ID_CREATE = 1,
4405  CALLBACK_ID_DESTROY,
4406  CALLBACK_ID_RESET,
4407  CALLBACK_ID_WAIT_CURSOR_SHOW,
4408  CALLBACK_ID_WAIT_CURSOR_HIDE,
4409  CALLBACK_ID_LOAD,
4410  CALLBACK_ID_SAVE,
4411  CALLBACK_ID_LOAD_SCENARIO_FILE,
4412  CALLBACK_ID_SAVE_SCENARIO_FILE,
4413  CALLBACK_ID_SCENE_OBJECT_IMPACT,
4414  CALLBACK_ID_LEFT_CLICK_SCENE,
4415  CALLBACK_ID_RIGHT_CLICK_SCENE,
4416  CALLBACK_ID_TIMED_EVENT,
4417  CALLBACK_ID_MANUALLY_INVOKED,
4418  CALLBACK_ID_POST_DRAW,
4419  CALLBACK_ID_PLAYBACK_MODE_CHANGED,
4420  CALLBACK_ID_INPUT_MODE_CHANGED,
4421  CALLBACK_ID_RENDER_MODE_CHANGED,
4422  CALLBACK_ID_PRE_REINITIALIZE,
4423  CALLBACK_ID_POST_REINITIALIZE,
4424  CALLBACK_ID_POST_LOAD_CHECKPOINT
4425  };
4426 
4427 #ifdef CPLUSPLUS_ONLY
4428 
4429  /*l
4430  *b Description:
4431  **
4432  ** This function adds a scenario callback.
4433  **
4434  *b Arguments:
4435  **
4436  *a callback - pointer to function with prototype
4437  *a diguyScenarioCallback (typedefed above)
4438  *a callback_id - integer id of when this callback is to be called
4439  *a callback_params - not currently used; pass NULL
4440  *a callback_user_data - pointer for user's own use; DI-Guy will
4441  *a do nothing to the contents of this pointer
4442  *a beyond passing it back when the callback is
4443  *a invoked
4444  *a remove_on_scenario_load - pass 1 to remove the callback on a
4445  *a scenario load, 0 to not
4446  **
4447  *b Returns:
4448  **
4449  ** 0 on success, -1 on failure
4450  **
4451  *b Callable From:
4452  **
4453  *- - C++
4454  */
4455  int add_callback(int callback_id,
4456  diguyScenarioCallback* callback,
4457  void* callback_params = 0,
4458  void* callback_user_data = 0,
4459  int remove_on_scenario_load = 1);
4460 
4461  /*l
4462  *b Description:
4463  **
4464  ** This function removes a user callback. All callbacks matching
4465  ** the specified callback_id and callback function will be removed.
4466  **
4467  *b Arguments:
4468  **
4469  *a callback_id - integer id of callback
4470  *a callback - pointer to function with prototype
4471  *a diguyCharacterCallback (typedefed above)
4472  **
4473  *b Returns:
4474  **
4475  ** 0 on success, -1 on failure
4476  **
4477  *b Callable From:
4478  **
4479  *- - C++
4480  */
4481  int remove_callback(int callback_id,
4482  diguyScenarioCallback* callback);
4483 
4484  /*l
4485  *b Description:
4486  **
4487  ** This function removes a user callback. All callbacks matching
4488  ** the specified callback_id and callback_user_data pointer will
4489  ** be removed.
4490  **
4491  *b Arguments:
4492  **
4493  *a callback_id - integer id of callback
4494  *a callback_user_data - pointer for user's own use
4495  **
4496  *b Returns:
4497  **
4498  ** 0 on success, -1 on failure
4499  **
4500  *b Callable From:
4501  **
4502  *- - C++
4503  */
4504  int remove_callback_with_user_data(int callback_id,
4505  void* callback_user_data);
4506 
4507  /*l
4508  *b Description:
4509  **
4510  ** This function sets a default user callback that will be added to
4511  ** all new characters. See diguyCharacter::add_callback() for
4512  ** details.
4513  **
4514  *b Callable From:
4515  **
4516  *- - C++
4517  */
4518  int add_default_character_callback(int callback_id,
4519  diguyCharacterCallback* callback,
4520  void* callback_params,
4521  void* callback_user_data,
4522  int add_to_existing_objects_flag = 0,
4523  int remove_on_scenario_load = 1);
4524 
4525  /*l
4526  *b Description:
4527  **
4528  ** This function removes a user callback. All default character
4529  ** callbacks matching the specified callback_id and callback function
4530  ** will be removed.
4531  **
4532  *b Arguments:
4533  **
4534  *a callback_id - integer id of callback
4535  *a callback - pointer to function with prototype
4536  *a diguyCharacterCallback (typedefed above)
4537  **
4538  *b Callable From:
4539  **
4540  *- - C++
4541  */
4542  int remove_default_character_callback(int callback_id,
4543  diguyCharacterCallback* callback);
4544 
4545  /*l
4546  *b Description:
4547  **
4548  ** This function removes a default user callback previously added by
4549  ** add_default_character_callback(). See
4550  ** diguyCharacter::remove_callback_with_user_data() for details.
4551  **
4552  *b Callable From:
4553  **
4554  *- - C++
4555  */
4556  int remove_default_character_callback_with_user_data(int callback_id,
4557  void* callback_user_data);
4558 
4559 
4560  /*l
4561  *b Description:
4562  **
4563  ** This function sets a default user callback that will be added
4564  ** to all new sensor regions. See
4565  ** diguySensorRegion::add_callback() for details.
4566  **
4567  *b Callable From:
4568  **
4569  *- - C++
4570  */
4571  int add_default_sensor_region_callback(int callback_id,
4572  diguySensorRegionCallback* callback,
4573  void* callback_params,
4574  void* callback_user_data,
4575  int add_to_existing_objects_flag = 0,
4576  int remove_on_scenario_load = 1);
4577 
4578  /*l
4579  *b Description:
4580  **
4581  ** This function removes a user callback. All default sensor region
4582  ** callbacks matching the specified callback_id and callback function
4583  ** will be removed.
4584  **
4585  *b Arguments:
4586  **
4587  *a callback_id - integer id of callback
4588  *a callback - pointer to function with prototype
4589  *a diguyCharacterCallback (typedefed above)
4590  **
4591  *b Callable From:
4592  **
4593  *- - C++
4594  */
4595  int remove_default_sensor_region_callback(int callback_id,
4596  diguySensorRegionCallback* callback);
4597 
4598  /*l
4599  *b Description:
4600  **
4601  ** This function removes a default user callback. All default sensor
4602  ** region callbacks matching the specified callback_id and
4603  ** callback_user_data pointer will be removed.
4604  **
4605  *b Arguments:
4606  **
4607  *a callback_id - integer id of callback
4608  *a callback_user_data - pointer for user's own use
4609  **
4610  *b Callable From:
4611  **
4612  *- - C++
4613  */
4614  int remove_default_sensor_region_callback_with_user_data(int callback_id,
4615  void* callback_user_data);
4616 
4617  /*l
4618  *b Description:
4619  **
4620  ** This function adds a default user callback that will be added
4621  ** to all new signals.
4622  **
4623  *b Callable From:
4624  **
4625  *- - C++
4626  */
4627  int add_default_signal_callback(int callback_id,
4628  diguySignalCallback* callback,
4629  void* callback_params,
4630  void* callback_user_data,
4631  int add_to_existing_objects_flag = 0,
4632  int remove_on_scenario_load = 1);
4633 
4634  /*l
4635  *b Description:
4636  **
4637  ** This function removes a user callback. All default signal
4638  ** callbacks matching the specified callback_id and callback function
4639  ** will be removed.
4640  **
4641  *b Arguments:
4642  **
4643  *a callback_id - integer id of callback
4644  *a callback - pointer to function with prototype
4645  *a diguyCharacterCallback (typedefed above)
4646  **
4647  *b Callable From:
4648  **
4649  *- - C++
4650  */
4651  int remove_default_signal_callback(int callback_id,
4652  diguySignalCallback* callback);
4653 
4654  /*l
4655  *b Description:
4656  **
4657  ** This function removes a default user callback. All default signal
4658  ** callbacks matching the specified callback_id and callback_user_data
4659  ** pointer will be removed.
4660  **
4661  *b Arguments:
4662  **
4663  *a callback_id - integer id of callback
4664  *a callback_user_data - pointer for user's own use
4665  **
4666  *b Callable From:
4667  **
4668  *- - C++
4669  */
4670  int remove_default_signal_callback_with_user_data(int callback_id,
4671  void* callback_user_data);
4672 
4673  /*l
4674  *b Description:
4675  **
4676  ** This function adds a default user callback that will be added
4677  ** to all new variables.
4678  **
4679  *b Callable From:
4680  **
4681  *- - C++
4682  */
4683  int add_default_variable_callback(int callback_id,
4684  diguyVariableCallback* callback,
4685  void* callback_params,
4686  void* callback_user_data,
4687  int add_to_existing_objects_flag = 0,
4688  int remove_on_scenario_load = 1);
4689 
4690  /*l
4691  *b Description:
4692  **
4693  ** This function removes a user callback. All default variable
4694  ** callbacks matching the specified callback_id and callback function
4695  ** will be removed.
4696  **
4697  *b Arguments:
4698  **
4699  *a callback_id - integer id of callback
4700  *a callback - pointer to function with prototype
4701  *a diguyCharacterCallback (typedefed above)
4702  **
4703  *b Callable From:
4704  **
4705  *- - C++
4706  */
4707  int remove_default_variable_callback(int callback_id,
4708  diguyVariableCallback* callback);
4709 
4710  /*l
4711  *b Description:
4712  **
4713  ** This function removes a default user callback. All default
4714  ** variable callbacks matching the specified callback_id and
4715  ** callback_user_data pointer will be removed.
4716  **
4717  *b Arguments:
4718  **
4719  *a callback_id - integer id of callback
4720  *a callback_user_data - pointer for user's own use
4721  **
4722  *b Callable From:
4723  **
4724  *- - C++
4725  */
4726  int remove_default_variable_callback_with_user_data(int callback_id,
4727  void* callback_user_data);
4728 
4729  /*l
4730  *b Description:
4731  **
4732  ** This function adds a default user callback that will be added
4733  ** to all new views.
4734  **
4735  ** Note that unlike most of the other add default callback
4736  ** functions, this one's add_to_existing_objects_flag argument
4737  ** defaults to a value of 1, since views in scenarios always
4738  ** exist and are neither created nor destroyed.
4739  **
4740  *b Callable From:
4741  **
4742  *- - C++
4743  */
4744  int add_default_view_callback(int callback_id,
4745  diguyViewCallback* callback,
4746  void* callback_params,
4747  void* callback_user_data,
4748  int add_to_existing_objects_flag = 1,
4749  int remove_on_scenario_load = 1);
4750 
4751  /*l
4752  *b Description:
4753  **
4754  ** This function removes a user callback. All default view
4755  ** callbacks matching the specified callback_id and callback function
4756  ** will be removed.
4757  **
4758  *b Arguments:
4759  **
4760  *a callback_id - integer id of callback
4761  *a callback - pointer to function with prototype
4762  *a diguyCharacterCallback (typedefed above)
4763  **
4764  *b Callable From:
4765  **
4766  *- - C++
4767  */
4768  int remove_default_view_callback(int callback_id,
4769  diguyViewCallback* callback);
4770 
4771  /*l
4772  *b Description:
4773  **
4774  ** This function removes a default user callback. All default view
4775  ** callbacks matching the specified callback_id and callback_user_data
4776  ** pointer will be removed.
4777  **
4778  *b Arguments:
4779  **
4780  *a callback_id - integer id of callback
4781  *a callback_user_data - pointer for user's own use
4782  **
4783  *b Callable From:
4784  **
4785  *- - C++
4786  */
4787  int remove_default_view_callback_with_user_data(int callback_id,
4788  void* callback_user_data);
4789 
4790  /*l
4791  *b Description:
4792  **
4793  ** This function adds a default user callback that will be added
4794  ** to all cameras.
4795  **
4796  *b Callable From:
4797  **
4798  *- - C++
4799  */
4800  int add_default_camera_callback(int callback_id,
4801  diguyViewCameraCallback* callback,
4802  void* callback_params,
4803  void* callback_user_data,
4804  int add_to_existing_objects_flag = 0,
4805  int remove_on_scenario_load = 1);
4806 
4807  /*l
4808  *b Description:
4809  **
4810  ** This function removes a user callback. All default camera
4811  ** callbacks matching the specified callback_id and callback function
4812  ** will be removed.
4813  **
4814  *b Arguments:
4815  **
4816  *a callback_id - integer id of callback
4817  *a callback - pointer to function with prototype
4818  *a diguyCharacterCallback (typedefed above)
4819  **
4820  *b Callable From:
4821  **
4822  *- - C++
4823  */
4824  int remove_default_camera_callback(int callback_id,
4825  diguyViewCameraCallback* callback);
4826 
4827  /*l
4828  *b Description:
4829  **
4830  ** This function removes a default user callback. All default camera
4831  ** callbacks matching the specified callback_id and callback_user_data
4832  ** pointer will be removed.
4833  **
4834  *b Arguments:
4835  **
4836  *a callback_id - integer id of callback
4837  *a callback_user_data - pointer for user's own use
4838  **
4839  *b Callable From:
4840  **
4841  *- - C++
4842  */
4843  int remove_default_camera_callback_with_user_data(int callback_id,
4844  void* callback_user_data);
4845 
4846  /*l
4847  *b Description:
4848  **
4849  ** This function adds a default user callback that will be added
4850  ** to all new fogs.
4851  **
4852  *b Callable From:
4853  **
4854  *- - C++
4855  */
4856  int add_default_fog_callback(int callback_id,
4857  diguyViewFogCallback* callback,
4858  void* callback_params,
4859  void* callback_user_data,
4860  int add_to_existing_objects_flag = 0,
4861  int remove_on_scenario_load = 1);
4862 
4863  /*l
4864  *b Description:
4865  **
4866  ** This function removes a user callback. All default fog
4867  ** callbacks matching the specified callback_id and callback function
4868  ** will be removed.
4869  **
4870  *b Arguments:
4871  **
4872  *a callback_id - integer id of callback
4873  *a callback - pointer to function with prototype
4874  *a diguyCharacterCallback (typedefed above)
4875  **
4876  *b Callable From:
4877  **
4878  *- - C++
4879  */
4880  int remove_default_fog_callback(int callback_id,
4881  diguyViewFogCallback* callback);
4882 
4883  /*l
4884  *b Description:
4885  **
4886  ** This function removes a default user callback. All default fog
4887  ** callbacks matching the specified callback_id and callback_user_data
4888  ** pointer will be removed.
4889  **
4890  *b Arguments:
4891  **
4892  *a callback_id - integer id of callback
4893  *a callback_user_data - pointer for user's own use
4894  **
4895  *b Callable From:
4896  **
4897  *- - C++
4898  */
4899  int remove_default_fog_callback_with_user_data(int callback_id,
4900  void* callback_user_data);
4901 
4902  /*l
4903  *b Description:
4904  **
4905  ** This function adds a default user callback that will be added
4906  ** to all new lights.
4907  **
4908  *b Callable From:
4909  **
4910  *- - C++
4911  */
4912  int add_default_light_callback(int callback_id,
4913  diguyViewLightCallback* callback,
4914  void* callback_params,
4915  void* callback_user_data,
4916  int add_to_existing_objects_flag = 0,
4917  int remove_on_scenario_load = 1);
4918 
4919  /*l
4920  *b Description:
4921  **
4922  ** This function removes a user callback. All default light
4923  ** callbacks matching the specified callback_id and callback function
4924  ** will be removed.
4925  **
4926  *b Arguments:
4927  **
4928  *a callback_id - integer id of callback
4929  *a callback - pointer to function with prototype
4930  *a diguyCharacterCallback (typedefed above)
4931  **
4932  *b Callable From:
4933  **
4934  *- - C++
4935  */
4936  int remove_default_light_callback(int callback_id,
4937  diguyViewLightCallback* callback);
4938 
4939  /*l
4940  *b Description:
4941  **
4942  ** This function removes a default user callback. All default light
4943  ** callbacks matching the specified callback_id and callback_user_data
4944  ** pointer will be removed.
4945  **
4946  *b Arguments:
4947  **
4948  *a callback_id - integer id of callback
4949  *a callback_user_data - pointer for user's own use
4950  **
4951  *b Callable From:
4952  **
4953  *- - C++
4954  */
4955  int remove_default_light_callback_with_user_data(int callback_id,
4956  void* callback_user_data);
4957 
4958 #endif
4959 
4960  /*l
4961  *b Description:
4962  **
4963  ** This function causes all of the scenario callbacks with the given
4964  ** callback_id to be called now.
4965  **
4966  *b Arguments:
4967  **
4968  *a callback_id - integer id of callback
4969  */
4970  void manually_invoke_callbacks_now(int callback_id);
4971 
4972  /*l
4973  *b Description:
4974  **
4975  ** This function adds a user callback script. Callback scripts can
4976  ** be removed with remove_callback_script().
4977  **
4978  ** See diguyCharacter::add_callback_script() for an example
4979  ** of use.
4980  **
4981  *b Arguments:
4982  **
4983  *a callback_id - integer id of the callback
4984  *a callback_script - Script text of callback to be added
4985  *a callback_script_type - the type of script contained in
4986  *a callback_script
4987  *a remove_on_scenario_load - if the callback is removed when a new
4988  *a scenario is loaded
4989  **
4990  ** If NULL is passed for callback_script_type, a default script type
4991  ** will be derived based on the default script interpreter of the
4992  ** scenario.
4993  **
4994  *i Lua specific:
4995  **
4996  ** When the script is called, the object for which it is being called
4997  ** will be in the callback_object global.
4998  **
4999  ** To pass NULL when calling from a lua script, use nil.
5000  **
5001  *b Returns:
5002  **
5003  ** 0 on success, -1 on failure
5004  */
5005  int add_callback_script(int callback_id,
5006  const char* callback_script,
5007  const char* callback_script_type = NULL,
5008  int remove_on_scenario_load = 1);
5009 
5010  /*l
5011  *b Description:
5012  **
5013  ** This function removes a user callback script previously added with
5014  ** add_callback_script().
5015  **
5016  ** See diguyCharacter::remove_callback_script() for an example
5017  ** of use.
5018  **
5019  *b Arguments:
5020  **
5021  *a callback_id - integer id of the callback
5022  *a callback_script - Script text of callback previously added
5023  *a callback_script_type - the type of script contained in
5024  *a callback_script
5025  **
5026  ** If NULL is passed for callback_script, all callback
5027  ** scripts whose ids match callback_id and whose types match
5028  ** callback_script_type will be removed.
5029  **
5030  ** If NULL is passed for callback_script_type, a default script type
5031  ** will be derived based on the default script interpreter of the
5032  ** scenario.
5033  **
5034  *i Lua specific:
5035  **
5036  ** To pass NULL when calling from a lua script, use nil.
5037  **
5038  *b Returns:
5039  **
5040  ** 0 on success, -1 on failure
5041  */
5042  int remove_callback_script(int callback_id,
5043  const char* callback_script,
5044  const char* callback_script_type = NULL);
5045 
5046  /*l
5047  *b Description:
5048  **
5049  ** This function adds a default character callback script.
5050  ** The callback script will be added to all new characters.
5051  ** See diguyCharacter::add_callback_script() for
5052  ** more details.
5053  **
5054  *b Returns:
5055  **
5056  ** 0 on success, -1 on failure
5057  */
5058  int add_default_character_callback_script(int callback_id,
5059  const char* callback_script,
5060  const char* callback_script_type = NULL,
5061  int add_to_existing_objects_flag = 0,
5062  int remove_on_scenario_load = 1);
5063 
5064  /*l
5065  *b Description:
5066  **
5067  ** This function removes a default character callback script.
5068  ** See diguyCharacter::remove_callback_script() for
5069  ** more details.
5070  **
5071  *b Returns:
5072  **
5073  ** 0 on success, -1 on failure
5074  */
5075  int remove_default_character_callback_script(int callback_id,
5076  const char* callback_script,
5077  const char* callback_script_type = NULL);
5078 
5079  /*l
5080  *b Description:
5081  **
5082  ** This function adds a default sensor region callback script.
5083  ** The callback script will be added to all new sensor regions.
5084  ** See diguySensorRegion::add_callback_script() for
5085  ** more details.
5086  **
5087  *b Returns:
5088  **
5089  ** 0 on success, -1 on failure
5090  */
5091  int add_default_sensor_region_callback_script(int callback_id,
5092  const char* callback_script,
5093  const char* callback_script_type = NULL,
5094  int add_to_existing_objects_flag = 0,
5095  int remove_on_scenario_load = 1);
5096 
5097  /*l
5098  *b Description:
5099  **
5100  ** This function removes a default sensor region callback script.
5101  ** See diguySensorRegion::remove_callback_script() for
5102  ** more details.
5103  **
5104  *b Returns:
5105  **
5106  ** 0 on success, -1 on failure
5107  */
5108  int remove_default_sensor_region_callback_script(int callback_id,
5109  const char* callback_script,
5110  const char* callback_script_type = NULL);
5111 
5112  /*l
5113  *b Description:
5114  **
5115  ** This function adds a default signal callback script.
5116  ** The callback script will be added to all new signals.
5117  ** See diguySignal::add_callback_script() for
5118  ** more details.
5119  **
5120  *b Returns:
5121  **
5122  ** 0 on success, -1 on failure
5123  */
5124  int add_default_signal_callback_script(int callback_id,
5125  const char* callback_script,
5126  const char* callback_script_type = NULL,
5127  int add_to_existing_objects_flag = 0,
5128  int remove_on_scenario_load = 1);
5129 
5130  /*l
5131  *b Description:
5132  **
5133  ** This function removes a default signal callback script.
5134  ** See diguySignal::remove_callback_script() for
5135  ** more details.
5136  **
5137  *b Returns:
5138  **
5139  ** 0 on success, -1 on failure
5140  */
5141  int remove_default_signal_callback_script(int callback_id,
5142  const char* callback_script,
5143  const char* callback_script_type = NULL);
5144 
5145  /*l
5146  *b Description:
5147  **
5148  ** This function adds a default variable callback script.
5149  ** The callback script will be added to all new variables.
5150  ** See diguySignal::add_callback_script() for
5151  ** more details.
5152  **
5153  *b Returns:
5154  **
5155  ** 0 on success, -1 on failure
5156  */
5157  int add_default_variable_callback_script(int callback_id,
5158  const char* callback_script,
5159  const char* callback_script_type = NULL,
5160  int add_to_existing_objects_flag = 0,
5161  int remove_on_scenario_load = 1);
5162 
5163  /*l
5164  *b Description:
5165  **
5166  ** This function removes a default variable callback script.
5167  ** See diguySignal::remove_callback_script() for
5168  ** more details.
5169  **
5170  *b Returns:
5171  **
5172  ** 0 on success, -1 on failure
5173  */
5174  int remove_default_variable_callback_script(int callback_id,
5175  const char* callback_script,
5176  const char* callback_script_type = NULL);
5177 
5178  /*l
5179  *b Description:
5180  **
5181  ** This function adds a default view callback script.
5182  ** The callback script will be added to all new views.
5183  ** See diguyView::add_callback_script() for
5184  ** more details.
5185  **
5186  *b Returns:
5187  **
5188  ** 0 on success, -1 on failure
5189  */
5190  int add_default_view_callback_script(int callback_id,
5191  const char* callback_script,
5192  const char* callback_script_type = NULL,
5193  int add_to_existing_objects_flag = 0,
5194  int remove_on_scenario_load = 1);
5195 
5196  /*l
5197  *b Description:
5198  **
5199  ** This function removes a default character view script.
5200  ** See diguyView::remove_callback_script() for
5201  ** more details.
5202  **
5203  *b Returns:
5204  **
5205  ** 0 on success, -1 on failure
5206  */
5207  int remove_default_view_callback_script(int callback_id,
5208  const char* callback_script,
5209  const char* callback_script_type = NULL);
5210 
5211  /*l
5212  *b Description:
5213  **
5214  ** This function adds a default camera callback script.
5215  ** The callback script will be added to all new cameras.
5216  ** See diguyViewCamera::add_callback_script() for
5217  ** more details.
5218  **
5219  *b Returns:
5220  **
5221  ** 0 on success, -1 on failure
5222  */
5223  int add_default_camera_callback_script(int callback_id,
5224  const char* callback_script,
5225  const char* callback_script_type = NULL,
5226  int add_to_existing_objects_flag = 0,
5227  int remove_on_scenario_load = 1);
5228 
5229  /*l
5230  *b Description:
5231  **
5232  ** This function removes a default camera callback script.
5233  ** See diguyViewCamera::remove_callback_script() for
5234  ** more details.
5235  **
5236  *b Returns:
5237  **
5238  ** 0 on success, -1 on failure
5239  */
5240  int remove_default_camera_callback_script(int callback_id,
5241  const char* callback_script,
5242  const char* callback_script_type = NULL);
5243 
5244  /*l
5245  *b Description:
5246  **
5247  ** This function adds a default fog callback script.
5248  ** The callback script will be added to all new fogs.
5249  ** See diguyViewFog::add_callback_script() for
5250  ** more details.
5251  **
5252  *b Returns:
5253  **
5254  ** 0 on success, -1 on failure
5255  */
5256  int add_default_fog_callback_script(int callback_id,
5257  const char* callback_script,
5258  const char* callback_script_type = NULL,
5259  int add_to_existing_objects_flag = 0,
5260  int remove_on_scenario_load = 1);
5261 
5262  /*l
5263  *b Description:
5264  **
5265  ** This function removes a default fog callback script.
5266  ** See diguyViewFog::remove_callback_script() for
5267  ** more details.
5268  **
5269  *b Returns:
5270  **
5271  ** 0 on success, -1 on failure
5272  */
5273  int remove_default_fog_callback_script(int callback_id,
5274  const char* callback_script,
5275  const char* callback_script_type = NULL);
5276 
5277  /*l
5278  *b Description:
5279  **
5280  ** This function adds a default light callback script.
5281  ** The callback script will be added to all new lights.
5282  ** See diguyViewLight::add_callback_script() for
5283  ** more details.
5284  **
5285  *b Returns:
5286  **
5287  ** 0 on success, -1 on failure
5288  */
5289  int add_default_light_callback_script(int callback_id,
5290  const char* callback_script,
5291  const char* callback_script_type = NULL,
5292  int add_to_existing_objects_flag = 0,
5293  int remove_on_scenario_load = 1);
5294 
5295  /*l
5296  *b Description:
5297  **
5298  ** This function removes a default light callback script.
5299  ** See diguyViewLight::remove_callback_script() for
5300  ** more details.
5301  **
5302  *b Returns:
5303  **
5304  ** 0 on success, -1 on failure
5305  */
5306  int remove_default_light_callback_script(int callback_id,
5307  const char* callback_script,
5308  const char* callback_script_type = NULL);
5309 
5310 
5311 /*****************************************************************************/
5327  /*l
5328  *b Description:
5329  **
5330  ** This function maps the event handler with the given name
5331  ** to a callback id. This mapping will be saved in the .dss
5332  ** file and restored when the .dss file is loaded.
5333  **
5334  ** Mappings can also be made via the DI-Guy Scenario UI.
5335  **
5336  ** The event handler is one of the following:
5337  **
5338  *- - a scenario callback function registered by
5339  *- diguyApp::register_scenario_event_handler() or
5340  *- diguyApp::register_scenario_event_handler_from_library()
5341  *- - a script registered by
5342  *- diguyApp::register_scenario_event_handler_script()
5343  *- - a Script, Decision, or Library Function in the scenario
5344  *- whose "Event Type" is "Scenario"
5345  **
5346  *b Arguments:
5347  **
5348  *a callback_id - integer id of callback
5349  *a handler_name - name of the event handler to map
5350  **
5351  *b Returns:
5352  **
5353  ** 0 on success, -1 on failure
5354  */
5355  int map_event_handler_to_callback_id(int callback_id,
5356  const char* handler_name);
5357 
5358  /*l
5359  *b Description:
5360  **
5361  ** This function unmaps the event handler with the given name
5362  ** from a callback id.
5363  **
5364  *b Arguments:
5365  **
5366  *a callback_id - integer id of callback
5367  *a handler_name - name of the event handler to map
5368  *a unmap_all_matches - pass 0 to unmap only the first match,
5369  *a pass 1 to unmap all matches
5370  **
5371  *b Returns:
5372  **
5373  ** 0 on success, -1 on failure
5374  */
5375  int unmap_event_handler_from_callback_id(int callback_id,
5376  const char* handler_name,
5377  int unmap_all_matches = 0);
5378 
5379  /*l
5380  *b Description:
5381  **
5382  ** This function manually invokes the named scenario event handler.
5383  ** The callback_id that will be passed to the event handler will
5384  ** be CALLBACK_ID_MANUALLY_INVOKED.
5385  **
5386  ** Note that care should be taken not to end up in an infinite loop
5387  ** of event calls. In general an event handler should not end up
5388  ** directly or indirectly invoking itself.
5389  **
5390  ** The event handler is one of the following:
5391  **
5392  *- - a scenario callback function registered by
5393  *- diguyApp::register_scenario_event_handler() or
5394  *- diguyApp::register_scenario_event_handler_from_library()
5395  *- - a script registered by
5396  *- diguyApp::register_scenario_event_handler_script()
5397  *- - a Script, Decision, or Library Function in the scenario
5398  *- whose "Event Type" is "Scenario"
5399  **
5400  *b Arguments:
5401  **
5402  *a handler_name - name of the event handler to invoke
5403  **
5404  *b Returns:
5405  **
5406  ** DIGUY_CALLBACK_CONTINUE or DIGUY_CALLBACK_STOP
5407  **
5408  *b Callable From:
5409  **
5410  *- - C++
5411  *- - Script
5412  *- - Decision
5413  */
5414  diguyCallbackReturn manually_invoke_event_handler(const char* handler_name);
5415 
5416 #ifdef CPLUSPLUS_ONLY
5417 
5418  /*l
5419  *b Description:
5420  **
5421  ** This function registers a character event handler
5422  ** function that can later be mapped via a call to
5423  ** diguyCharacter::map_event_handler_to_callback_id().
5424  **
5425  ** Call unregister_character_event_handler() to
5426  ** unregister the function.
5427  **
5428  *b Arguments:
5429  **
5430  *a handler_name - name of the event handler
5431  *a callback - pointer to handler function
5432  *a callback_user_data - pointer for user's own use; DI-Guy will
5433  *a do nothing to the contents of this pointer
5434  *a beyond passing it back when the handler
5435  *a function is called
5436  **
5437  *b Returns:
5438  **
5439  ** 0 on success, -1 on failure
5440  **
5441  *b Callable From:
5442  **
5443  *- - C++
5444  */
5445  int register_character_event_handler(const char* handler_name,
5446  diguyCharacterCallback* callback,
5447  void* callback_user_data = 0);
5448 
5449 #endif
5450 
5451  /*l
5452  *b Description:
5453  **
5454  ** This function registers a character event handler
5455  ** function that can later be mapped via a call to
5456  ** diguyCharacter::map_event_handler_to_callback_id().
5457  **
5458  ** Unlike register_character_event_handler(), which directly
5459  ** passes a function pointer, this function looks up the
5460  ** function pointer from a shared library (a .dll under
5461  ** Windows, a .so under Unix).
5462  **
5463  ** The passed library_name should not include the
5464  ** .dll or .so extension; these will be added automatically.
5465  ** This allows for cross-platform scenarios that don't
5466  ** have differing dynamic library extensions built into
5467  ** them.
5468  **
5469  ** Call unregister_character_event_handler() to
5470  ** unregister the function.
5471  **
5472  *b Arguments:
5473  **
5474  *a handler_name - name of the event handler
5475  *a library_name - pointer to handler function
5476  *a function_name - pointer to handler function
5477  *a callback_user_data - pointer for user's own use; DI-Guy will
5478  *a do nothing to the contents of this pointer
5479  *a beyond passing it back when the handler
5480  *a function is called
5481  **
5482  *b Returns:
5483  **
5484  ** 0 on success, -1 on failure
5485  */
5486  int register_character_event_handler_from_library(const char* handler_name,
5487  const char* library_name,
5488  const char* function_name,
5489  void* callback_user_data = 0);
5490 
5491  /*l
5492  *b Description:
5493  **
5494  ** This function registers a character event handler
5495  ** script that can later be mapped via a call to
5496  ** diguyCharacter::map_event_handler_to_callback_id().
5497  **
5498  ** Call unregister_character_event_handler() to
5499  ** unregister the script.
5500  **
5501  *b Arguments:
5502  **
5503  *a handler_name - name of the event handler
5504  *a handler_script - Script text
5505  *a handler_script_type - type of script; pass NULL
5506  *a for scenario to use the default
5507  *a script interpreter
5508  **
5509  *b Returns:
5510  **
5511  ** 0 on success, -1 on failure
5512  */
5513  int register_character_event_handler_script(const char* handler_name,
5514  const char* handler_script,
5515  const char* handler_script_type = 0);
5516 
5517  /*l
5518  *b Returns:
5519  **
5520  ** 1 if there is a character event handler with the given
5521  ** name, 0 if not
5522  **
5523  *b Arguments:
5524  **
5525  *a handler_name - name of the event handler
5526  */
5527  int has_registered_character_event_handler(const char* handler_name);
5528 
5529  /*l
5530  *b Description:
5531  **
5532  ** This function unregisters a character event handler.
5533  ** This will unmap the event handler from any mappings
5534  ** it is a part of.
5535  **
5536  *b Arguments:
5537  **
5538  *a handler_name - name of the event handler
5539  **
5540  *b Returns:
5541  **
5542  ** 0 on success, -1 on failure
5543  */
5544  int unregister_character_event_handler(const char* handler_name);
5545 
5546 #ifdef CPLUSPLUS_ONLY
5547 
5548  /*l
5549  *b Description:
5550  **
5551  ** This function is analogous to the
5552  ** register_character_event_handler() function,
5553  ** but is for signals rather than characters.
5554  **
5555  *b Callable From:
5556  **
5557  *- - C++
5558  */
5559  int register_signal_event_handler(const char* handler_name,
5560  diguySignalCallback* callback,
5561  void* callback_user_data = 0);
5562 
5563 #endif
5564 
5565  /*l
5566  *b Description:
5567  **
5568  ** This function is analogous to the
5569  ** register_character_event_handler_from_library() function,
5570  ** but is for signals rather than characters.
5571  */
5572  int register_signal_event_handler_from_library(const char* handler_name,
5573  const char* library_name,
5574  const char* function_name,
5575  void* callback_user_data = 0);
5576 
5577  /*l
5578  *b Description:
5579  **
5580  ** This function is analogous to the
5581  ** register_character_event_handler_script() function,
5582  ** but is for signals rather than characters.
5583  */
5584  int register_signal_event_handler_script(const char* handler_name,
5585  const char* handler_script,
5586  const char* handler_script_type = 0);
5587 
5588  /*l
5589  *b Description:
5590  **
5591  ** This function is analogous to the
5592  ** has_registered_character_event_handler() function,
5593  ** but is for signals rather than characters.
5594  */
5595  int has_registered_signal_event_handler(const char* handler_name);
5596 
5597  /*l
5598  *b Description:
5599  **
5600  ** This function is analogous to the
5601  ** unregister_character_event_handler() function,
5602  ** but is for signals rather than characters.
5603  */
5604  int unregister_signal_event_handler(const char* handler_name);
5605 
5606 #ifdef CPLUSPLUS_ONLY
5607 
5608  /*l
5609  *b Description:
5610  **
5611  ** This function is analogous to the
5612  ** register_character_event_handler() function,
5613  ** but is for sensor regions rather than characters.
5614  **
5615  *b Callable From:
5616  **
5617  *- - C++
5618  */
5619  int register_sensor_region_event_handler(const char* handler_name,
5620  diguySensorRegionCallback* callback,
5621  void* callback_user_data = 0);
5622 
5623 #endif
5624 
5625  /*l
5626  *b Description:
5627  **
5628  ** This function is analogous to the
5629  ** register_character_event_handler_from_library() function,
5630  ** but is for sensor regions rather than characters.
5631  */
5632  int register_sensor_region_event_handler_from_library(const char* handler_name,
5633  const char* library_name,
5634  const char* function_name,
5635  void* callback_user_data = 0);
5636 
5637  /*l
5638  *b Description:
5639  **
5640  ** This function is analogous to the
5641  ** register_character_event_handler_script() function,
5642  ** but is for sensor regions rather than characters.
5643  */
5644  int register_sensor_region_event_handler_script(const char* handler_name,
5645  const char* handler_script,
5646  const char* handler_script_type = 0);
5647 
5648  /*l
5649  *b Description:
5650  **
5651  ** This function is analogous to the
5652  ** has_registered_character_event_handler() function,
5653  ** but is for sensor regions rather than characters.
5654  */
5655  int has_registered_sensor_region_event_handler(const char* handler_name);
5656 
5657  /*l
5658  *b Description:
5659  **
5660  ** This function is analogous to the
5661  ** unregister_character_event_handler() function,
5662  ** but is for sensor regions rather than characters.
5663  */
5664  int unregister_sensor_region_event_handler(const char* handler_name);
5665 
5666 #ifdef CPLUSPLUS_ONLY
5667 
5668  /*l
5669  *b Description:
5670  **
5671  ** This function is analogous to the
5672  ** register_character_event_handler() function,
5673  ** but is for variables rather than characters.
5674  **
5675  *b Callable From:
5676  **
5677  *- - C++
5678  */
5679  int register_variable_event_handler(const char* handler_name,
5680  diguyVariableCallback* callback,
5681  void* callback_user_data = 0);
5682 
5683 #endif
5684 
5685  /*l
5686  *b Description:
5687  **
5688  ** This function is analogous to the
5689  ** register_character_event_handler_from_library() function,
5690  ** but is for variables rather than characters.
5691  */
5692  int register_variable_event_handler_from_library(const char* handler_name,
5693  const char* library_name,
5694  const char* function_name,
5695  void* callback_user_data = 0);
5696 
5697  /*l
5698  *b Description:
5699  **
5700  ** This function is analogous to the
5701  ** register_character_event_handler_script() function,
5702  ** but is for variables rather than characters.
5703  */
5704  int register_variable_event_handler_script(const char* handler_name,
5705  const char* handler_script,
5706  const char* handler_script_type = 0);
5707 
5708  /*l
5709  *b Description:
5710  **
5711  ** This function is analogous to the
5712  ** has_registered_character_event_handler() function,
5713  ** but is for variables rather than characters.
5714  */
5715  int has_registered_variable_event_handler(const char* handler_name);
5716 
5717  /*l
5718  *b Description:
5719  **
5720  ** This function is analogous to the
5721  ** unregister_character_event_handler() function,
5722  ** but is for variables rather than characters.
5723  */
5724  int unregister_variable_event_handler(const char* handler_name);
5725 
5726 
5727 
5728 /*****************************************************************************/
5738  /*l
5739  *b Description:
5740  **
5741  ** This function saves the current run of the scenario to the
5742  ** specified file, and other files whose names are derived from
5743  ** the passed filename. The passed filename should end with the
5744  ** extension ".dsr" (DI-Guy Review).
5745  **
5746  ** The review data can be reloaded later by calling the load()
5747  ** function, and passing the same filename.
5748  **
5749  ** The following is saved for later review:
5750  **
5751  *- - all character positions and poses
5752  *- - sounds played by characters due to play_sound() and
5753  ** fire_weapon_n_times() calls
5754  **
5755  ** Note that Paths, Waypoints, and Event Beads per se are *not* saved,
5756  ** but rather their effects on the characters' positions and poses.
5757  **
5758  *b Arguments:
5759  **
5760  *a filename - file in which to save review data
5761  **
5762  *b Returns:
5763  **
5764  ** 0 on success, -1 on failure
5765  *b C++ Example:
5766  **
5767  *e // when shutting down the current run:
5768  *e scenario->save_review_data("review0.dsr");
5769  *e
5770  *e // when after action review is needed:
5771  *e scenario->load("review0.dsr");
5772  */
5773  int save_review_data(const char* filename);
5774 
5775  /*l
5776  *b Returns:
5777  **
5778  ** 1 if scenario was loaded from review data (from a .dsr file);
5779  ** 0 if not (from a .dss file)
5780  */
5781  int get_loaded_from_review_data();
5782 
5783  /*l
5784  *b Description:
5785  **
5786  ** This function sets what type of "history" will be kept for the
5787  ** scenario.
5788  **
5789  ** If time is run backwards in a scenario with history,
5790  ** the following will be "remembered" and replayed:
5791  **
5792  *- - camera settings currently in the primary view's camera
5793  *- - signal trigger counts
5794  *- - enabled/disabled status of scene objects
5795  *- - sounds
5796  **
5797  ** The default is DIGUY_HISTORY_TYPE_NONE for scenarios created
5798  ** using the DI-Guy API, and DIGUY_HISTORY_TYPE_COMPLETE for scenarios
5799  ** created using the DI-Guy Scenario editor.
5800  **
5801  *b Arguments:
5802  **
5803  *a history_type - history type to be used for the scenario
5804  **
5805  ** history_type should be one of the following values:
5806  **
5807  *i DIGUY_HISTORY_TYPE_NONE
5808  **
5809  ** This history type saves no history.
5810  **
5811  *i DIGUY_HISTORY_TYPE_COMPLETE
5812  **
5813  ** This history type saves a complete history.
5814  **
5815  ** DIGUY_HISTORY_TYPE_LAST and DIGUY_HISTORY_TYPE_FIRST are not
5816  ** supported for scenario history.
5817  **
5818  *b Returns:
5819  **
5820  ** 0 on success, -1 on failure
5821  */
5822  int set_history_type(diguyHistoryType history_type);
5823 
5824  /*l
5825  *b Returns:
5826  **
5827  ** the current history type of the scenario; see
5828  ** set_history_type()
5829  */
5830  diguyHistoryType get_history_type();
5831 
5832  /*l
5833  *b Description:
5834  **
5835  ** This function sets the history type for this scenario, as well as
5836  ** the history types of all characters.
5837  **
5838  ** See also diguyScenario::set_history_type() and
5839  ** diguyCharacter::set_history_type().
5840  **
5841  *b Arguments:
5842  **
5843  *a history_type - history type to be used for the scenario and all
5844  *a characters
5845  */
5846  void set_overall_history_type(diguyHistoryType overall_history_type);
5847 
5848  /*l
5849  *b Description:
5850  **
5851  ** This function returns the overall history type of the scenario.
5852  **
5853  ** The return value will be:
5854  **
5855  *- - DIGUY_HISTORY_TYPE_COMPLETE if history is enabled for the
5856  *- scenario and *all* characters
5857  *- - DIGUY_HISTORY_TYPE_PARTIAL if history is enabled for at least
5858  *- one of the scenario or any character, but not all
5859  *- - DIGUY_HISTORY_TYPE_NONE if history is not enabled for the
5860  *- scenario or any character
5861  **
5862  ** See also diguyScenario::get_history_type() and
5863  ** diguyCharacter::get_history_type().
5864  */
5865  diguyHistoryType get_overall_history_type();
5866 
5867  /*l
5868  *b Returns:
5869  **
5870  ** whether the scenario is playing back stored history
5871  */
5872  int get_replaying_history();
5873 
5874  /*l
5875  *b Description:
5876  **
5877  ** This function sets how many sound instances are kept in memory when
5878  ** history is enabled. By keeping them in memory, users can "scrub"
5879  ** backwards in time and hear sounds that were started earlier in time
5880  ** and will be resumed at the proper offset into the sound. This
5881  ** function lets users balance that need with memory management.
5882  **
5883  *b Arguments:
5884  **
5885  *a num_sound_instances - override system default of 100
5886  **
5887  *b Returns:
5888  **
5889  ** none
5890  */
5891  void set_history_max_sound_instances(int num_sound_instances);
5892 
5893 
5894 /*****************************************************************************/
5904  /*l
5905  *b Description:
5906  **
5907  ** This function sets whether automatic graphics LOD switching
5908  ** should be enabled for certain graphics environments (see below).
5909  **
5910  ** By default it is enabled.
5911  **
5912  ** There are two ways that DI-Guy calculates the proper
5913  ** graphics LOD. For some graphics environments the calculation
5914  ** is done "manually", using data from a diguyViewCamera.
5915  ** In other environments the calculation is done by the graphics
5916  ** environment itself. The method used in each graphics
5917  ** environment is noted below.
5918  **
5919  *i OpenGL Version:
5920  **
5921  ** This function enables or disables automatic LOD switching.
5922  ** In this graphics environment LOD calculations are done by
5923  ** the renderer; information from the diguyViewCamera is not
5924  ** used.
5925  **
5926  *i DI-Guy Graphics API Version:
5927  **
5928  ** This function enables or disables automatic LOD switching.
5929  ** In this graphics environment LOD calculations are done by
5930  ** the renderer; information from the diguyViewCamera is not
5931  ** used.
5932  */
5933  void set_automatic_graphics_lod_switching(int enable_graphics_lod_switching);
5934 
5936  int get_automatic_graphics_lod_switching();
5937 
5940  int set_character_culling_distance(float dist);
5941 
5943  float get_character_culling_distance();
5944 
5948  void set_cull_bounds_scale_factor(float size);
5949 
5951  float get_cull_bounds_scale_factor();
5952 
5953 
5956  int set_vehicle_culling_distance(float dist);
5957 
5959  float get_vehicle_culling_distance();
5960 
5963  int set_prop_culling_distance(float dist);
5965  float get_prop_culling_distance();
5966 
5967  /*l
5968  *b Description:
5969  **
5970  ** Turns on instancing system. This can yield much faster rendering, but can make
5971  ** rendering pipeline much more complex. This value is initially
5972  ** set by use_shader_instancing in the diguy graphics init structure.
5973  */
5974  void set_instancing_enabled(int val);
5975 
5977  int get_instancing_enabled() const;
5978 
5979  /*l
5980  *b Description:
5981  **
5982  ** Sets the minimum LOD that the instancing system turns on this defaults to LOD 4.
5983  */
5984  void set_instancing_min_lod(int val);
5985 
5987  int get_instancing_min_lod() const;
5988 
5990  void set_visualize_instance_groups(int val);
5991 
5993  int get_visualize_instance_groups() const;
5994 
5995  /*l
5996  *b Description:
5997  ** For scene graph renderers, it can be necessary to patch the texture buffer object after
5998  ** the scene graph finishes updating various post processes (ground clamping for instance),
5999  ** or modifying the TBO with a local space camera. This function lets DI-Guy knows to keep
6000  ** track of TBO shape index data, and not fill out the positions in the TBO data.
6001  **
6002  ** This function allows the end user to set the matrix in the TBO for each shape
6003  ** the character has. It requires diguyCharacter::set_final_tbo_position_matrix() is called
6004  ** after build_instance_groups() and before update_instancing_data()
6005  */
6006  void set_instancing_tbo_patching_enabled(int enable_patching);
6007  int get_instancing_tbo_patching_enabled() const;
6008 
6012  void set_instancing_position_callback_enabled(int use_user_position_matrices);
6013  int get_instancing_position_callback_enabled() const;
6014 
6021  void set_num_extra_per_instance_data_floats(int number);
6022  int get_num_extra_per_instance_data_floats() const;
6023 
6025  void build_instance_groups();
6026 
6029  void update_instancing_data();
6030 
6032  void get_tbo_instance_data(int & num_floats, const float*& data);
6033 
6034 #ifdef CPLUSPLUS_ONLY
6035 
6036  /*l
6037  *b Description:
6038  **
6039  ** Sets the distances at which level of detail switching occurs
6040  ** for characters of the specified type. Existing characters
6041  ** are not affected; only newly created characters will have the
6042  ** specified LOD switching ranges.
6043  **
6044  ** Characters will display with the highest level of detail when
6045  ** viewed from a distance between ranges[0] and ranges[1].
6046  ** Characters will not display at all when viewed from further
6047  ** away than the highest switching range.
6048  **
6049  ** Note: ranges[0] should almost always be 0.0.
6050  **
6051  *b Arguments:
6052  **
6053  *a character_type - character type name, as returned by
6054  *a get_character_type_at_index()
6055  *a ranges - an array of 8 non-negative floating point numbers,
6056  *a each larger than the one before, specifying the
6057  *a LOD switching ranges in meters
6058  **
6059  ** Pass "all" for character_type to set the default ranges of all
6060  ** character types.
6061  **
6062  ** The table below indicates the number of polygons for one of the
6063  ** default soldier models in each level of detail, and the LOD
6064  ** switching ranges in effect before this function is called.
6065  **
6066  *e lod polys min max
6067  *e --------------------------
6068  *e 1 2300 0 5
6069  *e 2 900 5 10
6070  *e 3 550 10 20
6071  *e 4 280 20 40
6072  *e 5 130 40 70
6073  *e 6 60 70 100
6074  *e 7 40 100 1000
6075  **
6076  *b Callable From:
6077  **
6078  *- - C++
6079  */
6080  void set_default_lod_ranges(const char* character_type, float* ranges);
6081 
6082 #endif
6083 
6084  /*l
6085  *b Description:
6086  **
6087  ** This function sets whether view and camera settings such as
6088  ** field-of-view (FOV) and window size should be taken into account
6089  ** when determining the graphics LOD from a character's LOD ranges.
6090  **
6091  ** The camera settings that are used are taken from the current
6092  ** render camera, as set by set_render_camera(). This happens
6093  ** automatically in DI-Guy Scenario, but must be set manually
6094  ** in the DI-Guy SDK.
6095  **
6096  ** DI-Guy graphics LODs are distance-based, but this approach can
6097  ** be problematic if the current camera's FOV is very narrow; a
6098  ** narrow FOV essentially acts like a telephoto lens. In this case
6099  ** a character that is far away, and would therefore be rendered
6100  ** with few polygons, can actually be quite large in the 3D view.
6101  **
6102  ** Setting this flag to 1 will cause the FOV to be taken into account
6103  ** when calculating the effective distance of a character from the
6104  ** camera.
6105  **
6106  ** Many DI-Guy LOD distances assume that the vertical FOV of the
6107  ** view is around 40. Smaller FOVs will scale the distances larger
6108  ** so that LOD changes happen further out. Likewise larger FOVs
6109  ** will scale the distances smaller; in this case even nearby
6110  ** characters will appear small and therefore need less resolution.
6111  **
6112  *b Arguments:
6113  **
6114  ** do_scale - pass 1 to enable scaling, 0 to disable
6115  */
6116  void set_scale_graphics_lod_ranges_from_view_settings(int do_scale);
6117 
6118  /*l
6119  *b Returns:
6120  **
6121  ** most recent setting of
6122  ** set_scale_graphics_lod_ranges_from_view_settings()
6123  */
6124  int get_scale_graphics_lod_ranges_from_view_settings();
6125 
6126  /*l
6127  *b Description:
6128  **
6129  ** This function sets whether automatic motion LOD switching
6130  ** should be enabled.
6131  **
6132  ** By default it is enabled in DI-Guy Scenario, and disabled in a
6133  ** DI-Guy API application.
6134  **
6135  ** When running in a user application that uses the DI-Guy
6136  ** API, the primary view's camera's position and orientation
6137  ** must be kept consistent with the application's perception
6138  ** of current camera settings. A pointer to the primary view's
6139  ** camera can be obtained by calling get_scenario_camera().
6140  **
6141  ** The following describes the algorithm used by automatic motion
6142  ** LOD switching:
6143  **
6144  *- - if a character is in front of the primary view's camera,
6145  *- the motion LOD is set to 1 (animate all joints)
6146  *- - else set motion LOD to 5 (stop animating everything but
6147  *- base position)
6148  **
6149  ** Note that if there are multiple views open on the scenario,
6150  ** the character must be behind *all* cameras for the motion
6151  ** LOD to be set to 5.
6152  **
6153  ** Also, if the history type of the character (as set by
6154  ** diguyCharacter::set_history_type()) is anything but
6155  ** DIGUY_HISTORY_TYPE_NONE, motion LOD 1 will be used since
6156  ** during scenario playback the character might be in front
6157  ** of any camera.
6158  */
6159  void set_automatic_motion_lod_switching(int enable_motion_lod_switching);
6160 
6161  /*l
6162  *b Description:
6163  **
6164  ** This function returns whether automatic motion LOD switching
6165  ** is be enabled for characters in the scenario, as set by
6166  ** set_automatic_motion_lod_switching().
6167  **
6168  *b Returns:
6169  **
6170  ** 1 if LODs enabled; 0 if not
6171  */
6172  int get_automatic_motion_lod_switching();
6173 
6174 
6175 /*****************************************************************************/
6185  /*l
6186  *b Description:
6187  **
6188  ** This function sends the passed string through the script
6189  ** interpreter.
6190  **
6191  *b Arguments:
6192  **
6193  *a script_text - string to be evaluated
6194  *a save_as_transient - flag stating whether script_text should
6195  *a be remembered as a transient event at
6196  *a the current scenario t; see
6197  *a push_transient_script_event()
6198  *a script_type - type of script contained in script_text; pass
6199  *a NULL to use scenario's default interpreter
6200  *a script_source - string identifying the 'source' of the script;
6201  *a will be printed in error output if there are
6202  *a syntax errors in the script
6203  **
6204  *b Returns:
6205  **
6206  ** 0 on success, -1 on failure
6207  **
6208  *b C++ Example:
6209  **
6210  *e scenario->eval_script("signal1:trigger();",
6211  *e 0,
6212  *e "lua",
6213  *e "User Script");
6214  */
6215  int eval_script(const char* script_text,
6216  int save_as_transient = 0,
6217  const char* script_type = NULL,
6218  const char* script_source = NULL);
6219 
6220  /*l
6221  *b Description:
6222  **
6223  ** This function sends the contents of the specified file through
6224  ** the script interpreter.
6225  **
6226  *b Arguments:
6227  **
6228  *a filename - filename of script to be evaluated
6229  *a script_type - type of script contained in file; pass NULL
6230  *a to use the scenario's default interpreter
6231  **
6232  *b Returns:
6233  **
6234  ** 0 on success, -1 on failure
6235  **
6236  *b C++ Example:
6237  **
6238  *e scenario->eval_script_file("my_scripts.pl");
6239  */
6240  int eval_script_file(const char* filename,
6241  const char* script_type = NULL);
6242 
6243  /*l
6244  *b Description:
6245  **
6246  ** This function manually triggers a script.
6247  **
6248  *b Arguments:
6249  **
6250  *a script_name - name of the script to be triggered
6251  **
6252  *b Returns:
6253  **
6254  ** return result of script; 0 if script not found
6255  **
6256  *b Callable From:
6257  **
6258  *- - C++
6259  *- - Script
6260  *- - Decision
6261  */
6262  int trigger_script(const char* script_name);
6263 
6264  /*l
6265  *b Description:
6266  **
6267  ** This function is similar to trigger_script(), but delays the
6268  ** trigger by the specified time.
6269  **
6270  *b Arguments:
6271  **
6272  *a script_name - name of the script to be triggered
6273  *a t_delay - how many seconds to delay trigger
6274  **
6275  *b Callable From:
6276  **
6277  *- - C++
6278  *- - Script
6279  *- - Decision
6280  */
6281  void trigger_script_delayed(const char* script_name, float t_delay);
6282 
6283  /*l
6284  *b Description:
6285  **
6286  ** This function manually triggers a decision.
6287  **
6288  *b Arguments:
6289  **
6290  *a decision_name - name of the decision to be triggered
6291  **
6292  *b Returns:
6293  **
6294  ** return result of decision; 0 if decision not found
6295  **
6296  *b Callable From:
6297  **
6298  *- - C++
6299  *- - Script
6300  *- - Decision
6301  */
6302  int trigger_decision(const char* decision_name);
6303 
6304  /*l
6305  *b Description:
6306  **
6307  ** This function is similar to trigger_decision(), but delays the
6308  ** trigger by the specified time.
6309  **
6310  *b Arguments:
6311  **
6312  *a decision_name - name of the decision to be triggered
6313  *a t_delay - how many seconds to delay trigger
6314  **
6315  *b Callable From:
6316  **
6317  *- - C++
6318  *- - Script
6319  *- - Decision
6320  */
6321  void trigger_decision_delayed(const char* decision_name, float t_delay);
6322 
6323  /*l
6324  *b Description:
6325  **
6326  ** This function places the passed script text on a list of scripts
6327  ** that should be re-evaluated when the scenario is replayed from
6328  ** review data.
6329  **
6330  ** Note that the script is *not* evaluated at this time. This can be
6331  ** done by calling eval_script() and passing 1 for the
6332  ** save_as_transient argument.
6333  **
6334  ** If the scenario is reset (as in a call to reset()), all transient
6335  ** scripts will be deleted. The transient script events can be saved
6336  ** and restored by calling save_transient_script_events() and
6337  ** load_transient_script_events(), respectively.
6338  **
6339  *b Arguments:
6340  **
6341  *a t - time at which script should be re-evaluated
6342  *a during scenario playback
6343  *a script_text - Script to be evaluated
6344  *a script_type - Scripting language to use (lua)
6345  **
6346  ** A copy of the passed script text is made.
6347  **
6348  *b Returns:
6349  **
6350  ** 0 on success, -1 on failure
6351  */
6352  void push_transient_script_event(float t, const char* script_text, const char* script_type);
6353 
6354  /*l
6355  *b Description:
6356  **
6357  ** This function deletes all transient script events.
6358  */
6359  void clear_transient_script_events();
6360 
6361  /*l
6362  *b Description:
6363  **
6364  ** This function saves the transient script events to the specified
6365  ** file. They can be restored by calling
6366  ** load_transient_script_events() with the same filename.
6367  **
6368  *b Arguments:
6369  **
6370  *a filename - file in which transient script events should be saved
6371  **
6372  *b Returns:
6373  **
6374  ** 0 on success, -1 on failure
6375  */
6376  int save_transient_script_events(const char* filename);
6377 
6378  /*l
6379  *b Description:
6380  **
6381  ** This function loads transient script events saved by a call to
6382  ** save_transient_script_events().
6383  **
6384  *b Arguments:
6385  **
6386  *a filename - file from which transient script events should be
6387  *a loaded
6388  **
6389  *b Returns:
6390  **
6391  ** 0 on success, -1 on failure
6392  */
6393  int load_transient_script_events(const char* filename);
6394 
6395  /*l
6396  *b Description:
6397  **
6398  ** This function creates a package object that points to an external
6399  ** file. If the language is not specified it will be determined based
6400  ** on the filename's extension. DI-Guy will attempt to derive an
6401  ** appropriate name for the package. In DI-Guy Scenario package
6402  ** dependencies are also extracted and loaded; currently this must be
6403  ** done manually in the SDK.
6404  */
6405  int load_package(const char* filename,
6406  const char* language = NULL,
6407  int warn_if_not_found = 1);
6408 
6409  /*l
6410  *b Description:
6411  **
6412  ** This function creates a package object that points to an external
6413  ** file. If the language is not specified it will be determined based
6414  ** on the filename's extension. DI-Guy will attempt to derive an
6415  ** appropriate name for the package. Dependency package will also be loaded.
6416  **
6417  */
6418  int load_package_with_dependancy( const char* filename,
6419  const char* depends_on_package,
6420  const char* language = NULL,
6421  int warn_if_not_found = 1 );
6422 
6423 
6424 /*****************************************************************************/
6434  /*l
6435  *b Description:
6436  **
6437  ** This function returns the number of postures the specified
6438  ** character type's actions support.
6439  **
6440  ** Use this function along with get_character_type_posture_at_index()
6441  ** to enumerate the character's postures.
6442  **
6443  *b Arguments:
6444  **
6445  *a character_type - character type name, as returned by
6446  *a get_character_type_at_index(), for example
6447  **
6448  *b Returns:
6449  **
6450  ** the number of postures the specified character type's actions
6451  ** support
6452  */
6453  int get_character_type_num_postures(const char* character_type);
6454 
6455  /*l
6456  *b Description:
6457  **
6458  ** This function returns the posture at the specified index.
6459  **
6460  ** Use this function along with get_character_type_num_postures()
6461  ** to enumerate the character's postures.
6462  **
6463  *b Arguments:
6464  **
6465  *a character_type - character type name, as returned by
6466  *a get_character_type_at_index(), for example
6467  *a index - index of the posture; indices start at 0
6468  **
6469  *b Returns:
6470  **
6471  ** the posture at the specified index
6472  */
6473  diguyMotionPosture get_character_type_posture_at_index(const char* character_type,
6474  int index);
6475 
6476  /*l
6477  *b Description:
6478  **
6479  ** This function returns the overall posture of the specified action.
6480  **
6481  ** The results of this function call can be useful in calls to the
6482  ** diguyCharacter::get_action_from_description() function, if
6483  ** for example an action with the same posture but a faster speed
6484  ** is desired.
6485  **
6486  *b Arguments:
6487  **
6488  *a character_type - character type name, as returned by
6489  *a get_character_type_at_index(), for example
6490  *a action_name - the action to query
6491  **
6492  *b Returns:
6493  **
6494  ** the overall posture of the specified action
6495  */
6496  diguyMotionPosture get_character_type_action_posture(const char* character_type,
6497  const char* action_name);
6498 
6499  /*l
6500  *b Description:
6501  **
6502  ** This function returns the number of variants the specified
6503  ** character type's actions support.
6504  **
6505  ** Use this function along with get_character_type_variant_at_index()
6506  ** to enumerate the character's variants.
6507  **
6508  ** This function differs from
6509  ** get_character_type_action_num_variants() in that this function
6510  ** returns the number of variants of *all* actions of the
6511  ** character. The other function returns the number of variants
6512  ** of a single action.
6513  **
6514  *b Arguments:
6515  **
6516  *a character_type - character type name, as returned by
6517  *a get_character_type_at_index(), for example
6518  **
6519  *b Returns:
6520  **
6521  ** the number of variants the specified character type's actions
6522  ** support
6523  */
6524  int get_character_type_num_variants(const char* character_type);
6525 
6526  /*l
6527  *b Description:
6528  **
6529  ** This function returns the variant at the specified index.
6530  **
6531  ** Use this function along with get_character_type_num_variants()
6532  ** to enumerate the character's variants.
6533  **
6534  ** This function differs from
6535  ** get_character_type_action_variant_at_index() in that this function
6536  ** returns one of the variants of *all* actions of the
6537  ** character. The other function returns one of the variants
6538  ** of a single action.
6539  **
6540  *b Arguments:
6541  **
6542  *a character_type - character type name, as returned by
6543  *a get_character_type_at_index(), for example
6544  *a index - index of the posture; indices start at 0
6545  **
6546  *b Returns:
6547  **
6548  ** the variant at the specified index
6549  */
6550  diguyMotionVariant get_character_type_variant_at_index(const char* character_type,
6551  int index);
6552 
6553  /*l
6554  *b Description:
6555  **
6556  ** This function returns the primary variant of the specified action.
6557  **
6558  *b Arguments:
6559  **
6560  *a character_type - character type name, as returned by
6561  *a get_character_type_at_index(), for example
6562  *a action_name - the action to query
6563  **
6564  *b Returns:
6565  **
6566  ** the overall variant of the specified action
6567  */
6568  diguyMotionVariant get_character_type_action_primary_variant(const char* character_type,
6569  const char* action_name);
6570 
6571  /*l
6572  *b Description:
6573  **
6574  ** This function returns the number of variants the specified
6575  ** action of the specified character type has.
6576  **
6577  ** Use this function along with
6578  ** get_character_type_action_variant_at_index()
6579  ** to enumerate the character's variants.
6580  **
6581  ** This function differs from
6582  ** get_character_type_num_variants() in that this function
6583  ** returns the number of variants of a single action of the
6584  ** character. The other function returns the number of variants
6585  ** of *all* actions.
6586  **
6587  *b Arguments:
6588  **
6589  *a character_type - character type name, as returned by
6590  *a get_character_type_at_index(), for example
6591  *a action_name - the action to query
6592  **
6593  *b Returns:
6594  **
6595  ** the number of variants of the specified action of the specified
6596  ** character type
6597  */
6598  int get_character_type_action_num_variants(const char* character_type,
6599  const char* action_name);
6600 
6601  /*l
6602  *b Description:
6603  **
6604  ** This function returns the variant at the specified index.
6605  **
6606  ** Use this function along with
6607  ** get_character_type_action_num_variants()
6608  ** to enumerate the character's variants.
6609  **
6610  ** This function differs from
6611  ** get_character_type_variant_at_index() in that this function
6612  ** returns one of the variants of a single action of the
6613  ** character. The other function returns one of the variants
6614  ** of *all* actions.
6615  **
6616  *b Arguments:
6617  **
6618  *a character_type - character type name, as returned by
6619  *a get_character_type_at_index(), for example
6620  *a index - index of the posture; indices start at 0
6621  **
6622  *b Returns:
6623  **
6624  ** the variant at the specified index
6625  */
6626  diguyMotionVariant get_character_type_action_variant_at_index(const char* character_type,
6627  const char* action_name,
6628  int index);
6629 
6630  /*l
6631  *b Description:
6632  **
6633  ** This function returns the number of directions the specified
6634  ** character type's actions can move.
6635  **
6636  ** Use the get_character_type_direction_at_index() function to
6637  ** enumerate the directions available to a character.
6638  **
6639  ** The results of this function call can be useful in calls to the
6640  ** diguyCharacter::get_action_from_description() function.
6641  **
6642  *b Arguments:
6643  **
6644  *a character_type - character type name, as returned by
6645  *a get_character_type_at_index(), for example
6646  **
6647  *b Returns:
6648  **
6649  ** the number of directions the specified character type's actions
6650  ** can move
6651  */
6652  int get_character_type_num_directions(const char* character_type);
6653 
6654  /*l
6655  *b Description:
6656  **
6657  ** Use the get_character_type_num_directions() function to
6658  ** get the number of directions available to a character.
6659  **
6660  ** The results of this function call can be useful in calls to the
6661  ** diguyCharacter::get_action_from_description() function.
6662  **
6663  *b Arguments:
6664  **
6665  *a character_type - character type name, as returned by
6666  *a get_character_type_at_index(), for example
6667  *a index - index of the direction; indices start at 0
6668  **
6669  *b Returns:
6670  **
6671  ** the direction at the specified index
6672  */
6673  diguyMotionDirection get_character_type_direction_at_index(const char* character_type,
6674  int index);
6675 
6676 
6677 /*****************************************************************************/
6703  /*l
6704  *b Returns:
6705  **
6706  ** number of interaction machines in the scenario
6707  */
6708  int get_num_interaction_machines();
6709 
6710  /*l
6711  *b Description:
6712  **
6713  ** This function creates a new interaction machine and returns a
6714  ** pointer to it.
6715  **
6716  ** Note that there is a shared interaction machine that always
6717  ** exists; a pointer to it can be obtained by calling
6718  ** get_shared_interaction_machine(). See that function for more
6719  ** details.
6720  **
6721  *b Arguments:
6722  **
6723  *a name - name of the new interaction machine
6724  **
6725  *b Returns:
6726  **
6727  ** pointer of type diguyInteractionMachine; NULL if creation failed
6728  */
6729  diguyInteractionMachine* create_interaction_machine(const char* name);
6730 
6731  /*l
6732  *b Description:
6733  **
6734  ** This function destroys the passed interaction machine.
6735  **
6736  ** NOTE: This function should not be called on the shared
6737  ** interaction machine returned by get_shared_interaction_machine().
6738  **
6739  *b Arguments:
6740  **
6741  *a interaction_machine - pointer to a diguyInteractionMachine
6742  *a to be destroyed
6743  */
6744  void destroy_interaction_machine(diguyInteractionMachine* interaction_machine);
6745 
6746  /*l
6747  *b Returns:
6748  **
6749  ** pointer of type diguyInteractionMachine; NULL if no interaction
6750  ** machine at the specified index
6751  **
6752  *b Arguments:
6753  **
6754  *a index - index of the interaction machine; indices start at 0
6755  */
6756  diguyInteractionMachine* get_interaction_machine_at_index(int index);
6757 
6758  /*l
6759  *b Description:
6760  **
6761  ** This function returns a pointer to the specified interaction
6762  ** machine.
6763  **
6764  *b Arguments:
6765  **
6766  *a name - name of interaction machine to be found
6767  **
6768  *b Returns:
6769  **
6770  ** pointer of type diguyInteractionMachine; NULL if not found
6771  */
6772  diguyInteractionMachine* find_interaction_machine(const char* name);
6773 
6774  /*l
6775  *b Description:
6776  **
6777  ** This function returns a pointer to the "active" interaction
6778  ** machine. Only one interaction machine can be showing and
6779  ** accepting input at a time.
6780  **
6781  *b Returns:
6782  **
6783  ** pointer of type diguyInteractionMachine; NULL if no interaction
6784  ** machine is active.
6785  */
6786  diguyInteractionMachine* get_active_interaction_machine();
6787 
6788  /*l
6789  *b Description:
6790  **
6791  ** This function returns a pointer to the shared interaction machine
6792  ** that is always available.
6793  **
6794  ** This shared interaction machine is convenient for quick
6795  ** alerts, notifications, or questions. Because it is shared,
6796  ** however, most or all of its parameters need to be set each
6797  ** time it is to be shown.
6798  **
6799  ** Do not call destroy_interaction_machine() on the returned
6800  ** object. It is owned by the scenario.
6801  **
6802  *b Returns:
6803  **
6804  ** pointer of type diguyInteractionMachine; should never be NULL
6805  */
6806  diguyInteractionMachine* get_shared_interaction_machine();
6807 
6808  /*l
6809  *b Description:
6810  **
6811  ** This is a convenience function for using the shared interaction
6812  ** machine to show a notification to the user. It sets parameters
6813  ** of the shared interaction machine based on the passed info and
6814  ** shows/activates the machine.
6815  **
6816  *b Arguments:
6817  **
6818  *a heading - text that will be at the top of the dialog
6819  *a info - informational text
6820  *a pause_scenario - pass 1 to pause the scenario while the
6821  *a interaction machine is active, 0 to leave
6822  *a the scenario running if it was when this
6823  *a function was called
6824  *a input_text - text that user will have to click to dismiss
6825  *a the interaction machine; something like "Ok"
6826  *a is typical
6827  *a ui_appearance - the color theme of the interaction machine
6828  **
6829  ** See the diguyInteractionMachine documentation for more information
6830  ** on what the various parameters mean.
6831  **
6832  *b Returns:
6833  **
6834  ** 0 on success, -1 on failure
6835  **
6836  *b Lua Example:
6837  **
6838  *e this_scenario:show_notification_with_shared_interaction_machine(
6839  *e "WARNING!",
6840  *e "Moving any closer to the harmful gas is not advised.",
6841  *e 0,
6842  *e "Ok",
6843  *e diguyInteractionMachine_UI_APPEARANCE_NOTIFICATION);
6844  **
6845  */
6846  int show_notification_with_shared_interaction_machine(const char* heading,
6847  const char* info,
6848  int pause_scenario = 0,
6849  const char* input_text = NULL,
6851 
6852 
6853 /*****************************************************************************/
6863  /*l
6864  *b Description:
6865  **
6866  ** This function returns a pointer to the I-Guy controller object
6867  ** of the scenario.
6868  **
6869  *b Returns:
6870  **
6871  ** pointer of type diguyIGuyController; should never be NULL
6872  */
6873  diguyIGuyController* get_iguy_controller();
6874 
6875 
6876 /*****************************************************************************/
6886  /*l
6887  *b Description:
6888  **
6889  ** This function finds the diguyViewLabel with the given name or
6890  ** creates it if it doesn't exist.
6891  **
6892  *b Arguments:
6893  **
6894  *a name - name of the diguyViewLabel to find or create
6895  **
6896  *b Returns:
6897  **
6898  ** pointer of type diguyViewLabel; should never be NULL
6899  */
6900  diguyViewLabel* find_or_create_label(const char* name);
6901 
6902  /*l
6903  *b Description:
6904  **
6905  ** This function returns a pointer to the specified diguyViewLabel.
6906  **
6907  *b Arguments:
6908  **
6909  *a name - name of diguyViewLabel to be found
6910  **
6911  *b Returns:
6912  **
6913  ** pointer of type diguyViewLabel; NULL if not found
6914  */
6915  diguyViewLabel* find_label(const char* name);
6916 
6917  /*l
6918  *b Description:
6919  **
6920  ** This function destroys the passed in diguyViewLabel.
6921  **
6922  *b Arguments:
6923  **
6924  *a label - pointer to a diguyViewLabel
6925  **
6926  *b Returns:
6927  **
6928  ** 0 on success, -1 on failure
6929  */
6930  int destroy_label(diguyViewLabel* label);
6931 
6932  /*l
6933  *b Returns:
6934  **
6935  ** The number of diguyViewLabel objects in the scenario.
6936  */
6937  int get_num_labels();
6938 
6939  /*l
6940  *b Returns:
6941  **
6942  ** The diguyViewLabel at the given index.
6943  **
6944  *b Arguments:
6945  **
6946  *a index - index of the diguyViewLabel; indices start at 0
6947  */
6948  diguyViewLabel* get_label_at_index(int index);
6949 
6950  /*l
6951  *b Description:
6952  **
6953  ** This function removes all diguyViewLabels in the scenario.
6954  */
6955  void reset_labels();
6956 
6957  /*l
6958  *b Description:
6959  **
6960  ** This function moves the specified diguyViewLabel to the front of
6961  ** the drawing list. This is sometimes necessary if labels overlap.
6962  **
6963  *b Arguments:
6964  **
6965  *a label - pointer to diguyViewLabel to move
6966  */
6967  void send_label_to_front(diguyViewLabel* label);
6968 
6969  /*l
6970  *b Description:
6971  **
6972  ** This function moves the specified diguyViewLabel to the back of
6973  ** the drawing list. This is sometimes necessary if labels overlap.
6974  **
6975  *b Arguments:
6976  **
6977  *a label - pointer to diguyViewLabel to move
6978  */
6979  void send_label_to_back(diguyViewLabel* label);
6980 
6981  /*l
6982  *b Description:
6983  **
6984  ** Functions that allow the built-in OGL renderer to draw labels on screen for
6985  ** debugging use, update_character_labels must be called first.
6986  **
6987  *e scenario->update_character_labels();
6988  *e scenario->draw_character_labels();
6989  **
6990  *b Returns:
6991  **
6992  ** -1 if not possible to draw labels
6993  */
6994  int draw_character_labels();
6995 
6997  void update_character_labels();
6998 
6999 /*****************************************************************************/
7009  /*l
7010  *b Description:
7011  **
7012  ** This function finds the diguyViewButtonPanel with the given name or
7013  ** creates it if it doesn't exist.
7014  **
7015  *b Arguments:
7016  **
7017  *a name - name of the diguyViewButtonPanel to find or create
7018  **
7019  *b Returns:
7020  **
7021  ** pointer of type diguyViewButtonPanel; should never be NULL
7022  */
7023  diguyViewButtonPanel* find_or_create_panel(const char* name,
7024  int horizontal = 0,
7025  int title = 1);
7026 
7027  /*l
7028  *b Description:
7029  **
7030  ** This function returns a pointer to the specified
7031  ** diguyViewButtonPanel.
7032  **
7033  *b Arguments:
7034  **
7035  *a name - name of diguyViewButtonPanel to be found
7036  **
7037  *b Returns:
7038  **
7039  ** pointer of type diguyViewButtonPanel; NULL if not found
7040  */
7041  diguyViewButtonPanel* find_panel(const char* name);
7042 
7043  /*l
7044  *b Description:
7045  **
7046  ** This function destroys the passed in diguyViewButtonPanel.
7047  **
7048  *b Arguments:
7049  **
7050  *a panel - pointer to a diguyViewButtonPanel
7051  **
7052  *b Returns:
7053  **
7054  ** 0 on success, -1 on failure
7055  */
7056  int destroy_panel(diguyViewButtonPanel* panel);
7057 
7058  /*l
7059  *b Returns:
7060  **
7061  ** The number of diguyViewButtonPanel objects in the scenario.
7062  */
7063  int get_num_panels();
7064 
7065  /*l
7066  *b Returns:
7067  **
7068  ** The diguyViewButtonPanel at the given index.
7069  **
7070  *b Arguments:
7071  **
7072  *a index - index of the diguyViewButtonPanel; indices start at 0
7073  */
7074  diguyViewButtonPanel* get_panel_at_index(int index);
7075 
7076 
7077 /*****************************************************************************/
7090  /*l
7091  *b Description:
7092  **
7093  ** This function returns the number of AI minds that are available to
7094  ** AI agent characters.
7095  **
7096  *b Returns:
7097  **
7098  ** number of available minds
7099  */
7100  int get_num_minds();
7101 
7102  /*l
7103  *b Returns:
7104  **
7105  ** name of the AI mind at the specified index
7106  */
7107  const char* get_mind_name_at_index(int index);
7108 
7109  /*l
7110  *b Description:
7111  **
7112  ** This function tests if a diguyCharacter pointer is a valid pointer.
7113  ** This is done by comparing the passed address to those of all
7114  ** characters in the scenario. The function is not exceedingly fast
7115  ** but can be useful when building AI that functions in a networked
7116  ** environment.
7117  **
7118  *b Returns:
7119  **
7120  ** 0 if invalid, 1 if valid
7121  */
7122  int is_valid_character_pointer(diguyCharacter* character);
7123 
7124  /*l
7125  *b Description:
7126  **
7127  ** This function tests if a diguyCharacterGroup pointer is a valid
7128  ** pointer. This is done by comparing the passed address to those of
7129  ** all groups in the scenario. The function is not exceedingly fast
7130  ** but can be useful when building AI that functions in a networked
7131  ** environment.
7132  **
7133  *b Returns:
7134  **
7135  ** 0 if invalid, 1 if valid
7136  */
7137  int is_valid_character_group_pointer(diguyCharacterGroup* character_group);
7138 
7139 /*****************************************************************************/
7155  /*l
7156  *b Description:
7157  **
7158  ** This function creates a new crowd and returns a pointer to it.
7159  **
7160  ** A Lua object is also created that has a pointer to this crowd.
7161  ** This object can be retrieved by calling find_lua_crowd(crowd_name)
7162  ** or find_lua_crowd(diguyCrowd* pointer) in lua.
7163  **
7164  *b Arguments:
7165  **
7166  *a name - name of crowd to be created
7167  *a make_companion_of_all - pass 1 to make this crowd a companion
7168  *a of all existing crowds
7169  **
7170  *b Returns:
7171  **
7172  ** pointer of type diguyCrowd
7173  */
7174  diguyCrowd* create_crowd(const char* name,
7175  int make_companion_of_all = 1);
7176 
7177  /*l
7178  *b Description:
7179  **
7180  ** This function destroys a crowd. It can also optionally destroy the
7181  ** characters that are crowd members, and the path shape that is
7182  ** associated with the crowd.
7183  **
7184  *b Arguments:
7185  **
7186  *a crowd - pointer to a diguyCrowd
7187  *a also_destroy_crowd_members - pass 1 to also destroy crowd member
7188  *a characters
7189  *a also_destroy_path_shapes - pass 1 to also destroy crowd-
7190  *a associated path shapes
7191  *a delay_destruction - pass 1 to wait till the next update
7192  *a call to destroy the crowd; can avoid
7193  *a crashes when AI's receive destruction
7194  *a messages
7195  **
7196  *b Returns:
7197  **
7198  ** 0 on success, -1 on failure
7199  */
7200  int destroy_crowd(diguyCrowd* crowd,
7201  int also_destroy_crowd_members = 0,
7202  int also_destroy_path_shapes = 0,
7203  int delay_destruction = 0);
7204 
7205  /*l
7206  *b Returns:
7207  **
7208  ** the number of crowds in the scenario
7209  */
7210  int get_num_crowds();
7211 
7212  /*l
7213  *b Returns:
7214  **
7215  ** pointer of type diguyCrowd; NULL if no crowd at the specified index
7216  **
7217  *b Arguments:
7218  **
7219  *a index - index of the crowd; indices start at 0
7220  */
7221  diguyCrowd* get_crowd_at_index(int index);
7222 
7223  /*l
7224  *b Returns:
7225  **
7226  ** A unique name based on base_name, e.g. "my_crowd7" from "my_crowd".
7227  **
7228  *b Arguments:
7229  **
7230  *a base_name - base string from which to build a unique name
7231  */
7232  const char* get_unique_crowd_name(const char* base_name);
7233 
7234  /*l
7235  *b Description:
7236  **
7237  ** This function returns a pointer to the specified crowd.
7238  **
7239  *b Arguments:
7240  **
7241  *a name - name of crowd to be found
7242  **
7243  *b Returns:
7244  **
7245  ** pointer of type diguyCrowd; NULL if not found
7246  */
7247  diguyCrowd* find_crowd(const char* crowd_name);
7248 
7249  /*l
7250  *b Description:
7251  **
7252  ** This function returns a pointer to the crowd with the given
7253  ** name. A new crowd with the given name will be created if
7254  ** it doesn't already exist.
7255  **
7256  *b Arguments:
7257  **
7258  *a name - name of the crowd to find or create
7259  *a make_companion_of_all - pass 1 to make this crowd a companion
7260  *a of all existing crowds
7261  **
7262  *b Returns:
7263  **
7264  ** pointer of type diguyCrowd; should never be NULL
7265  */
7266  diguyCrowd* find_or_create_crowd(const char* crowd_name,
7267  int make_companion_of_all = 1);
7268 
7269  /*l
7270  *b Description:
7271  **
7272  ** This function sets whether crowds should be created for
7273  ** incoming network entities.
7274  **
7275  *b Arguments:
7276  **
7277  *a do_create - pass 1 to create network crowds; 0 to not
7278  */
7279  void set_create_network_crowds(int do_create);
7280 
7281  /*l
7282  *b Returns:
7283  **
7284  *a 1 if network crowds will be created; 0 if not
7285  **
7286  */
7287  int get_create_network_crowds();
7288 
7289 
7290 /*****************************************************************************/
7305  /*l
7306  *b Description:
7307  **
7308  ** This function creates a new crowd profile and returns a
7309  ** pointer to it.
7310  **
7311  *b Arguments:
7312  **
7313  *a name - name of crowd profile to be created
7314  **
7315  *b Returns:
7316  **
7317  ** pointer of type diguyCrowdProfile
7318  */
7319  diguyCrowdProfile* create_crowd_profile(const char* name);
7320 
7321  /*l
7322  *b Description:
7323  **
7324  ** This function destroys a crowd profile.
7325  **
7326  *b Arguments:
7327  **
7328  *a crowd_profile - pointer to a diguyCrowdProfile
7329  **
7330  *b Returns:
7331  **
7332  ** 0 on success, -1 on failure
7333  */
7334  int destroy_crowd_profile(diguyCrowdProfile* crowd_profile);
7335 
7336  /*l
7337  *b Returns:
7338  **
7339  ** The number of crowd profiles in the scenario.
7340  */
7341  int get_num_crowd_profiles();
7342 
7343  /*l
7344  *b Returns:
7345  **
7346  ** pointer of type diguyCrowdProfile; NULL if no crowd profile
7347  ** at the specified index
7348  **
7349  *b Arguments:
7350  **
7351  *a index - index of the crowd profile; indices start at 0
7352  */
7353  diguyCrowdProfile* get_crowd_profile_at_index(int index);
7354 
7355  /*l
7356  *b Description:
7357  **
7358  ** This function returns a pointer to the specified crowd profile.
7359  **
7360  *b Arguments:
7361  **
7362  *a name - name of crowd profile to be found
7363  **
7364  *b Returns:
7365  **
7366  ** pointer of type diguyCrowdProfile; NULL if not found
7367  */
7368  diguyCrowdProfile* find_crowd_profile(const char* name);
7369 
7370 
7371 /*****************************************************************************/
7381  /*l
7382  *b Returns:
7383  **
7384  ** pointer of type diguyLoadManager; this scenario's character
7385  ** load manager
7386  */
7387  diguyLoadManager* get_character_load_manager();
7388 
7389 
7390 /*****************************************************************************/
7400  /*l
7401  *b Description:
7402  **
7403  ** This function forces the octtree to rebuild if it's out of date.
7404  */
7405  int force_octtree_generation();
7406 
7407  /*l
7408  *b Description:
7409  **
7410  ** Adds the given character to the octtree. If use_bounding_box_only is true,
7411  ** the bounding box will be used instead of using full link data.
7412  **
7413  */
7414  void add_character_to_octtree(diguyCharacter* character,
7415  int use_bounding_box_only = 0);
7416 
7417  /*l
7418  *b Description:
7419  **
7420  ** Removes the given character from the octtree.
7421  **
7422  */
7423  void remove_character_from_octtree(diguyCharacter* character);
7424 
7425  /*l
7426  *b Description:
7427  **
7428  ** Preloads the given appearance for the character with octtree data.
7429  ** Uses more memory, but avoids needing to build data as characters are instantiated.
7430  **
7431  */
7432  int preload_octtree(const char* character_type, const char* appearance);
7433 
7434  /*l
7435  *b Description:
7436  **
7437  ** This function uses the octtree to check if the path between x1,
7438  ** y1, z1 and x2, y2, z2 has any static obstructions.
7439  **
7440  *b Returns:
7441  **
7442  ** 1 if the path is clear, 0 if static obstructions are present.
7443  */
7444  int check_visibility(float x1, float y1, float z1,
7445  float x2, float y2, float z2);
7446 
7447 
7448 /*****************************************************************************/
7458 #ifdef CPLUSPLUS_ONLY
7459 
7460  /*l
7461  *b Description:
7462  **
7463  ** This function sets a default altitude function that will be added
7464  ** to all characters that are subsequently created. It can be overridden
7465  ** on a per-character basis by a call to diguyCharacter::set_altitude_function().
7466  ** See that function for details.
7467  **
7468  *b Callable From:
7469  **
7470  *- - C++
7471  */
7472  int set_default_character_altitude_function(diguyAltitudeFunction* altitude_function);
7473 
7474  /*l
7475  *b Description:
7476  **
7477  ** This function sets a generic altitude function for the scenario
7478  ** that is used for local path clamping and other operations that
7479  ** require the altitude at specific x, y coordinates to be calculated.
7480  ** This is for the benefit of SDK users who have their own representation
7481  ** of terrain and structures.
7482  **
7483  ** diguyScenario::ground_clamp() can be told to use the registered
7484  ** function, but this is optional.
7485  **
7486  ** DI-Guy Scenario has a default altitude function; replacing the
7487  ** default function is not recommended.
7488  **
7489  *b Callable From:
7490  **
7491  *- - C++
7492  */
7493  void set_altitude_function(diguyScenarioAltitudeFunction* altitude_function);
7494 
7495  /*l
7496  *b Returns:
7497  **
7498  ** the altitude function for the scenario as set by
7499  ** set_altitude_function()
7500  **
7501  *b Callable From:
7502  **
7503  *- - C++
7504  */
7505  diguyScenarioAltitudeFunction* get_altitude_function();
7506 
7507 #endif
7508 
7511  void set_altitude_max_climb(float altitude_max_climb);
7512  float get_altitude_max_climb();
7513 
7516  void set_altitude_max_drop(float altitude_max_drop);
7517  float get_altitude_max_drop();
7518 
7519 
7520 /*****************************************************************************/
7530  /*l
7531  *b Description:
7532  **
7533  ** Sets the default intersection function. This function will be used to determine
7534  ** whether there is an intersection between a specified ray and the world.
7535  */
7536  static void set_default_intersection_function(diguyScenarioIntersectionFunction* intersection_function);
7537  void set_intersection_function(diguyScenarioIntersectionFunction* intersection_function);
7538 
7539  /*l
7540  *b Description:
7541  **
7542  ** Creates a detonation using the specified munition name. If the
7543  ** DI-Guy networking module is enabled the detonation is broadcast
7544  ** over the network.
7545  **
7546  *b Arguments:
7547  **
7548  *a munition_name - name of the munition to detonate; this will
7549  *a potentially trigger special effects depending
7550  *a on the munition
7551  *a x, y, z - location of the detonation
7552  *a attacker_name - this MUST be specified if the detonation is being
7553  *a broadcast over the network
7554  *a radius_override - defaults to the data in the munition config file
7555  *a broadcast_on_network - pass 0 to not broadcast detonation on DIS
7556  *a network
7557  *a ground_clamp_impact - 13.2.1 change, make it posible to not ground clamp this,
7558  *a was default behavior :-(
7559  **
7560  ** Note: Overriding the detonation radius will NOT work on broadcast
7561  ** detonations since the override value is not transmitted.
7562  */
7563  int trigger_detonation(const char* munition_name,
7564  float x, float y, float z,
7565  const char* attacker_name = NULL,
7566  float radius_override = -1.0f,
7567  int broadcast_on_network = 1,
7568  int ground_clamp_impact = 1 );
7569 
7570  /*l
7571  *b Description:
7572  **
7573  ** This function checks for intersection against characters in the
7574  ** specified view.
7575  **
7576  ** To check for intersections against both characters and scene
7577  ** objects, call get_intersection_at_screen_coords().
7578  **
7579  ** The returned diguyImpact pointer is owned by the scenario and
7580  ** should not be deleted. It will remain valid until the next call
7581  ** to any one of the following functions:
7582  **
7583  *- - find_character_at_screen_coords()
7584  *- - get_impact_at_screen_coords()
7585  *- - get_intersection_at_screen_coords()
7586  **
7587  *i This function should only be called from a DI-Guy Scenario Plugin.
7588  **
7589  *b Arguments:
7590  **
7591  *a view - view to check
7592  *a sx, sy - view coordinates to check
7593  **
7594  *b Returns:
7595  **
7596  ** pointer of type diguyImpact; NULL if no character intersected
7597  **
7598  *b Callable From:
7599  **
7600  *- - DI-Guy Scenario Plugin
7601  */
7602  diguyImpact* find_character_at_screen_coords(diguyView* view,
7603  float sx,
7604  float sy);
7605 
7606  /*l
7607  *b Description:
7608  **
7609  ** This function creates an impact object based on the sx and sy in
7610  ** the specified view. This function will trigger an impact callback
7611  ** on individuals who are touched, (it will not however kill
7612  ** characters who don't have impact callbacks.
7613  **
7614  ** The returned diguyImpact pointer is owned by the scenario and
7615  ** should not be deleted. It will remain valid until the next call
7616  ** to any one of the following functions:
7617  **
7618  *- - find_character_at_screen_coords()
7619  *- - get_impact_at_screen_coords()
7620  *- - get_intersection_at_screen_coords()
7621  **
7622  *i This function should only be called from a DI-Guy Scenario Plugin.
7623  **
7624  *b Arguments:
7625  **
7626  *a view - view to check
7627  *a sx, sy - view coordinates to check
7628  *a use_octtree - use the octtree; will not test against all
7629  *a characters unless they are explicitly added,
7630  *a but much faster
7631  **
7632  *b Returns:
7633  **
7634  ** pointer of type diguyImpact;
7635  **
7636  *b Callable From:
7637  **
7638  *- - DI-Guy Scenario Plugin
7639  */
7640  diguyImpact* get_impact_at_screen_coords(diguyView* view,
7641  float sx,
7642  float sy,
7643  int use_octtree = 0);
7644 
7645  /*l
7646  *b Description:
7647  **
7648  ** This function checks for intersection against the world *and*
7649  ** characters in the specified view. Unlike the function
7650  ** get_impact_at_screen_coords(), this function doesn't trigger
7651  ** callbacks; instead, it just fills out the impact info.
7652  **
7653  ** The returned diguyImpact pointer is owned by the scenario and
7654  ** should not be deleted. It will remain valid until the next call to
7655  ** any one of the following functions:
7656  **
7657  *- - find_character_at_screen_coords()
7658  *- - get_impact_at_screen_coords()
7659  *- - get_intersection_at_screen_coords()
7660  **
7661  *i This function should only be called from a DI-Guy Scenario Plugin.
7662  **
7663  *b Arguments:
7664  **
7665  *a view - view to check
7666  *a sx, sy - view coordinates to check
7667  *a use_octtree - use the octtree; will not test against all
7668  *a characters unless they are explicitly added,
7669  *a but much faster
7670  **
7671  *b Returns:
7672  **
7673  ** diguyImpact with the xyz location of the intersection; NULL if
7674  ** there was nothing to intersect there
7675  **
7676  *b Callable From:
7677  **
7678  *- - DI-Guy Scenario Plugin
7679  */
7680  diguyImpact* get_intersection_at_screen_coords(diguyView* view,
7681  float sx,
7682  float sy,
7683  int use_octtree = 0);
7684 
7685  /*l
7686  *b Description:
7687  **
7688  ** This function checks for intersection against the world and returns
7689  ** basic collision results.
7690  **
7691  ** This function will only return valid results in environments where
7692  ** the DI-Guy geometry octtree is available; currently that is when
7693  ** using OpenGL and the DI-Guy flight geometry loader. DI-Guy
7694  ** Scenario is such a case.
7695  **
7696  *b Arguments:
7697  **
7698  *a origin_x, origin_y, origin_z - starting location of the ray trace
7699  *a dir_x, dir_y, dir_z - direction of ray trace (should be normalized)
7700  *a max_distance_to_test - max distance ray will travel;
7701  *a -1.0 will test an infinitely long ray
7702  *a intersection_x, _y, and _z - world location of intersection
7703  *a normal_x, normal_y, normal_z - normal of intersection surface
7704  **
7705  ** Smaller values for max_distance_to_test will result in better
7706  ** performance.
7707  **
7708  ** The location of the intersection point is returned in the
7709  ** intersection x, y, and z pointers.
7710  **
7711  ** The normal of the surface intersected is returned in the normal
7712  ** x, y, and z pointers.
7713  **
7714  *b Returns:
7715  **
7716  ** 1 if intersection occurred, 0 if not.
7717  */
7718  int intersect_static_geometry(
7719  float origin_x, float origin_y, float origin_z,
7720  float dir_x, float dir_y, float dir_z,
7721  float max_distance_to_test,
7722  float* intersection_x, float* intersection_y, float* intersection_z,
7723  float* normal_x = NULL, float* normal_y = NULL, float* normal_z = NULL,
7724  int use_callback = 1);
7725 
7726  /*l
7727  *b Description:
7728  **
7729  ** This function returns the z height, or altitude, of the uppermost
7730  ** piece of terrain under the passed x, y, z point.
7731  **
7732  ** Two methods can be used to determine the altitude: a custom scenario
7733  ** altitude function set by the user, or by testing against DI-Guy's
7734  ** internal octtree calculated from terrain geometry.
7735  **
7736  ** See set_altitude_function() for information on the scenario
7737  ** altitude function. DI-Guy Scenario has its own version of this function,
7738  ** which defaults to using the octtree when it's available, and falls back on
7739  ** using a screen render and Z-buffer check when it's not.
7740  **
7741  ** Note that the octtree is not always available. In general, it is
7742  ** available only in DI-Guy Scenario, or when the built-in OpenGL
7743  ** renderer and DI-Guy flight geometry loader are in use. Users of the SDK
7744  ** typically have their own representations of terrain and structures.
7745  **
7746  *b Arguments:
7747  **
7748  *a x, y, z - world location to ground clamp
7749  *a valid - optional pointer to get an explicit result if anything
7750  *a was hit
7751  *a use_altitude_function - pass 1 to use scenario altitude function
7752  *a (tried first)
7753  *a use_octtree - pass 1 to use internal octtree
7754  **
7755  *b Returns:
7756  **
7757  ** new_z if ground clamp was possible, original z if not
7758  */
7759  float ground_clamp(float x, float y, float z,
7760  int* valid = NULL,
7761  int use_altitude_function = 1,
7762  int use_octtree = 0);
7763 
7764 
7765 #ifdef CPLUSPLUS_ONLY
7766 
7767  /******************************************************
7768  **
7769  *4 Impact Callback Functions:
7770  **
7771  ** Unless otherwise specified, callable from:
7772  **
7773  *- - C++
7774  *- - Script
7775  */
7776 
7777  /*l
7778  *b Description:
7779  **
7780  ** The following prototype should be used for the impact
7781  ** function:
7782  **
7783  *e int impact_func(diguyImpact* impact,
7784  *e float from_x,
7785  *e float from_y,
7786  *e float from_z,
7787  *e float to_x,
7788  *e float to_y,
7789  *e float to_z,
7790  *e diguyScenario* s);
7791  **
7792  ** When a character fires their weapon, DI-Guy calls this function
7793  ** with a pointer to the diguyImpact that must be filled out, the x,
7794  ** y, z position of the shot, and the target x, y, z.
7795  **
7796  ** The impact function should then do an intersection test and return
7797  ** 1 if a hit occurred.
7798  **
7799  ** By default the impact should have both the attacker and the
7800  ** munition type already specified. The intersection function must at
7801  ** least call diguyImpact::set_valid_impact() for the system to
7802  ** consider the impact valid. See diguyImpact for a sample function.
7803  **
7804  *b Callable From:
7805  **
7806  *- - C++
7807  */
7808  int set_fire_weapon_intersection_function(diguyScenarioFindImpactOnLineFunction* impact_function);
7809 
7810  /*l
7811  *b Description:
7812  **
7813  ** This function sets an impact function that will be added to all new
7814  ** scenarios. It can be overridden by an explicit call to
7815  ** diguyScenario::set_fire_weapon_intersection_function(). See that
7816  ** function for details.
7817  **
7818  *b Callable From:
7819  **
7820  *- - C++
7821  */
7822  static void set_default_fire_weapon_intersection_function(diguyScenarioFindImpactOnLineFunction* impact_function);
7823 
7824 #endif
7825 
7826  /*l
7827  *b Description:
7828  **
7829  ** Most DI-Guy visual objects (e.g., characters, path shapes,
7830  ** waypoints) have a unique identified, or UID. In many cases these
7831  ** UID values can be coded into 24-bit color values. This can be
7832  ** useful for implementing some types of intersection detection
7833  ** functions, in which each visual object is rendered with a different
7834  ** color.
7835  **
7836  ** This function will take the passed color values and update internal
7837  ** DI-Guy state of which objects objects have been hit.
7838  **
7839  ** It will also return an impact record containing information a
7840  ** subset of that information.
7841  **
7842  ** This can include:
7843  **
7844  *- - the hit character, if one was hit
7845  *- - the hit link and shape of the character
7846  *- - the hit scene object, if one was hit
7847  **
7848  ** Note that the returned impact pointer is owned by DI-Guy and is
7849  ** temporary. The information you need from it should be immediately
7850  ** read, and the pointer should not be stored.
7851  */
7852  diguyImpact* map_color_to_impact(char r, char g, char b);
7853 
7854  /*l
7855  *b Description:
7856  **
7857  ** When the callback with id diguyScenario::CALLBACK_ID_SCENE_OBJECT_IMPACT
7858  ** is called, this function will return the impact object containing
7859  ** information about that impact.
7860  **
7861  ** There may be multiple impacts that result from some operations.
7862  ** In this case this function should be called multiple times, until
7863  ** it returns NULL. When processing of data from each successive
7864  ** impact is done, call set_last_impact_been_processed() to queue up
7865  ** the next impact object for processing.
7866  **
7867  ** The maximum number of unprocessed impacts is finite, and set by
7868  ** the function set_max_unprocessed_impacts().
7869  **
7870  ** Note that the returned impact pointers are owned by DI-Guy and are
7871  ** temporary. The information you need from them should be
7872  ** immediately read, and the pointers should not be stored.
7873  */
7874  diguyImpact* get_last_env_impact_info();
7875 
7876  /*l
7877  *b Description:
7878  **
7879  ** Reading of data from the last impact information will be considered
7880  ** complete when this function is called.
7881  */
7882  void set_last_impact_been_processed();
7883 
7884  /*l
7885  *b Description:
7886  **
7887  ** This function will add the passed impact object to the list of
7888  ** impact objects to be processed by calls to
7889  ** get_last_env_impact_info(). An internal copy of the impact object
7890  ** is made.
7891  */
7892  void set_last_env_impact_info(const diguyImpact& impact);
7893 
7894  /*l
7895  *b Description:
7896  **
7897  ** Sets the maximum number of unprocessed impacts there can be.
7898  **
7899  ** The unprocessed impact array is a first-in-first-out queue. If an
7900  ** impact occurs that pushes the number of unprocessed impacts past
7901  ** this maximum number, earlier impacts will be dropped from the
7902  ** array.
7903  **
7904  ** The initial value is 10.
7905  */
7906  void set_max_unprocessed_impacts(int max_unprocessed_impacts);
7907 
7908 
7909 #ifdef CPLUSPLUS_ONLY
7910 
7911 
7912 /*****************************************************************************/
7932  /*l
7933  *b Description:
7934  **
7935  ** This function sets a default point line of sight function that
7936  ** will be added to all new characters. It can be overridden by an
7937  ** explicit call to diguyCharacter::set_point_los_function(). See
7938  ** that function for details.
7939  **
7940  *b Callable From:
7941  **
7942  *- - C++
7943  */
7944  int set_default_point_los_function(diguyPointLOSFunction* point_los_function);
7945 
7946  /*l
7947  *b Description:
7948  **
7949  ** This function sets a default character line of sight function that
7950  ** will be added to all new characters. It can be overridden by an
7951  ** explicit call to diguyCharacter::set_character_los_function().
7952  ** See that function for details.
7953  **
7954  *b Callable From:
7955  **
7956  *- - C++
7957  */
7958  int set_default_character_los_function(diguyCharacterLOSFunction* character_los_function);
7959 
7960  /*l
7961  *b Description:
7962  **
7963  ** This function sets a default feeler function that will be added
7964  ** to all new DI-Guy AI agents. It can be overridden by an explicit
7965  ** call to diguyCharacter::agent_set_feeler_function().
7966  **
7967  ** See the "User-Defined Feelers" section in diguyCharacter.h for
7968  ** more information.
7969  **
7970  *b Arguments:
7971  **
7972  *a feeler_function - pointer to user-defined feeler function
7973  **
7974  *b Returns:
7975  **
7976  ** 0 on success, -1 on failure
7977  **
7978  *b Callable From:
7979  **
7980  *- - C++
7981  */
7982  int set_default_agent_feeler_function(diguyFeelerFunction* feeler_function);
7983 
7984 #endif
7985 
7986  /*l
7987  *b Description:
7988  **
7989  ** Experimental intersection-detection function.
7990  **
7991  *b Arguments:
7992  **
7993  *a origin_x,origin_y,origin_z - starting point
7994  *a dir_x,dir_y,dir_z - direction vector
7995  *a max_distance_to_test - distance to test to
7996  *a use_callback - 1 to use
7997  **
7998  *b Returns:
7999  **
8000  ** diguyIntersectionResult structure
8001  */
8002  diguyIntersectionResult exp_intersect_geometry(
8003  float origin_x, float origin_y, float origin_z,
8004  float dir_x, float dir_y, float dir_z,
8005  float max_distance_to_test,
8006  int use_callback = 1);
8007 
8008 /*****************************************************************************/
8018  /*l
8019  *b Description:
8020  **
8021  ** This function returns a pointer to the region with the given
8022  ** name. A new region with the given name will be created if
8023  ** it doesn't already exist.
8024  **
8025  *b Arguments:
8026  **
8027  *a name - name of the region to find or create
8028  **
8029  *b Returns:
8030  **
8031  ** pointer of type diguyRegion; should never be NULL
8032  */
8033  diguyRegion* find_or_create_region(const char* name);
8034 
8035  /*l
8036  *b Description:
8037  **
8038  ** This function returns a pointer to the specified region.
8039  **
8040  *b Arguments:
8041  **
8042  *a name - name of region to be found
8043  **
8044  *b Returns:
8045  **
8046  ** pointer of type diguyRegion; NULL if not found
8047  */
8048  diguyRegion* find_region(const char* name);
8049 
8050  /*l
8051  *b Description:
8052  **
8053  ** This function creates a new diguyRegion and returns a pointer to
8054  ** it.
8055  **
8056  *b Arguments:
8057  **
8058  *a name - name of the new region object
8059  **
8060  *b Returns:
8061  **
8062  ** pointer of type diguyRegion
8063  */
8064  diguyRegion* create_region(const char* name);
8065 
8066  /*l
8067  *b Description:
8068  **
8069  ** This function destroys the passed region.
8070  **
8071  *b Arguments:
8072  **
8073  *a region - region to destroy
8074  */
8075  void destroy_region(diguyRegion* region);
8076 
8077  /*l
8078  *b Returns:
8079  **
8080  ** number of regions in the scenario
8081  */
8082  int get_num_regions();
8083 
8084  /*l
8085  *b Returns:
8086  **
8087  ** pointer of type diguyRegion; NULL if no region at the
8088  ** specified index
8089  **
8090  *b Arguments:
8091  **
8092  *a index - index of the region; indices start at 0
8093  */
8094  diguyRegion* get_region_at_index(int index);
8095 
8096  /*l
8097  *b Description:
8098  **
8099  ** The scenario will attempt to create a navigation path on the
8100  ** via_region. An A* path planning algorithm is used to find the
8101  ** path. See also diguyCharacter::agent_move_to_point() and
8102  ** diguyCharacter::agent_move_to_point_via_subregions().
8103  **
8104  *b Arguments:
8105  **
8106  *a x1, y1, z1 - start location
8107  *a x2, y2, z2 - end location
8108  *a via_region - name of the region to run A* on
8109  *a path_shape - path shape that stores the created path
8110  *a preferred_subregions_mask - diguySubregionMask value of regions
8111  *a preferred for travel
8112  *a cost_bias_for_preferred_regions - how much cheaper it will be
8113  *a to cross spaces that are part of desired subregion;
8114  *a should be < 1.0
8115  *a cost_bias_for_neutral_regions - how much more expensive it will be
8116  *a to cross spaces that are not part of desired subregion; see
8117  *a below for more information
8118  *a repulsed_regions_mask - diguySubregionMask value of regions *not*
8119  *a preferred for travel
8120  *a cost_bias_for_repulsed_regions - how much more expensive it will be
8121  *a to cross regions that are marked as repulsive; pass
8122  *a DIGUY_DEFAULT_FLOAT to avoid completely
8123  **
8124  ** Pass DIGUY_DEFAULT_FLOAT for cost_bias_for_neutral_regions and
8125  ** cost_bias_for_repulsed_regions to specify that they should be
8126  ** avoided completely.
8127  **
8128  ** The preferred_subregions_mask and repulsed_regions_mask use
8129  ** DI-Guy subregion mask values combined together. For example,
8130  ** DIGUY_SUBREGION_MASK_SIDEWALK | DIGUY_SUBREGION_MASK_CROSSWALK.
8131  **
8132  ** For cost_bias_for_neutral_regions, specifying a non-zero value for
8133  ** this lowers the likelihood that searches fail on disjointed
8134  ** subregions. A value < 1 will cause the planner to run faster but
8135  ** explore fewer points, possibly missing preferred regions. Values
8136  ** greater then 1 will explore more points but will be slower.
8137  **
8138  *b Returns:
8139  **
8140  ** 0 on success, -1 on failure
8141  */
8142  int find_navigation_path(float x1, float y1, float z1,
8143  float x2, float y2, float z2,
8144  const char* via_region,
8145  diguyPathShape* path_shape,
8146  float cost_bias_for_preferred_regions = 0.25f,
8147  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
8148  float cost_bias_for_neutral_regions = 1.1f,
8149  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
8150  float cost_bias_for_repulsive_regions = 100.0f);
8151 
8152  /*l
8153  *b Description:
8154  **
8155  ** Sets an upper limit on how far a character is willing to travel as
8156  ** a multiple of the straight line distance between point A and point
8157  ** B before declaring that it can't get to a location.
8158  **
8159  ** Note that internally the straight line distance is forced to have a
8160  ** lower bound of 10 meters, so a character is always willing to
8161  ** travel a minimum of 10 * max_distance_planning_multiplier meters.
8162  **
8163  ** Defaults to -1, which means off.
8164  */
8165  void set_max_distance_planning_multiplier(float mul);
8166 
8167  /*l
8168  *b Returns:
8169  **
8170  ** float constant that's used to decide if planner should give up;
8171  ** -1 means off
8172  */
8173  float get_max_distance_planning_multiplier();
8174 
8175  /*l
8176  *b Description:
8177  **
8178  ** This function returns in seconds how much time has been spent path
8179  ** planning during the current frame. It can be used to avoid 100
8180  ** characters simultaneously hitting the path planner.
8181  **
8182  *b Returns:
8183  **
8184  ** time in seconds
8185  */
8186  float get_time_spent_path_planning_this_frame();
8187 
8188  /*l
8189  *b Description:
8190  **
8191  ** This function enables the path planner to run in a background
8192  ** thread. Note this only occurs if the
8193  ** diguyCharacter::agent_move_to_point_bg() or
8194  ** diguyCharacter::agent_move_to_point_via_subregions_bg() api
8195  ** functions are used.
8196  **
8197  ** By default the multi-threaded path planner is on.
8198  */
8199  void set_multithreaded_path_planning_enabled(int value);
8200  /*l
8201  *b Returns:
8202  **
8203  ** Returns 1 if the path planner is enabled to run in a background
8204  ** thread. By default the multi-threaded path planner is on.
8205  */
8206  int get_multithreaded_path_planning_enabled();
8207 
8208 
8209 /*****************************************************************************/
8219  /*l
8220  *b Returns:
8221  **
8222  ** number of formations in the scenario
8223  */
8224  int get_num_formations();
8225 
8226  /*l
8227  *b Returns:
8228  **
8229  ** pointer of type diguyFormation; NULL if no
8230  ** formation at the specified index
8231  **
8232  *b Arguments:
8233  **
8234  *a index - index of the formation; indices start at 0
8235  */
8236  diguyFormation* get_formation_at_index(int index);
8237 
8238  /*l
8239  *b Description:
8240  **
8241  ** This function returns a pointer to the specified formation.
8242  **
8243  *b Arguments:
8244  **
8245  *a name - name of formation to be found
8246  **
8247  *b Returns:
8248  **
8249  ** pointer of type diguyFormation; NULL if not found
8250  */
8251  diguyFormation* find_formation(const char* name);
8252 
8253  /*l
8254  *b Description:
8255  **
8256  ** This function returns a pointer to the first formation it finds of
8257  ** a given size.
8258  **
8259  *b Arguments:
8260  **
8261  *a size - size of formation to be found
8262  **
8263  *b Returns:
8264  **
8265  ** pointer of type diguyFormation; NULL if not found
8266  */
8267  diguyFormation* find_formation_of_size(int size);
8268 
8269  /*l
8270  *b Description:
8271  **
8272  ** This function creates a new formation and returns a
8273  ** pointer to it.
8274  **
8275  *b Arguments:
8276  **
8277  *a name - name of the new formation
8278  **
8279  *b Returns:
8280  **
8281  ** pointer of type diguyFormation
8282  */
8283  diguyFormation* create_formation(const char* name);
8284 
8285  /*l
8286  *b Description:
8287  **
8288  ** This function finds the formation with the given name or
8289  ** creates it if it doesn't exist.
8290  **
8291  *b Arguments:
8292  **
8293  *a name - name of the formation to find or create
8294  **
8295  *b Returns:
8296  **
8297  ** pointer of type diguyFormation; should never be NULL
8298  */
8299  diguyFormation* find_or_create_formation(const char* name);
8300 
8301  /*l
8302  *b Description:
8303  **
8304  ** This function destroys a formation.
8305  **
8306  *b Arguments:
8307  **
8308  *a formation - pointer to a diguyFormation
8309  **
8310  *b Returns:
8311  **
8312  ** 0 on success, -1 on failure
8313  */
8314  int destroy_formation(diguyFormation* formation);
8315 
8316 
8317 /*****************************************************************************/
8333  void set_draw_authoring_visuals(int visible);
8335  int get_draw_authoring_visuals();
8336 
8337  void set_action_bead_labels_visible(diguyVisibleFlag vflag);
8338  void set_aim_trajectories_visible(diguyVisibleFlag vflag);
8339  void set_author_selection_handles_visible(diguyVisibleFlag vflag);
8340  void set_bead_array_visible(diguyVisibleFlag vflag);
8341  void set_character_labels_visible(diguyVisibleFlag vflag);
8342  void set_character_visible(diguyVisibleFlag vflag);
8343  void set_crowd_behavior_visible(diguyVisibleFlag flag);
8344  void set_crowd_feelers_visible(diguyVisibleFlag flag);
8345  void set_crowd_influence_visible(diguyVisibleFlag flag);
8346  void set_crowd_regions_visible(diguyVisibleFlag flag);
8347  void set_gaze_vector_visible(diguyVisibleFlag flag);
8348  void set_light_array_visible(diguyVisibleFlag vflag);
8349  void set_lua_objects_visible(diguyVisibleFlag flag);
8350  void set_mesh_region_array_visible(diguyVisibleFlag vflag);
8351  void set_sensor_region_array_visible(diguyVisibleFlag vflag);
8352  void set_spath_visible(diguyVisibleFlag vflag);
8353  void set_waypoint_array_visible(diguyVisibleFlag vflag);
8354 
8355  diguyVisibleFlag get_action_bead_labels_visible();
8356  diguyVisibleFlag get_aim_trajectories_visible();
8357  diguyVisibleFlag get_author_selection_handles_visible();
8358  diguyVisibleFlag get_bead_array_visible();
8359  diguyVisibleFlag get_character_labels_visible();
8360  diguyVisibleFlag get_character_visible();
8361  diguyVisibleFlag get_crowd_behavior_visible();
8362  diguyVisibleFlag get_crowd_feelers_visible();
8363  diguyVisibleFlag get_crowd_influence_visible();
8364  diguyVisibleFlag get_crowd_regions_visible();
8365  diguyVisibleFlag get_gaze_vectors_visible();
8366  diguyVisibleFlag get_light_array_visible();
8367  diguyVisibleFlag get_lua_objects_visible();
8368  diguyVisibleFlag get_mesh_region_array_visible();
8369  diguyVisibleFlag get_sensor_region_array_visible();
8370  diguyVisibleFlag get_spath_visible();
8371  diguyVisibleFlag get_waypoint_array_visible();
8372 
8373  void set_hide_author_selection_handles_during_play(int visible);
8374  int get_hide_author_selection_handles_during_play();
8375 
8376 
8377 /*****************************************************************************/
8387  /*l
8388  *b Returns:
8389  **
8390  ** If weapon fire will show flash geometry, (depending on munition configuration)
8391  */
8392  int get_weapon_flash_enabled();
8393 
8394  /*l
8395  *b Description:
8396  **
8397  ** Sets if weapon fire will create weapon geometry, (depending on munition configuration)
8398  */
8399  int set_weapon_flash_enabled(int enabled);
8400 
8401  /*l
8402  *b Returns:
8403  **
8404  ** If weapon fire will create light flashes, smoke and shell ejections, (depending on munition configuration)
8405  */
8406  int get_weapon_fire_effects_enabled();
8407 
8408  /*l
8409  *b Description:
8410  **
8411  ** Sets if weapon fire will create light flashes, smoke and shell ejections, (depending on munition configuration)
8412  */
8413  int set_weapon_fire_effects_enabled(int enabled);
8414 
8415  /*l
8416  *b Returns:
8417  **
8418  ** The number of light flashes that are currently active
8419  */
8420  int get_num_active_fire_effects();
8421 
8422  /*l
8423  *b Description:
8424  **
8425  ** This function gets the data needed for producing a weapon flash
8426  ** light source in the world. The convenience function diguyOglUtils::update_lighting()
8427  ** shows sample implementation for feeding this data into uniform buffers.
8428  **/
8429  int get_weapon_fire_effect_data(int index, float * radius,
8430  double * position_x, double * position_y, double * position_z,
8431  float * color_r, float * color_g, float * color_b,
8432  float * falloff_r,
8433  float * falloff_rsq);
8434 
8436  int get_num_active_lights();
8437 
8439  int sort_active_lights();
8440 
8441  /*l
8442  *b Description:
8443  **
8444  ** This function gets the data needed for producing a particle system or vehicle light.
8445  ** The convenience function diguyOglUtils::update_lighting()
8446  ** shows sample implementation for feeding this data into uniform buffers.
8447  **/
8448  int get_active_light_data(int index, diguyLightRenderDesc * light_desc);
8449 
8450 /*****************************************************************************/
8465  /*l
8466  *b Description:
8467  **
8468  ** Sets the current selected character in scenario
8469  **
8470  *b Returns:
8471  **
8472  ** 0 on success, -1 on failure
8473  **/
8474  int set_current_character(diguyCharacter* current_character);
8475 
8476  /*l
8477  *b Returns:
8478  **
8479  ** The current selected character in scenario
8480  **/
8481  diguyCharacter* get_current_character();
8482 
8484  int get_current_character_index();
8485 
8486  /*l
8487  *b Description:
8488  **
8489  ** Sets the current selected crowd in scenario
8490  **
8491  *b Returns:
8492  **
8493  ** 0 on success, -1 on failure
8494  **/
8495  int set_current_crowd(diguyCrowd* current_crowd);
8496  /*l
8497  *b Returns:
8498  **
8499  ** The current selected crowd in scenario
8500  **/
8501  diguyCrowd* get_current_crowd();
8502 
8503  /*l
8504  *b Description:
8505  **
8506  ** Sets the active crowd profile, which determines the attributes
8507  ** of subsequently-created crowds. See diguyCrowdProfile.
8508  **
8509  *b Returns:
8510  **
8511  ** 0 on success, -1 on failure
8512  **/
8513  int set_current_crowd_profile(diguyCrowdProfile* current_profile);
8514  /*l
8515  *b Description:
8516  **
8517  ** Sets the active crowd profile by name.
8518  **
8519  *b Returns:
8520  **
8521  ** 0 on success, -1 on failure
8522  **/
8523  int set_current_crowd_profile_by_name(const char* crowd_profile_name);
8524  /*l
8525  *b Returns:
8526  **
8527  ** Active crowd profile
8528  **/
8529  diguyCrowdProfile* get_current_crowd_profile();
8530 
8531  /*l
8532  *b Description:
8533  **
8534  ** Sets the current region. See diguyRegion.
8535  **
8536  *b Returns:
8537  **
8538  ** 0 on success, -1 on failure
8539  **/
8540  int set_current_region(diguyRegion* current_region);
8541  /*l
8542  *b Returns:
8543  **
8544  ** Current region.
8545  **/
8546  diguyRegion* get_current_region();
8547 
8548 
8549 /*****************************************************************************/
8554  /*l
8555  *b Description:
8556  **
8557  ** This function enables or disables the particle module.
8558  ** By default the particle module is enabled.
8559  */
8560  void set_particle_module_disabled(int disable_particle_module);
8561 
8562  /*l
8563  *b Description:
8564  **
8565  ** This function creates a particle system with type description_name
8566  ** at x, y, z. If duration is specified the system will automatically
8567  ** stop emitting after that amount of time.
8568  **
8569  *b Arguments:
8570  **
8571  *a description_name - name of particle description to create
8572  *a x, y, z - the world space position of the system
8573  *a record_transient_event - pass 1 to have this particle system
8574  *a play in history playback
8575  *a duration - how long the emitter should emit; if -1 is
8576  *a specified then the description must have a
8577  *a lifetime specified
8578  */
8579  int create_particle_system(const char* description_name,
8580  float x, float y, float z,
8581  int record_transient_event = 1,
8582  float duration = -1.0f);
8583 
8584  /*l
8585  *b Description:
8586  **
8587  ** Similar to create_particle_system(), but allows orientation to be set.
8588  **
8589  *b Arguments:
8590  **
8591  *a rz, rx, ry - orientation axes
8592  **
8593  ** (See create_particle_system() for other parameters)
8594  */
8595  int create_particle_system_with_orientation(const char* description_name,
8596  float x, float y, float z,
8597  float rz, float rx, float ry,
8598  int record_transient_event = 1,
8599  float duration = -1.0f);
8600 
8601  /*l
8602  *b Returns:
8603  **
8604  ** 1 if the particle description named description_name exists,
8605  ** else 0
8606  */
8607  int has_particle_description(const char* description_name);
8608 
8609  /*l
8610  *b Description:
8611  **
8612  ** Set wind velocity vector for particle system
8613  */
8614  void set_global_wind(float x, float y, float z);
8615 
8616 
8617 /*****************************************************************************/
8623 // These should probably be C++ only. Not sure how much they make sense for
8624 // exposure to the scripting languages, unless you want perl to call lua
8625 // via C++.
8626 
8627  /*l
8628  *b Returns:
8629  **
8630  ** string representation of lua_object.field_name
8631  **
8632  ** Note that the returned string pointer will not remain valid, so
8633  ** the returned string should be copied.
8634  **
8635  *b Arguments:
8636  **
8637  *a lua_object - a global lua object
8638  *a field_name - name of the field; field_name can include ".",
8639  *a allowing retrieval of fields in complex data
8640  *a structures
8641  **/
8642  const char* lua_get_object_field_as_string(const char* lua_object,
8643  const char* field_name);
8644 
8645  /*l
8646  **
8647  *b Description:
8648  **
8649  ** Runs a member function of a lua object.
8650  **
8651  *b Arguments:
8652  **
8653  *a lua_object - a lua object in the global scope, object names with fields should be properly handled
8654  *a ie object.subobject.blah should get properly parsed
8655  *a function_name - name of the function to call
8656  *a argument - optional string argument
8657  *a has_return_string - if set to 1 function will pop the top value of
8658  *a the lua stack and return it as a string
8659  **
8660  *b Returns:
8661  **
8662  ** NULL or string representation of
8663  ** lua_object:function_name(argument).
8664  **
8665  ** The returned string should be copied if it needs to be used later.
8666  **/
8667  const char* lua_evaluate_object_function(const char* lua_object,
8668  const char* function_name,
8669  const char* argument = NULL,
8670  int has_return_string = 0);
8671 
8672  /*l
8673  *b Description:
8674  **
8675  ** A two argument version of lua_evaluate_object_function().
8676  */
8677  const char* lua_evaluate_object_function_2a(const char* lua_object,
8678  const char* function_name,
8679  const char* argument,
8680  const char* argument2,
8681  int has_return_string = 0);
8682 
8683  /*l
8684  *b Description:
8685  **
8686  ** A three argument version of lua_evaluate_object_function().
8687  */
8688  const char* lua_evaluate_object_function_3a(const char* lua_object,
8689  const char* function_name,
8690  const char* argument,
8691  const char* argument2,
8692  const char* argument3,
8693  int has_return_string = 0);
8694 
8695  /*l
8696  *b Description:
8697  **
8698  ** A four argument version of lua_evaluate_object_function().
8699  */
8700  const char* lua_evaluate_object_function_4a(const char* lua_object,
8701  const char* function_name,
8702  const char* argument,
8703  const char* argument2,
8704  const char* argument3,
8705  const char* argument4,
8706  int has_return_string = 0);
8707 
8708 
8709  /*l
8710  *b Description:
8711  **
8712  ** Executes a lua_object:state_manager() function call. Useful for
8713  ** creating sleep-able coroutine based objects that aren't
8714  ** characters.
8715  **/
8716  int lua_send_message_to_object(const char* lua_object,
8717  const char* sender,
8718  const char* message_type,
8719  const char* message,
8720  const char* message_params = NULL);
8721 
8722 #ifdef CPLUSPLUS_ONLY
8723 
8724  /*l
8725  *b Description:
8726  **
8727  ** This function allows low level access to the lua_State pointer.
8728  ** This pointer can be used by a programmer to query and run functions
8729  ** on the Lua virtual machine. This object can also be used to
8730  ** register new C functions to lua, which allows you to instrument and
8731  ** create callbacks from script to your code. See luaL_register
8732  ** on-line.
8733  **
8734  ** For more information on how the Lua C api works see:
8735  ** http://www.lua.org/pil/24.html
8736  **
8737  *b NOTE:
8738  **
8739  ** Currently all scenarios share the same underlying Lua state object.
8740  ** This may cause issues in applications with multiple scenarios.
8741  **
8742  *b Callable From:
8743  **
8744  *- - C++
8745  */
8746  void* get_lua_state();
8747 
8748  /*l
8749  *b Description:
8750  **
8751  ** Mainly used to pass a qt pointer to lua so lqt can be used to
8752  ** modify/read from the widget. This requires the that the lqt package
8753  ** is loaded; see the lqt.lua utility package for more info.
8754  **
8755  *b Arguments:
8756  **
8757  *a lua_state - a Lua_State pointer, might be the same as get_lua_state();
8758  *a depends if the calling function is inside a coroutine
8759  *a class_name - class name should be a core class of qt with a star
8760  *a after it; i.e. "QWidget*" or "QLineEdit*"
8761  *a ptr - pointer to that is returned to the calling function in lua
8762  **
8763  *b Callable From:
8764  **
8765  *- - C++
8766  **
8767  *b C++ Example:
8768  **
8769  *e int push_graphics_view_to_lua(lua_State *L)
8770  *e {
8771  *e bdiQGraphicsView* graphics_view = get_primary_3d_window_graphics_view();
8772  *e if (m_scenario->push_qt_pointer_to_lua(L, "QGraphicsView*", graphics_view) == -1)
8773  *e {
8774  *e return 0;
8775  *e }
8776  *e return 1;
8777  *e }
8778  **
8779  ** Plug-in init code:
8780  **
8781  *e lua_State* L = (lua_State*)scenario->get_lua_state();
8782  *e if (L)
8783  *e {
8784  *e lua_register(L, "get_graphics_view", push_graphics_view_to_lua);
8785  *e }
8786  **
8787  ** In lua:
8788  **
8789  *e local graphics_view = get_graphics_view();
8790  **
8791  **/
8792  int push_qt_pointer_to_lua(void* lua_state,
8793  const char* class_name,
8794  void* ptr);
8795 
8796  /*l
8797  *b Description:
8798  **
8799  ** The most open function calling function available, if this doesn't
8800  ** manage to accomplish what you need you probably want to start
8801  ** using the lua interpreter directly.
8802  **
8803  ** The type arguments are string versions of the type being sent to
8804  ** lua, options include:
8805  *>
8806  *- - '' - empty argument
8807  *- - 'b' boolean - void* argument1 is assumed to be an int
8808  *- - 'f' field - void* argument1 assumed to be character string of
8809  *- a field of a global lua object; supports nested
8810  *- fields like foo.bar.a
8811  *- - 's' string - void* argument1 assumed to be character string
8812  *- - 'd' double - void* argument is assumed to be a double
8813  *- - diguy... - void* argument assumed to be a diguy class
8814  *- pointer ie "diguyCharacter", "diguyCrowd" (no
8815  *- star used for diguy classes)
8816  *- - Q...* - void* argument is assumed to be a pointer to a
8817  *- child of QObject; the class name should be a core
8818  *- class of qt with a star after it, e.g. "QWidget*"
8819  *- or "QLineEdit*"
8820  *<
8821  *b Arguments:
8822  **
8823  *a lua_object - a global lua object
8824  *a function_name - name of the function to call
8825  *a arg(1/2/3/4)_type - is the data type
8826  *a argument(1/2/3/4) - void* pointers to data
8827  *a has_return_string - if set to 1 function will pop the top value of
8828  *a the lua stack and return it as a string
8829  **
8830  *b Returns:
8831  **
8832  ** NULL or string representation of lua_object:function_name(argument)
8833  **
8834  ** The returned string should be copied if it needs to be used later.
8835  **
8836  *b Callable From:
8837  **
8838  *- - C++
8839  **/
8840  const char* lua_evaluate_object_function_4a_flex(const char* lua_object,
8841  const char* function_name,
8842  const char* arg1_type, void* argument1,
8843  const char* arg2_type, void* argument2,
8844  const char* arg3_type, void* argument3,
8845  const char* arg4_type, void* argument4,
8846  int has_return_string = 0);
8847 
8848  /*l
8849  *b Description:
8850  **
8851  ** Effectively the same as diguyScenario::lua_evaluate_object_function_4a_flex()
8852  ** but works on global functions.
8853  **
8854  *b Callable From:
8855  **
8856  *- - C++
8857  */
8858  const char* lua_evaluate_global_function_4a_flex(const char* function_name,
8859  const char* arg_type, void* argument,
8860  const char* arg_type2, void* argument2,
8861  const char* arg_type3, void* argument3,
8862  const char* arg_type4, void* argument4,
8863  int has_return_string = 0);
8864 
8865 #endif
8866 
8867  /*l
8868  *b Description:
8869  **
8870  ** Prints a message to lua interpreter log object. In DI-Guy
8871  ** Scenario this is sent to the AI Mind Editor and used to fill out
8872  ** the error log. The Mind editor log parses debug.traceback()
8873  ** calls.
8874  **/
8875  int lua_log_printf(int notify_level, const char* string);
8876 
8877  /*l
8878  *b Returns:
8879  **
8880  ** package meta data as a formatted string; useful for debugging,
8881  ** only valid inside DI-Guy Scenario
8882  */
8883  const char* dump_package_info(const char* package_name);
8884 
8885 /*****************************************************************************/
8891  /*l
8892  **
8893  *b Description:
8894  **
8895  ** Sends a message to specified diguyCharacter. The recipient must have a
8896  ** Lua mind that is capable of handling the message. The message will wake up
8897  ** the sleep() function in the mind that last relinquished control
8898  ** from the mind's coroutine.
8899  **
8900  *b Arguments:
8901  **
8902  *a to_character - the diguyCharacter to receive the message
8903  *a from_character - the diguyCharacter from whom the message originates
8904  *a message_type - should properly be "signal", but other settings may be used
8905  *a message - the actual name of the message, e.g. "detonation"
8906  *a message_params - comma-separated parameters, for use by the message handler
8907  **
8908  *b Returns:
8909  **
8910  ** 1 if message delivery successful, otherwise 0
8911  **
8912  *b Callable From:
8913  **
8914  *- - C++ and Lua
8915  **/
8916  int send_message(diguyCharacter *to_character,
8917  diguyCharacter *from_character,
8918  const char* message_type,
8919  const char* message,
8920  const char* message_params = NULL);
8921 
8922  /*l
8923  **
8924  *b Description:
8925  **
8926  ** Broadcasts a message to all other diguyCharacters within a certain
8927  ** radius of the from_character. The recipients must have Lua minds
8928  ** that are capable of handling the message. The message will wake up
8929  ** the sleep() function in the mind that last relinquished control
8930  ** from the mind's coroutine.
8931  **
8932  *b Arguments:
8933  **
8934  *a from_character - the diguyCharacter from whom the message originates
8935  *a radius - how far the broadcast goes (in meters) from the from_character
8936  *a message_type - should properly be "broadcast", but other settings may be used
8937  *a message - the actual name of the message, e.g. "detonation"
8938  *a message_params - comma-separated parameters, for use by the message handler
8939  **
8940  *b Returns:
8941  **
8942  ** -1 for failure, >= 0 for number of successful receptions
8943  **
8944  *b Callable From:
8945  **
8946  *- - C++ and Lua
8947  **/
8948  int broadcast_message(diguyCharacter *from_character,
8949  float radius,
8950  const char* message_type,
8951  const char* message,
8952  const char* message_params = NULL);
8953 
8954  /*l
8955  **
8956  *b Description:
8957  **
8958  ** Broadcasts a message to all diguyCharacters within named group, who
8959  ** are within given radius of the from_character. See comments for
8960  ** broadcast_message() above.
8961  **
8962  *b Arguments:
8963  **
8964  *a from_character - the diguyCharacter from whom the message originates
8965  *a group_name - name of group to broadcast to
8966  *a radius - how far the broadcast goes (in meters) from the from_character
8967  *a message_type - should properly be "broadcast", but other settings may be used
8968  *a message - the actual name of the message, e.g. "detonation"
8969  *a message_params - comma-separated parameters, for use by the message handler
8970  **
8971  *b Returns:
8972  **
8973  ** -1 for failure, >= 0 for number of successful receptions
8974  **
8975  *b Callable From:
8976  **
8977  *- - C++ and Lua
8978  **/
8979  int broadcast_message_to_group(diguyCharacter *from_character,
8980  const char* group_name,
8981  float radius,
8982  const char* message_type,
8983  const char* message,
8984  const char* message_params = NULL);
8985 
8986 /****************************************************************************/
8987 /****************************************************************************/
8988 /****************************************************************************/
8995 /****************************************************************************/
8996 /****************************************************************************/
8997 /****************************************************************************/
8998 
8999  /*l
9000  *b Returns:
9001  **
9002  ** value set by last call to set_eval_decisions_as_scripts()
9003  */
9004  int get_eval_decisions_as_scripts();
9005 
9006  /*l
9007  *b Description:
9008  **
9009  ** If called with an argument of 1, all decision beads and decision beads will
9010  ** be converted to scripts before being run.
9011  */
9012  void set_eval_decisions_as_scripts(int eval_decisions_as_scripts);
9013 
9014  /*l
9015  *b Description:
9016  **
9017  ** Gets the point of impact with the world along specified line segment
9018  **
9019  *b Returns:
9020  **
9021  ** pointer to diguyImpact object or NULL
9022  */
9023  diguyImpact* get_impact_on_line(float from_x,
9024  float from_y,
9025  float from_z,
9026  float to_x,
9027  float to_y,
9028  float to_z);
9029 
9030  /*l
9031  *b Description:
9032  **
9033  ** Increments wait cursor counter. If non-zero, then wait cursor is displayed
9034  ** in DI-GUY scenario.
9035  */
9036  void wait_cursor_push();
9037  /*l
9038  *b Description:
9039  **
9040  ** Decrements wait cursor counter.
9041  */
9042  void wait_cursor_pop();
9043 
9045  diguyParticleSystemRenderer * get_particle_renderer();
9046 
9048  void set_character_sorting_enabled(int enabled);
9049  int get_character_sorting_enabled();
9050 
9051 #ifdef CPLUSPLUS_ONLY
9052 
9053  /*l
9054  *b Description:
9055  **
9056  ** This function sets a generic node pointer that can later be
9057  ** retrieved by the get_graphics_api_node_ptr() call. The pointer is
9058  ** otherwise not used.
9059  **
9060  *b Arguments:
9061  **
9062  *a node_ptr - generic void* pointer
9063  **
9064  *b Callable From:
9065  **
9066  *- - C++
9067  */
9068  void set_graphics_api_node_ptr(void* node_ptr);
9069 
9070  /*l
9071  *b Returns:
9072  **
9073  ** pointer set by most recent call to set_graphics_api_node_ptr
9074  **
9075  *b Callable From:
9076  **
9077  *- - C++
9078  */
9079  void* get_graphics_api_node_ptr();
9080 
9081 #endif
9082 
9083  /*l
9084  *b Description:
9085  **
9086  ** Sets whether shadow disks are drawn for characters. Call with 1 to turn on,
9087  ** 0 to turn off.
9088  */
9089  void set_draw_character_shadow_disks(int draw_character_shadow_disks);
9090 
9091  /*l
9092  *b Returns:
9093  **
9094  ** 1 if shadow disks are drawn, 0 if not
9095  */
9096  int get_draw_character_shadow_disks();
9097 
9098  /*l
9099  *b Returns:
9100  **
9101  ** size of texture map for shadows
9102  */
9103  int get_shadow_map_size();
9104 
9105  /*l
9106  *b Description:
9107  **
9108  ** Sets size of texture map for shadows. Defaults to 1024. Allowed values
9109  ** are powers of two up to 4096.
9110  */
9111  int set_shadow_map_size(int shadow_size);
9112 
9113  /*l
9114  *b Description:
9115  **
9116  ** Used for DI-Guy OSG Author Programming Example. Sets the default value
9117  ** used for characters. See also diguyCharacter::set_scene_graph_mask()
9118  */
9119  void set_default_character_scene_graph_mask(unsigned long mask);
9120  unsigned long get_default_character_scene_graph_mask();
9121 
9122  /*l
9123  *b Description:
9124  **
9125  ** Used for DI-Guy OSG Author Programming Example. Sets the default value
9126  ** used for characters. See also diguySceneObject::set_scene_graph_mask()
9127  */
9128  void set_default_scene_object_scene_graph_mask(unsigned long mask);
9129  unsigned long get_default_scene_object_scene_graph_mask();
9130 
9131  /*l
9132  *b Description:
9133  **
9134  ** For internal use.
9135  */
9136  void set_internal_int(int var, int val);
9137  void set_internal_float(int var, float val);
9138 
9139  /*l
9140  *b Description:
9141  **
9142  ** This sets the number of point lights that get handed down to
9143  ** diguyGraphicsShaderTechnique::pick_shader_program().
9144  */
9145  int set_num_active_point_lights(int active_lights);
9146 
9147  /*l
9148  *b Description:
9149  ** This gets the number of point lights that get handed down to
9150  ** diguyGraphicsShaderTechnique::pick_shader_program() the default is 0.
9151  ** The convenience function diguyOglUtils::update_lighting()
9152  ** shows sample implementation for feeding this data into uniform buffers.
9153  **/
9154  int get_num_active_point_lights();
9155 
9156 /****************************************************************************/
9157 /****************************************************************************/
9158 /****************************************************************************/
9162 /****************************************************************************/
9163 /****************************************************************************/
9164 /****************************************************************************/
9165 
9166  /*l
9167  *b Description:
9168  **
9169  ** Sets bounding box of world
9170  **
9171  *b Arguments:
9172  **
9173  *a x_min,y_min,z_min,x_max,y_max,z_max - bounds
9174  **
9175  *b Returns:
9176  **
9177  ** 0 on success, -1 on failure
9178  ** (float * arguments converted to return values in Lua)
9179  */
9180  int set_world_bounds(float x_min, float y_min, float z_min,
9181  float x_max, float y_max, float z_max);
9182 
9183  /*l
9184  *b Description:
9185  **
9186  ** Gets bounding box of world
9187  **
9188  *b Arguments:
9189  **
9190  *a x_min,y_min,z_min,x_max,y_max,z_max - output parameters
9191  **
9192  *b Returns:
9193  **
9194  ** 0 on success, -1 on failure
9195  ** (float * arguments converted to return values in Lua)
9196  */
9197  int get_world_bounds(float* x_min, float* y_min, float* z_min,
9198  float* x_max, float* y_max, float* z_max);
9199 
9200 
9201 
9202 /****************************************************************************/
9203 /****************************************************************************/
9204 /****************************************************************************/
9208 /****************************************************************************/
9209 /****************************************************************************/
9210 /****************************************************************************/
9211 
9212  /*l
9213  *b Description:
9214  **
9215  ** Internal use
9216  */
9217  void set_checkpoint_frequency(float freq);
9218  /*l
9219  *b Description:
9220  **
9221  ** Internal use
9222  */
9223  float get_checkpoint_frequency();
9224  /*l
9225  *b Description:
9226  **
9227  ** Internal use
9228  */
9229  void set_checkpointing_enabled(int enable_checkpointing);
9230  /*l
9231  *b Description:
9232  **
9233  ** Internal use
9234  */
9235  int get_checkpointing_enabled();
9236 
9237  // should be removed, only for testing
9238  //void checkpoint();
9239  //void load_checkpoint();
9240 
9241 /****************************************************************************/
9242 /****************************************************************************/
9243 /****************************************************************************/
9247 /****************************************************************************/
9248 /****************************************************************************/
9249 /****************************************************************************/
9250 
9251  /*l
9252  *b Description:
9253  **
9254  ** Sets initial render mode
9255  **
9256  *b Arguments:
9257  **
9258  *a render_mode - string containing render mode setting name
9259  **
9260  ** Built-in render modes:
9261  **
9262  *- "normal"
9263  *- "shadow"
9264  *- "glow"
9265  *- "alternate1"
9266  *- "alternate2"
9267  *- "alternate3"
9268  */
9269  void set_initial_render_mode(const char* render_mode);
9270 
9271  /*l
9272  *b Returns:
9273  **
9274  ** initial render mode, as string
9275  **
9276  */
9277  const char* get_initial_render_mode();
9278 
9279  /*l
9280  *b Description:
9281  **
9282  ** Sets current render mode. See set_initial_render_mode()
9283  **
9284  */
9285  void set_current_render_mode(const char* render_mode);
9286 
9287  /*l
9288  *b Returns:
9289  **
9290  ** render mode, as string, derived from current light settings
9291  **
9292  *b Arguments:
9293  **
9294  *a set_current_to_derived - if 1, current render mode becomes derived
9295  *- mode
9296  **
9297  */
9298  const char* derive_render_mode_from_light_settings(int set_current_to_derived = 1);
9299 
9301  const char* get_current_render_mode();
9302 
9303  /*l
9304  *b Description:
9305  **
9306  ** Sets default shader for characters
9307  **
9308  *b Arguments:
9309  **
9310  *a render_mode - string containing render mode name
9311  *a shader_name - string containing name of shader technique
9312  *- (there should be a _glsl.cfg file of the same name)
9313  *a update_existing_characters - if 1, all existing characters will now
9314  *- be drawn using this shader
9315  */
9316  void set_default_character_shader(const char* render_mode,
9317  const char* shader_name,
9318  int update_existing_characters = 1);
9319 
9321  const char* get_default_character_shader(const char* render_mode);
9322 
9323  /*l
9324  *b Description:
9325  **
9326  ** Sets default shader for scene objects
9327  **
9328  *b Arguments:
9329  **
9330  *a render_mode - string containing render mode name
9331  *a shader_name - string containing name of shader technique
9332  *- (there should be a _glsl.cfg file of the same name)
9333  *a update_existing_scene_objects - if 1, all existing scene objects will now
9334  *- be drawn using this shader
9335  */
9336  void set_default_scene_object_shader(const char* render_mode,
9337  const char* shader_name,
9338  int update_existing_scene_objects = 1);
9339 
9341  const char* get_default_scene_object_shader(const char* render_mode);
9342 
9343  /*l
9344  *b Description:
9345  **
9346  ** Sets default shader for particle systems
9347  **
9348  *b Arguments:
9349  **
9350  *a render_mode - string containing render mode name
9351  *a shader_name - string containing name of shader technique
9352  *- (there should be a _glsl.cfg file of the same name)
9353  *a update_existing_particle_systems - if 1, all existing particle systems will now
9354  *- be drawn using this shader
9355  */
9356  void set_default_particle_system_shader(const char* render_mode,
9357  const char* shader_name,
9358  int update_existing_particle_systems = 1);
9359 
9361  const char* get_default_particle_system_shader(const char* render_mode);
9362 
9363  /*l
9364  *b Description:
9365  **
9366  ** Sets FaceFX animation set for a given actor.
9367  **
9368  *b Arguments:
9369  **
9370  *a actor_name - actor's name
9371  *a file_name - fully qualified file name ending in ".animset_ingame"
9372  */
9373  int facefx_mount_animset(const char* actor_name, const char* file_name);
9374 
9375  /*l
9376  *b Description:
9377  **
9378  ** Sets vehicle smoothing on or off. If 1, vehicle will be updated
9379  ** at a higher rate than frame dt
9380  **
9381  ** Default is on.
9382  */
9383  int set_vehicle_smoothing_enabled(int enable_smoothing);
9384  int get_vehicle_smoothing_enabled();
9385 
9386  /*l
9387  *b Description:
9388  **
9389  ** Sets realtime IK on or off. Experimental.
9390  **
9391  */
9392  int set_realtime_ik_enabled(int val);
9393  int get_realtime_ik_enabled();
9394 
9395  int set_draw_ik_visuals(int val);
9396  int get_draw_ik_visuals();
9397 
9398  int set_draw_skeletons(int val);
9399  int get_draw_skeletons();
9400 
9401  float get_last_update_time()
9402  {
9403  if(m_last_update_time == -9999.0f){
9404  return 0.0f;
9405  }
9406  return m_last_update_time;
9407  }
9408 
9409  void set_disable_profiler();
9410 
9411 
9412  const char* get_lua_field_as_string(const char* lua_object, const char* field_name,
9413  int warn_if_no_field = 1);
9414 
9415  float get_lua_field_as_float(const char* lua_object, const char* field_name,
9416  int warn_if_no_field = 1,
9417  int* found_field = NULL);
9418 
9419  void update_particle_preview(float time);
9420 
9421 
9422 /****************************************************************************/
9423 /****************************************************************************/
9424 /****************************************************************************/
9435 /****************************************************************************/
9436 /****************************************************************************/
9437 /****************************************************************************/
9438 
9439  // Removed due to head system changes. Body Appearance now dictates what heads are available
9440  /*l
9441  ** Similar to get_character_type_num_appearances(), but for
9442  ** head appearances.
9443  */
9444  int get_character_type_num_head_appearances(const char* character_type);
9445 
9446  /*l
9447  ** Similar to get_character_type_appearance_at_index(), but for
9448  ** head appearances.
9449  */
9450  const char* get_character_type_head_appearance_at_index(const char* character_type,
9451  int index);
9452 
9453 #ifdef CPLUSPLUS_ONLY
9454 
9455  /*l
9456  *b Description:
9457  **
9458  ** Deprecated; use diguyApp::add_default_scenario_callback() instead.
9459  */
9460  static int add_default_callback(int callback_id,
9461  diguyScenarioCallback* callback,
9462  void* callback_params = 0,
9463  void* callback_user_data = 0);
9464 
9465  /*l
9466  *b Description:
9467  **
9468  ** Deprecated; use diguyApp::remove_default_scenario_callback()
9469  ** instead.
9470  */
9471  static int remove_default_callback(int callback_id,
9472  diguyScenarioCallback* callback);
9473 
9474 #endif
9475 
9476  /*l
9477  *b Description:
9478  **
9479  ** Deprecated;
9480  ** use diguyApp::remove_default_scenario_callback_with_User_data()
9481  ** instead.
9482  */
9483  static int remove_default_callback_with_user_data(int callback_id,
9484  void* callback_user_data);
9485 
9486  /*l
9487  *b Description:
9488  **
9489  ** Deprecated; use diguyApp::add_default_scenario_callback_script()
9490  ** instead.
9491  */
9492  static int add_default_callback_script(int callback_id,
9493  const char* callback_script,
9494  const char* callback_script_type);
9495 
9496  /*l
9497  *b Description:
9498  **
9499  ** Deprecated; use diguyApp::remove_default_scenario_callback_script()
9500  ** instead.
9501  */
9502  static int remove_default_callback_script(int callback_id,
9503  const char* callback_script,
9504  const char* callback_script_type);
9505 
9506  /*l
9507  *b Description:
9508  **
9509  ** Deprecated as of 10.0.0; use get_character_type_map() intead,
9510  ** and then call
9511  ** diguyCharacterTypeMap::get_field_value(DIGUY_CHARACTER_TYPE_MAP_FIELD_CHARACTER_CLASS)
9512  */
9513  const char* get_character_type_class(const char* character_type);
9514 
9515  /*l
9516  *b Description:
9517  **
9518  ** Deprecated as of 10.5.1; use merge_object() intead.
9519  */
9520  int merge_asset(const char* string);
9521 
9522  /*l
9523  *b Description:
9524  **
9525  ** Deprecated as of 12.0.0; use bdi_log_print() from libbdilog.h
9526  ** instead.
9527  */
9528  void print_to_log(int notify_level, const char* string);
9529 
9530 
9531 #ifdef CPLUSPLUS_ONLY
9532 
9533  /*
9534  *2 VegaPrime Helper Functions
9535  */
9536  diguyCharacter* create_pending_reflected_character(const char* name,
9537  const char* character_type,
9538  const char* appearance = NULL);
9539 
9540  int set_network_translation(float x, float y, float z);
9541  int get_network_translation(float* x, float* y, float* z);
9542 
9543  /*l
9544  *b Description:
9545  **
9546  ** Deprecated as of 12.0.0; use save_as() instead.
9547  */
9548  void set_project_filename(const char* project_filename);
9549 
9550  /*l
9551  *b Description:
9552  **
9553  ** Deprecated as of 12.0.0; use get_filename() or
9554  ** get_filename_without_directory() intead.
9555  */
9556  const char* get_project_filename();
9557 
9563  bdiScenario* get_scripted_object();
9564 
9565 
9566 private:
9567 
9568  /*l
9569  ** A private constructor. Use the DI-Guy function
9570  ** diguy_create_scenario() to obtain a diguyScenario object pointer.
9571  */
9572  diguyScenario(bdiScenario* scenario);
9573 
9574  /*l
9575  ** A private destructor. Use the DI-Guy function
9576  ** diguy_destroy_scenario() to delete a diguyScenario object pointer.
9577  */
9578  virtual ~diguyScenario();
9579 
9580  /*l
9581  ** A pointer to internal data.
9582  */
9583  bdiScenario* m_scenario;
9584  float m_last_update_time;
9585 
9586  friend class bdiScenario;
9587 
9588 #endif
9589 
9590 };
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:62
The diguyViewFogSettings class holds camera settings data that can be loaded into a diguyViewFog usin...
Definition: diguyViewFogSettings.h:43
Experimental class for diguyIntersectionResult exp_intersect_geometry.
Definition: diguyImpact.h:617
diguyMotionDirection
Definition: diguyMotionDirection.h:26
chain settings.. Rarely used
Definition: diguyChainSettings.h:32
int diguyScenarioIntersectionFunction(diguyScenario *scenario, float origin_x, float origin_y, float origin_z, float dir_x, float dir_y, float dir_z, float max_distance_to_test, float *intersection_x, float *intersection_y, float *intersection_z, float *normal_x, float *normal_y, float *normal_z)
Definition: diguy_typedefs.h:80
Definition: diguyInfoPopup.h:32
A class that represents a bullet impact in the world, often used by AIs to make reaction decisions...
Definition: diguyImpact.h:41
Definition: diguyLoadManager.h: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:1188
The character type map provides extra information about DI-Guy character types and appearances...
Definition: diguyCharacterTypeMap.h:220
float diguyAltitudeFunction(diguyCharacter *character, float x, float y, float old_z, int *valid)
Definition: diguy_typedefs.h:57
This class is a simple structure for transmitting diguy lights down to the uniform buffer system this...
Definition: diguyViewLight.h:36
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:82
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
4 Header files and forward declarations
Definition: simple_playback_ogl.cpp:56
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:47
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:57
diguyCallbackReturn diguyViewCameraCallback(diguyViewCamera *camera, int callback_id, void *callback_params, void *callback_user_data)
Definition: diguy_typedefs.h:205