IG::Entity Class
Header: | #include <plugins/UnigineIG.h> |
Entity Class
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.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:<entity_types>
<entity id="111" name="b52">
</entity>
</entity_types>
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:<entity_types>
<entity id="111" name="b52">
</entity>
</entity_types>
Return value
Entity type.void setState ( int id ) #
Sets the state of the entity.Arguments
- int id - Entity state to be set.
int 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 ( int enabled ) #
Sets the value indicating if the entity uses the alpha value of its parent.Arguments
- int enabled - 1 the entity shall use the alpha value of its parent; 0 - 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
- Ptr<ObjectTerrainGlobal> terrain - Global terrain to be used by the entity for ground clamping.
void setGroundClamp ( int clamp ) #
Sets the value of the Ground/Ocean Clamp parameter.Arguments
- int clamp - Ground/Ocean Clamp parameter value. One of the clamp values.
int getGroundClamp ( ) #
Returns the value of the Ground/Ocean Clamp parameter.Return value
Ground/Ocean Clamp parameter value. One of the clamp values.void setAnimationDirection ( int animation_direction ) #
Returns the entity's animation playback direction.Arguments
- int animation_direction - Direction of the entity's animation playback. One of the ANIM_DIR_* values.
int getAnimationDirection ( ) #
Returns the current entity's animation playback direction.Return value
Direction of the entity's animation playback. One of the ANIM_DIR_* values.void setAnimationLoop ( int animation_loop ) #
Returns the entity's animation playback mode.Arguments
- int animation_loop - Mode of the entity's animation playback. One of the ANIM_LOOP_* values.
int getAnimationLoop ( ) #
Returns the current entity's animation playback mode.Return value
Mode of the entity's animation playback. One of the ANIM_LOOP_* values.void setAnimationState ( int animation_state ) #
Returns the entity's animation playback state.Arguments
- int animation_state - State of the entity's animation playback. One of the ANIM_STATE_* values.
int getAnimationState ( ) #
Returns the current entity's animation playback state.Return value
State of the entity's animation playback. One of the ANIM_STATE_* values.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 setRate ( const Math::Vec3 & linear, const Math::vec3 & angular, int coord_system ) #
Sets linear and angular rates for the entity in the specified coordinate system.Arguments
- const Math::Vec3 & linear - Linear velocity vector to be set.
- const Math::vec3 & angular - Angular rate vector (roll, pitch, yaw), in degrees per second.
- int coord_system - Coordinate system:
- 0 - world
- 1 - local
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:
2019-12-25
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)