Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
Public Member Functions
AngelOgre::Entity Class Reference

Description

Defines an instance of a discrete, movable object based on a Mesh.

Entity and SubEntity classes are never created directly. Use the createEntity method of the SceneManager (passing a model name) to create one.
Entities are included in the scene by associating them with a SceneNode, using the attachEntity method. See the SceneNode class for full information.
Note
No functions were declared virtual to improve performance.

Definition at line 24 of file AngelOgre_Entity.h.

+ Inheritance diagram for AngelOgre::Entity:

Public Member Functions

 ~Entity ()
 
void setMaterialName (const string &name, const string &groupName="OgreAutodetect")
 
const string & getMovableType (void) const
 
AnimationState getAnimationState (const string &name)
 
AnimationStateSet getAllAnimationStates (void)
 
void setDisplaySkeleton (bool display)
 
bool getDisplaySkeleton (void) const
 
uint64 getNumManualLodLevels (void) const
 
uint16 getCurrentLodIndex ()
 
Entity * getManualLodLevel (uint64 index) const
 
void setMeshLodBias (float factor, uint16 maxDetailIndex=0, uint16 minDetailIndex=99)
 
void setMaterialLodBias (float factor, uint16 maxDetailIndex=0, uint16 minDetailIndex=99)
 
bool hasSkeleton (void) const
 
- Public Member Functions inherited from AngelOgre::MovableObject
const string & getName (void) const
 
const string & getMovableType (void) const
 
Node * getParentNode (void) const
 
SceneNode getParentSceneNode (void) const
 
bool isParentTagPoint () const
 
bool isAttached (void) const
 
void detachFromParent (void)
 
bool isInScene (void) const
 
float getBoundingRadius (void) const
 
void setVisible (bool visible)
 
bool getVisible (void) const
 
bool isVisible (void) const
 
void setRenderingDistance (float dist)
 
float getRenderingDistance (void) const
 
void setRenderingMinPixelSize (float pixelSize)
 
float getRenderingMinPixelSize () const
 
void setCastShadows (bool enabled)
 
bool getCastShadows (void) const
 
void setDebugDisplayEnabled (bool enabled)
 
bool isDebugDisplayEnabled (void) const
 

Constructor & Destructor Documentation

◆ ~Entity()

AngelOgre::Entity::~Entity ( )

Default destructor.

Member Function Documentation

◆ getAllAnimationStates()

AnimationStateSet AngelOgre::Entity::getAllAnimationStates ( void  )

For entities based on animated meshes, gets the AnimationState objects for all animations.

Returns
In case the entity is animated, this functions returns the pointer to a AnimationStateSet containing all animations of the entries. If the entity is not animated, it returns 0.
Remarks
You animate an entity by updating the animation state objects. Each of these represents the current state of each animation available to the entity. The AnimationState objects are initialised from the Mesh object.

◆ getAnimationState()

AnimationState AngelOgre::Entity::getAnimationState ( const string &  name)

For entities based on animated meshes, gets the AnimationState object for a single animation.

Remarks
You animate an entity by updating the animation state objects. Each of these represents the current state of each animation available to the entity. The AnimationState objects are initialised from the Mesh object.

◆ getCurrentLodIndex()

uint16 AngelOgre::Entity::getCurrentLodIndex ( )

Returns the current LOD used to render.

◆ getDisplaySkeleton()

bool AngelOgre::Entity::getDisplaySkeleton ( void  ) const

Returns whether or not the entity is currently displaying its skeleton.

◆ getManualLodLevel()

Entity * AngelOgre::Entity::getManualLodLevel ( uint64  index) const

Gets a pointer to the entity representing the numbered manual level of detail.

Remarks
The zero-based index never includes the original entity, unlike Mesh::getLodLevel.

◆ getMovableType()

const string & AngelOgre::Entity::getMovableType ( void  ) const

Merge all the child object Bounds a return it. returns "Entity"

◆ getNumManualLodLevels()

uint64 AngelOgre::Entity::getNumManualLodLevels ( void  ) const

Returns the number of manual levels of detail that this entity supports.

Remarks
This number never includes the original entity, it is difference with Mesh::getNumLodLevels.

◆ hasSkeleton()

bool AngelOgre::Entity::hasSkeleton ( void  ) const

Returns whether or not this entity is skeletally animated.

◆ setDisplaySkeleton()

void AngelOgre::Entity::setDisplaySkeleton ( bool  display)

Tells the Entity whether or not it should display it's skeleton, if it has one.

◆ setMaterialLodBias()

void AngelOgre::Entity::setMaterialLodBias ( float  factor,
uint16  maxDetailIndex = 0,
uint16  minDetailIndex = 99 
)

Sets a level-of-detail bias for the material detail of this entity.

Remarks
Level of detail reduction is normally applied automatically based on the Material settings. However, it is possible to influence this behaviour for this entity by adjusting the LOD bias. This 'nudges' the material level of detail used for this entity up or down depending on your requirements. You might want to use this if there was a particularly important entity in your scene which you wanted to detail better than the others, such as a player model.
There are three parameters to this method; the first is a factor to apply; it defaults to 1.0 (no change), by increasing this to say 2.0, this entity would take twice as long to use a lower detail material, whilst at 0.5 this entity would use lower detail versions twice as quickly. The other 2 parameters are hard limits which let you set the maximum and minimum level-of-detail index to use, after all other calculations have been made. This lets you say that this entity should never be simplified, or that it can only use LODs below a certain level even when right next to the camera.
Parameters
factorProportional factor to apply to the distance at which LOD is changed. Higher values increase the distance at which higher LODs are displayed (2.0 is twice the normal distance, 0.5 is half).
maxDetailIndexThe index of the maximum LOD this entity is allowed to use (lower indexes are higher detail: index 0 is the original full detail model).
minDetailIndexThe index of the minimum LOD this entity is allowed to use (higher indexes are lower detail. Use something like 99 if you want unlimited LODs (the actual LOD will be limited by the number of LOD indexes used in the Material).

◆ setMaterialName()

void AngelOgre::Entity::setMaterialName ( const string &  name,
const string &  groupName = "OgreAutodetect" 
)

Gets the Mesh that this Entity is based on.

Sets the material to use for the whole of this entity.

Remarks
This is a shortcut method to set all the materials for all subentities of this entity. Only use this method is you want to set the same material for all subentities or if you know there is only one. Otherwise call getSubEntity() and call the same method on the individual SubEntity.

◆ setMeshLodBias()

void AngelOgre::Entity::setMeshLodBias ( float  factor,
uint16  maxDetailIndex = 0,
uint16  minDetailIndex = 99 
)

Sets a level-of-detail bias for the mesh detail of this entity.

Remarks
Level of detail reduction is normally applied automatically based on the Mesh settings. However, it is possible to influence this behaviour for this entity by adjusting the LOD bias. This 'nudges' the mesh level of detail used for this entity up or down depending on your requirements. You might want to use this if there was a particularly important entity in your scene which you wanted to detail better than the others, such as a player model.
There are three parameters to this method; the first is a factor to apply; it defaults to 1.0 (no change), by increasing this to say 2.0, this model would take twice as long to reduce in detail, whilst at 0.5 this entity would use lower detail versions twice as quickly. The other 2 parameters are hard limits which let you set the maximum and minimum level-of-detail version to use, after all other calculations have been made. This lets you say that this entity should never be simplified, or that it can only use LODs below a certain level even when right next to the camera.
Parameters
factorProportional factor to apply to the distance at which LOD is changed. Higher values increase the distance at which higher LODs are displayed (2.0 is twice the normal distance, 0.5 is half).
maxDetailIndexThe index of the maximum LOD this entity is allowed to use (lower indexes are higher detail: index 0 is the original full detail model).
minDetailIndexThe index of the minimum LOD this entity is allowed to use (higher indexes are lower detail). Use something like 99 if you want unlimited LODs (the actual LOD will be limited by the number in the Mesh).

The documentation for this class was generated from the following file: