
|
|
This file was automatically generated from diguyApp.h. Do not edit this file directly; the changes will be lost.Includes: declspec_diguy.h | diguy_typedefs.h | diguy_constants.h | stdlib.h
Contents:
Link against: libdiguy
function int |
Prototype:
typedef int (*diguyModuleFunctionVoid)();
class diguyApp
|
class BDI_DECLSPEC_diguy diguyApp { public: static diguyApp* get_app(); int get_num_scenarios(); diguyScenario* get_scenario_at_index(int index); int get_num_blend_functions(); const char* get_blend_function_name_at_index(int index); int is_debug(); int is_api_mode(); int is_module_enabled(const char* module_name); diguyScenario* get_current_scenario(); static const char* get_diguy_base_dir_path(); static const char* get_diguy_subdir_path(const char* subdir); diguyExerciseInterface* get_exercise_interface(); #ifdef CPLUSPLUS_ONLY int add_default_scenario_callback(int callback_id, diguyScenarioCallback* callback, void* callback_params = 0, void* callback_user_data = 0, int remove_on_scenario_load = 1); int remove_default_scenario_callback(int callback_id, diguyScenarioCallback* callback); int remove_default_scenario_callback_with_user_data(int callback_id, void* callback_user_data); #endif int add_default_scenario_callback_script(int callback_id, const char* callback_script, const char* callback_script_type, int remove_on_scenario_load = 1); int remove_default_scenario_callback_script(int callback_id, const char* callback_script, const char* callback_script_type); #ifdef CPLUSPLUS_ONLY int register_scenario_event_handler(const char* handler_name, diguyScenarioCallback* callback, void* callback_user_data = 0); #endif int register_scenario_event_handler_from_library(const char* handler_name, const char* library_name, const char* function_name, void* callback_user_data = 0); int register_scenario_event_handler_script(const char* handler_name, const char* handler_script, const char* handler_script_type = NULL); int has_registered_scenario_event_handler(const char* handler_name); int unregister_scenario_event_handler(const char* handler_name); int load_plugin(const char* plugin_name, int required_by_scenario = 0, int unload_on_scenario_close = 0, int accepts_mouse_input = 1); int unload_plugin(const char* plugin_name); void unload_all_plugins(); int get_num_plugins(); const char* get_name_of_plugin(int index); diguyGraphicsShaderProgram* load_shader_program(const char* shader_name, const char* vertex_shader_filename, const char* pixel_shader_filename); void reload_shader_programs(); diguyGraphicsShaderProgram* find_shader_program(const char* shader_name); int get_num_shader_programs(); diguyGraphicsShaderProgram* get_shader_program_at_index(int index); diguyGraphicsShaderProgram* get_current_bound_shader_program(); diguyGraphicsShaderTechnique* find_shader_technique(const char* shader_technique_name); int get_num_shader_techniques(); diguyGraphicsShaderTechnique* get_shader_technique_at_index(int index); int set_max_character_shader_quality_level(int quality_level); int get_max_character_shader_quality_level(); int set_max_scene_object_shader_quality_level(int quality_level); int get_max_scene_object_shader_quality_level(); int get_use_sRGB_textures(); int set_precompute_quaternions_enabled(int enabled); int get_precompute_quaternions_enabled(); int set_num_rendering_passes(int num_rendering_passes); int get_num_rendering_passes(); int get_render_pass_flags(); int set_render_pass_flags(int flags); int get_ideal_num_threads(); int set_num_threads(int num_threads); int get_num_threads(); int reserve_num_threads(int num_reserve_threads); int set_base_input_mode(diguyScenarioInputMode mode); diguyScenarioInputMode get_base_input_mode(); int get_last_clicked_xyz(float* x, float* y, float* z); void set_last_clicked_xyz(float x, float y, float z); diguyCharacter* get_last_clicked_character(); int get_mouse_screen_xy(float* sx, float* sy); int get_xyz_under_mouse(float* x, float* y, float* z); void set_lua_object_waiting_for_input(const char* object_name); const char* get_lua_object_waiting_for_input(); diguyAuthorInterface* get_author_interface(); diguyViewPainter* get_view_painter(); void set_collision_group_detection_flag(diguyPhysicsCollisionGroup collision_group1, diguyPhysicsCollisionGroup collision_group2, int enable_collisions); int get_collision_group_detection_flag(diguyPhysicsCollisionGroup collision_group1, diguyPhysicsCollisionGroup collision_group2); void set_physics_sim_ground_plane_enabled(int enabled); int get_physics_sim_ground_plane_enabled(); void set_physics_sim_ground_plane_height(float height); float get_physics_sim_ground_plane_height(); static const char* get_standard_bdi_library_suffix(); static const char* get_diguy_version_library_suffix(); static const char* get_compiler_library_suffix(); static void* load_module_library(const char* module_lib_name, int include_diguy_standard_library_suffixes = 1, int* load_status = NULL); static void* resolve_module_library_symbol(void* module_handle, const char* symbol_name); static void unload_module_library(void* module_handle); int get_sound_factory_is_initialized(); int set_munition_type_DIS_impact_septet(const char* munition_type, int sep1, int sep2, int sep3, int sep4, int sep5, int sep6, int sep7); int set_munition_type_DIS_tracer_septet(const char* munition_type, int sep1, int sep2, int sep3, int sep4, int sep5, int sep6, int sep7); const char* get_munition_type_from_DIS_septet( int sep1, int sep2, int sep3, int sep4, int sep5, int sep6, int sep7, int include_last_septet_value = 1); int unload_unreferenced_graphics_files(int garbage_collect_appearances = 1); int reload_texture_files(); int set_threshold_to_unload_textures(int number); int get_threshold_to_unload_textures(); int set_texture_unload_frequency(float seconds); float get_texture_unload_frequency(); int get_unload_unused_after_scenario_load(); int set_unload_unused_after_scenario_load(int val); int set_cache_optimized_motion_files(int enabled = 0); int get_cache_optimized_motion_files(); int memory_tracker_print_report(int include_permanent_objects = 0, int just_markers = 0); int memory_tracker_drop_marker(); void set_reflected_entity_message_list(const char* message); const char* get_reflected_entity_message_list(); const char* get_scene_object_file_name_from_ui(); int show_generate_navmesh_ui(); diguyLogChannel* create_log_channel(); void destroy_log_channel(diguyLogChannel*); int get_num_log_channels(); diguyLogChannel* get_log_channel_at_index(int index); int set_current_painting_subregion(diguySubregionIndex index);
| General Functions |
Unless otherwise noted all functions in this class section are callable from:
- C++
- Script
In lua static function are callable as diguyApp_function_name or via the this_app global.
function diguyApp::get_app |
Prototype:
Description:static diguyApp* get_app();
This static function returns a pointer to the DI-Guy application. All functions below can then be called through this pointer.Returns:
a pointer of type diguyAppC++ Example:
diguyApp* app = diguyApp::get_app();
function diguyApp::get_num_scenarios |
Prototype:
Returns:int get_num_scenarios();
number of scenarios in the app
function diguyApp::get_scenario_at_index |
Prototype:
Returns:diguyScenario* get_scenario_at_index(int index);
pointer of type diguyScenario; NULL if no scenario at the specified indexArguments:
index index of the scenario; indices start at 0
function diguyApp::get_num_blend_functions |
Prototype:
Returns:int get_num_blend_functions();
number of blend functions available
function diguyApp::get_blend_function_name_at_index |
Prototype:
Returns:const char* get_blend_function_name_at_index(int index);
name of blend function at specified index; NULL if no blend function at specified indexArguments:
index index of the blend function; indices start at 0
function diguyApp::is_debug |
Prototype:
Description:int is_debug();
This function returns whether or not the application is in debug mode. Useful for choosing which versions of shared libraries to load.Returns:
1 if app is in debug mode; 0 if not
function diguyApp::is_api_mode |
Prototype:
Description:int is_api_mode();
This function returns whether or not the DI-Guy SDK is being used inside of DI-Guy Scenario or as an embedded C++ library.Returns:
1 if being used as a library; 0 if not
function diguyApp::is_module_enabled |
Prototype:
Description:int is_module_enabled(const char* module_name);
This function returns whether or not the specified module is currently enabled.Returns:
1 if module is enabled; 0 if not
function diguyApp::get_current_scenario |
Prototype:
Returns:diguyScenario* get_current_scenario();
pointer of type diguyScenario; NULL if no current scenario
| Directory Functions |
- C++
- Script
| Networking Functions |
- C++
- Script
function diguyApp::get_exercise_interface |
Prototype:
Description:diguyExerciseInterface* get_exercise_interface();
Gets a pointer to the exercise interface. If DI-Guy is not on the network, the returned pointer will be NULL.Returns:
pointer of type diguyExerciseInterface on success, NULL on failure or if not on the network
| C++ Only Callback Functions |
function diguyApp::add_default_scenario_callback |
Prototype:
Description:int add_default_scenario_callback(int callback_id, diguyScenarioCallback* callback, void* callback_params = 0, void* callback_user_data = 0, int remove_on_scenario_load = 1);
This function sets a default user callback that will be added to all new scenarios. See diguyScenario::add_callback() for details.
function diguyApp::remove_default_scenario_callback |
Prototype:
Description:int remove_default_scenario_callback(int callback_id, diguyScenarioCallback* callback);
This function removes a default user callback previously added by add_default_scenario_callback(). See diguyScenario::remove_callback() for details.Returns:
0 on success, -1 on failure
function diguyApp::remove_default_scenario_callback_with_user_data |
Prototype:
Description:int remove_default_scenario_callback_with_user_data(int callback_id, void* callback_user_data);
This function removes a default user callback previously added by add_default_scenario_callback(). See diguyScenario::remove_callback_with_user_data() for details.
| C++ and Script Callback Functions |
function diguyApp::add_default_scenario_callback_script |
Prototype:
Description:int add_default_scenario_callback_script(int callback_id, const char* callback_script, const char* callback_script_type, int remove_on_scenario_load = 1);
This function adds a default scenario callback script. The callback script will be added to all new scenarios. See diguyScenario::add_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyApp::remove_default_scenario_callback_script |
Prototype:
Description:int remove_default_scenario_callback_script(int callback_id, const char* callback_script, const char* callback_script_type);
This function removes a default scenario callback script. See diguyScenario::remove_callback_script() for more details.Returns:
0 on success, -1 on failure
| Event Handler Functions |
DI-Guy event handlers are similar to callbacks, but have a name with which they can be referenced. This name allows DI-Guy Scenario to map event handlers to callback ids using a UI, and allows for these mappings to be saved and restored as part of the scenario.
function diguyApp::register_scenario_event_handler |
Prototype:
Description:int register_scenario_event_handler(const char* handler_name, diguyScenarioCallback* callback, void* callback_user_data = 0);
This function is analogous to the diguyScenario::register_character_event_handler() function, but is for scenarios rather than characters.
The registered event handler can be mapped to an event via the DI-Guy Scenario UI, or by the function diguyScenario::map_event_handler_to_callback_id().
It can also be manually invoked by the function call diguyScenario::manually_invoke_event_handler().Callable From:
- C++
function diguyApp::register_scenario_event_handler_from_library |
Prototype:
Description:int register_scenario_event_handler_from_library(const char* handler_name, const char* library_name, const char* function_name, void* callback_user_data = 0);
This function is analogous to the diguyScenario::register_character_event_handler_from_library() function, but is for scenarios rather than characters.
The registered event handler can be mapped to an event via the DI-Guy Scenario UI, or by the function diguyScenario::map_event_handler_to_callback_id().
It can also be manually invoked by the function call diguyScenario::manually_invoke_event_handler().
function diguyApp::register_scenario_event_handler_script |
Prototype:
Description:int register_scenario_event_handler_script(const char* handler_name, const char* handler_script, const char* handler_script_type = NULL);
This function is analogous to the diguyScenario::register_character_event_handler_script() function, but is for scenarios rather than characters.
The registered event handler can be mapped to an event via the DI-Guy Scenario UI, or by the function diguyScenario::map_event_handler_to_callback_id().
It can also be manually invoked by the function call diguyScenario::manually_invoke_event_handler().
function diguyApp::has_registered_scenario_event_handler |
Prototype:
Description:int has_registered_scenario_event_handler(const char* handler_name);
This function is analogous to the diguyScenario::has_registered_character_event_handler() function, but is for scenarios rather than characters.
function diguyApp::unregister_scenario_event_handler |
Prototype:
Description:int unregister_scenario_event_handler(const char* handler_name);
This function is analogous to the diguyScenario::unregister_character_event_handler() function, but is for scenarios rather than characters.
| Plugin Functions |
See complete overview at \ref diguyScenarioPluginOverview
\page diguyScenarioPluginOverview DI-Guy Scenario Plug-in Overview
\tableofcontents
A DI-Guy plugin is a dynamic library that adds additional functionality to DI-Guy Scenario or to an application using the standard DI-Guy SDK libraries.
Plugins can be loaded in three ways:
- specified on DI-Guy Scenario command line using "+plugin xyz" argument
- added to a scenario in DI-Guy Scenario via the Scenario ObjectsSpecialized ObjectsPlugins page
- by calling diguyApp::load_plugin()
Once a plugin has successfully been loaded, functions from the plugin will be called at specific times during scenario execution.
Plugins can be unloaded in four ways:
- DI-Guy Scenario is shut down
- if part of a scenario, and the plugin is removed from the scenario by pressing Unload on the Plugins page
- if part of a scenario, "Unload on Scenario Close" on the Plugins page is checked, and a new scenario is loaded
- by calling diguyApp::unload_plugin()
Once a plugin has successfully been loaded, functions from the plugin will be called at specific times during scenario execution.
Following is a list of the functions that DI-Guy will look for in the library. Note that a plugin does not need to implement all of these functions; if a function is missing the plugin will quietly skip it. Only the diguy_version() function must be implemented.
Note that new functions may be added to plugins in the future.
void diguy_version(int* version_major, int* version_minor, int* version_point)
This function will be called once, when the plugin is being loaded. The function should return, via the passed int pointers, the DI-Guy version number as defined in diguy_constants.h. DI-Guy will compare these numbers against the current version number to make sure the plugin is compatible with the current version.
C++ Example:
void initialize_plugin(diguyApp* app)
__declspec(dllexport) void diguy_version(int* version_major, int* version_minor, int* version_point) { *version_major = DIGUY_VERSION_MAJOR; *version_minor = DIGUY_VERSION_MINOR; *version_point = DIGUY_VERSION_POINT; }
This function will be called once, when the plugin is being loaded.If the plugin is being loaded because it was specified on the DI-Guy Scenario command line, this function will be called as DI-Guy Scenario is initializing, before the first scenario is created.
If the plugin is part of a scenario (is shown in the DI-Guy Scenario Scenario ObjectsSpecialized ObjectsPlugins page), the call will happen when the scenario is loaded.
If the plugin is being loaded because of a load_plugin() call, this function will be called during the load_plugin() call.
void deinitialize_plugin(diguyApp* app)
This function will be called once, when the plugin is being unloaded. The call will happen while DI-Guy Scenario is shutting down, or during the unload_plugin() call if the plugin is being explicitly unloaded by function call.
void initialize(diguyScenario* s)
This function will be called when the passed scenario first becomes aware of the plugin. This will be when the scenario is created if the plugin has already been loaded, or during the load_plugin() call if the plugin is loaded after the scenario was created.
void deinitialize(diguyScenario* s)
This function will be called when the scenario is deleted, or when unload_plugin() is called.
void pre_update(diguyScenario* s)
This function will be called during the diguyScenario::update() call, before anything else is changed due to the update. (i.e., characters will not have moved yet, etc.)
void post_update(diguyScenario* s)
This function will be called during the diguyScenario::update() call, after everything else is changed due to the update. (i.e., characters will have moved, etc.)
void pre_draw(diguyScenario* s)
This function will be called during the diguyScenario::draw() call, before anything else is drawn.
void post_draw(diguyScenario* s)
This function will be called during the diguyScenario::draw() call, after everything else is drawn.
void reset(diguyScenario* s)
This function will be called when the scenario is reset, either due to pressing the Reset button in DI-Guy Scenario, or calling the diguyScenario::reset() function. The scenario is also implicitly reset when a .dss file is loaded.
diguyPluginMouseCursor get_mouse_cursor(diguyScenario* s)
This function should return which type of cursor should be used when the mouse is in a 3D view. See the documentation for diguyPluginMouseCursor for which values are available. If this function is not exported from the plugin, the default cursor DIGUY_PLUGIN_MOUSE_CURSOR_LEFT_ARROW will be used.
void mouse_press(diguyScenario* s, diguyPluginMouseEvent* mouse_event)
This function is called on an initial press of any mouse button in a 3D view. Use the query functions of the diguyPluginMouseEvent object to retrieve which view the press occurred in and the x and y screen coordinates of the press.
void mouse_drag(diguyScenario* s, diguyPluginMouseEvent* mouse_event)
This function is called when the mouse is moved in a 3D while one or more buttons are pressed.
void mouse_release(diguyScenario* s, diguyPluginMouseEvent* mouse_event)
This function is called when any mouse button is released in a 3D view.
void mouse_move(diguyScenario* s, diguyPluginMouseEvent* mouse_event)
This function is called when the mouse is moved in a 3D while no buttons are pressed.
int key_press(diguyScenario* s, diguyPluginKeyboardEvent* keyboard_event)
This function is called on an initial press of any key in a 3D view. Use the query functions of the diguyPluginKeyboardEvent object to retrieve which view the press occurred in and the code of the key. The code can be a standard ASCII value, or one of the DIGUY_SPECIAL_KEY_* values defined in diguy_constants.h. Return 1 to indicate that the key was handled and that the default key handler should not be called. Return 0 for the default key handler to be called.
int key_release(diguyScenario* s, diguyPluginKeyboardEvent* keyboard_event)
The same as key_press(), but called when the key is released.
void save_review_data(diguyScenario* s, const char* filename)
This function will be called when after-action review data for the scenario is saved by a call to diguyScenario::save_review_data().
void load_review_data(diguyScenario* s, const char* filename)
This function will be called when after-action review data for the scenario is loaded by a call to diguyScenario::load().
Windows Specific:
Plugin functions should be declared with __declspec(dllexport) to make sure that the symbols are properly exported from the DLL.
The LIBC version that the plugin uses (MD, MDd, MT, or MTd) must be the same as that of DI-Guy Scenario or the DI-Guy libraries used. If this does not happen conflicting versions of the DI-Guy DLLs will be loaded and the program will be unstable.
function diguyApp::load_plugin |
Prototype:
Description:int load_plugin(const char* plugin_name, int required_by_scenario = 0, int unload_on_scenario_close = 0, int accepts_mouse_input = 1);
This function adds a new dynamic library plugin to the app. Plugins work within DI-Guy Scenario as well as the DI-Guy SDK.Arguments:
Returns:
plugin_name name of the plugin; should be dynamic library name without the extension required_by_scenario if set to 1, this plugin is required for proper execution of this scenario; when the scenario is loaded this plugin will be loaded as well if it is not already active; default value is 0 unload_on_scenario_close if set to 1, this plugin will be unloaded if this scenario is closed or a new scenario is opened; default value is 0 accepts_mouse_input if set to 1, this plugin will receive mouse events via the mouse plugin functions when the input mode is "Plugin"; default value is 1
0 on success, -1 on failureWindows Specific:
The DLL should be placed in a directory that is in the path, or in the same directory as the DI-Guy Scenario executable.
The DLL version of DI-Guy Scenario or the SDK must be used for plugins to work.See complete overview at \ref diguyScenarioPluginOverview
function diguyApp::unload_plugin |
Prototype:
Description:int unload_plugin(const char* plugin_name);
This function unloads a dynamic library plugin from the app that was added using the load_plugin() function.Arguments:
Returns:
name name of the plugin
0 on success, -1 on failureSee complete overview at \ref diguyScenarioPluginOverview
function diguyApp::unload_all_plugins |
Prototype:
Description:void unload_all_plugins();
Unloads all plug-ins.
function diguyApp::get_num_plugins |
Prototype:
Returns:int get_num_plugins();
This function returns the number of dynamic library plugins currently loaded.See complete overview at \ref diguyScenarioPluginOverview
function diguyApp::get_name_of_plugin |
Prototype:
Returns:const char* get_name_of_plugin(int index);
the name of a specific plug-in at a specified indexArguments:
See complete overview at \ref diguyScenarioPluginOverview
| Shader Functions |
function diguyApp::load_shader_program |
Prototype:
Description:diguyGraphicsShaderProgram* load_shader_program(const char* shader_name, const char* vertex_shader_filename, const char* pixel_shader_filename);
This function loads (or reloads) shader source files into a shader program. The shader program can be attached to a character in two ways:
First, a shader may be explicitly added to a character using the diguyCharacter::set_shader_program() function.
Second, a shader may be implicitly added to a character if its appearance specifies an associated shader required to make the appearance look right. Most often this is for appearances that are skinned, requiring a shader to transform the vertices correctly. DI-Guy most often uses the 'diguy_object' shader for this.
If a shader program with the same name has already been loaded, this function will replace it.
DI-Guy Scenario uses GLSL shaders.Arguments:
Returns:
pointer to object type diguyGraphicsShaderProgram on success, NULL on failure
function diguyApp::reload_shader_programs |
Prototype:
Description:void reload_shader_programs();
This function reloads all previously loaded shader programs, using the same source filenames as were used when the shader was initially loaded.
This function can be used to reload/replace an existing shader with the same name, allowing for quick edit and test cycles when working on new shaders.
function diguyApp::find_shader_program |
Prototype:
Description:diguyGraphicsShaderProgram* find_shader_program(const char* shader_name);
This function looks for the previously loaded shader program with the given name.Arguments:
Returns:
pointer to object type diguyGraphicsShaderProgram on success, NULL on failure
function diguyApp::get_num_shader_programs |
Prototype:
Returns:int get_num_shader_programs();
number of loaded shader programs
function diguyApp::get_shader_program_at_index |
Prototype:
Description:diguyGraphicsShaderProgram* get_shader_program_at_index(int index);
This function returns the shader program at the specified index.Arguments:
Returns:
pointer to object type diguyGraphicsShaderProgram on success, NULL on failure
function diguyApp::get_current_bound_shader_program |
Prototype:
Description:diguyGraphicsShaderProgram* get_current_bound_shader_program();
This function returns the shader program that's currently activeReturns:
pointer to object type diguyGraphicsShaderProgram on success, NULL on failure
function diguyApp::find_shader_technique |
Prototype:
Description:diguyGraphicsShaderTechnique* find_shader_technique(const char* shader_technique_name);
This function looks for the previously loaded shader technique with the given name.Arguments:
Returns:
pointer to object type diguyGraphicsShaderTechnique on success, NULL on failure
function diguyApp::get_num_shader_techniques |
Prototype:
Returns:int get_num_shader_techniques();
number of loaded shader techniques
function diguyApp::get_shader_technique_at_index |
Prototype:
Returns:diguyGraphicsShaderTechnique* get_shader_technique_at_index(int index);
a pointer to a diguyGraphicsShaderTechnique on success at the specified index, NULL on failure.Arguments:
function diguyApp::set_max_character_shader_quality_level |
Prototype:
Description:int set_max_character_shader_quality_level(int quality_level);
This function sets the max shader quality level for characters in the application. See diguyGraphicsShaderProgram.h for the diguyGraphicsShaderQualityLevel enum. This quality level, which can range from no lighting to normal mapped characters, will be used to pick an appropriate shader from a shader technique.
function diguyApp::get_max_character_shader_quality_level |
Prototype:
int get_max_character_shader_quality_level();
function diguyApp::set_max_scene_object_shader_quality_level |
Prototype:
Description:int set_max_scene_object_shader_quality_level(int quality_level);
This function sets the maximum shader quality level for scene objects in the application. See diguyApp::set_max_character_shader_quality_level() for more information.
function diguyApp::get_max_scene_object_shader_quality_level |
Prototype:
int get_max_scene_object_shader_quality_level();
function diguyApp::get_use_sRGB_textures |
Prototype:
Returns:int get_use_sRGB_textures();
the value that was passed in for init.use_sRGB_corrected_textures allows end users to procedurally choose gamma correction behavior.
| Performance Functions |
function diguyApp::set_precompute_quaternions_enabled |
Prototype:
Description:int set_precompute_quaternions_enabled(int enabled);
This function tells DI-Guy to use quaternions for all joint angles in motions. It should be called after DI-Guy is initialized and before characters are created. By default DI-Guy data uses Euler angles.
Some motion operations are faster using quaternions, while some are not. In general anything that requires blending of motions will be faster when using quaternions.
This function should not have any negative effect on character motion quality.Arguments:
Returns:
0 on success, -1 on failureC++ Example:
diguy_graphics_initialize(); diguyApp* the_app = diguy_get_app(); the_app->set_precompute_quaternions_enabled(1);
function diguyApp::get_precompute_quaternions_enabled |
Prototype:
Returns:int get_precompute_quaternions_enabled();
current setting of whether quaternions are enabled; see set_precompute_quaternions_enabled()
function diguyApp::set_num_rendering_passes |
Prototype:
Description:int set_num_rendering_passes(int num_rendering_passes);
This function sets how may rendering passes DI-Guy will use to draw objects such as characters and scene objects.
By default DI-Guy uses two rendering passes. Fully opaque objects are drawn in the first pass; semi-transparent objects are drawn in the second.
If few or no objects have transparency, the number of rendering passes can be set to 1, which will increase rendering performance.
If the number of rendering passes is set to 1, semi-transparent objects may incorrectly occlude objects behind them, depending on object rendering order.
This function can be called at any time.Arguments:
Returns:
0 on success, -1 on failure
function diguyApp::get_num_rendering_passes |
Prototype:
Returns:int get_num_rendering_passes();
current setting of number of rendering passes; see set_num_rendering_passes()
function diguyApp::get_render_pass_flags |
Prototype:
Description:int get_render_pass_flags();
Gets current render pass flags. See diguyRenderPassFlags. The values are or'd together.
function diguyApp::set_render_pass_flags |
Prototype:
Description:int set_render_pass_flags(int flags);
Sets current render pass flags. See diguyRenderPassFlags.
| Threading Functions |
function diguyApp::get_ideal_num_threads |
Prototype:
Description:int get_ideal_num_threads();
This function returns the ideal number of threads available on the system. This will correspond to the number of available processors.Returns:
ideal number of threads on the system; -1 on failure to detect
function diguyApp::set_num_threads |
Prototype:
Description:int set_num_threads(int num_threads);
This function sets how many threads are available to DI-Guy.Arguments:
Returns:
0 on success, -1 on failure
function diguyApp::get_num_threads |
Prototype:
Returns:int get_num_threads();
number of threads available to DI-Guy
function diguyApp::reserve_num_threads |
Prototype:
Description:int reserve_num_threads(int num_reserve_threads);
This function reserves threads for the client application by setting the number of threads available to DI-Guy. DI-Guy will use up to (max_num_threads - reserve_num_threads).Arguments:
Returns:
0 on success, -1 on failure
| User Input Functions |
function diguyApp::set_base_input_mode |
Prototype:
Description:int set_base_input_mode(diguyScenarioInputMode mode);
This function changes the current Input Mode of the DI-Guy Scenario application or a DI-Guy Author Host IG.Arguments:
Returns:
mode the new base Input Mode of DI-Guy Scenario or DI-Guy Author
-1 if mode change failed (e.g., tried for AI-related mode but AI not available, 0 on no error
function diguyApp::get_base_input_mode |
Prototype:
Returns:diguyScenarioInputMode get_base_input_mode();
the current Input Mode of the DI-Guy Scenario application or a DI-Guy Author Host IG.
function diguyApp::get_last_clicked_xyz |
Prototype:
Description:int get_last_clicked_xyz(float* x, float* y, float* z);
This function returns the 3D world position of the last clicked point in a DI-Guy Scenario 3D view.
This function is meant to complement the use of callbacks with callback id DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT.Arguments:
x, y, z position in meters from the origin Pass NULL for any values that are not needed.
function diguyApp::set_last_clicked_xyz |
Prototype:
Description:void set_last_clicked_xyz(float x, float y, float z);
This function sets the 3D world position of the last clicked point in a DI-Guy Scenario 3D view.
This function is meant to complement the use of callbacks with callback id DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT.Arguments:
x, y, z position in meters from the origin
function diguyApp::get_last_clicked_character |
Prototype:
Description:diguyCharacter* get_last_clicked_character();
This function returns the last character clicked by the mouse in DI-Guy Scenario.
This function is meant to complement the use of callbacks with callback id DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT.Returns:
pointer of type diguyCharacter; may be NULL if no character has been clicked
function diguyApp::get_mouse_screen_xy |
Prototype:
Description:int get_mouse_screen_xy(float* sx, float* sy);
This function returns the current screen coordinates x and y position of the mouse.
function diguyApp::get_xyz_under_mouse |
Prototype:
Description:int get_xyz_under_mouse(float* x, float* y, float* z);
This function returns the current xyz coordinates under the mouse location, this is a fairly speedy test since the octtree is used. Typically this function is used to help build interactive UI tools.Arguments:
x, y, z resulting position in meters from the origin
function diguyApp::set_lua_object_waiting_for_input |
Prototype:
Description:void set_lua_object_waiting_for_input(const char* object_name);
This function sets up the UI to notify a lua object of mouse events via messages while in input mode DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT.
The following callbacks are generated:
- CALLBACK_ID_UI_MOUSE_DOWN
- CALLBACK_ID_UI_MOUSE_UP
- CALLBACK_ID_UI_RIGHT_MOUSE_DOWN
- CALLBACK_ID_UI_RIGHT_MOUSE_UP
See luaUIStateMachine:get_user_selected_point() to see an example of usage. Typically this function is used to help build interactive UI tools.Arguments:
object_name resulting position in meters from the origin
function diguyApp::get_lua_object_waiting_for_input |
Prototype:
Returns:const char* get_lua_object_waiting_for_input();
The name of the lua object that's currently waiting for input events. Can return NULL if there's no active object.
| DI-Guy Author Functions |
function diguyApp::get_author_interface |
Prototype:
Description:diguyAuthorInterface* get_author_interface();
This function is equivalent to the function diguy_author_get_author_interface() in diguy_author.h. It is made available here so it is available to scripts.
| Draw Functions |
function diguyApp::get_view_painter |
Prototype:
Returns:diguyViewPainter* get_view_painter();
This function returns a pointer to a diguyViewPainter object. This object can be used to draw lines, text, and other primitives in the 3D views of DI-Guy Scenario.
| Physics Module Functions |
function diguyApp::set_collision_group_detection_flag |
Prototype:
Description:void set_collision_group_detection_flag(diguyPhysicsCollisionGroup collision_group1, diguyPhysicsCollisionGroup collision_group2, int enable_collisions);
This function sets whether the two specified collision groups should collide against each other.Arguments:
collision_group1 first collision group collision_group2 second collision group enable_collisions pass 1 to have groups collide, 0 to not
function diguyApp::get_collision_group_detection_flag |
Prototype:
Description:int get_collision_group_detection_flag(diguyPhysicsCollisionGroup collision_group1, diguyPhysicsCollisionGroup collision_group2);
This function returns whether the two specified collision groups should collide against each other.Arguments:
Returns:
collision_group1 first collision group collision_group2 second collision group
1 if collision groups collide, 0 if not
function diguyApp::set_physics_sim_ground_plane_enabled |
Prototype:
Description:void set_physics_sim_ground_plane_enabled(int enabled);
The physics simulation module can have an optional ground plane enabled through which no objects will pass. This function sets whether the ground plane is enabled.Arguments:
enabled pass 1 to enable ground plane, 0 to disable
function diguyApp::get_physics_sim_ground_plane_enabled |
Prototype:
Returns:int get_physics_sim_ground_plane_enabled();
1 if physics sim ground plane enabled, 0 if not
function diguyApp::set_physics_sim_ground_plane_height |
Prototype:
Description:void set_physics_sim_ground_plane_height(float height);
The physics simulation module can have an optional ground plane enabled through which no objects will pass. This function sets the height of the ground plane.Arguments:
height height in meters
function diguyApp::get_physics_sim_ground_plane_height |
Prototype:
Returns:float get_physics_sim_ground_plane_height();
height of physics sim ground plane
| Library Functions |
These functions provide support for loading DI-Guy modules at runtime, without need for linking against module import libraries.
function diguyApp::load_module_library |
Prototype:
Description:static void* load_module_library(const char* module_lib_name, int include_diguy_standard_library_suffixes = 1, int* load_status = NULL);
Loads dynamic library module. The handle returned can be passed into resolve_symbol() or unload_module_library().Returns:
handle as (void *) pointer, NULL if library is not found or failed to load.
Load status is set to:
0 : load successful -1 : library not found -2 : ?
function diguyApp::resolve_module_library_symbol |
Prototype:
Description:static void* resolve_module_library_symbol(void* module_handle, const char* symbol_name);
Returns pointer to function provided by already-loaded dynamic library module. Pointer should be cast to one of:
- diguyModuleFunctionInt - diguyModuleFunctionVoid - diguyModuleFunctionVoidReturnsVoidReturns:
pointer to function, or NULL if function not found.
function diguyApp::unload_module_library |
Prototype:
Description:static void unload_module_library(void* module_handle);
Unloads dynamic library module, given handle to it.
function diguyApp::get_sound_factory_is_initialized |
Prototype:
Description:int get_sound_factory_is_initialized();
Returns 1 if a sound factory is initialized.
| Experimental Munition Type Functions |
These functions provide access to munition types defined for DI-Guy.
function diguyApp::set_munition_type_DIS_impact_septet |
Prototype:
Description:int set_munition_type_DIS_impact_septet(const char* munition_type, int sep1, int sep2, int sep3, int sep4, int sep5, int sep6, int sep7);
Sets override values for the specified munition type's DIS impact septet.
Munition types are defined in the config file munition_types.cfg, located under the DI-Guy installation config directory.Arguments:
function diguyApp::set_munition_type_DIS_tracer_septet |
Prototype:
Description:int set_munition_type_DIS_tracer_septet(const char* munition_type, int sep1, int sep2, int sep3, int sep4, int sep5, int sep6, int sep7);
Similar to set_munition_type_DIS_impact_septet(), but overrides the septet for tracer type.
function diguyApp::get_munition_type_from_DIS_septet |
Prototype:
Description:const char* get_munition_type_from_DIS_septet( int sep1, int sep2, int sep3, int sep4, int sep5, int sep6, int sep7, int include_last_septet_value = 1);
Returns the munition type name based on the passed septet values.Arguments:
| Experimental Functions |
function diguyApp::unload_unreferenced_graphics_files |
Prototype:
Description:int unload_unreferenced_graphics_files(int garbage_collect_appearances = 1);
Causes garbage-collection to unload graphics files that have been previously loaded into memory, but are unused, freeing up memory. There may be a frame hitch if graphics files are to be used again and need to be reloaded.Arguments:
function diguyApp::reload_texture_files |
Prototype:
Description:int reload_texture_files();
Causes textures that have changes to be reloaded
function diguyApp::set_threshold_to_unload_textures |
Prototype:
Description:int set_threshold_to_unload_textures(int number);
How many textures in memory before texture unloading starts (defaults to 5000)
function diguyApp::get_threshold_to_unload_textures |
Prototype:
int get_threshold_to_unload_textures();
function diguyApp::set_texture_unload_frequency |
Prototype:
Description:int set_texture_unload_frequency(float seconds);
How often to check if inactive textures should be unloaded.
function diguyApp::get_texture_unload_frequency |
Prototype:
float get_texture_unload_frequency();
function diguyApp::get_unload_unused_after_scenario_load |
Prototype:
Description:int get_unload_unused_after_scenario_load();
Should unused assets be garbage collected after loading a new scenario.
function diguyApp::set_unload_unused_after_scenario_load |
Prototype:
int set_unload_unused_after_scenario_load(int val);
function diguyApp::set_cache_optimized_motion_files |
Prototype:
Description:int set_cache_optimized_motion_files(int enabled = 0);
Sets whether optimized versions of motion files should be cached to disk when they are loaded.
This is still experimental. The default is 0, don't enable caching.Arguments:
function diguyApp::get_cache_optimized_motion_files |
Prototype:
Returns:int get_cache_optimized_motion_files();
1 if caching of optimized motion files is enabled, 0 if disabled
function diguyApp::memory_tracker_print_report |
Prototype:
Description:int memory_tracker_print_report(int include_permanent_objects = 0, int just_markers = 0);
Prints to the log a report about memory usage and leaks.Arguments:
function diguyApp::memory_tracker_drop_marker |
Prototype:
Description:int memory_tracker_drop_marker();
Add a marker for use by memory_tracker_print_report()
function diguyApp::set_reflected_entity_message_list |
Prototype:
Description:void set_reflected_entity_message_list(const char* message);
Provide DI-Guy Scenario with a list of messages that the user can access from the right-click menu. When a message is selected, it is sent over the network to the AIs of remote entities. If the AIs can process the message, they will. Typically used to kill remote entities from a master server.Arguments:
function diguyApp::get_reflected_entity_message_list |
Prototype:
Description:const char* get_reflected_entity_message_list();
Returns a string containing a comma-separated list of supported reflected-entity messages, as set by set_reflected_entity_message_list()
function diguyApp::get_scene_object_file_name_from_ui |
Prototype:
Description:const char* get_scene_object_file_name_from_ui();
In DI-Guy Scenario pops up a user interface asking the end user to pick a scene object file name.
function diguyApp::show_generate_navmesh_ui |
Prototype:
Description:int show_generate_navmesh_ui();
Causes DI-Guy to display UI relevant to navmesh generation
| Experimental Log Channel Functions |
function diguyApp::create_log_channel |
Prototype:
Returns:diguyLogChannel* create_log_channel();
Newly-created log channel
function diguyApp::destroy_log_channel |
Prototype:
Description:void destroy_log_channel(diguyLogChannel*);
Destroys specified log channel
function diguyApp::get_num_log_channels |
Prototype:
Returns:int get_num_log_channels();
Number of log channels
function diguyApp::get_log_channel_at_index |
Prototype:
Returns:diguyLogChannel* get_log_channel_at_index(int index);
Log channel at index
| Deprecated Functions |
function diguyApp::set_current_painting_subregion |
Prototype:
int set_current_painting_subregion(diguySubregionIndex index);Deprecated as of DI-Guy 12.0.0. Use diguyAuthorVisualRegionPaintbrush::set_painting_subregion() instead.
ALL RIGHTS RESERVED.
These coded instructions, statements, and computer programs contain unpublished proprietary information of Boston Dynamics and are protected by Copyright Laws of the United States. They may not be used, duplicated, or disclosed in any form, in whole or in part, without the prior written consent from Boston Dynamics.
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the government is subject to restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Sofware clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the Commercial Computer Software--Restricted Rights at 48 CFR 52.227-19, as applicable. Unpublished-rights reserved under the Copyright Laws of the United States.
Contractor/Manufacturer is:
Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.