The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to- Sim
SDK edition to use it.
You should upgrade to
Manager Class
Members
IGConfig getConfig ( ) #
Returns the IG configuration as an IGConfig class instance.Return value
IGConfig class instance containing IG configuration.void reloadConfig ( ) #
Reloads the IG Configuration file (ig_config.xml).bool loadDatabase ( int database_id ) #
Loads the database with the specified ID and sets it to be used.Arguments
- int database_id - ID of the database to be used.
Return value
true means that the database with the specified ID is loaded successfully; otherwise, false.void reloadDatabase ( ) #
Console: database_reload
Reloads the current database.void unloadDatabase ( ) #
Unloads the current database.int getCurrentDatabaseID ( ) #
Returns the identifier of the currently loaded world database stored in the IG configuration file (ig_config.xml).Return value
Identifier of the world database, or 0, if no world is loaded.int getDatabaseID ( ) #
Returns the identifier of the world database with the specified name stored in the IG configuration file (ig_config.xml).Arguments
Return value
Identifier of the specified world database, or 0, if no world is loaded.getDatabaseName ( int id ) #
Returns the name of the world database stored in the IG configuration file (ig_config.xml).Arguments
- int id - Identifier of the world database.
Return value
The world database name.bool isDatabaseLoaded ( ) #
Returns a value indicating if any database is currently loaded.Return value
true if any database is currently loaded; otherwise, false.getSkyMap ( ) #
Returns the interface of the sky map.Return value
Sky map interface.getMeteo ( ) #
Returns the meteo interface.Return value
Meteo interface.SymbolsController * getSymbolsController ( ) #
Returns the interface of the symbols controller.Return value
Symbols controller interface.getLightController ( ) #
Returns the interface of the light controller.Return value
Light controller interface.getConverter ( ) #
Returns the converter interface.Return value
Converter interface.getView ( int view_id, bool auto_create ) #
Returns the interface of the specified view.Arguments
- int view_id - ID of the view.
- bool auto_create - 1 to automatically create the view with the specified ID if it doesn't exist yet; 0 - to return nullptr in case the view doesn't exist.
Return value
bool removeView ( int view_id ) #
Removes the view with the specified ID.Arguments
- int view_id - ID of the view to be removed.
Return value
1 if the view with the specified ID is removed successfully; otherwise - 0.bool isViewExist ( int view_id ) #
Returns a value indicating if the view with the specified ID exists.Arguments
- int view_id - ID of the view.
Return value
1 if the view with the specified ID exists; otherwise - 0.getViewGroup ( int group_id, bool auto_create ) #
Returns the interface of the specified view group.Arguments
- int group_id - ID of the view group.
- bool auto_create - 1 to automatically create the view group with the specified ID if it doesn't exist yet; 0 - to return nullptr in case the view group doesn't exist.
Return value
bool removeViewGroup ( int group_view_id ) #
Removes the view group with the specified ID.Arguments
- int group_view_id - ID of the view group to be removed.
Return value
1 if the view group with the specified ID is removed successfully; otherwise - 0.bool isViewGroupExist ( int group_view_id ) #
Returns a value indicating if the view group with the specified ID exists.Arguments
- int group_view_id - ID of the view group.
Return value
1 if the view group with the specified ID exists; otherwise - 0.getEntity ( bool auto_create = true ) #
Returns the interface of the specified entity.Arguments
- bool auto_create - 1 to automatically create the entity with the specified ID if it doesn't exist yet; 0 - to return nullptr in case the entity doesn't exist.
Return value
bool removeEntity ( ) #
Removes the entity with the specified ID.Arguments
Return value
1 if the entity with the specified ID is removed successfully; otherwise - 0.bool isEntityExist ( long entity_id ) #
Returns a value indicating if the entity with the specified ID exists.Arguments
- long entity_id - ID of the entity.
Return value
1 if the entity with the specified ID exists; otherwise - 0.void getEntities ( Unigine::Vector<Entity *> & entities_ret ) #
Fills the list of entities with all existing entities.Arguments
findEntity ( ) #
Returns the interface of the entity represented by the specified node.Arguments
Return value
findEntityType ( ) #
Returns the ID of the entity type by its name. Entity type ID and name define the type of the entity to be used for a specific instance and are set in the entity definition section of the IG configuration file as follows:<entity_types>
<entity id="111" name="b52">
</entity>
</entity_types>
Arguments
Return value
Entity type ID.int findComponentID ( ) #
Returns the ID of the component with the given name, which belongs to the specified entity type.Arguments
Return value
Component ID.int findArticulatedPartID ( ) #
Returns the identifier of an articulated part by its name and the type of the entity it belongs to, stored in the IG configuration file (ig_config.xml).Arguments
Return value
Identifier of an articulated part.void setInterpolation ( bool enabled ) #
Sets a value indicating if interpolation and extrapolation should be enabled for the IG.Arguments
- bool enabled - true to enable interpolation and extrapolation for the IG; false - to disable.
bool isInterpolation ( ) #
Returns a value indicating if interpolation and extrapolation are enabled for the IG.Return value
true if interpolation and extrapolation are enabled for the IG; otherwise, false.void setInterpolationLerp ( bool enabled ) #
Sets a value indicating if interpolation between the current and previous frames should be enabled for the IG to tackle the problem of lost packets between the IG and hosts.Arguments
- bool enabled - true to enable interpolation between the current and previous frames for the IG; false - to disable.
bool isInterpolationLerp ( ) #
Returns a value indicating if interpolation between the current and previous frames is enabled for the IG to tackle the problem of lost packets between the IG and hosts.Return value
true if interpolation between the current and previous frames is enabled for the IG; otherwise, false.void setInterpolationTime ( double current_time ) #
Sets the interpolation time value for the IG.Arguments
- double current_time - Current interpolation time value, in seconds.
double getInterpolationTime ( ) #
Returns the current interpolation time value for the IG.Return value
Interpolation time value, in seconds.void setInterpolationPeriod ( double time_period ) #
Sets the interpolation period value for the IG.Arguments
- double time_period - Interpolation period value, in seconds. The default value is 0.04.
double getInterpolationPeriod ( ) #
Returns the current interpolation period value for the IG.Return value
Interpolation period value, in seconds. The default value is 0.04.void setExtrapolationPeriod ( double time_period ) #
Sets the extrapolation period value for the IG.Arguments
- double time_period - Extrapolation period value, in seconds. The default value is 0.04.
double getExtrapolationPeriod ( ) #
Returns the current extrapolation period value for the IG.Return value
Extrapolation period value, in seconds. The default value is 0.2.void setInterpolationLerpFactor ( double factor ) #
Sets the interpolation lerp factor value for the IG. The lower the value the smoother movement will be, but it will feel like objects move underwater or in a jelly, higher values result in higher positioning accuracy (objects positions will be closer to actual ones for the current frame), but objects will move with a noticeable jitter.Frame-to-frame interpolation mode must be enabled.
Arguments
- double factor - Current interpolation lerp factor value, in seconds.
double getInterpolationLerpFactor ( ) #
Returns the current interpolation lerp factor value for the IG. The lower the value the smoother movement will be, but it will feel like objects move underwater or in a jelly, higher values result in higher positioning accuracy (objects positions will be closer to actual ones for the current frame), but objects will move with a noticeable jitter.Frame-to-frame interpolation mode must be enabled.
Return value
Interpolation lerp factor value.getTerrain ( ) #
Returns the currently used global terrain object.Return value
Currently used global terrain object.getGeodeticPivot ( ) #
Returns the geodetic pivot used to curve the terrain.Return value
Current geodetic pivot used to curve the terrain.bool isTerrainCurved ( ) #
Check if the terrain is curved.Return value
1, if the terrain is curved, otherwise 0.void setTerrainIntersectionMask ( int mask ) #
Sets the intersection mask that is used to define the ground/landing surface.Arguments
- int mask - Intersection mask.
int getTerrainIntersectionMask ( ) #
Returns the intersection mask that is used to define the ground/landing surface.Return value
Intersection mask.bool getHatHot ( ) #
Checks if there is anything in the given geodetic position and returns HAT/HOT as well as surface normal, exact object over which the request was made, intersected surface, world coordinates of the intersection point, etc. to the specified output variables.Arguments
Return value
true, if there is anything in the given geodetic position, otherwise false.bool getIntersection ( int mask ) #
Checks if the ray with set points intersects with anything.Arguments
- int mask - Intersection mask.
Return value
1, if the ray intersects with anything, otherwise 0.getWater ( ) #
Returns the interface of the water control.Return value
Water control interface.loadNode ( ) #
Loads a node from the specified file to the world on the Master and all Slaves. This is a network analogue of the loadNode() method of the World class.This is a safe analogue of the Syncker method loadNode() that has an internal check if this method runs on the master and if Syncker is running.
Arguments
Return value
void syncNode ( ) #
Enables synchronization of parameters of the given node via the UDP protocol. Scene nodes are not synchronized by default, this method is used to add a particular node to the synchronization queue.This is a safe analogue of the Syncker method addSyncNode() that has an internal check if this method runs on the master and if Syncker is running. If this method is called on a slave, it does nothing.
Arguments
void synckerCreate ( unsigned char mask = 255 ) #
Synchronizes creation of the given node on all Slaves. This method is to be called after node creation on the Master. It is recommended to use the loadNode() method whenever possible as this approach allows adding nodes of all types, unlike the synckerCreate() method that supports only a limited number of them.This is a safe analogue of the Syncker method createNode() that has an internal check if this method runs on the master and if Syncker is running. If this method is called on a slave, it does nothing.
Arguments
- unsigned char mask - Synchronization mask.
void synckerDestroy ( ) #
Synchronizes deletion of the given node (with all its children) on the Master and all Slaves.This is a safe analogue of the Syncker method deleteNode() that has an internal check if this method runs on the master and if Syncker is running. If this method is called on a slave, it does nothing.
Arguments
bool isSyncNode ( ) #
Returns a value indicating if synchronization of the given node is enabled. Using this method you can quickly check if a node is monitored by the Syncker (node's states are dispatched to Slaves over the network).This is a safe analogue of the Syncker method isSyncNode() that has an internal check if this method runs on the master and if Syncker is running. If this method is called on a slave, it does nothing.
Arguments
Return value
true if synchronization of the given node is enabled; otherwise, false.bool checkEntityType ( ) #
Checks if the given entity type is supported by IG.Arguments
Return value
1, if the given entity type is supported, otherwise 0.void setCollisionVolumeMask ( int mask ) #
Sets a new collision volume mask for entities.Arguments
- int mask - New collision volume mask.
int getCollisionVolumeMask ( ) #
Returns the current collision volume mask for entities.Return value
Current collision volume mask for entities.void setFreeze ( bool value ) #
Sets a value indicating if execution of IG logic is temporarily put on hold (paused). This method can be useful for debugging.Arguments
- bool value - true - to put on hold (pause) execution of IG logic; false - to resume execution.
bool isFreeze ( ) #
Returns a value indicating if execution of IG logic is temporarily put on hold (paused).Return value
true, if execution of IG logic is temporarily put on hold (paused), otherwise false.void sendUserMessage ( ) #
Sends user message from the master to a slave.Arguments
addOnUserMessageReceivedCallback ( ) #
Executes the callback function when the user message from the master is received.Arguments
Return value
Callback subscriber ID. This ID can be used to remove this callback when necessary.bool isMaster ( ) #
Returns a value indicating if the IG application is a Syncker-Master or runs in a single mode without the Syncker at all.Return value
1 if the IG application is a Syncker-Master or runs in a single mode without the Syncker at all; 0 if the IG application is a Syncker-Slave.bool isReady ( ) #
Returns a value indicating if all Slaves that were waited for by the IG have connected.Return value
1 if all Slaves that were waited for by the IG have connected; otherwise - 0.float getIFps ( ) #
Returns the inverse FPS value (the time in seconds it took to complete the last frame). This method is similar to the Game::getIFps() but it is more preferred for multi-channel systems as it implements more accurate frame time calculation (including spike-periods).Return value
Inverse FPS value (1/FPS) - the time in seconds it took to complete the last frame, in seconds.void setDistanceScale ( float d ) #
Sets the global distance scale for all rendering distance parameters: shadow distance, light distance, LOD distances, etc. (see render_distance_scale console command) and for the IG Simplifier component. The Simplifier component can help optimize rendering of your entities. When assigned to an entity, it enables you to define which parts of its model can be neglected starting at certain distance levels (e.g., hide flaps, ailerons, and rudders at 1km, engines at 5 km, etc.) and which substitutes can be used to represent an entity at a large distance (e.g., a flashing strobe light, when the plane is just a point on the screen).This method calls the setDistanceScale() of the Render class.
Arguments
- float d - Global rendering distance scale and Simplifier component (IG LOD manager).
void setAdaptiveQualitySystemMode ( int mode ) #
Sets a new Adaptive Quality System mode. This system provides automatic real-time adjustment of levels of detail depending on current performance (render_distance_scale and simplifier_distance_scale).Arguments
- int mode - Adaptive Quality System mode to be set. One of the following values:
- 0 - real-time quality adjustment is disabled
- 1 - degradation mode only (image quality is degraded if the performance goes down)
- 2 - automatic real-time adjustment (image quality is degraded if the performance is low, and improved if the performance increases)
void destroyObjects ( ) #
Destroys all entities, views, and view groups.int getCurrentView ( ) #
Returns the current ID of the view.Return value
ID of the view.void setCurrentView ( int view_id ) #
Switches to the view with the specified ID. If the view with the specifie ID does not exist, it will be created automatically.Arguments
- int view_id - ID of the view to be set as current.
void setSlaveView ( int view_id ) #
Sets a view with the specified ID to be used for the specified Slave (available for Master IG only).Arguments
- int view_id - ID of the view to be set as current for the specified Slave.
void setSlaveView ( int index, int view_id ) #
Sets a view with the specified ID to be used for a certain Slave by its index (available for Master IG only).Arguments
- int index - Slave index in the range from 0 to the total numer of Slaves.
- int view_id - ID of the view to be set as current for the specified Slave.
int getSlaveView ( ) #
Returns the current view ID used for a certain Slave by its name .Arguments
Return value
ID of the view used for the Slave with the specified name.int getSlaveView ( int slave_index ) #
Returns the current view ID used for a certain Slave by its index (available for Master IG only).Arguments
- int slave_index - Slave index in the range from 0 to the total numer of Slaves.
Return value
ID of the view used for the Slave with the specified index.void clearInterpolationData ( ) #
Clears all interpolation data for all entities.getGeodeticOrigin ( ) #
Returns the coordinates of the geodetic origin.Return value
Geodetic origin coordinates.int getNumSlaves ( ) #
Returns the total number of Slaves (available for Master IG only).Return value
Total number of IG Slaves.getSlaveName ( int index ) #
Returns Slave name by its index (available for Master IG only).Arguments
- int index - Slave index.
Return value
Name of the Slave with the specified index.getSynckerName ( ) #
Returns the current name of the IG host.Return value
Current name of the IG host.void setDebugEnabled ( bool v ) #
Console: ig_debug
Sets a value indicating if the Debug mode is enabled. This mode allows inspecting the IG application at run-time.Arguments
- bool v - 1 - to enable the Debug mode; 0 - to disable it.
bool isDebugEnabled ( ) #
Console: ig_debug
Returns a value indicating if the Debug mode is enabled. This mode allows inspecting the IG application at run-timeReturn value
1 if the IG Debug mode is enabled; otherwise, 0.void setPropertyWarningEnabled ( int v ) #
Arguments
- int v
Last update:
2022-04-26
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)