This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Engine Functions

Warning
UnigineScript is deprecated and will be removed in future releases. Please consider using C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScipt is not guaranteed, as the current level of support assumes only fixing critical issues.

The Engine class is required for the engine initialization and executing the main loop of the program. Also, you can get the engine startup options through this class.

See Also#

Analogues of C++ runWorldFunction() methods are described in the engine.world class reference.

Analogues of C++ runEditorFunction() methods are described in the engine.editor class reference.

Analogues of C++ runSystemFunction() methods are described in the engine.system class reference.

Engine Class

Members


string engine.getAppPath ( ) #

Returns the path to a directory where binary executable file is stored.

Return value

Path to a directory where binary executable file is stored.

const char * engine.getArg ( int num ) #

Returns a command line argument by its index.

Arguments

  • int num - Index of the command line argument.

Return value

Command line argument.

string engine.getCachePath ( ) #

Returns a path to a directory where cached files will be stored.

Return value

Path to the directory with cached files.

ControlsApp engine.getControls ( ) #

Returns a ControlsApp object that handles input from the current application window.

Return value

An instance of the ControlsApp class.

string engine.getDataPath ( ) #

Returns a path to the -data_pathdirectory specified at the engine startup.

Return value

Path to the data directory.

const char * engine.getEditorCache ( ) #

Returns a path to the editor script cache file.

Return value

Path to the editor script cache.

string engine.getEditorScript ( ) #

Returns a path to the editor script (provided by the -editor_scriptcommand line argument).

Return value

Path to the editor script.

string engine.getError ( ) #

Returns the system error message.

Return value

The system error message of the current frame, if there is one; otherwise an empty string.

string engine.getExternDefines ( ) #

Returns the external definitions specified on the application start-up.

Return value

The list of external definitions.

Gui engine.getGui ( ) #

Returns a system GUI associated with the engine and used to manipulate the user interface.

Return value

System GUI used to manipulate the user interface.

string engine.getHomePath ( ) #

Returns a path to the user's home directory.

Return value

Path to the user's home directory.

float engine.getInterfaceTime ( ) #

Returns the total accumulative time spent on rendering GUI widgets.

Return value

Time value, in milliseconds.

int engine.isMain ( ) #

Checks if the current thread is main.

Return value

1 if the current thread is main; otherwise, 0.

string engine.getMessage ( ) #

Returns the last system message of the current frame, or empty string if there are no messages.

Return value

The last system message.

virtual int engine.getNumArgs ( ) # =0

Returns the number of command line arguments.

Return value

Number of command line arguments.

string engine.getArg ( int num ) #

Returns the command-line argument by its index.

Arguments

  • int num - Index of the argument

Return value

Command-line argument

int engine.getNumPluginPaths ( ) #

Returns the number of paths to directories with plugins specified via -plugin_pathcommand-line option.

Return value

Number of the specified paths to directories with plugins.

int engine.getNumPlugins ( ) #

Returns the number of loaded plugins.

Return value

Number of plugins.

string engine.getPluginPath ( int num ) #

Returns a path to a plugin directory specified via -plugin_path.

Arguments

  • int num - Plugin path number in the row of the specified plugin paths.

Return value

Path to a plugin directory.

float engine.getPresentTime ( ) #

Returns the total time spent on waiting for the GPU after all calculations on the CPU are completed. See the Profiler article for details.

Return value

Time value, in milliseconds.

float engine.getRenderTime ( ) #

Returns the time value, required to prepare all data to be rendered in the current frame and feed rendering commands from the CPU to the GPU. See the Profiler article for details.

Return value

Rendering time value, milliseconds.

string engine.getSavePath ( ) #

Returns a path to a directory where a default configuration file, saved files and screenshots will be stored.

Return value

Path to a directory with the default configuration file, saved files, etc.

string engine.getSoundApp ( ) #

Returns the current sound API.

Return value

Sound API instance.

const char * engine.getSystemCache ( ) #

Returns a path to the system script cache.

Return value

Path to the system script cache.

string engine.getSystemScript ( ) #

Returns a path to the system script.

Return value

Path to the system script.

float engine.getTotalTime ( ) #

Returns the total time that both rendering and calculating of the frame took (the duration of the main loop in the application execution sequence). Includes update, render, swap and wait GPU.

Return value

Total time value, milliseconds.

float engine.getTotalCPUTime ( ) #

Returns the total CPU time taken to perform calculations for the frame (the duration of the main loop in the application execution sequence). Includes update, render and swap.

Return value

Total CPU time value, milliseconds.

float engine.getUpdateTime ( ) #

Returns the duration of the update phase, during which the objects are prepared for their collision response to be calculated.

Return value

The update phase duration value, milliseconds.

string engine.getVideoApp ( ) #

Returns a graphics API used for rendering.

Return value

Graphics API used for rendering.

void engine.dialogError ( string title ) #

Displays a dialog window with errors set using the error() function.

Arguments

  • string title - Title to be displayed in the error window.

void engine.dialogMessage ( string title ) #

Displays a dialog window with the last message set using the message() function.

Arguments

  • string title - Title to be displayed in the message window.

void engine.error ( string format, ... values ) #

Adds a text describing an error to the list of errors.

Arguments

void engine.message ( string format, ... values ) #

Adds a new message to the list of messages.

Arguments

Last update: 2020-04-10
Build: ()