RigsofRods
Soft-body Physics Simulation
Public Member Functions
AngelOgre::Entity Class Reference

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

#include <AngelOgre_Entity.h>

+ Inheritance diagram for AngelOgre::Entity:
+ Collaboration diagram for AngelOgre::Entity:

Public Member Functions

 ~Entity ()
 Default destructor. More...
 
void setMaterialName (const string &name, const string &groupName="OgreAutodetect")
 Gets the Mesh that this Entity is based on. More...
 
const string & getMovableType (void) const
 
AnimationState getAnimationState (const string &name)
 For entities based on animated meshes, gets the AnimationState object for a single animation. More...
 
AnimationStateSet getAllAnimationStates (void)
 For entities based on animated meshes, gets the AnimationState objects for all animations. More...
 
void setDisplaySkeleton (bool display)
 Tells the Entity whether or not it should display it's skeleton, if it has one. More...
 
bool getDisplaySkeleton (void) const
 Returns whether or not the entity is currently displaying its skeleton. More...
 
uint64 getNumManualLodLevels (void) const
 Returns the number of manual levels of detail that this entity supports. More...
 
uint16 getCurrentLodIndex ()
 Returns the current LOD used to render. More...
 
EntitygetManualLodLevel (uint64 index) const
 Gets a pointer to the entity representing the numbered manual level of detail. More...
 
void setMeshLodBias (float factor, uint16 maxDetailIndex=0, uint16 minDetailIndex=99)
 Sets a level-of-detail bias for the mesh detail of this entity. More...
 
void setMaterialLodBias (float factor, uint16 maxDetailIndex=0, uint16 minDetailIndex=99)
 Sets a level-of-detail bias for the material detail of this entity. More...
 
bool hasSkeleton (void) const
 Returns whether or not this entity is skeletally animated. More...
 
- Public Member Functions inherited from AngelOgre::MovableObject
const string & getName (void) const
 Returns the name of this object. More...
 
const string & getMovableType (void) const
 Returns the type name of this object. More...
 
NodegetParentNode (void) const
 Returns the node to which this object is attached. More...
 
SceneNode getParentSceneNode (void) const
 Returns the scene node to which this object is attached. More...
 
bool isParentTagPoint () const
 Gets whether the parent node is a TagPoint (or a SceneNode) More...
 
bool isAttached (void) const
 Returns true if this object is attached to a SceneNode or TagPoint. More...
 
void detachFromParent (void)
 Detaches an object from a parent SceneNode or TagPoint, if attached. More...
 
bool isInScene (void) const
 Returns true if this object is attached to a SceneNode or TagPoint, and this SceneNode / TagPoint is currently in an active part of the scene graph. More...
 
float getBoundingRadius (void) const
 Retrieves the local axis-aligned bounding box for this object. More...
 
void setVisible (bool visible)
 Tells this object whether to be visible or not, if it has a renderable component. More...
 
bool getVisible (void) const
 Gets this object whether to be visible or not, if it has a renderable component. More...
 
bool isVisible (void) const
 Returns whether or not this object is supposed to be visible or not. More...
 
void setRenderingDistance (float dist)
 Sets the distance at which the object is no longer rendered. More...
 
float getRenderingDistance (void) const
 Gets the distance at which batches are no longer rendered. More...
 
void setRenderingMinPixelSize (float pixelSize)
 Sets the minimum pixel size an object needs to be in both screen axes in order to be rendered. More...
 
float getRenderingMinPixelSize () const
 Returns the minimum pixel size an object needs to be in both screen axes in order to be rendered. More...
 
void setCastShadows (bool enabled)
 Return an instance of user objects binding associated with this class. More...
 
bool getCastShadows (void) const
 Returns whether shadow casting is enabled for this object. More...
 
void setDebugDisplayEnabled (bool enabled)
 Sets whether or not the debug display of this object is enabled. More...
 
bool isDebugDisplayEnabled (void) const
 Gets whether debug display of this object is enabled. More...
 

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

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: