This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
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
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Unigine.Plugins.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.

This class represents the IG Entity interface.

Notice
IG plugin must be loaded.

Entity Class

Перечисления (Enums)

STATE#

ИмяОписание
STATE_INACTIVE = 0The entity is inactive.
STATE_ACTIVE = 1The entity is active.
STATE_DESTROYED = 2The entity is destroyed.

CLAMP#

ИмяОписание
CLAMP_NO_CLAMP = 0Altitude clamping for entity is disabled.
CLAMP_NON_CONFORMAL = 1Altitude parameter specifies an offset of the entity above the ground level.
CLAMP_CONFORMAL = 2Altitude parameter specifies an offset of the entity above the sea level.

CLAMP_HEIGHT_MODE#

ИмяОписание
CLAMP_HEIGHT_MODE_RELATIVE = 0Clamp height mode that makes the entity to be clamped to the ground and the height be calculated from the ground.
CLAMP_HEIGHT_MODE_IGNORE = 1Clamp height mode that makes the entity to be clamped to the ground and the height be ignored.

ANIMATION_DIRECTION#

ИмяОписание
ANIMATION_DIRECTION_FORWARD = 0Forward direction of the entity animation playback.
ANIMATION_DIRECTION_BACKWARD = 1Backward direction of the entity animation playback.

ANIMATION_LOOP#

ИмяОписание
ANIMATION_LOOP_ONESHOT = 0Oneshot mode of the entity animation playback.
ANIMATION_LOOP_CONTINUOUS = 1Continuous mode of the entity animation playback.

ANIMATION_STATE#

ИмяОписание
ANIMATION_STATE_STOP = 0Stop entity animation playback.
ANIMATION_STATE_PAUSE = 1Pause entity animation playback.
ANIMATION_STATE_PLAY = 2Start entity animation playback.
ANIMATION_STATE_CONTINUE = 3Resume entity animation playback.

COORDINATE_SYSTEM#

ИмяОписание
COORDINATE_SYSTEM_WORLD = 0If 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.
COORDINATE_SYSTEM_LOCAL = 1If the reference coordinate system is set to this value, the velocity and acceleration are defined relative to the entity’s local coordinate system.

Properties

vec3 AngularAcceleration#

The angular acceleration of the entity.

dvec3 LinearAcceleration#

The linear acceleration of the entity.

vec3 AngularVelocity#

The angular velocity of the entity.

dvec3 LinearVelocity#

The linear velocity of the entity.

Entity.COORDINATE_SYSTEM ExtrapolationCoordSystem#

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.

bool Interpolation#

The a value indicating if interpolation and extrapolation are enabled.

Entity.ANIMATION_STATE AnimationState#

The entity's animation playback state.

Entity.ANIMATION_LOOP AnimationLoop#

The entity's animation playback mode.

Entity.ANIMATION_DIRECTION AnimationDirection#

The entity's animation playback direction.

Entity.CLAMP_HEIGHT_MODE GroundClampHeightMode#

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.

Entity.CLAMP GroundClamp#

The value of the Ground/Ocean Clamp parameter.

bool InheritAlpha#

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

int Alpha#

The alpha value, that determines transparency of entity geometry.

int AttachState#

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

long ParentID#

The ID of the entity parent.

bool Collision#

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

Entity.STATE State#

The entity state.

bool IsPrespawned#

The true if the entity is prespawned, otherwise false.

long InternalType#

The internal type of the entity.

long Type#

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>

NodeReference NodeReference#

The node reference assigned to the entity.

Node Node#

The node assigned to the entity.

long ID#

The unique ID of the entity instance.

Members


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 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.

dvec3 GetGroundClampPoint ( ) #

Returns the current ground clamping point coordinates for the entity. Clamping is performed relative to the ground and sea level.

void SetVelocity ( dvec3 linear, vec3 angular_deg ) #

Sets linear and angular velocity for the entity.

Arguments

  • dvec3 linear - Linear velocity vector to be set.
  • vec3 angular_deg - Angular velocity vector (roll, pitch, yaw), in degrees per second.

void SetAcceleration ( dvec3 linear, vec3 angular_deg ) #

Sets linear and angular acceleration for the entity.

Arguments

  • dvec3 linear - Linear acceleration vector to be set.
  • vec3 angular_deg - Angular acceleration vector (roll, pitch, yaw), in degrees per second.

Component GetComponent ( int id, bool auto_create ) #

Returns the interface of the specified component.

Arguments

  • int id - ID of the component.
  • bool auto_create - true to automatically create the component with the specified ID if it doesn't exist yet; false - to return nullptr in case the component doesn't exist.

Return value

Component interface if it exists, or nullptr otherwise.

ArticulatedPart GetArticulatedPart ( int id, bool auto_create ) #

Returns the interface of the specified articulated part.

Arguments

  • int id - ID of the articulated part.
  • bool auto_create - true to automatically create the articulated part with the specified ID if it doesn't exist yet; false - to return nullptr in case the articulated part doesn't exist.

Return value

Articulated part interface if it exists, or nullptr otherwise.

CollisionSegment GetCollisionSegment ( int id, bool auto_create ) #

Returns the interface of the specified collision segment.

Arguments

  • int id - ID of the collision segment.
  • bool auto_create - true to automatically create the collision segment with the specified ID if it doesn't exist yet; false - to return nullptr in case the collision segment doesn't exist.

Return value

Collision segment interface if it exists, or nullptr otherwise.

CollisionVolume GetCollisionVolume ( int id, bool auto_create ) #

Returns the interface of the specified collision volume.

Arguments

  • int id - ID of the collision volume.
  • bool auto_create - true to automatically create the collision volume with the specified ID if it doesn't exist yet; false - to return nullptr in case the collision volume doesn't exist.

Return value

Collision volume interface if it exists, or nullptr otherwise.

string GetTypeName ( ) #

Returns the name of the entity type (defined in the entity definition section).

Return value

Entity type name.

bool IsPrespawned ( ) #

Returns a value indicating if the entity is prespawned (i.e. created via UnigineEditor and already exists in the world).

Return value

true if the entity is prespawned, otherwise false.

IntPtr AddOnBeforeChangeTypeCallback ( OnBeforeChangeTypeDelegate func ) #

Adds a callback to be fired before changing the entity type.

Arguments

  • OnBeforeChangeTypeDelegate func - Callback function with the following signature: void OnBeforeChangeTypeDelegate(long old_type, long new_type).

Return value

ID of the last added Before Change Type callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

bool RemoveOnBeforeChangeTypeCallback ( IntPtr id ) #

Removes the specified callback from the list of Before Change Type callbacks.

Arguments

Return value

true if the Before Change Type callback with the given ID was removed successfully; otherwise false.

void ClearOnBeforeChangeTypeCallback ( ) #

Clears all added Before Change Type callbacks.

IntPtr AddOnAfterChangeTypeCallback ( OnAfterChangeTypeDelegate func ) #

Adds a callback to be fired after changing the entity type.

Arguments

  • OnAfterChangeTypeDelegate func - Callback function with the following signature: void OnAfterChangeTypeDelegate(long old_type, long new_type).

Return value

ID of the last added After Change Type callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

bool RemoveOnAfterChangeTypeCallback ( IntPtr id ) #

Removes the specified callback from the list of After Change Type callbacks.

Arguments

Return value

true if the After Change Type callback with the given ID was removed successfully; otherwise false.

void ClearOnAfterChangeTypeCallback ( ) #

Clears all added After Change Type callbacks.
Last update: 19.04.2024
Build: ()