![]() |
DI-Guy SDK Documentation
13.1
|
An Singleton class representing the DI-Guy Application. More...
#include <diguyApp.h>
Public Member Functions | |
Networking Functions | |
Unless otherwise specified, all functions callable from:
| |
| diguyExerciseInterface * | get_exercise_interface () |
| Gets a pointer to the exercise interface. More... | |
C++ Only Callback Functions | |
| 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. More... | |
| int | remove_default_scenario_callback (int callback_id, diguyScenarioCallback *callback) |
| This function removes a default user callback previously added by add_default_scenario_callback(). More... | |
| 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(). More... | |
C++ and Script Callback Functions | |
| 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. More... | |
| 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. More... | |
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. | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| int | add_draw_pass (const diguyDrawPass *drawPass) |
| Adds a draw pass which is used to modified how diguyScenario::draw() functions. More... | |
| int | remove_all_draw_passes () |
| Removes all draw passes previously registered with diguyApp::add_draw_pass(). More... | |
Plugin Functions | |
See complete overview at DI-Guy Scenario Plug-in Overview | |
| 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. More... | |
| 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. More... | |
| void | unload_all_plugins () |
| Unloads all plug-ins. More... | |
| int | get_num_plugins () |
| Returns: This function returns the number of dynamic library plugins currently loaded. More... | |
| const char * | get_name_of_plugin (int index) |
| Returns: the name of a specific plug-in at a specified index. More... | |
Shader Functions | |
| diguyGraphicsShaderProgram * | load_shader_program (const char *shader_name, const char *vertex_shader_filename, const char *pixel_shader_filename, const char *shader_version) |
| This function loads (or reloads) shader source files into a shader program. More... | |
| 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. More... | |
| diguyGraphicsShaderProgram * | find_shader_program (const char *shader_name) |
| This function looks for the previously loaded shader program with the given name. More... | |
| int | get_num_shader_programs () |
| Returns: number of loaded shader programs. More... | |
| diguyGraphicsShaderProgram * | get_shader_program_at_index (int index) |
| This function returns the shader program at the specified index. More... | |
| diguyGraphicsShaderProgram * | get_current_bound_shader_program () |
| This function returns the shader program that's currently active. More... | |
| diguyGraphicsShaderTechnique * | find_shader_technique (const char *shader_technique_name) |
| This function looks for the previously loaded shader technique with the given name. More... | |
| int | get_num_shader_techniques () |
| Returns: number of loaded shader techniques. More... | |
| diguyGraphicsShaderTechnique * | get_shader_technique_at_index (int index) |
| Returns: a pointer to a diguyGraphicsShaderTechnique on success at the specified index, NULL on failure. More... | |
| int | set_max_character_shader_quality_level (int quality_level) |
| This function sets the max shader quality level for characters in the application. More... | |
| int | get_max_character_shader_quality_level () |
| 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. More... | |
| int | get_max_scene_object_shader_quality_level () |
| int | get_use_sRGB_textures () |
| Returns: the value that was passed in for init.use_sRGB_corrected_textures allows end users to procedurally choose gamma correction behavior. More... | |
Performance Functions | |
| int | set_precompute_quaternions_enabled (int enabled) |
| This function tells DI-Guy to use quaternions for all joint angles in motions. More... | |
| int | get_precompute_quaternions_enabled () |
| Returns: current setting of whether quaternions are enabled; see set_precompute_quaternions_enabled() More... | |
| 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. More... | |
| int | get_num_rendering_passes () |
| Returns: current setting of number of rendering passes; see set_num_rendering_passes() More... | |
| int | get_render_pass_flags () |
| Gets current render pass flags. More... | |
| int | set_render_pass_flags (int flags) |
| Sets current render pass flags. More... | |
Threading Functions | |
| int | get_ideal_num_threads () |
| This function returns the ideal number of threads available on the system. More... | |
| int | set_num_threads (int num_threads) |
| This function sets how many threads are available to DI-Guy. More... | |
| int | get_num_threads () |
| Returns: number of threads available to DI-Guy. More... | |
| 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. More... | |
| void | set_use_qt_threading_infrastructure () |
| Documentation Pending. More... | |
| int | get_use_qt_threading_infrastructure () |
| void | set_use_intel_threading_infrastructure () |
| Documentation Pending. More... | |
| int | get_use_intel_threading_infrastructure () |
User Input Functions | |
| 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. More... | |
| diguyScenarioInputMode | get_base_input_mode () |
| Returns: the current Input Mode of the DI-Guy Scenario application or a DI-Guy Author Host IG. More... | |
| 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. More... | |
| 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. More... | |
| diguyCharacter * | get_last_clicked_character () |
| This function returns the last character clicked by the mouse in DI-Guy Scenario. More... | |
| int | get_mouse_screen_xy (float *sx, float *sy) |
| This function returns the current screen coordinates x and y position of the mouse. More... | |
| 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. More... | |
| 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. More... | |
| const char * | get_lua_object_waiting_for_input () |
| Returns: The name of the lua object that's currently waiting for input events. More... | |
DI-Guy Author Functions | |
| diguyAuthorInterface * | get_author_interface () |
| This function is equivalent to the function diguy_author_get_author_interface() in diguy_author.h. More... | |
Draw Functions | |
| diguyViewPainter * | get_view_painter () |
| Returns: This function returns a pointer to a diguyViewPainter object. More... | |
Physics Module Functions | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| int | get_physics_sim_ground_plane_enabled () |
| Returns: 1 if physics sim ground plane enabled, 0 if not. More... | |
| 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. More... | |
| float | get_physics_sim_ground_plane_height () |
| Returns: height of physics sim ground plane. More... | |
Experimental Munition Type Functions | |
These functions provide access to munition types defined for DI-Guy. | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
Experimental Log Channel Functions | |
| diguyLogChannel * | create_log_channel () |
| Returns: Newly-created log channel. More... | |
| void | destroy_log_channel (diguyLogChannel *) |
| Destroys specified log channel. More... | |
| int | get_num_log_channels () |
| Returns: Number of log channels. More... | |
| diguyLogChannel * | get_log_channel_at_index (int index) |
| Returns: Log channel at index. More... | |
Deprecated Functions | |
| int | set_current_painting_subregion (diguySubregionIndex index) |
| Deprecated as of DI-Guy 12.0.0. More... | |
Static Public Member Functions | |
Directory Functions | |
Unless otherwise specified, all functions callable from:
| |
| static const char * | get_diguy_base_dir_path () |
| Returns: the path to the base directory of the DI-Guy installation; this is typically set by the environment variable DIGUY. More... | |
| static const char * | get_diguy_subdir_path (const char *subdir) |
| Returns: the path to a subdirectory of the DI-Guy installation; this is typically derived from the environment variable DIGUY, but is sometimes overridden by other environment variables. More... | |
General Functions | |
Unless otherwise noted all functions in this class section are callable from:
In lua static function are callable as diguyApp_function_name or via the this_app global. | |
| static diguyApp * | get_app () |
| This static function returns a pointer to the DI-Guy application. More... | |
| int | get_num_scenarios () |
| Returns: number of scenarios in the app. More... | |
| diguyScenario * | get_scenario_at_index (int index) |
| Returns: pointer of type diguyScenario; NULL if no scenario at the specified index. More... | |
| int | get_num_blend_functions () |
| Returns: number of blend functions available. More... | |
| const char * | get_blend_function_name_at_index (int index) |
| Returns: name of blend function at specified index; NULL if no blend function at specified index. More... | |
| int | is_debug () |
| This function returns whether or not the application is in debug mode. More... | |
| 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. More... | |
| int | is_module_enabled (const char *module_name) |
| This function returns whether or not the specified module is currently enabled. More... | |
| diguyScenario * | get_current_scenario () |
| Returns: pointer of type diguyScenario; NULL if no current scenario. More... | |
Library Functions | |
These functions provide support for loading DI-Guy modules at runtime, without need for linking against module import libraries. | |
| static const char * | get_standard_bdi_library_suffix () |
| Returns: the library suffix, which is derived from the dll compiling flags, e.g. More... | |
| static const char * | get_diguy_version_library_suffix () |
| Returns: the library suffix, which is derived from the version number, e.g. More... | |
| static const char * | get_compiler_library_suffix () |
| Returns: the library suffix, which is derived from the compiler type, e.g. More... | |
| 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. More... | |
| static void * | resolve_module_library_symbol (void *module_handle, const char *symbol_name) |
| Returns pointer to function provided by already-loaded dynamic library module. More... | |
| static void | unload_module_library (void *module_handle) |
| Unloads dynamic library module, given handle to it. More... | |
| int | get_sound_factory_is_initialized () |
| Returns 1 if a sound factory is initialized. More... | |
Experimental Functions | |
| static int | decompress_lz4_file (const char *source, const char *destination) |
| 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. More... | |
| int | reload_texture_files () |
| Causes textures that have changes to be reloaded. More... | |
| int | set_threshold_to_unload_textures (int number) |
| How many textures in memory before texture unloading starts (defaults to 5000) More... | |
| int | get_threshold_to_unload_textures () |
| int | set_texture_unload_frequency (float seconds) |
| How often to check if inactive textures should be unloaded. More... | |
| float | get_texture_unload_frequency () |
| int | get_unload_unused_after_scenario_load () |
| Should unused assets be garbage collected after loading a new scenario. More... | |
| int | set_unload_unused_after_scenario_load (int val) |
| 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. More... | |
| int | get_cache_optimized_motion_files () |
| Returns: 1 if caching of optimized motion files is enabled, 0 if disabled. More... | |
| 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. More... | |
| int | memory_tracker_drop_marker () |
| Add a marker for use by memory_tracker_print_report() More... | |
| 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. More... | |
| 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() More... | |
| 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. More... | |
| int | show_generate_navmesh_ui () |
| Causes DI-Guy to display UI relevant to navmesh generation. More... | |
| void | print_process_memory_info () |
Private Functions | |
The functions and variables past this point are for internal use only. No external access to them is expected or necessary. | |
| bdiScenarioApp * | m_scripted_object |
| A pointer to internal data. More... | |
| class | bdiScenarioApp |
| void | set_no_blend_test (int flag) |
| void | set_motion_events_log_enabled (int enabled) |
| void | dump_motion_events_to_file (const char *filename, int show_event_id_strings=0, int indent=0) |
| bdiScenarioApp * | get_scripted_object () |
| diguyApp (bdiScenarioApp *scenario) | |
| A private constructor. More... | |
| virtual | ~diguyApp () |
| A private destructor. More... | |
An Singleton class representing the DI-Guy Application.
|
private |
|
privatevirtual |
A private destructor.
Use the DI-Guy function diguy_deinitialize() to delete a diguyApp object pointer.
|
static |
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 diguyApp
C++ Example:
| int diguyApp::get_num_scenarios | ( | ) |
Returns: number of scenarios in the app.
| diguyScenario* diguyApp::get_scenario_at_index | ( | int | index | ) |
Returns: pointer of type diguyScenario; NULL if no scenario at the specified index.
| index | index of the scenario; indices start at 0 |
| int diguyApp::get_num_blend_functions | ( | ) |
Returns: number of blend functions available.
| const char* diguyApp::get_blend_function_name_at_index | ( | int | index | ) |
Returns: name of blend function at specified index; NULL if no blend function at specified index.
| index | index of the blend function; indices start at 0 |
| int diguyApp::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
| int diguyApp::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
| int diguyApp::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
| diguyScenario* diguyApp::get_current_scenario | ( | ) |
Returns: pointer of type diguyScenario; NULL if no current scenario.
|
static |
Returns: the path to the base directory of the DI-Guy installation; this is typically set by the environment variable DIGUY.
|
static |
Returns: the path to a subdirectory of the DI-Guy installation; this is typically derived from the environment variable DIGUY, but is sometimes overridden by other environment variables.
| subdir | name of the subdirectory |
| diguyExerciseInterface* diguyApp::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
| int diguyApp::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.
| int diguyApp::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
| int diguyApp::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.
| int diguyApp::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
| int diguyApp::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
| int diguyApp::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:
| int diguyApp::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().
| int diguyApp::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().
| int diguyApp::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.
| int diguyApp::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.
| int diguyApp::add_draw_pass | ( | const diguyDrawPass * | drawPass | ) |
Adds a draw pass which is used to modified how diguyScenario::draw() functions.
| int diguyApp::remove_all_draw_passes | ( | ) |
Removes all draw passes previously registered with diguyApp::add_draw_pass().
| int diguyApp::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.
| 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 |
Returns:
0 on success, -1 on failure
Windows 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 DI-Guy Scenario Plug-in Overview
| int diguyApp::unload_plugin | ( | const char * | plugin_name | ) |
This function unloads a dynamic library plugin from the app that was added using the load_plugin() function.
| name | name of the plugin |
Returns:
0 on success, -1 on failure
See complete overview at DI-Guy Scenario Plug-in Overview
| void diguyApp::unload_all_plugins | ( | ) |
Unloads all plug-ins.
| int diguyApp::get_num_plugins | ( | ) |
Returns: This function returns the number of dynamic library plugins currently loaded.
See complete overview at DI-Guy Scenario Plug-in Overview
| const char* diguyApp::get_name_of_plugin | ( | int | index | ) |
Returns: the name of a specific plug-in at a specified index.
index - index of the plugin to query
See complete overview at DI-Guy Scenario Plug-in Overview
| diguyGraphicsShaderProgram* diguyApp::load_shader_program | ( | const char * | shader_name, |
| const char * | vertex_shader_filename, | ||
| const char * | pixel_shader_filename, | ||
| const char * | shader_version | ||
| ) |
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.
shader_name - name by which shader program will be referenced vertex_shader_filename - name of file containing vertex shader source code pixel_shader_filename - name of file containing vertex shader source code
Returns:
pointer to object type diguyGraphicsShaderProgram on success, NULL on failure
| void diguyApp::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.
| diguyGraphicsShaderProgram* diguyApp::find_shader_program | ( | const char * | shader_name | ) |
This function looks for the previously loaded shader program with the given name.
shader_name - name of program to find
Returns:
pointer to object type diguyGraphicsShaderProgram on success, NULL on failure
| int diguyApp::get_num_shader_programs | ( | ) |
Returns: number of loaded shader programs.
| diguyGraphicsShaderProgram* diguyApp::get_shader_program_at_index | ( | int | index | ) |
This function returns the shader program at the specified index.
index - index of shader program
Returns:
pointer to object type diguyGraphicsShaderProgram on success, NULL on failure
| diguyGraphicsShaderProgram* diguyApp::get_current_bound_shader_program | ( | ) |
This function returns the shader program that's currently active.
Returns:
pointer to object type diguyGraphicsShaderProgram on success, NULL on failure
| diguyGraphicsShaderTechnique* diguyApp::find_shader_technique | ( | const char * | shader_technique_name | ) |
This function looks for the previously loaded shader technique with the given name.
shader_technique_name - name of program to find
Returns:
pointer to object type diguyGraphicsShaderTechnique on success, NULL on failure
| int diguyApp::get_num_shader_techniques | ( | ) |
Returns: number of loaded shader techniques.
| diguyGraphicsShaderTechnique* diguyApp::get_shader_technique_at_index | ( | int | index | ) |
Returns: a pointer to a diguyGraphicsShaderTechnique on success at the specified index, NULL on failure.
index - index of shader technique
| int diguyApp::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.
| int diguyApp::get_max_character_shader_quality_level | ( | ) |
| int diguyApp::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.
| int diguyApp::get_max_scene_object_shader_quality_level | ( | ) |
| int diguyApp::get_use_sRGB_textures | ( | ) |
Returns: the value that was passed in for init.use_sRGB_corrected_textures allows end users to procedurally choose gamma correction behavior.
| int diguyApp::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 Quaternions.
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.
enables - pass 1 to use quaternions for motions, 0 to use Euler angles
Returns:
0 on success, -1 on failure
C++ Example:
| int diguyApp::get_precompute_quaternions_enabled | ( | ) |
Returns: current setting of whether quaternions are enabled; see set_precompute_quaternions_enabled()
| int diguyApp::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.
num_rendering_passes - how many rendering passes to use; default is 2
Returns:
0 on success, -1 on failure
| int diguyApp::get_num_rendering_passes | ( | ) |
Returns: current setting of number of rendering passes; see set_num_rendering_passes()
| int diguyApp::get_render_pass_flags | ( | ) |
Gets current render pass flags.
See diguyRenderPassFlags. The values are or'd together.
| int diguyApp::set_render_pass_flags | ( | int | flags | ) |
Sets current render pass flags.
See diguyRenderPassFlags.
| int diguyApp::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
| int diguyApp::set_num_threads | ( | int | num_threads | ) |
This function sets how many threads are available to DI-Guy.
num_threads - number of threads available to DI-Guy
Returns:
0 on success, -1 on failure
| int diguyApp::get_num_threads | ( | ) |
Returns: number of threads available to DI-Guy.
| int diguyApp::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).
reserve_num_threads - how many threads to reserve
Returns:
0 on success, -1 on failure
| void diguyApp::set_use_qt_threading_infrastructure | ( | ) |
Documentation Pending.
| int diguyApp::get_use_qt_threading_infrastructure | ( | ) |
| void diguyApp::set_use_intel_threading_infrastructure | ( | ) |
Documentation Pending.
| int diguyApp::get_use_intel_threading_infrastructure | ( | ) |
| int diguyApp::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.
| mode | the new base Input Mode of DI-Guy Scenario or DI-Guy Author |
Returns:
-1 if mode change failed (e.g., tried for AI-related mode but AI not available, 0 on no error
| diguyScenarioInputMode diguyApp::get_base_input_mode | ( | ) |
Returns: the current Input Mode of the DI-Guy Scenario application or a DI-Guy Author Host IG.
| int diguyApp::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.
| x,y,z | position in meters from the origin |
Pass NULL for any values that are not needed.
| void diguyApp::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.
| x,y,z | position in meters from the origin |
| diguyCharacter* diguyApp::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
| int diguyApp::get_mouse_screen_xy | ( | float * | sx, |
| float * | sy | ||
| ) |
This function returns the current screen coordinates x and y position of the mouse.
| int diguyApp::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.
| x,y,z | resulting position in meters from the origin |
| void diguyApp::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:
See luaUIStateMachine:get_user_selected_point() to see an example of usage. Typically this function is used to help build interactive UI tools.
| object_name | resulting position in meters from the origin |
| const char* diguyApp::get_lua_object_waiting_for_input | ( | ) |
Returns: The name of the lua object that's currently waiting for input events.
Can return NULL if there's no active object.
| diguyAuthorInterface* diguyApp::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.
| diguyViewPainter* diguyApp::get_view_painter | ( | ) |
Returns: 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.
| void diguyApp::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.
| collision_group1 | first collision group |
| collision_group2 | second collision group |
| enable_collisions | pass 1 to have groups collide, 0 to not |
| int diguyApp::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.
| collision_group1 | first collision group |
| collision_group2 | second collision group |
Returns:
1 if collision groups collide, 0 if not
| void diguyApp::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.
| enabled | pass 1 to enable ground plane, 0 to disable |
| int diguyApp::get_physics_sim_ground_plane_enabled | ( | ) |
Returns: 1 if physics sim ground plane enabled, 0 if not.
| void diguyApp::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.
| height | height in meters |
| float diguyApp::get_physics_sim_ground_plane_height | ( | ) |
Returns: height of physics sim ground plane.
|
static |
Returns: the library suffix, which is derived from the dll compiling flags, e.g.
"_x86_vc9_md"
|
static |
Returns: the library suffix, which is derived from the version number, e.g.
"_1250"
|
static |
Returns: the library suffix, which is derived from the compiler type, e.g.
"_vc9"
|
static |
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 : ?
|
static |
Returns pointer to function provided by already-loaded dynamic library module.
Pointer should be cast to one of:
Returns:
pointer to function, or NULL if function not found.
|
static |
Unloads dynamic library module, given handle to it.
| int diguyApp::get_sound_factory_is_initialized | ( | ) |
Returns 1 if a sound factory is initialized.
| int diguyApp::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.
munition_type - name of munition type to modify; e.g., "m16" sep1, etc. - new DIS septet values
| int diguyApp::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.
| const char* diguyApp::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.
sep1, etc. - DIS septet values include_last_septet_value - pass 1 to include the last septet value in the search, 0 to not
| int diguyApp::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.
garbage_collect_appearances - setting to 1 will attempt to remove unused character appearance geometry as well as scene objects; default is 1. If 0, only scene object files will be discarded.
| int diguyApp::reload_texture_files | ( | ) |
Causes textures that have changes to be reloaded.
| int diguyApp::set_threshold_to_unload_textures | ( | int | number | ) |
How many textures in memory before texture unloading starts (defaults to 5000)
| int diguyApp::get_threshold_to_unload_textures | ( | ) |
| int diguyApp::set_texture_unload_frequency | ( | float | seconds | ) |
How often to check if inactive textures should be unloaded.
| float diguyApp::get_texture_unload_frequency | ( | ) |
| int diguyApp::get_unload_unused_after_scenario_load | ( | ) |
Should unused assets be garbage collected after loading a new scenario.
| int diguyApp::set_unload_unused_after_scenario_load | ( | int | val | ) |
| int diguyApp::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.
enabled - pass 1 to enable caching, 0 to disable
| int diguyApp::get_cache_optimized_motion_files | ( | ) |
Returns: 1 if caching of optimized motion files is enabled, 0 if disabled.
| int diguyApp::memory_tracker_print_report | ( | int | include_permanent_objects = 0, |
| int | just_markers = 0 |
||
| ) |
Prints to the log a report about memory usage and leaks.
include_permanent_objects - pass 1 to include permanent objects in reports; 0 is default just_markers - pass 1 to only generate reports for memory use at instants after a marker is dropped
| int diguyApp::memory_tracker_drop_marker | ( | ) |
Add a marker for use by memory_tracker_print_report()
| void diguyApp::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.
message - a string containing a comma-separated list of messages.
| const char* diguyApp::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()
| const char* diguyApp::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.
| int diguyApp::show_generate_navmesh_ui | ( | ) |
Causes DI-Guy to display UI relevant to navmesh generation.
| void diguyApp::print_process_memory_info | ( | ) |
|
static |
| diguyLogChannel* diguyApp::create_log_channel | ( | ) |
Returns: Newly-created log channel.
| void diguyApp::destroy_log_channel | ( | diguyLogChannel * | ) |
Destroys specified log channel.
| int diguyApp::get_num_log_channels | ( | ) |
Returns: Number of log channels.
| diguyLogChannel* diguyApp::get_log_channel_at_index | ( | int | index | ) |
Returns: Log channel at index.
| int diguyApp::set_current_painting_subregion | ( | diguySubregionIndex | index | ) |
Deprecated as of DI-Guy 12.0.0.
Use diguyAuthorVisualRegionPaintbrush::set_painting_subregion() instead.
| void diguyApp::set_no_blend_test | ( | int | flag | ) |
| void diguyApp::set_motion_events_log_enabled | ( | int | enabled | ) |
| void diguyApp::dump_motion_events_to_file | ( | const char * | filename, |
| int | show_event_id_strings = 0, |
||
| int | indent = 0 |
||
| ) |
|
inline |
|
friend |
|
private |
A pointer to internal data.