OGRE  1.12.13
Object-Oriented Graphics Rendering Engine
Ogre::Entity Class Reference

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

#include <OgreEntity.h>

+ Inheritance diagram for Ogre::Entity:

Public Types

typedef std::vector< MovableObject * > ChildObjectList
 Contains the child objects (attached to bones) indexed by name. More...
 
typedef VectorIterator< ChildObjectListChildObjectListIterator
 
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 std::vector< ShadowRenderable * > ShadowRenderableList
 
typedef VectorIterator< ShadowRenderableListShadowRenderableListIterator
 

Public Member Functions

 ~Entity ()
 Default destructor. More...
 
void _deinitialise (void)
 Tear down the internal structures of this Entity, rendering it uninitialised. More...
 
const Affine3_getBoneMatrices (void) const
 Internal method for retrieving bone matrix information. More...
 
bool _getBuffersMarkedForAnimation (void) const
 Are buffers already marked as vertex animated? More...
 
VertexData_getHardwareVertexAnimVertexData (void) const
 Advanced method to get the hardware morph vertex information. More...
 
Real _getMeshLodFactorTransformed () const
 Get the LOD strategy transformation of the mesh LOD factor. More...
 
unsigned short _getNumBoneMatrices (void) const
 Internal method for retrieving bone matrix information. More...
 
TempBlendedBufferInfo_getSkelAnimTempBufferInfo (void)
 Advanced method to get the temp buffer information for software skeletal animation. More...
 
VertexData_getSkelAnimVertexData (void) const
 Advanced method to get the temporarily blended skeletal vertex information for entities which are software skinned. More...
 
VertexData_getSoftwareVertexAnimVertexData (void) const
 Advanced method to get the temporarily blended software vertex animation information. More...
 
TempBlendedBufferInfo_getVertexAnimTempBufferInfo (void)
 Advanced method to get the temp buffer information for software morph animation. More...
 
void _initialise (bool forceReinitialise=false)
 Try to initialise the Entity from the underlying resources. More...
 
bool _isAnimated (void) const
 Tests if any animation applied to this entity. More...
 
bool _isSkeletonAnimated (void) const
 Tests if skeleton was animated. More...
 
void _markBuffersUsedForAnimation (void)
 Mark just this vertex data as animated. More...
 
void _notifyAttached (Node *parent, bool isTagPoint=false) override
 Internal method called to notify the object that it has been attached to a node. More...
 
void _notifyCurrentCamera (Camera *cam) override
 Internal method to notify the object of the camera to be used for the next rendering operation. More...
 
void _releaseManualHardwareResources () override
 Notifies the movable object that hardware resources were lost. More...
 
void _restoreManualHardwareResources () override
 Notifies the movable object that hardware resources should be restored. More...
 
void _updateAnimation (void)
 Advanced method to perform all the updates required for an animated entity. More...
 
void _updateRenderQueue (RenderQueue *queue) override
 Internal method by which the movable object must add Renderable subclass instances to the rendering queue. More...
 
void addSoftwareAnimationRequest (bool normalsAlso)
 Add a request for software animation. More...
 
TagPointattachObjectToBone (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. More...
 
VertexDataBindChoice chooseVertexDataForBinding (bool hasVertexAnim)
 Choose which vertex data to bind to the renderer. More...
 
Entityclone (const String &newName) const
 Clones this entity and returns a pointer to the clone. More...
 
void detachAllObjectsFromBone (void)
 Detach all MovableObjects previously attached using attachObjectToBone. More...
 
MovableObjectdetachObjectFromBone (const String &movableName)
 Detach a MovableObject previously attached using attachObjectToBone. More...
 
void detachObjectFromBone (MovableObject *obj)
 Detaches an object by pointer. More...
 
AnimationStateSetgetAllAnimationStates (void) const
 For entities based on animated meshes, gets the AnimationState objects for all animations. More...
 
bool getAlwaysUpdateMainSkeleton () const
 The skeleton of the main entity will be updated even if the an LOD entity is being displayed. More...
 
AnimationStategetAnimationState (const String &name) const
 For entities based on animated meshes, gets the AnimationState object for a single animation. More...
 
ChildObjectListIterator getAttachedObjectIterator (void)
 
const ChildObjectListgetAttachedObjects () const
 Gets an iterator to the list of objects attached to bones on this entity. More...
 
const AxisAlignedBoxgetBoundingBox (void) const override
 Retrieves the local axis-aligned bounding box for this object. More...
 
Real getBoundingRadius (void) const override
 Retrieves the radius of the origin-centered bounding sphere for this object. More...
 
AxisAlignedBox getChildObjectsBoundingBox (void) const
 Merge all the child object Bounds a return it. More...
 
ushort getCurrentLodIndex ()
 Returns the current LOD used to render. More...
 
bool getDisplaySkeleton (void) const
 Returns whether or not the entity is currently displaying its skeleton. More...
 
EdgeDatagetEdgeList (void) override
 Returns details of the edges which might be used to determine a silhouette. More...
 
EntitygetManualLodLevel (size_t index) const
 Gets a pointer to the entity representing the numbered manual level of detail. More...
 
const MeshPtrgetMesh (void) const
 Gets the Mesh that this Entity is based on. More...
 
const StringgetMovableType (void) const override
 Returns the type name of this object. More...
 
size_t getNumManualLodLevels (void) const
 Returns the number of manual levels of detail that this entity supports. More...
 
size_t getNumSubEntities (void) const
 Retrieves the number of SubEntity objects making up this entity. More...
 
const ShadowRenderableListgetShadowVolumeRenderableList (ShadowTechnique shadowTechnique, const Light *light, HardwareIndexBufferSharedPtr *indexBuffer, size_t *indexBufferUsedSize, bool extrudeVertices, Real extrusionDistance, unsigned long flags=0) override
 Gets an list of the renderables required to render the shadow volume. More...
 
SkeletonInstancegetSkeleton (void) const
 Get this Entity's personal skeleton instance. More...
 
const EntitySetgetSkeletonInstanceSharingSet () const
 Returns a pointer to the set of entities which share a SkeletonInstance. More...
 
bool getSkipAnimationStateUpdate () const
 Entity's skeleton's AnimationState will not be automatically updated when set to true. More...
 
int getSoftwareAnimationNormalsRequests (void) const
 Returns the number of requests that have been made for software animation of normals. More...
 
int getSoftwareAnimationRequests (void) const
 Returns the number of requests that have been made for software animation. More...
 
const SubEntityListgetSubEntities () const
 Retrieves SubEntity objects making up this entity. More...
 
SubEntitygetSubEntity (const String &name) const
 Gets a pointer to a SubEntity by name. More...
 
SubEntitygetSubEntity (size_t index) const
 Gets a pointer to a SubEntity, ie a part of an Entity. More...
 
uint32 getTypeFlags (void) const
 Override to return specific type flag. More...
 
bool getUpdateBoundingBoxFromSkeleton () const
 If true, the skeleton of the entity will be used to update the bounding box for culling. More...
 
VertexDatagetVertexDataForBinding (void)
 Retrieve the VertexData which should be used for GPU binding. More...
 
const AxisAlignedBoxgetWorldBoundingBox (bool derive=false) const override
 Retrieves the axis-aligned bounding box for this object in world coordinates. More...
 
const SpheregetWorldBoundingSphere (bool derive=false) const override
 Retrieves the worldspace bounding sphere for this object. More...
 
bool hasAnimationState (const String &name) const
 Returns whether the AnimationState with the given name exists. More...
 
bool hasSkeleton (void) const
 Returns whether or not this entity is skeletally animated. More...
 
bool hasVertexAnimation (void) const
 Returns whether or not this entity is either morph or pose animated. More...
 
bool isHardwareAnimationEnabled (void)
 Returns whether or not hardware animation is enabled. More...
 
bool isInitialised (void) const
 Has this Entity been initialised yet? More...
 
void loadingComplete (Resource *res)
 Resource::Listener hook to notify Entity that a delay-loaded Mesh is complete. More...
 
void refreshAvailableAnimationState (void)
 Updates the internal animation state set to include the latest available animations from the attached skeleton. More...
 
void removeSoftwareAnimationRequest (bool normalsAlso)
 Removes a request for software animation. More...
 
void setAlwaysUpdateMainSkeleton (bool update)
 The skeleton of the main entity will be updated even if the an LOD entity is being displayed. More...
 
void setDisplaySkeleton (bool display)
 Tells the Entity whether or not it should display it's skeleton, if it has one. More...
 
void setMaterial (const MaterialPtr &material)
 Sets the material to use for the whole of this entity. More...
 
void setMaterialLodBias (Real factor, ushort maxDetailIndex=0, ushort minDetailIndex=99)
 Sets a level-of-detail bias for the material detail of this entity. More...
 
void setMaterialName (const String &name, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Sets the material to use for the whole of this entity. More...
 
void setMeshLodBias (Real factor, ushort maxDetailIndex=0, ushort minDetailIndex=99)
 Sets a level-of-detail bias for the mesh detail of this entity. More...
 
void setPolygonModeOverrideable (bool PolygonModeOverrideable)
 Sets whether the polygon mode of this entire entity may be overridden by the camera detail settings. More...
 
void setRenderQueueGroup (uint8 queueID) override
 Sets the render queue group this entity will be rendered through. More...
 
void setRenderQueueGroupAndPriority (uint8 queueID, ushort priority) override
 Sets the render queue group and group priority this entity will be rendered through. More...
 
void setSkipAnimationStateUpdate (bool skip)
 Entity's skeleton's AnimationState will not be automatically updated when set to true. More...
 
void setUpdateBoundingBoxFromSkeleton (bool update)
 If true, the skeleton of the entity will be used to update the bounding box for culling. More...
 
void shareSkeletonInstanceWith (Entity *entity)
 Shares the SkeletonInstance with the supplied entity. More...
 
bool sharesSkeletonInstance () const
 Returns whether this entity shares it's SkeltonInstance with other entity instances. More...
 
void stopSharingSkeletonInstance ()
 Stops sharing the SkeletonInstance with other entities. More...
 
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. More...
 
- Public Member Functions inherited from Ogre::MovableObject
 MovableObject ()
 Constructor. More...
 
 MovableObject (const String &name)
 Named constructor. More...
 
virtual ~MovableObject ()
 Virtual destructor - read Scott Meyers if you don't know why this is needed. More...
 
MovableObjectFactory_getCreator (void) const
 Get the creator of this object, if any (internal use only) More...
 
LightList_getLightList ()
 Returns a pointer to the current list of lights for this object. More...
 
SceneManager_getManager (void) const
 Get the manager of this object, if any (internal use only) More...
 
virtual const Affine3_getParentNodeFullTransform (void) const
 Return the full transformation of the parent sceneNode or the attachingPoint node. More...
 
virtual void _notifyCreator (MovableObjectFactory *fact)
 Notify the object of it's creator (internal use only) More...
 
virtual void _notifyManager (SceneManager *man)
 Notify the object of it's manager (internal use only) More...
 
virtual void _notifyMoved (void)
 Internal method called to notify the object that it has been moved. More...
 
void addQueryFlags (uint32 flags)
 As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object. More...
 
void addVisibilityFlags (uint32 flags)
 As setVisibilityFlags, except the flags passed as parameters are appended to the existing flags on this object. More...
 
void detachFromParent (void)
 Detaches an object from a parent SceneNode or TagPoint, if attached. More...
 
Real getBoundingRadiusScaled () const
 as getBoundingRadius, but with scaling applied More...
 
bool getCastShadows (void) const
 Returns whether shadow casting is enabled for this object. More...
 
const AxisAlignedBoxgetDarkCapBounds (const Light &light, Real dirLightExtrusionDist) const override
 Gets the world space bounding box of the dark cap, as extruded using the light provided. More...
 
EdgeDatagetEdgeList (void)
 Returns details of the edges which might be used to determine a silhouette. More...
 
const AxisAlignedBoxgetLightCapBounds (void) const override
 Gets the world space bounding box of the light cap. More...
 
uint32 getLightMask () const
 Get a bitwise mask which will filter the lights affecting this object. More...
 
ListenergetListener (void) const
 Gets the current listener for this object. More...
 
const StringgetName (void) const
 Returns the name of this object. More...
 
NodegetParentNode (void) const
 Returns the node to which this object is attached. More...
 
SceneNodegetParentSceneNode (void) const
 Returns the scene node to which this object is attached. More...
 
Real getPointExtrusionDistance (const Light *l) const
 Get the distance to extrude for a point/spot light. More...
 
virtual uint32 getQueryFlags (void) const
 Returns the query flags relevant for this object. More...
 
bool getReceivesShadows ()
 Returns whether the Material of any Renderable that this MovableObject will add to the render queue will receive shadows. More...
 
Real getRenderingDistance (void) const
 Gets the distance at which batches are no longer rendered. More...
 
Real getRenderingMinPixelSize () const
 Returns the minimum pixel size an object needs to be in both screen axes in order to be rendered. More...
 
uint8 getRenderQueueGroup (void) const
 Gets the queue group for this entity. More...
 
const ShadowRenderableListgetShadowVolumeRenderableList (ShadowTechnique shadowTechnique, const Light *light, HardwareIndexBufferSharedPtr *indexBuffer, size_t *indexBufferUsedSize, bool extrudeVertices, Real extrusionDist, unsigned long flags=0)
 Define a default implementation of method from ShadowCaster which implements no shadows. More...
 
const AnygetUserAny (void) const
 
UserObjectBindingsgetUserObjectBindings ()
 Return an instance of user objects binding associated with this class. More...
 
const UserObjectBindingsgetUserObjectBindings () const
 Return an instance of user objects binding associated with this class. More...
 
virtual uint32 getVisibilityFlags (void) const
 Returns the visibility flags relevant for this object. More...
 
bool getVisible (void) const
 Gets this object whether to be visible or not, if it has a renderable component. More...
 
bool isAttached (void) const
 Returns true if this object is attached to a SceneNode or TagPoint. More...
 
bool isDebugDisplayEnabled (void) const
 Gets whether debug display of this object is enabled. More...
 
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. More...
 
bool isParentTagPoint () const
 Gets whether the parent node is a TagPoint (or a SceneNode) More...
 
virtual bool isVisible (void) const
 Returns whether or not this object is supposed to be visible or not. More...
 
const LightListqueryLights (void) const
 Gets a list of lights, ordered relative to how close they are to this movable object. More...
 
void removeQueryFlags (uint32 flags)
 As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object. More...
 
void removeVisibilityFlags (uint32 flags)
 As setVisibilityFlags, except the flags passed as parameters are removed from the existing flags on this object. More...
 
void setCastShadows (bool enabled)
 Sets whether or not this object will cast shadows. More...
 
void setDebugDisplayEnabled (bool enabled)
 Sets whether or not the debug display of this object is enabled. More...
 
void setLightMask (uint32 lightMask)
 Set a bitwise mask which will filter the lights affecting this object. More...
 
void setListener (Listener *listener)
 Sets a listener for this object. More...
 
void setQueryFlags (uint32 flags)
 Sets the query flags for this object. More...
 
void setRenderingDistance (Real dist)
 Sets the distance at which the object is no longer rendered. More...
 
void setRenderingMinPixelSize (Real pixelSize)
 Sets the minimum pixel size an object needs to be in both screen axes in order to be rendered. More...
 
void setUserAny (const Any &anything)
 
void setVisibilityFlags (uint32 flags)
 Sets the visibility flags for this object. More...
 
void setVisible (bool visible)
 Tells this object whether to be visible or not, if it has a renderable component. More...
 
- Public Member Functions inherited from Ogre::ShadowCaster
virtual ~ShadowCaster ()
 
virtual ShadowRenderableListIterator getShadowVolumeRenderableIterator (ShadowTechnique shadowTechnique, const Light *light, HardwareIndexBufferSharedPtr *indexBuffer, size_t *indexBufferUsedSize, bool extrudeVertices, Real extrusionDistance, unsigned long flags=0)
 
bool hasEdgeList ()
 Returns whether the object has a valid edge list. More...
 
- 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. More...
 
const StringVectorgetAnimableValueNames (void) const
 Gets a list of animable value names for this object. More...
 
- Public Member Functions inherited from Ogre::Resource::Listener
virtual ~Listener ()
 
virtual void preparingComplete (Resource *)
 Called whenever the resource finishes preparing (paging into memory). More...
 
virtual void unloadingComplete (Resource *)
 Called whenever the resource has been unloaded. More...
 

Additional Inherited Members

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

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

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

◆ ChildObjectListIterator

Member Enumeration Documentation

◆ 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

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

Deprecated:
use getSubEntities()

◆ getSubEntity() [2/2]

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

Gets a pointer to a SubEntity by name.

Remarks
Names should be initialized during a Mesh creation.

◆ getNumSubEntities()

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

Retrieves the number of SubEntity objects making up this entity.

Deprecated:
use getSubEntities()

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

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

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.

◆ setMaterial()

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

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.

◆ _releaseManualHardwareResources()

void Ogre::Entity::_releaseManualHardwareResources ( )
overridevirtual

Notifies the movable object that hardware resources were lost.

Remarks
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 ( )
overridevirtual

Notifies the movable object that hardware resources should be restored.

Remarks
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)
overridevirtual

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

Remarks
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)
overridevirtual

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

Remarks
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
queueIDEnumerated 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 
)
overridevirtual

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

Remarks
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
queueIDEnumerated value of the queue group to use. See the enum RenderQueueGroupID for what kind of values can be used here.
priorityThe priority within a group to use.

Reimplemented from Ogre::MovableObject.

◆ getBoundingBox()

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

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

Remarks
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)
overridevirtual

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

Remarks
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
overridevirtual

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.

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.

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

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

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

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

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

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

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

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

Remarks
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
boneNameThe name of the bone (in the skeleton) to attach this object
pMovablePointer to the object to attach
offsetOrientationAn adjustment to the orientation of the attached object, relative to the bone.
offsetPositionAn adjustment to the position of the attached object, relative to the bone.
Returns
The TagPoint to which the object has been attached

◆ 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
movableNameThe name of the movable object to be detached.

◆ detachObjectFromBone() [2/2]

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

Detaches an object by pointer.

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

◆ detachAllObjectsFromBone()

void Ogre::Entity::detachAllObjectsFromBone ( void  )

Detach all MovableObjects previously attached using attachObjectToBone.

◆ getAttachedObjectIterator()

ChildObjectListIterator Ogre::Entity::getAttachedObjectIterator ( void  )

◆ 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
overridevirtual

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
overridevirtual

Retrieves the axis-aligned bounding box for this object in world coordinates.

Reimplemented from Ogre::MovableObject.

◆ getWorldBoundingSphere()

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

Retrieves the worldspace bounding sphere for this object.

Reimplemented from Ogre::MovableObject.

◆ getEdgeList()

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

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

Implements Ogre::ShadowCaster.

◆ getShadowVolumeRenderableList()

const ShadowRenderableList& Ogre::Entity::getShadowVolumeRenderableList ( ShadowTechnique  shadowTechnique,
const Light light,
HardwareIndexBufferSharedPtr indexBuffer,
size_t *  indexBufferUsedSize,
bool  extrudeVertices,
Real  extrusionDistance,
unsigned long  flags = 0 
)
overridevirtual

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

Remarks
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
shadowTechniqueThe technique being used to generate the shadow.
lightThe light to generate the shadow from.
indexBufferThe index buffer to build the renderables into, the current contents are assumed to be disposable.
indexBufferUsedSizeIf 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.
extrudeVerticesIf true, this means this class should extrude the vertices of the back of the volume in software. If false, it will not be done (a vertex program is assumed).
extrusionDistanceThe distance to extrude the shadow volume.
flagsTechnique-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.

Remarks
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 
)
overridevirtual

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.

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

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

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

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

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

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

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

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

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

◆ _getSkelAnimTempBufferInfo()

TempBlendedBufferInfo* Ogre::Entity::_getSkelAnimTempBufferInfo ( void  )

Advanced method to get the temp buffer information for software skeletal animation.

◆ _getVertexAnimTempBufferInfo()

TempBlendedBufferInfo* Ogre::Entity::_getVertexAnimTempBufferInfo ( void  )

Advanced method to get the temp buffer information for software morph animation.

◆ getTypeFlags()

uint32 Ogre::Entity::getTypeFlags ( void  ) const
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?

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

Remarks
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
forceReinitialiseIf 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)
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 
)
overridevirtual

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

Remarks
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: