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
FAQ
编程
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

IG::Manager Class

Header: #include <UnigineIG.h>

This class represents the IG Manager interface.

Notice
IG plugin must be loaded.

Manager Class

Members


IGConfig * getConfig ( ) #

Returns the IG configuration as an IGConfig class instance.

Return value

IGConfig class instance containing IG configuration.

bool loadDatabase ( int datatbase_id ) #

Loads the database with the specified ID and sets it to be used.

Arguments

  • int datatbase_id - ID of the database to be used.

Return value

true means that the database with the specified ID is loaded successfully; otherwise, false.

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 ( const char * world_name ) #

Returns the identifier of the world database with the specified name stored in the IG configuration file (ig_config.xml).

Arguments

  • const char * world_name - World database name.

Return value

Identifier of the specified world database, or 0, if no world is loaded.

const char * 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.

SkyMap * getSkyMap ( ) #

Returns the interface of the sky map.

Return value

Sky map interface.

Meteo * getMeteo ( ) #

Returns the meteo interface.

Return value

Meteo interface.

SymbolsController * getSymbolsController ( ) #

Returns the interface of the symbols controller.

Return value

Symbols controller interface.

LightController * getLightController ( ) #

Returns the interface of the light controller.

Return value

Light controller interface.

void setCoordinateSystem ( int coord_system ) #

Sets the specified coordinate system to be used.

Arguments

int getCoordinateSystem ( ) #

Returns the currently used coordinate system.

Return value

Coordinate system currently used.

Converter * getConverter ( ) #

Returns the converter interface.

Return value

Converter interface.

View * getView ( int view_id ) #

Returns the interface of the specified view.
Notice
The specified view will be created, if it doesn't exist yet.

Arguments

  • int view_id - ID of the view.

Return value

Pointer to the view interface.

ViewGroup * getViewGroup ( int group_id ) #

Returns the interface of the specified view group.
Notice
The specified view group will be created, if it doesn't exist yet.

Arguments

  • int group_id - ID of the view group.

Return value

Pointer to the view group interface.

Entity * getEntity ( int entity_id ) #

Returns the interface of the specified entity.
Notice
The specified entity will be created, if it doesn't exist yet.

Arguments

  • int entity_id - ID of the entity.
    Notice
    The value should be the entity ID, not the type ID.

Return value

Pointer to the entity interface.

void getEntities ( Unigine::Vector<Entity *> & entities_ret ) #

Fills the list of entities with all existing entities.

Arguments

  • Unigine::Vector<Entity *> & entities_ret - List of entities

int isEntity ( int entity_id ) #

Returns a value indicating if an entity with the specified ID exists.

Arguments

  • int entity_id - ID of the entity.

Return value

1 if an entity with the specified ID exists; otherwise, 0.

Entity * findEntity ( const Unigine::NodePtr & node ) #

Returns the interface of the entity represented by the specified node.

Arguments

  • const Unigine::NodePtr & node - Node for which an entity is to be found.

Return value

Pointer to the entity interface.

int findEntityType ( const char * type_name ) #

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:
Source code (XML)
<entity_types>
	<entity id="111" name="b52">
	</entity>
</entity_types>

Arguments

  • const char * type_name - Entity type name.

Return value

Entity type ID.

int findComponentID ( int entity_type, const char * name ) #

Returns the ID of the component with the given name, which belongs to the specified entity type.

Arguments

  • int entity_type - Entity type ID.
    Notice
    Entity type ID is defined in the entity definition section of the IG configuration file.
  • const char * name - Component name.

Return value

Component ID.

int findArticulatedPartID ( int entity_type, const char * name ) #

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

  • int entity_type - Entity type identifier indicated in the IG configuration file (ig_config.xml).
  • const char * name - Name of an articulated part indicated in the IG configuration file (ig_config.xml).

Return value

Identifier of an articulated part.

void setPlayer ( int view_id ) #

Sets the view with the given ID as a current one.

Arguments

  • int view_id - ID of the view to be set.

void setInterpolation ( int enabled ) #

Sets a value indicating if interpolation and extrapolation should be enabled for the IG.

Arguments

int isInterpolation ( ) #

Returns a value indicating if interpolation and extrapolation are enabled for the IG.

Return value

1 if interpolation and extrapolation are enabled for the IG; otherwise, 0.

void setInterpolationLerp ( int 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

  • int enabled - 1 to enable interpolation between the current and previous frames for the IG; 0 - to disable.

int 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

1 if interpolation between the current and previous frames is enabled for the IG; otherwise, 0.

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 period ) #

Sets the interpolation period value for the IG.

Arguments

  • double 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 period ) #

Sets the extrapolation period value for the IG.

Arguments

  • double period - Extrapolation period value, in seconds. The default value is 0.04.

int 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 current_time ) #

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.
Notice
Frame-to-frame interpolation mode must be enabled.

Arguments

  • double current_time - 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.
Notice
Frame-to-frame interpolation mode must be enabled.

Return value

Interpolation lerp factor value.

const Unigine::ObjectTerrainGlobalPtr & getTerrain ( ) #

Returns the currently used terrain object.

Return value

Currently used terrain object.

const Unigine::GeodeticPivotPtr & getGeodeticPivot ( ) #

Returns the geodetic pivot used to curve the terrain.

Return value

Current geodetic pivot used to curve the terrain.

int 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 ( const Vec3 & geo_position, double & ret_hat, double & ret_hot, IGIntersection & ret_intersection ) #

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

  • const Vec3 & geo_position - Geodetic position.
  • double & ret_hat - Address for the return HAT value.
  • double & ret_hot - Address for the return HOT value.
  • IGIntersection & ret_intersection - Information on intersection at the given geodetic position, such as exact object over which the request was made, intersected surface, world coordinates of the intersection point, etc.

Return value

true, if there is anything in the given geodetic position, otherwise false.

bool getIntersection ( const Vec3 & p0, const Vec3 & p1, int mask, Unigine::Vector<IGIntersection> & ret ) #

Checks if the ray with set points intersects with anything.

Arguments

  • const Vec3 & p0 - Ray origin.
  • const Vec3 & p1 - Point along the ray.
  • int mask - Intersection mask.
  • Unigine::Vector<IGIntersection> & ret - Vector containing information on intersections.

Return value

1, if the ray intersects with anything, otherwise 0.

Water * getWater ( ) #

Returns the interface of the water control.

Return value

Water control interface.

Unigine::Plugins::Syncker::Syncker * getSyncker ( ) #

Returns the Syncker Interface.

Return value

Pointer to the Syncker::Syncker interface.

Unigine::Plugins::Syncker::Master * getSynckerMaster ( ) #

Returns the Syncker Master Interface.

Return value

Pointer to the Syncker::Master interface.

Unigine::Plugins::Syncker::Slave * getSynckerSlave ( ) #

Returns the Syncker Slave Interface.

Return value

Pointer to the Syncker::Slave interface.

int64_t getEntityType ( uint8_t kind, uint8_t domain, uint16_t country, uint8_t cat, uint8_t subcat, uint8_t spec, uint8_t extra ) #

Returns the entity type identifier (defined in the entity definition section) based on the given arguments. Can be used to convert the entity's DIS type to the IG type.
You can also set the type using a DIS-style ID:
Source code (XML)
<entity_types>
	<entity id="1.2.222.4.14.0.0" name="vehicle">
	</entity>
</entity_types>

Arguments

  • uint8_t kind - Entity kind
  • uint8_t domain - Domain
  • uint16_t country - Country
  • uint8_t cat - Category
  • uint8_t subcat - Sub Category
  • uint8_t spec - Specific
  • uint8_t extra - Extra

Return value

Entity type identifier

bool checkEntityType ( int64_t entity_type ) #

Checks if the given entity type is supported by IG.

Arguments

Return value

1, if the given entity type is supported, otherwise 0.

void setCollisionVolumeDetectionCallback ( CallbackBase * func ) #

Sets the callback function that is executed as soon as intersection with the collision volume is detected.

Arguments

  • CallbackBase * func - Callback function

void setCollisionSegmentDetectionCallback ( CallbackBase * func ) #

Sets the callback function that is executed as soon as intersection with the collision segment is detected.

Arguments

  • CallbackBase * func - Callback function

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 ( const BlobPtr & send_message ) #

Sends user message from the master to a slave.

Arguments

  • const BlobPtr & send_message - User message

void setOnUserMessageReceivedCallback ( CallbackBase * callback ) #

Executes the callback function when the user message from the master is received.

Arguments

  • CallbackBase * callback - Callback function
Last update: 2019-12-25
Build: ()