Loading...
Searching...
No Matches
Ogre::Entity Class Reference
Core » Scene

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

`#include <OgreEntity.h>`

Inheritance diagram for Ogre::Entity:
[legend]

## Public Types

typedef std::vector< MovableObject * > | ChildObjectList
| Contains the child objects (attached to bones) indexed by name.
typedef VectorIterator< ChildObjectList > | ChildObjectListIterator
typedef std::set< Entity * > | EntitySet
typedef std::vector< std::pair< unsigned short, bool > > | SchemeHardwareAnimMap
typedef std::vector< SubEntity * > | SubEntityList
enum | VertexDataBindChoice { BIND_ORIGINAL , BIND_SOFTWARE_SKELETAL , BIND_SOFTWARE_MORPH , BIND_HARDWARE_MORPH }
| Identify which vertex data we should be sending to the renderer. More...
Public Types inherited from Ogre::ShadowCaster
typedef Ogre::ShadowRenderableList | ShadowRenderableList
typedef VectorIterator< ShadowRenderableList > | ShadowRenderableListIterator

## Public Member Functions

| ~Entity ()
| Default destructor.
void | _deinitialise (void)
| Tear down the internal structures of this Entity, rendering it uninitialised.
const Affine3 * | _getBoneMatrices (void) const
| Internal method for retrieving bone matrix information.
bool | _getBuffersMarkedForAnimation (void) const
| Are buffers already marked as vertex animated?
VertexData * | _getHardwareVertexAnimVertexData (void) const
| Advanced method to get the hardware morph vertex information.
Real | _getMeshLodFactorTransformed () const
| Get the LOD strategy transformation of the mesh LOD factor.
unsigned short | _getNumBoneMatrices (void) const
| Internal method for retrieving bone matrix information.
VertexData * | _getSkelAnimVertexData (void) const
| Advanced method to get the temporarily blended skeletal vertex information for entities which are software skinned.
VertexData * | _getSoftwareVertexAnimVertexData (void) const
| Advanced method to get the temporarily blended software vertex animation information.
void | _initialise (bool forceReinitialise=false)
| Try to initialise the Entity from the underlying resources.
bool | _isAnimated (void) const
| Tests if any animation applied to this entity.
bool | _isSkeletonAnimated (void) const
| Tests if skeleton was animated.
void | _markBuffersUsedForAnimation (void)
| Mark just this vertex data as animated.
void | _notifyAttached (Node *parent, bool isTagPoint=false) override
| Internal method called to notify the object that it has been attached to a node.
void | _notifyCurrentCamera (Camera *cam) override
| Internal method to notify the object of the camera to be used for the next rendering operation.
void | _releaseManualHardwareResources () override
| Notifies the movable object that hardware resources were lost.
void | _restoreManualHardwareResources () override
| Notifies the movable object that hardware resources should be restored.
void | _updateAnimation (void)
| Advanced method to perform all the updates required for an animated entity.
void | _updateRenderQueue (RenderQueue *queue) override
| Internal method by which the movable object must add Renderable subclass instances to the rendering queue.
void | addSoftwareAnimationRequest (bool normalsAlso)
| Add a request for software animation.
TagPoint * | attachObjectToBone (const String &boneName, MovableObject *pMovable, const Quaternion &offsetOrientation=Quaternion::IDENTITY, const Vector3 &offsetPosition=Vector3::ZERO)
| Attaches another object to a certain bone of the skeleton which this entity uses.
VertexDataBindChoice | chooseVertexDataForBinding (bool hasVertexAnim)
| Choose which vertex data to bind to the renderer.
Entity * | clone (const String &newName) const
| Clones this entity and returns a pointer to the clone.
void | detachAllObjectsFromBone (void)
| Detach all MovableObjects previously attached using attachObjectToBone.
MovableObject * | detachObjectFromBone (const String &movableName)
| Detach a MovableObject previously attached using attachObjectToBone.
void | detachObjectFromBone (MovableObject *obj)
| Detaches an object by pointer.
AnimationStateSet * | getAllAnimationStates (void) const
| For entities based on animated meshes, gets the AnimationState objects for all animations.
bool | getAlwaysUpdateMainSkeleton () const
| The skeleton of the main entity will be updated even if the an LOD entity is being displayed.
AnimationState * | getAnimationState (const String &name) const
| For entities based on animated meshes, gets the AnimationState object for a single animation.
ChildObjectListIterator | getAttachedObjectIterator (void)
const ChildObjectList & | getAttachedObjects () const
| Gets an iterator to the list of objects attached to bones on this entity.
const AxisAlignedBox & | getBoundingBox (void) const override
| Retrieves the local axis-aligned bounding box for this object.
Real | getBoundingRadius (void) const override
| Retrieves the radius of the origin-centered bounding sphere for this object.
AxisAlignedBox | getChildObjectsBoundingBox (void) const
| Merge all the child object Bounds a return it.
ushort | getCurrentLodIndex ()
| Returns the current LOD used to render.
bool | getDisplaySkeleton (void) const
| Returns whether or not the entity is currently displaying its skeleton.
EdgeData * | getEdgeList (void) override
| Returns details of the edges which might be used to determine a silhouette.
Entity * | getManualLodLevel (size_t index) const
| Gets a pointer to the entity representing the numbered manual level of detail.
const MeshPtr & | getMesh (void) const
| Gets the Mesh that this Entity is based on.
const String & | getMovableType (void) const override
| Returns the type name of this object.
size_t | getNumManualLodLevels (void) const
| Returns the number of manual levels of detail that this entity supports.
size_t | getNumSubEntities (void) const
| Retrieves the number of SubEntity objects making up this entity.
const ShadowRenderableList & | getShadowVolumeRenderableList (const Light *light, const HardwareIndexBufferPtr &indexBuffer, size_t &indexBufferUsedSize, float extrusionDistance, int flags=0) override
| Gets an list of the renderables required to render the shadow volume.
SkeletonInstance * | getSkeleton (void) const
| Get this Entity's personal skeleton instance.
const EntitySet * | getSkeletonInstanceSharingSet () const
| Returns a pointer to the set of entities which share a SkeletonInstance.
bool | getSkipAnimationStateUpdate () const
| Entity's skeleton's AnimationState will not be automatically updated when set to true.
int | getSoftwareAnimationNormalsRequests (void) const
| Returns the number of requests that have been made for software animation of normals.
int | getSoftwareAnimationRequests (void) const
| Returns the number of requests that have been made for software animation.
const SubEntityList & | getSubEntities () const
| Retrieves SubEntity objects making up this entity.
SubEntity * | getSubEntity (const String &name) const
| Gets a pointer to a SubEntity by name.
SubEntity * | getSubEntity (size_t index) const
| Gets a pointer to a SubEntity, ie a part of an Entity.
uint32 | getTypeFlags (void) const override
| Override to return specific type flag.
bool | getUpdateBoundingBoxFromSkeleton () const
| If true, the skeleton of the entity will be used to update the bounding box for culling.
VertexData * | getVertexDataForBinding (void)
| Retrieve the VertexData which should be used for GPU binding.
const AxisAlignedBox & | getWorldBoundingBox (bool derive=false) const override
| Get the world bounding box of the caster.
const Sphere & | getWorldBoundingSphere (bool derive=false) const override
| Retrieves the worldspace bounding sphere for this object.
bool | hasAnimationState (const String &name) const
| Returns whether the AnimationState with the given name exists.
bool | hasSkeleton (void) const
| Returns whether or not this entity is skeletally animated.
bool | hasVertexAnimation (void) const
| Returns whether or not this entity is either morph or pose animated.
bool | isHardwareAnimationEnabled (void)
| Returns whether or not hardware animation is enabled.
bool | isInitialised (void) const
| Has this Entity been initialised yet?
void | loadingComplete (Resource *res) override
| Resource::Listener hook to notify Entity that a delay-loaded Mesh is complete.
void | refreshAvailableAnimationState (void)
| Updates the internal animation state set to include the latest available animations from the attached skeleton.
void | removeSoftwareAnimationRequest (bool normalsAlso)
| Removes a request for software animation.
void | setAlwaysUpdateMainSkeleton (bool update)
| The skeleton of the main entity will be updated even if the an LOD entity is being displayed.
void | setDisplaySkeleton (bool display)
| Tells the Entity whether or not it should display it's skeleton, if it has one.
void | setMaterial (const MaterialPtr &material)
| Sets the material to use for the whole of this entity.
void | setMaterialLodBias (Real factor, ushort maxDetailIndex=0, ushort minDetailIndex=99)
| Sets a level-of-detail bias for the material detail of this entity.
void | setMaterialName (const String &name, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
| Sets the material to use for the whole of this entity.
void | setMeshLodBias (Real factor, ushort maxDetailIndex=0, ushort minDetailIndex=99)
| Sets a level-of-detail bias for the mesh detail of this entity.
void | setPolygonModeOverrideable (bool PolygonModeOverrideable)
| Sets whether the polygon mode of this entire entity may be overridden by the camera detail settings.
void | setRenderQueueGroup (uint8 queueID) override
| Sets the render queue group this entity will be rendered through.
void | setRenderQueueGroupAndPriority (uint8 queueID, ushort priority) override
| Sets the render queue group and group priority this entity will be rendered through.
void | setSkipAnimationStateUpdate (bool skip)
| Entity's skeleton's AnimationState will not be automatically updated when set to true.
void | setUpdateBoundingBoxFromSkeleton (bool update)
| If true, the skeleton of the entity will be used to update the bounding box for culling.
void | shareSkeletonInstanceWith (Entity *entity)
| Shares the SkeletonInstance with the supplied entity.
bool | sharesSkeletonInstance () const
| Returns whether this entity shares it's SkeltonInstance with other entity instances.
void | stopSharingSkeletonInstance ()
| Stops sharing the SkeletonInstance with other entities.
void | visitRenderables (Renderable::Visitor *visitor, bool debugRenderables=false) override
| Method to allow a caller to abstractly iterate over the Renderable instances that this MovableObject will add to the render queue when asked, if any.
Public Member Functions inherited from Ogre::MovableObject
| MovableObject ()
| Constructor.
| MovableObject (const String &name)
| Named constructor.
virtual | ~MovableObject ()
| Virtual destructor - read Scott Meyers if you don't know why this is needed.
MovableObjectFactory * | _getCreator (void) const
| Get the creator of this object, if any (internal use only).
LightList * | _getLightList ()
| Returns a pointer to the current list of lights for this object.
SceneManager * | _getManager (void) const
| Get the manager of this object, if any (internal use only).
virtual const Affine3 & | _getParentNodeFullTransform (void) const
| Return the full transformation of the parent sceneNode or the attachingPoint node.
virtual void | _notifyCreator (MovableObjectFactory *fact)
| Notify the object of it's creator (internal use only).
virtual void | _notifyManager (SceneManager *man)
| Notify the object of it's manager (internal use only).
virtual void | _notifyMoved (void)
| Internal method called to notify the object that it has been moved.
void | addQueryFlags (uint32 flags)
| As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object.
void | addVisibilityFlags (uint32 flags)
| As setVisibilityFlags, except the flags passed as parameters are appended to the existing flags on this object.
void | detachFromParent (void)
| Detaches an object from a parent SceneNode or TagPoint, if attached.
Real | getBoundingRadiusScaled () const
| as getBoundingRadius, but with scaling applied
bool | getCastShadows (void) const override
| Returns whether shadow casting is enabled for this object.
uint32 | getLightMask () const
| Get a bitwise mask which will filter the lights affecting this object.
Listener * | getListener (void) const
| Gets the current listener for this object.
const String & | getName (void) const
| Returns the name of this object.
Node * | getParentNode (void) const
| Returns the node to which this object is attached.
SceneNode * | getParentSceneNode (void) const
| Returns the scene node to which this object is attached.
Real | getPointExtrusionDistance (const Light *l) const override
| Get the distance to extrude for a point/spot light.
virtual uint32 | getQueryFlags (void) const
| Returns the query flags relevant for this object.
bool | getReceivesShadows ()
| Returns whether the Material of any Renderable that this MovableObject will add to the render queue will receive shadows.
Real | getRenderingDistance (void) const
| Gets the distance at which batches are no longer rendered.
Real | getRenderingMinPixelSize () const
| Returns the minimum pixel size an object needs to be in both screen axes in order to be rendered.
uint8 | getRenderQueueGroup (void) const
| Gets the queue group for this entity.
const Any & | getUserAny (void) const
UserObjectBindings & | getUserObjectBindings ()
| Class that provides convenient interface to establish a linkage between custom user application objects and Ogre core classes.
const UserObjectBindings & | getUserObjectBindings () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
virtual uint32 | getVisibilityFlags (void) const
| Returns the visibility flags relevant for this object.
bool | getVisible (void) const
| Gets this object whether to be visible or not, if it has a renderable component.
const AxisAlignedBox & | getWorldBoundingBox (bool derive=false) const override
| Retrieves the axis-aligned bounding box for this object in world coordinates.
bool | isAttached (void) const
| Returns true if this object is attached to a SceneNode or TagPoint.
bool | isDebugDisplayEnabled (void) const
| Gets whether debug display of this object is enabled.
virtual 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.
bool | isParentTagPoint () const
| Gets whether the parent node is a TagPoint (or a SceneNode).
virtual bool | isVisible (void) const
| Returns whether or not this object is supposed to be visible or not.
const LightList & | queryLights (void) const
| Gets a list of lights, ordered relative to how close they are to this movable object.
void | removeQueryFlags (uint32 flags)
| As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object.
void | removeVisibilityFlags (uint32 flags)
| As setVisibilityFlags, except the flags passed as parameters are removed from the existing flags on this object.
void | setCastShadows (bool enabled)
| Sets whether or not this object will cast shadows.
void | setDebugDisplayEnabled (bool enabled)
| Sets whether or not the debug display of this object is enabled.
void | setLightMask (uint32 lightMask)
| Set a bitwise mask which will filter the lights affecting this object.
void | setListener (Listener *listener)
| Sets a listener for this object.
void | setQueryFlags (uint32 flags)
| Sets the query flags for this object.
void | setRenderingDistance (Real dist)
| Sets the distance at which the object is no longer rendered.
void | setRenderingMinPixelSize (Real pixelSize)
| Sets the minimum pixel size an object needs to be in both screen axes in order to be rendered.
void | setUserAny (const Any &anything)
void | setVisibilityFlags (uint32 flags)
| Sets the visibility flags for this object.
void | setVisible (bool visible)
| Tells this object whether to be visible or not, if it has a renderable component.
Public Member Functions inherited from Ogre::ShadowCaster
virtual | ~ShadowCaster ()
const AxisAlignedBox & | getDarkCapBounds (const Light &light, Real dirLightExtrusionDist) const
| Gets the world space bounding box of the dark cap, as extruded using the light provided.
const AxisAlignedBox & | getLightCapBounds (void) const
| Gets the world space bounding box of the light cap.
bool | hasEdgeList ()
| Returns whether the object has a valid edge list.
Public Member Functions inherited from Ogre::AnimableObject
| AnimableObject ()
virtual | ~AnimableObject ()
virtual AnimableValuePtr | createAnimableValue (const String &valueName)
| Create a reference-counted AnimableValuePtr for the named value.
virtual const StringVector & | getAnimableValueNames (void) const
| Gets a list of animable value names for this object.
Public Member Functions inherited from Ogre::Resource::Listener
virtual | ~Listener ()
virtual void | preparingComplete (Resource *)
| Called whenever the resource finishes preparing (paging into memory).
virtual void | unloadingComplete (Resource *)
| Called whenever the resource has been unloaded.

## Additional Inherited Members

Static Public Member Functions inherited from Ogre::MovableObject
static uint32 | getDefaultQueryFlags ()
| Get the default query flags for all future MovableObject instances.
static uint32 | getDefaultVisibilityFlags ()
| Get the default visibility flags for all future MovableObject instances.
static void | setDefaultQueryFlags (uint32 flags)
| Set the default query flags for all future MovableObject instances.
static void | setDefaultVisibilityFlags (uint32 flags)
| Set the default visibility flags for all future MovableObject instances.
Static Public Member Functions inherited from Ogre::ShadowCaster
static void | clearShadowRenderableList (ShadowRenderableList &shadowRenderables)
| Common implementation of releasing shadow renderables.
static void | extrudeVertices (const HardwareVertexBufferSharedPtr &vertexBuffer, size_t originalVertexCount, const Vector4 &lightPos, Real extrudeDist)
| Utility method for extruding vertices based on a light.

## Detailed Description

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

Ogre generally divides renderable objects into 2 groups, discrete (separate) and relatively small objects which move around the world, and large, sprawling geometry which makes up generally immovable scenery, aka 'level geometry'.

The Mesh and SubMesh classes deal with the definition of the geometry used by discrete movable objects. Entities are actual instances of objects based on this geometry in the world. Therefore there is usually a single set Mesh for a car, but there may be multiple entities based on it in the world. Entities are able to override aspects of the Mesh it is defined by, such as changing material properties per instance (so you can have many cars using the same geometry but different textures for example). Because a Mesh is split into SubMeshes for this purpose, the Entity class is a grouping class (much like the Mesh class) and much of the detail regarding individual changes is kept in the SubEntity class. There is a 1:1 relationship between SubEntity instances and the SubMesh instances associated with the Mesh the Entity is based on.

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 SceneNode::attachObject method.

Note
  No functions were declared virtual to improve performance.

## Member Typedef Documentation

## EntitySet

typedef std::set<Entity*> Ogre::Entity::EntitySet

## SchemeHardwareAnimMap

typedef std::vector<std::pair<unsigned short, bool> > Ogre::Entity::SchemeHardwareAnimMap

## SubEntityList

typedef std::vector<SubEntity*> Ogre::Entity::SubEntityList

## ChildObjectList

typedef std::vector<MovableObject*> Ogre::Entity::ChildObjectList

Contains the child objects (attached to bones) indexed by name.

## ChildObjectListIterator

typedef VectorIterator<ChildObjectList> Ogre::Entity::ChildObjectListIterator

## Member Enumeration Documentation

## VertexDataBindChoice

enum Ogre::Entity::VertexDataBindChoice

Identify which vertex data we should be sending to the renderer.

Enumerator
BIND_ORIGINAL |
BIND_SOFTWARE_SKELETAL |
BIND_SOFTWARE_MORPH |
BIND_HARDWARE_MORPH |

## Constructor & Destructor Documentation

## ~Entity()

Ogre::Entity::~Entity | ( |  | ) |

Default destructor.

## Member Function Documentation

## getMesh()

const MeshPtr & Ogre::Entity::getMesh | ( | void |  | ) | const

Gets the Mesh that this Entity is based on.

## getSubEntity() [1/2]

SubEntity * Ogre::Entity::getSubEntity | ( | size_t | index | ) | const

inline

Gets a pointer to a SubEntity, ie a part of an Entity.

References SubEntity.

## getSubEntity() [2/2]

SubEntity * Ogre::Entity::getSubEntity | ( | const String & | name | ) | const

Gets a pointer to a SubEntity by name.

Names should be initialized during a Mesh creation.

References SubEntity.

## getNumSubEntities()

size_t Ogre::Entity::getNumSubEntities | ( | void |  | ) | const

inline

Retrieves the number of SubEntity objects making up this entity.

## getSubEntities()

const SubEntityList & Ogre::Entity::getSubEntities | ( |  | ) | const

inline

Retrieves SubEntity objects making up this entity.

## clone()

Entity * Ogre::Entity::clone | ( | const String & | newName | ) | const

Clones this entity and returns a pointer to the clone.

Useful method for duplicating an entity. The new entity must be given a unique name, and is not attached to the scene in any way so must be attached to a SceneNode to be visible (exactly as entities returned from SceneManager::createEntity).

Parameters

  newName | Name for the new entity.

## setMaterialName()

void Ogre::Entity::setMaterialName | ( | const String & | name,
|  | const String & | groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME )

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

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.

References Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME.

## setMaterial()

void Ogre::Entity::setMaterial | ( | const MaterialPtr & | material | ) |

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

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.

## _releaseManualHardwareResources()

void Ogre::Entity::_releaseManualHardwareResources | ( |  | ) |

override virtual

Notifies the movable object that hardware resources were lost.

Called automatically by RenderSystem if hardware resources were lost and can not be restored using some internal mechanism. Among affected resources are nested shadow renderables, ManualObjects, etc.

Reimplemented from Ogre::MovableObject.

## _restoreManualHardwareResources()

void Ogre::Entity::_restoreManualHardwareResources | ( |  | ) |

override virtual

Notifies the movable object that hardware resources should be restored.

Called automatically by RenderSystem if hardware resources were lost and can not be restored using some internal mechanism. Among affected resources are nested shadow renderables, ManualObjects, etc.

Reimplemented from Ogre::MovableObject.

## _notifyCurrentCamera()

void Ogre::Entity::_notifyCurrentCamera | ( | Camera * | cam | ) |

override virtual

Internal method to notify the object of the camera to be used for the next rendering operation.

Certain objects may want to do specific processing based on the camera position. This method notifies them in case they wish to do this.

Reimplemented from Ogre::MovableObject.

## setRenderQueueGroup()

void Ogre::Entity::setRenderQueueGroup | ( | uint8 | queueID | ) |

override virtual

Sets the render queue group this entity will be rendered through.

Render queues are grouped to allow you to more tightly control the ordering of rendered objects. If you do not call this method, all Entity objects default to the default queue (RenderQueue::getDefaultQueueGroup), which is fine for most objects. You may want to alter this if you want this entity to always appear in front of other objects, e.g. for a 3D menu system or such.

  See RenderQueue for more details.

Parameters

  queueID | Enumerated value of the queue group to use. See the enum RenderQueueGroupID for what kind of values can be used here.

Reimplemented from Ogre::MovableObject.

## setRenderQueueGroupAndPriority()

void Ogre::Entity::setRenderQueueGroupAndPriority | ( | uint8 | queueID,
|  | ushort | priority )

override virtual

Sets the render queue group and group priority this entity will be rendered through.

Render queues are grouped to allow you to more tightly control the ordering of rendered objects. Within a single render group there another type of grouping called priority which allows further control. If you do not call this method, all Entity objects default to the default queue and priority (RenderQueue::getDefaultQueueGroup, RenderQueue::getDefaultRenderablePriority), which is fine for most objects. You may want to alter this if you want this entity to always appear in front of other objects, e.g. for a 3D menu system or such.

  See RenderQueue for more details.

Parameters

  queueID | Enumerated value of the queue group to use. See the enum RenderQueueGroupID for what kind of values can be used here.
  priority | The priority within a group to use.

Reimplemented from Ogre::MovableObject.

## getBoundingBox()

const AxisAlignedBox & Ogre::Entity::getBoundingBox | ( | void |  | ) | const

override virtual

Retrieves the local axis-aligned bounding box for this object.

This bounding box is in local coordinates.

Implements Ogre::MovableObject.

## getChildObjectsBoundingBox()

AxisAlignedBox Ogre::Entity::getChildObjectsBoundingBox | ( | void |  | ) | const

Merge all the child object Bounds a return it.

## _updateRenderQueue()

void Ogre::Entity::_updateRenderQueue | ( | RenderQueue * | queue | ) |

override virtual

Internal method by which the movable object must add Renderable subclass instances to the rendering queue.

The engine will call this method when this object is to be rendered. The object must then create one or more Renderable subclass instances which it places on the passed in Queue for rendering.

Implements Ogre::MovableObject.

## getMovableType()

const String & Ogre::Entity::getMovableType | ( | void |  | ) | const

override virtual

Returns the type name of this object.

Implements Ogre::MovableObject.

## getAnimationState()

AnimationState * Ogre::Entity::getAnimationState | ( | const String & | name | ) | const

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

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.

## hasAnimationState()

bool Ogre::Entity::hasAnimationState | ( | const String & | name | ) | const

Returns whether the AnimationState with the given name exists.

## getAllAnimationStates()

AnimationStateSet * Ogre::Entity::getAllAnimationStates | ( | void |  | ) | const

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.

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.

## setDisplaySkeleton()

void Ogre::Entity::setDisplaySkeleton | ( | bool | display | ) |

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

## getDisplaySkeleton()

bool Ogre::Entity::getDisplaySkeleton | ( | void |  | ) | const

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

## getNumManualLodLevels()

size_t Ogre::Entity::getNumManualLodLevels | ( | void |  | ) | const

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

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

## getCurrentLodIndex()

ushort Ogre::Entity::getCurrentLodIndex | ( |  | ) |

inline

Returns the current LOD used to render.

## getManualLodLevel()

Entity * Ogre::Entity::getManualLodLevel | ( | size_t | index | ) | const

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

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

## setMeshLodBias()

void Ogre::Entity::setMeshLodBias | ( | Real | factor,
|  | ushort | maxDetailIndex = 0,
|  | ushort | minDetailIndex = 99 )

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

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

  factor | Proportional 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).
  maxDetailIndex | The index of the maximum LOD this entity is allowed to use (lower indexes are higher detail: index 0 is the original full detail model).
  minDetailIndex | The 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).

## setMaterialLodBias()

void Ogre::Entity::setMaterialLodBias | ( | Real | factor,
|  | ushort | maxDetailIndex = 0,
|  | ushort | minDetailIndex = 99 )

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

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

  factor | Proportional 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).
  maxDetailIndex | The index of the maximum LOD this entity is allowed to use (lower indexes are higher detail: index 0 is the original full detail model).
  minDetailIndex | The 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).

## setPolygonModeOverrideable()

void Ogre::Entity::setPolygonModeOverrideable | ( | bool | PolygonModeOverrideable | ) |

Sets whether the polygon mode of this entire entity may be overridden by the camera detail settings.

## attachObjectToBone()

TagPoint * Ogre::Entity::attachObjectToBone | ( | const String & | boneName,
|  | MovableObject * | pMovable,
|  | const Quaternion & | offsetOrientation = Quaternion::IDENTITY,
|  | const Vector3 & | offsetPosition = Vector3::ZERO )

Attaches another object to a certain bone of the skeleton which this entity uses.

This method can be used to attach another object to an animated part of this entity, by attaching it to a bone in the skeleton (with an offset if required). As this entity is animated, the attached object will move relative to the bone to which it is attached.

  An exception is thrown if the movable object is already attached to the bone, another bone or scenenode. If the entity has no skeleton or the bone name cannot be found then an exception is thrown.

Parameters

  boneName | The name of the bone (in the skeleton) to attach this object
  pMovable | Pointer to the object to attach
  offsetOrientation | An adjustment to the orientation of the attached object, relative to the bone.
  offsetPosition | An adjustment to the position of the attached object, relative to the bone.

Returns
  The TagPoint to which the object has been attached

References Ogre::MovableObject::MovableObject(), and Ogre::Quaternion::IDENTITY.

## detachObjectFromBone() [1/2]

MovableObject * Ogre::Entity::detachObjectFromBone | ( | const String & | movableName | ) |

Detach a MovableObject previously attached using attachObjectToBone.

If the movable object name is not found then an exception is raised.

Parameters

  movableName | The name of the movable object to be detached.

References Ogre::MovableObject::MovableObject().

## detachObjectFromBone() [2/2]

void Ogre::Entity::detachObjectFromBone | ( | MovableObject * | obj | ) |

Detaches an object by pointer.

Use this method to destroy a MovableObject which is attached to a bone of belonging this entity. But sometimes the object may be not in the child object list because it is a LOD entity, this method can safely detect and ignore in this case and won't raise an exception.

References Ogre::MovableObject::MovableObject().

## detachAllObjectsFromBone()

void Ogre::Entity::detachAllObjectsFromBone | ( | void |  | ) |

Detach all MovableObjects previously attached using attachObjectToBone.

## getAttachedObjectIterator()

ChildObjectListIterator Ogre::Entity::getAttachedObjectIterator | ( | void |  | ) |

Deprecated
  use getAttachedObjects()

## getAttachedObjects()

const ChildObjectList & Ogre::Entity::getAttachedObjects | ( |  | ) | const

inline

Gets an iterator to the list of objects attached to bones on this entity.

## getBoundingRadius()

Real Ogre::Entity::getBoundingRadius | ( | void |  | ) | const

override virtual

Retrieves the radius of the origin-centered bounding sphere for this object.

Implements Ogre::MovableObject.

## getWorldBoundingBox()

const AxisAlignedBox & Ogre::Entity::getWorldBoundingBox | ( | bool | derive = false | ) | const

override virtual

Get the world bounding box of the caster.

Implements Ogre::ShadowCaster.

## getWorldBoundingSphere()

const Sphere & Ogre::Entity::getWorldBoundingSphere | ( | bool | derive = false | ) | const

override virtual

Retrieves the worldspace bounding sphere for this object.

Reimplemented from Ogre::MovableObject.

## getEdgeList()

EdgeData * Ogre::Entity::getEdgeList | ( | void |  | ) |

override virtual

Returns details of the edges which might be used to determine a silhouette.

Reimplemented from Ogre::ShadowCaster.

## getShadowVolumeRenderableList()

const ShadowRenderableList & Ogre::Entity::getShadowVolumeRenderableList | ( | const Light * | light,
|  | const HardwareIndexBufferPtr & | indexBuffer,
|  | size_t & | indexBufferUsedSize,
|  | float | extrusionDistance,
|  | int | flags = 0 )

override virtual

Gets an list of the renderables required to render the shadow volume.

Shadowable geometry should ideally be designed such that there is only one ShadowRenderable required to render the the shadow; however this is not a necessary limitation and it can be exceeded if required.

Parameters

  light | The light to generate the shadow from.
  indexBuffer | The index buffer to build the renderables into, the current contents are assumed to be disposable.
  indexBufferUsedSize | If the rest of buffer is enough than it would be locked with HBL_NO_OVERWRITE semantic and indexBufferUsedSize would be increased, otherwise HBL_DISCARD would be used and indexBufferUsedSize would be reset.
  extrusionDistance | The distance to extrude the shadow volume.
  flags | Technique-specific flags, see ShadowRenderableFlags.

Reimplemented from Ogre::ShadowCaster.

## _getBoneMatrices()

const Affine3 * Ogre::Entity::_getBoneMatrices | ( | void |  | ) | const

inline

Internal method for retrieving bone matrix information.

## _getNumBoneMatrices()

unsigned short Ogre::Entity::_getNumBoneMatrices | ( | void |  | ) | const

inline

Internal method for retrieving bone matrix information.

## hasSkeleton()

bool Ogre::Entity::hasSkeleton | ( | void |  | ) | const

inline

Returns whether or not this entity is skeletally animated.

## getSkeleton()

SkeletonInstance * Ogre::Entity::getSkeleton | ( | void |  | ) | const

inline

Get this Entity's personal skeleton instance.

## isHardwareAnimationEnabled()

bool Ogre::Entity::isHardwareAnimationEnabled | ( | void |  | ) |

Returns whether or not hardware animation is enabled.

Because fixed-function indexed vertex blending is rarely supported by existing graphics cards, hardware animation can only be done if the vertex programs in the materials used to render an entity support it. Therefore, this method will only return true if all the materials assigned to this entity have vertex programs assigned, and all those vertex programs must support 'includes_morph_animation true' if using morph animation, 'includes_pose_animation true' if using pose animation and 'includes_skeletal_animation true' if using skeletal animation.

Also note the the function returns value according to the current active scheme. This is due to the fact that RTSS schemes may be different in their handling of hardware animation.

## _notifyAttached()

void Ogre::Entity::_notifyAttached | ( | Node * | parent,
|  | bool | isTagPoint = false )

override virtual

Internal method called to notify the object that it has been attached to a node.

Reimplemented from Ogre::MovableObject.

## getSoftwareAnimationRequests()

int Ogre::Entity::getSoftwareAnimationRequests | ( | void |  | ) | const

inline

Returns the number of requests that have been made for software animation.

If non-zero then software animation will be performed in updateAnimation regardless of the current setting of isHardwareAnimationEnabled or any internal optimise for eliminate software animation. Requests for software animation are made by calling the addSoftwareAnimationRequest() method.

## getSoftwareAnimationNormalsRequests()

int Ogre::Entity::getSoftwareAnimationNormalsRequests | ( | void |  | ) | const

inline

Returns the number of requests that have been made for software animation of normals.

If non-zero, and getSoftwareAnimationRequests() also returns non-zero, then software animation of normals will be performed in updateAnimation regardless of the current setting of isHardwareAnimationEnabled or any internal optimise for eliminate software animation. Currently it is not possible to force software animation of only normals. Consequently this value is always less than or equal to that returned by getSoftwareAnimationRequests(). Requests for software animation of normals are made by calling the addSoftwareAnimationRequest() method with 'true' as the parameter.

## addSoftwareAnimationRequest()

void Ogre::Entity::addSoftwareAnimationRequest | ( | bool | normalsAlso | ) |

Add a request for software animation.

Tells the entity to perform animation calculations for skeletal/vertex animations in software, regardless of the current setting of isHardwareAnimationEnabled(). Software animation will be performed any time one or more requests have been made. If 'normalsAlso' is 'true', then the entity will also do software blending on normal vectors, in addition to positions. This advanced method useful for situations in which access to actual mesh vertices is required, such as accurate collision detection or certain advanced shading techniques. When software animation is no longer needed, the caller of this method should always remove the request by calling removeSoftwareAnimationRequest(), passing the same value for 'normalsAlso'.

## removeSoftwareAnimationRequest()

void Ogre::Entity::removeSoftwareAnimationRequest | ( | bool | normalsAlso | ) |

Removes a request for software animation.

Calling this decrements the entity's internal counter of the number of requests for software animation. If the counter is already zero then calling this method throws an exception. The 'normalsAlso' flag if set to 'true' will also decrement the internal counter of number of requests for software animation of normals.

## shareSkeletonInstanceWith()

void Ogre::Entity::shareSkeletonInstanceWith | ( | Entity * | entity | ) |

Shares the SkeletonInstance with the supplied entity.

Note that in order for this to work, both entities must have the same Skeleton.

## hasVertexAnimation()

bool Ogre::Entity::hasVertexAnimation | ( | void |  | ) | const

Returns whether or not this entity is either morph or pose animated.

## stopSharingSkeletonInstance()

void Ogre::Entity::stopSharingSkeletonInstance | ( |  | ) |

Stops sharing the SkeletonInstance with other entities.

## sharesSkeletonInstance()

bool Ogre::Entity::sharesSkeletonInstance | ( |  | ) | const

inline

Returns whether this entity shares it's SkeltonInstance with other entity instances.

## getSkeletonInstanceSharingSet()

const EntitySet * Ogre::Entity::getSkeletonInstanceSharingSet | ( |  | ) | const

inline

Returns a pointer to the set of entities which share a SkeletonInstance.

If this instance does not share it's SkeletonInstance with other instances `NULL` will be returned

## refreshAvailableAnimationState()

void Ogre::Entity::refreshAvailableAnimationState | ( | void |  | ) |

Updates the internal animation state set to include the latest available animations from the attached skeleton.

Use this method if you manually add animations to a skeleton, or have linked the skeleton to another for animation purposes since creating this entity.

Note
  If you have called getAnimationState prior to calling this method, the pointers will still remain valid.

## _updateAnimation()

void Ogre::Entity::_updateAnimation | ( | void |  | ) |

Advanced method to perform all the updates required for an animated entity.

You don't normally need to call this, but it's here in case you wish to manually update the animation of an Entity at a specific point in time. Animation will not be updated more than once a frame no matter how many times you call this method.

## _isAnimated()

bool Ogre::Entity::_isAnimated | ( | void |  | ) | const

Tests if any animation applied to this entity.

An entity is animated if any animation state is enabled, or any manual bone applied to the skeleton.

## _isSkeletonAnimated()

bool Ogre::Entity::_isSkeletonAnimated | ( | void |  | ) | const

Tests if skeleton was animated.

## _getSkelAnimVertexData()

VertexData * Ogre::Entity::_getSkelAnimVertexData | ( | void |  | ) | const

Advanced method to get the temporarily blended skeletal vertex information for entities which are software skinned.

Internal engine will eliminate software animation if possible, this information is unreliable unless added request for software animation via addSoftwareAnimationRequest.

Note
  The positions/normals of the returned vertex data is in object space.

## _getSoftwareVertexAnimVertexData()

VertexData * Ogre::Entity::_getSoftwareVertexAnimVertexData | ( | void |  | ) | const

Advanced method to get the temporarily blended software vertex animation information.

Internal engine will eliminate software animation if possible, this information is unreliable unless added request for software animation via addSoftwareAnimationRequest.

Note
  The positions/normals of the returned vertex data is in object space.

## _getHardwareVertexAnimVertexData()

VertexData * Ogre::Entity::_getHardwareVertexAnimVertexData | ( | void |  | ) | const

Advanced method to get the hardware morph vertex information.

Note
  The positions/normals of the returned vertex data is in object space.

## getTypeFlags()

uint32 Ogre::Entity::getTypeFlags | ( | void |  | ) | const

override virtual

Override to return specific type flag.

Reimplemented from Ogre::MovableObject.

## getVertexDataForBinding()

VertexData * Ogre::Entity::getVertexDataForBinding | ( | void |  | ) |

Retrieve the VertexData which should be used for GPU binding.

## chooseVertexDataForBinding()

VertexDataBindChoice Ogre::Entity::chooseVertexDataForBinding | ( | bool | hasVertexAnim | ) |

Choose which vertex data to bind to the renderer.

## _getBuffersMarkedForAnimation()

bool Ogre::Entity::_getBuffersMarkedForAnimation | ( | void |  | ) | const

inline

Are buffers already marked as vertex animated?

## _markBuffersUsedForAnimation()

void Ogre::Entity::_markBuffersUsedForAnimation | ( | void |  | ) |

Mark just this vertex data as animated.

## isInitialised()

bool Ogre::Entity::isInitialised | ( | void |  | ) | const

inline

Has this Entity been initialised yet?

If this returns false, it means this Entity hasn't been completely constructed yet from the underlying resources (Mesh, Skeleton), which probably means they were delay-loaded and aren't available yet. This Entity won't render until it has been successfully initialised, nor will many of the manipulation methods function.

## _initialise()

void Ogre::Entity::_initialise | ( | bool | forceReinitialise = false | ) |

Try to initialise the Entity from the underlying resources.

This method builds the internal structures of the Entity based on it resources (Mesh, Skeleton). This may or may not succeed if the resources it references have been earmarked for background loading, so you should check isInitialised afterwards to see if it was successful.

Parameters

  forceReinitialise | If `true`, this forces the Entity to tear down it's internal structures and try to rebuild them. Useful if you changed the content of a Mesh or Skeleton at runtime.

## _deinitialise()

void Ogre::Entity::_deinitialise | ( | void |  | ) |

Tear down the internal structures of this Entity, rendering it uninitialised.

## loadingComplete()

void Ogre::Entity::loadingComplete | ( | Resource * | res | ) |

override virtual

Resource::Listener hook to notify Entity that a delay-loaded Mesh is complete.

Reimplemented from Ogre::Resource::Listener.

## visitRenderables()

void Ogre::Entity::visitRenderables | ( | Renderable::Visitor * | visitor,
|  | bool | debugRenderables = false )

override virtual

Method to allow a caller to abstractly iterate over the Renderable instances that this MovableObject will add to the render queue when asked, if any.

Parameters

  visitor | Pointer to a class implementing the Renderable::Visitor interface which will be called back for each Renderable which will be queued. Bear in mind that the state of the Renderable instances may not be finalised depending on when you call this.
  debugRenderables | If false, only regular renderables will be visited (those for normal display). If true, debug renderables will be included too.

Implements Ogre::MovableObject.

## _getMeshLodFactorTransformed()

Real Ogre::Entity::_getMeshLodFactorTransformed | ( |  | ) | const

Get the LOD strategy transformation of the mesh LOD factor.

## setSkipAnimationStateUpdate()

void Ogre::Entity::setSkipAnimationStateUpdate | ( | bool | skip | ) |

inline

Entity's skeleton's AnimationState will not be automatically updated when set to true.

Useful if you wish to handle AnimationState updates manually.

## getSkipAnimationStateUpdate()

bool Ogre::Entity::getSkipAnimationStateUpdate | ( |  | ) | const

inline

Entity's skeleton's AnimationState will not be automatically updated when set to true.

Useful if you wish to handle AnimationState updates manually.

## setAlwaysUpdateMainSkeleton()

void Ogre::Entity::setAlwaysUpdateMainSkeleton | ( | bool | update | ) |

inline

The skeleton of the main entity will be updated even if the an LOD entity is being displayed.

useful if you have entities attached to the main entity. Otherwise position of attached entities will not be updated.

## getAlwaysUpdateMainSkeleton()

bool Ogre::Entity::getAlwaysUpdateMainSkeleton | ( |  | ) | const

inline

The skeleton of the main entity will be updated even if the an LOD entity is being displayed.

useful if you have entities attached to the main entity. Otherwise position of attached entities will not be updated.

## setUpdateBoundingBoxFromSkeleton()

void Ogre::Entity::setUpdateBoundingBoxFromSkeleton | ( | bool | update | ) |

If true, the skeleton of the entity will be used to update the bounding box for culling.

Useful if you have skeletal animations that move the bones away from the root. Otherwise, the bounding box of the mesh in the binding pose will be used.

When true, the bounding box will be generated to only enclose the bones that are used for skinning. Also the resulting bounding box will be expanded by the amount of GetMesh()->getBoneBoundingRadius(). The expansion amount can be changed on the mesh to achieve a better fitting bounding box.

## getUpdateBoundingBoxFromSkeleton()

bool Ogre::Entity::getUpdateBoundingBoxFromSkeleton | ( |  | ) | const

inline

If true, the skeleton of the entity will be used to update the bounding box for culling.

Useful if you have skeletal animations that move the bones away from the root. Otherwise, the bounding box of the mesh in the binding pose will be used.

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

- OgreEntity.h