UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Sandworm (Experimental)
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
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
Engine-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

IG::Entity Class

Warning
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to Sim SDK edition to use it.
Header: #include <plugins/UnigineIG.h>

This class represents the IG Entity interface.

Notice
IG plugin must be loaded.

Entity Class

Enums

STATE#

NameDescription
INACTIVE = The entity is inactive.
ACTIVE = The entity is active.
DESTROYED = The entity is destroyed.

CLAMP#

NameDescription
NO_CLAMP = Altitude clamping for entity is disabled.
NON_CONFORMAL = Altitude parameter specifies an offset of the entity above the ground level.
CONFORMAL = Altitude parameter specifies an offset of the entity above the sea level.

CLAMP_HEIGHT_MODE#

NameDescription
RELATIVE = Clamp height mode that makes the entity to be clamped to the ground and the height be calculated from the ground.
IGNORE = Clamp height mode that makes the entity to be clamped to the ground and the height be ignored.

ANIM_DIR#

NameDescription
ANIM_DIR_FORWARD = Forward direction of the entity animation playback.
ANIM_DIR_BACKWARD = Backward direction of the entity animation playback.

ANIM_LOOP#

NameDescription
ANIM_LOOP_ONESHOT = Oneshot mode of the entity animation playback.
ANIM_LOOP_CONTINUOUS = Continuous mode of the entity animation playback.

ANIM_STATE#

NameDescription
ANIM_STATE_STOP = Stop entity animation playback.
ANIM_STATE_PAUSE = Pause entity animation playback.
ANIM_STATE_PLAY = Start entity animation playback.
ANIM_STATE_CONTINUE = Resume entity animation playback.

COORD_SYSTEM#

NameDescription
WORLD = If the reference coordinate system is set to this value, and the entity is a top-level (non-child) entity, the velocity and acceleration are defined relative to the database. Linear velocity and acceleration describe a path along and above the surface of the geoid. Angular velocity and acceleration describe a rotation relative to a reference plane. If the entity is a child entity, the velocity and acceleration are defined relative to the parent’s local coordinate system.
LOCAL = If the reference coordinate system is set to this value, the velocity and acceleration are defined relative to the entity’s local coordinate system.

Members


int getID ( ) #

Returns the unique ID of the entity instance.

Return value

Entity ID.

const Ptr<Node> & getNode ( ) #

Returns the node assigned to the entity.

Return value

Node assigned to the entity.

const Ptr<NodeReference> & getNodeReference ( ) #

Returns the node reference assigned to the entity.

Return value

NodeReference assigned to the entity.

void setGeoPosition ( const Math::Vec3 & position ) #

Sets the entity position in geo-coordinates (lat, lon, alt).

Arguments

  • const Math::Vec3 & position - New geo-coordinates of entity position to be set.

Math::Vec3 getGeoPosition ( ) #

Returns the current entity position in geo-coordinates (lat, lon, alt).

Return value

Entity position coordinates.
Notice
Geo-coordinates will be returned if there is no parent entity assigned, otherwise — local coordinates will be returned.

void setRotationEuler ( const Math::vec3 & euler ) #

Sets the entity rotation.

Arguments

  • const Math::vec3 & euler - Entity rotation euler angles to set.

void setRotationEuler ( const Math::vec3 & euler, double timestamp ) #

Sets the entity rotation at the specified time.

Arguments

  • const Math::vec3 & euler - Entity rotation euler angles to set.
  • double timestamp - Timestamp, indicating the time when rotation is to be set.

Math::vec3 getRotationEuler ( ) #

Returns the current entity rotation euler angles.

Return value

Entity rotation euler angles.

void setType ( int id ) #

Sets the type of the entity. Entity type ID is defined 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>
Setting the type to 0 removes the entity from the scene.

Arguments

  • int id - Entity type to be set. 0 removes the entity from the scene.

int getType ( ) #

Returns the type of the current entity. Entity type ID is defined 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>

Return value

Entity type.

void setState ( Entity::STATE id ) #

Sets the state of the entity.

Arguments

Entity::STATE getState ( ) #

Returns the current entity state.

Return value

Current entity state.

void setCollision ( int enabled ) #

Sets the value indicating if collision detecton shall be enabled for the entity.

Arguments

  • int enabled - 1 to enable collision detecton for the entity; 0 — to disable.

int getCollision ( ) #

Returns the value indicating if collision detecton shall be enabled for the entity.

Return value

Collision Detection Enable parameter value. 1 collision detecton for the entity shall be enabled; 0 — collision detecton for the entity shall be enabled.

void setParent ( Entity * entity ) #

Attaches the entity as a child to the specified parent entity.

Arguments

  • Entity * entity - Parent entity.

void unparent ( ) #

Detaches the entity from its parent.

int getParentID ( ) #

Returns the ID of the entity parent.

Return value

Entity parent ID.

int getAttachState ( ) #

Returns the value of the Attach State parameter. It specifies whether the entity is be attached as a child to a parent.

Return value

Attach State parameter value. 1 the entity shall be or remain attached to the entity specified by the Parent ID parameter; 0 — the entity shall be detached from its parent.

void setAlpha ( int byte_value ) #

Sets the alpha value, that determines transparency of entity geometry.

Arguments

  • int byte_value - Alpha value to be set.

int getAlpha ( ) #

Returns the current alpha value, that determines transparency of entity geometry.

Return value

Alpha value.

void setInheritAlpha ( bool enabled ) #

Sets the value indicating if the entity uses the alpha value of its parent.

Arguments

  • bool enabled - true the entity shall use the alpha value of its parent; false — the entity shall use its own alpha value.

int isInheritAlpha ( ) #

Returns the value indicating if the entity uses the alpha value of its parent.

Return value

1 if the entity uses the alpha value of its parent; otherwise, 0.

void setGround ( Ptr<ObjectTerrainGlobal> terrain ) #

Sets the terrain to be used by the entity for ground clamping.

Arguments

void setGroundClamp ( Entity::CLAMP clamp ) #

Sets the value of the Ground/Ocean Clamp parameter.

Arguments

Entity::CLAMP getGroundClamp ( ) #

Returns the value of the Ground/Ocean Clamp parameter.

Return value

Ground/Ocean Clamp parameter value.

void setGroundClampHeightMode ( Entity::CLAMP_MODE height_mode ) #

Sets the value of the clamp height mode parameter used for clamping. By default, the Ground Clamp Height Mode is set to RELATIVE — the entity is clamped to the ground and the height is calculated from the ground. With the mode set to IGNORE, the entity is clamped to the ground and the height is ignored.

Arguments

Entity::CLAMP_MODE getGroundClampHeightMode ( ) #

Returns the value of the clamp height mode parameter used for clamping. By default, the Ground Clamp Height Mode is set to RELATIVE — the entity is clamped to the ground and the height is calculated from the ground. With the mode set to IGNORE, the entity is clamped to the ground and the height is ignored.

Return value

Clamp height mode parameter value.

void setAnimationDirection ( Entity::ANIM_DIR animation_direction ) #

Sets the entity's animation playback direction.

Arguments

  • Entity::ANIM_DIR animation_direction - Direction of the entity's animation playback.

Entity::ANIM_DIR getAnimationDirection ( ) #

Returns the current entity's animation playback direction.

Return value

Direction of the entity's animation playback.

void setAnimationLoop ( Entity::ANIM_LOOP animation_loop ) #

Sets the entity's animation playback mode.

Arguments

Entity::ANIM_LOOP getAnimationLoop ( ) #

Returns the current entity's animation playback mode.

Return value

Mode of the entity's animation playback.

void setAnimationState ( Entity::ANIM_STATE animation_state ) #

Sets the entity's animation playback state.

Arguments

Entity::ANIM_STATE getAnimationState ( ) #

Returns the current entity's animation playback state.

Return value

State of the entity's animation playback.

void setInterpolation ( int id ) #

Sets a value indicating if interpolation and extrapolation are enabled.

Arguments

  • int id - 1 to enable interpolation and extrapolation; 0 — to disable.

int isInterpolation ( ) #

Returns a value indicating if interpolation and extrapolation are enabled.

Return value

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

void setExtrapolationCoordSystem ( Entity::COORD_SYSTEM animation_state ) #

Sets the reference coordinate system to which the linear and angular velocity and acceleration are applied. If the reference coordinate system is set to WORLD, and the entity is a top-level (non-child) entity, the velocity and acceleration are defined relative to the database. Linear velocity and acceleration describe a path along and above the surface of the geoid. Angular velocity and acceleration describe a rotation relative to a reference plane. If the entity is a child entity, the velocity and acceleration are defined relative to the parent’s local coordinate system. If the reference coordinate system is set to LOCAL, the velocity and acceleration are defined relative to the entity’s local coordinate system.

Arguments

Entity::COORD_SYSTEM getExtrapolationCoordSystem ( ) #

Returns the current reference coordinate system to which the linear and angular velocity and acceleration are applied. If the reference coordinate system is set to WORLD, and the entity is a top-level (non-child) entity, the velocity and acceleration are defined relative to the database. Linear velocity and acceleration describe a path along and above the surface of the geoid. Angular velocity and acceleration describe a rotation relative to a reference plane. If the entity is a child entity, the velocity and acceleration are defined relative to the parent’s local coordinate system. If the reference coordinate system is set to LOCAL, the velocity and acceleration are defined relative to the entity’s local coordinate system.

Return value

Extrapolation coordinate system.

void setVelocity ( const Math::Vec3 & linear, const Math::vec3 & angular_deg ) #

Sets linear and angular velocity for the entity.

Arguments

  • const Math::Vec3 & linear - Linear velocity vector to be set.
  • const Math::vec3 & angular_deg - Angular velocity vector (roll, pitch, yaw), in degrees per second.

const Math::Vec3 & getLinearVelocity ( ) #

Returns the linear velocity of the entity.

Return value

Linear velocity vector.

const Math::vec3 & getAngularVelocity ( ) #

Returns the angular velocity of the entity.

Return value

Angular velocity vector (roll, pitch, yaw), in degrees per second.

void setAcceleration ( const Math::Vec3 & linear, const Math::vec3 & angular_deg ) #

Sets linear and angular acceleration for the entity.

Arguments

  • const Math::Vec3 & linear - Linear acceleration vector to be set.
  • const Math::vec3 & angular_deg - Angular acceleration vector (roll, pitch, yaw), in degrees per second.

const Math::Vec3 & getLinearAcceleration ( ) #

Returns the linear acceleration of the entity.

Return value

Linear acceleration vector.

const Math::vec3 & getAngularAcceleration ( ) #

Returns the angular acceleration of the entity.

Return value

Angular acceleration vector (roll, pitch, yaw), in degrees per second.

Component * getComponent ( int id ) #

Returns the interface of the specified component.

Arguments

  • int id - ID of the component.

Return value

Component interface.

ArticulatedPart * getArticulatedPart ( int id ) #

Returns the interface of the specified articulated part.

Arguments

  • int id - ID of the articulated part.

Return value

Articulated part interface.

CollisionSegment * getCollisionSegment ( int id ) #

Returns the interface of the specified collision segment.

Arguments

  • int id - ID of the collision segment.

Return value

Collision segment interface.

Vector < IG::CollisionSegment * > getCollisionSegments ( ) #

Returns the list of all collision segments associated with the entity.

CollisionVolume * getCollisionVolume ( int id ) #

Returns the interface of the specified collision volume.

Arguments

  • int id - ID of the collision volume.

Return value

Collision volume interface.

Vector < IG::CollisionVolume * > getCollisionVolumes ( ) #

Returns the list of all collision volumes associated with the entity.

const Unigine::Vector< Ptr<Node> > & getObjects ( ) #

Returns the vector of all nodes, that constitute the entity.

Return value

Vector of nodes, that constitute the entity.
Last update: 2020-12-19