Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

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:

Inheritance graph
[legend]
Collaboration diagram for Ogre::Entity:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::map< String,
MovableObject * > 
ChildObjectList
 Contains the child objects (attached to bones) indexed by name.

typedef MapIterator< ChildObjectListChildObjectListIterator

Public Methods

 ~Entity ()
 Default destructor.

MeshgetMesh (void)
 Gets the Mesh that this Entity is based on.

SubEntitygetSubEntity (unsigned int index)
 Gets a pointer to a SubEntity, ie a part of an Entity.

SubEntitygetSubEntity (const String &name)
 Gets a pointer to a SubEntity by name.

unsigned int getNumSubEntities (void) const
 Retrieves the number of SubEntity objects making up this entity.

Entity * clone (const String &newName)
 Clones this entity and returns a pointer to the clone.

void setMaterialName (const String &name)
 Sets the material to use for the whole of this entity.

void _notifyCurrentCamera (Camera *cam)
 Overridden - see MovableObject.

const AxisAlignedBoxgetBoundingBox (void) const
 Overridden - see MovableObject.

AxisAlignedBox getChildObjectsBoundingBox (void) const
 merge all the child object Bounds a return it

void _updateRenderQueue (RenderQueue *queue)
 Overridden - see MovableObject.

const StringgetName (void) const
 Overridden from MovableObject.

const StringgetMovableType (void) const
 Overridden from MovableObject.

AnimationStategetAnimationState (const String &name)
 For entities based on animated meshes, gets the AnimationState object for a single animation.

AnimationStateSetgetAllAnimationStates (void)
 For entities based on animated meshes, gets the AnimationState objects for all animations.

void setDisplaySkeleton (bool display)
 Tells the Entity whether or not it should display it's skeleton, if it has one.

void setMeshLodBias (Real factor, ushort maxDetailIndex=0, ushort minDetailIndex=99)
 Sets a level-of-detail bias for the mesh detail 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 setRenderDetail (SceneDetailLevel renderDetail)
 Sets the rendering detail of this entire entity (solid, wireframe etc).

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

MovableObjectdetachObjectFromBone (const String &movableName)
 detach a MovableObject previously attached using attachObjectToBone

ChildObjectListIterator getAttachedObjectIterator (void)
 Gets an iterator to the list of objects attached to bones on this entity.

Real getBoundingRadius (void) const
void setNormaliseNormals (bool normalise)
 If set to true, this forces normals of this entity to be normalised dynamically by the hardware.

bool getNormaliseNormals (void) const
 Returns true if this entity has auto-normalisation of normals set.

virtual NodegetParentNode (void) const
 Returns the node to which this object is attached.

virtual void _notifyAttached (Node *parent, bool isTagPoint=false)
 Internal method called to notify the object that it has been attached to a node.

virtual bool isAttached (void) const
 Returns true if this object is attached to a SceneNode or TagPoint.

virtual const AxisAlignedBoxgetWorldBoundingBox (bool derive=false) const
 Retrieves the axis-aligned bounding box for this object in world coordinates.

virtual const SpheregetWorldBoundingSphere (bool derive=false) const
 Retrieves the worldspace bounding sphere for this object.

virtual void setVisible (bool visible)
 Tells this object whether to be visible or not, if it has a renderable component.

virtual bool isVisible (void) const
 Returns whether or not this object is supposed to be visible or not.

virtual void setUserObject (UserDefinedObject *obj)
 Call this to associate your own custom user object instance with this MovableObject.

virtual UserDefinedObjectgetUserObject (void)
 Retrieves a pointer to a custom application object associated with this movable by an earlier call to setUserObject.

virtual void setRenderQueueGroup (RenderQueueGroupID queueID)
 Sets the render queue group this entity will be rendered through.

virtual RenderQueueGroupID getRenderQueueGroup (void) const
 Gets the queue group for this entity, see setRenderQueueGroup for full details.

virtual Matrix4 _getParentNodeFullTransform (void) const
 return the full transformation of the parent sceneNode or the attachingPoint node

virtual void setQueryFlags (unsigned long flags)
 Sets the query flags for this object.

virtual void addQueryFlags (unsigned long flags)
 As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object.

virtual void removeQueryFlags (unsigned long flags)
 As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object.

virtual unsigned long getQueryFlags (void) const
 Returns the query flags relevant for this object.


Protected Attributes

ChildObjectList mChildObjectList
AxisAlignedBoxmFullBoundingBox
 Bounding box that 'contains' all the mesh of each child entity.

bool mNormaliseNormals
NodemParentNode
 node to which this object is attached

bool mParentIsTagPoint
bool mVisible
 Is this object visible?

UserDefinedObjectmUserObject
 User defined object which is linked to this object.

RenderQueueGroupID mRenderQueueID
 The render queue to use when rendering this object.

unsigned long mQueryFlags
 Flags determining whether this object is included / excluded from scene queries.

AxisAlignedBox mWorldAABB
 Cached world AABB of this object.

Sphere mWorldBoundingSphere

Private Types

typedef std::vector< SubEntity * > SubEntityList
 List of SubEntities (point to SubMeshes).

typedef std::vector< SubEntityList * > LODSubEntityList
 List of SubEntity lists (for manual LODs).


Private Methods

 Entity ()
 Private constructor (instances cannot be created directly).

 Entity (const String &name, Mesh *mesh, SceneManager *creator)
 Private constructor - specify name (the usual constructor used).

void cacheBoneMatrices (void)
 Private method to cache bone matrices from skeleton.

void buildSubEntityList (Mesh *mesh, SubEntityList *sublist)
 Builds a list of SubEntities based on the SubMeshes contained in the Mesh.

void attachObjectImpl (MovableObject *pMovable, TagPoint *pAttachingPoint)
 internal implementation of attaching a 'child' object to this entity and assign the parent node to the child entity


Private Attributes

String mName
 Name of the entity; used for location in the scene.

MeshmMesh
 The Mesh that this Entity is based on.

SubEntityList mSubEntityList
SceneManagermCreatorSceneManager
 Pointer back to the SceneManager that created this instance, for notification purposes.

AnimationStateSet mAnimationState
 State of animation for animable meshes.

Matrix4mBoneMatrices
 Cached bone matrices, including any world transform.

unsigned short mNumBoneMatrices
bool mDisplaySkeleton
 Flag determines whether or not to display skeleton.

ushort mMeshLodIndex
 The LOD number of the mesh to use, calculated by _notifyCurrentCamera.

Real mMeshLodFactorInv
 LOD bias factor, inverted for optimisation when calculating adjusted depth.

ushort mMinMeshLodIndex
 Index of minimum detail LOD (NB higher index is lower detail).

ushort mMaxMeshLodIndex
 Index of maximum detail LOD (NB lower index is higher detail).

Real mMaterialLodFactorInv
 LOD bias factor, inverted for optimisation when calculating adjusted depth.

ushort mMinMaterialLodIndex
 Index of minimum detail LOD (NB higher index is lower detail).

ushort mMaxMaterialLodIndex
 Index of maximum detail LOD (NB lower index is higher detail).

bool mUsingManualLOD
 Flag indicating that mesh uses manual LOD and so might have multiple SubEntity versions.

LODSubEntityList mLodSubEntityList

Static Private Attributes

String msMovableType = "Entity"
 Shared class-level name for Movable type.


Friends

class SceneManager
class SubEntity

Detailed Description

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

Remarks:
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 attachEntity method. See the SceneNode class for full information.

Note:
No functions were declared virtual to improve performance.

Definition at line 70 of file OgreEntity.h.


Member Typedef Documentation

typedef std::map<String, MovableObject*> Ogre::Entity::ChildObjectList
 

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

Definition at line 155 of file OgreEntity.h.

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

Definition at line 324 of file OgreEntity.h.

Referenced by getAttachedObjectIterator().

typedef std::vector<SubEntityList*> Ogre::Entity::LODSubEntityList [private]
 

List of SubEntity lists (for manual LODs).

We don't know when the mesh is using manual LODs whether one LOD to the next will have the same number of SubMeshes, therefore we have to allow a SubEntity list with each alternate one.

Definition at line 144 of file OgreEntity.h.

typedef std::vector<SubEntity*> Ogre::Entity::SubEntityList [private]
 

List of SubEntities (point to SubMeshes).

Definition at line 94 of file OgreEntity.h.

Referenced by _updateRenderQueue(), and Entity().


Constructor & Destructor Documentation

Ogre::Entity::Entity   [private]
 

Private constructor (instances cannot be created directly).

Definition at line 43 of file OgreEntity.cpp.

References mFullBoundingBox, and mNormaliseNormals.

Ogre::Entity::Entity const String   name,
Mesh   mesh,
SceneManager   creator
[private]
 

Private constructor - specify name (the usual constructor used).

Definition at line 49 of file OgreEntity.cpp.

References Ogre::Mesh::_getNumBoneMatrices(), Ogre::Mesh::_initAnimationState(), buildSubEntityList(), Ogre::Mesh::getLodLevel(), Ogre::Mesh::getNumLodLevels(), Ogre::Mesh::hasSkeleton(), Ogre::Mesh::isLodManual(), mAnimationState, Ogre::Mesh::MeshLodUsage::manualMesh, mBoneMatrices, mDisplaySkeleton, mFullBoundingBox, mLodSubEntityList, mMaterialLodFactorInv, mMaxMaterialLodIndex, mMaxMeshLodIndex, mMeshLodFactorInv, mMeshLodIndex, mMinMaterialLodIndex, mMinMeshLodIndex, mNumBoneMatrices, mSubEntityList, SubEntityList, and Ogre::ushort.

Ogre::Entity::~Entity  
 

Default destructor.

Definition at line 103 of file OgreEntity.cpp.

References mBoneMatrices, mFullBoundingBox, mLodSubEntityList, and mSubEntityList.


Member Function Documentation

Matrix4 Ogre::MovableObject::_getParentNodeFullTransform void    const [virtual, inherited]
 

return the full transformation of the parent sceneNode or the attachingPoint node

Definition at line 92 of file OgreMovableObject.cpp.

References Ogre::Node::_getFullTransform(), and Ogre::MovableObject::mParentNode.

Referenced by cacheBoneMatrices(), Ogre::TagPoint::getParentEntityTransform(), Ogre::MovableObject::getWorldBoundingBox(), Ogre::SubEntity::getWorldTransforms(), and Ogre::BillboardSet::getWorldTransforms().

void Ogre::MovableObject::_notifyAttached Node   parent,
bool    isTagPoint = false
[virtual, inherited]
 

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

Definition at line 54 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mParentIsTagPoint, and Ogre::MovableObject::mParentNode.

Referenced by Ogre::SceneNode::attachObject(), attachObjectImpl(), Ogre::SceneNode::detachAllObjects(), Ogre::SceneNode::detachObject(), and Ogre::SceneNode::~SceneNode().

void Ogre::Entity::_notifyCurrentCamera Camera   cam [virtual]
 

Overridden - see MovableObject.

Implements Ogre::MovableObject.

Definition at line 190 of file OgreEntity.cpp.

References Ogre::Camera::_getLodBiasInverse(), Ogre::Mesh::getLodIndexSquaredDepth(), Ogre::Node::getSquaredViewDepth(), mChildObjectList, mMaterialLodFactorInv, mMaxMaterialLodIndex, mMaxMeshLodIndex, mMesh, mMeshLodFactorInv, mMeshLodIndex, mMinMaterialLodIndex, mMinMeshLodIndex, Ogre::MovableObject::mParentNode, mSubEntityList, and Ogre::Real.

void Ogre::Entity::_updateRenderQueue RenderQueue   queue [virtual]
 

Overridden - see MovableObject.

Implements Ogre::MovableObject.

Definition at line 275 of file OgreEntity.cpp.

References Ogre::RenderQueue::addRenderable(), cacheBoneMatrices(), Ogre::Skeleton::getBone(), Ogre::Skeleton::getNumBones(), Ogre::Mesh::getSkeleton(), Ogre::Mesh::hasSkeleton(), Ogre::Mesh::isLodManual(), mChildObjectList, mDisplaySkeleton, mLodSubEntityList, mMesh, mMeshLodIndex, Ogre::MovableObject::mRenderQueueID, mSubEntityList, RENDERABLE_DEFAULT_PRIORITY, and SubEntityList.

virtual void Ogre::MovableObject::addQueryFlags unsigned long    flags [virtual, inherited]
 

As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object.

Definition at line 168 of file OgreMovableObject.h.

void Ogre::Entity::attachObjectImpl MovableObject   pMovable,
TagPoint   pAttachingPoint
[private]
 

internal implementation of attaching a 'child' object to this entity and assign the parent node to the child entity

Definition at line 484 of file OgreEntity.cpp.

References Ogre::MovableObject::_notifyAttached(), Ogre::MovableObject::getName(), and mChildObjectList.

Referenced by attachObjectToBone().

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

Definition at line 457 of file OgreEntity.cpp.

References attachObjectImpl(), Ogre::Bone::createChildTagPoint(), Except, Ogre::Skeleton::getBone(), Ogre::Mesh::getSkeleton(), Ogre::Mesh::hasSkeleton(), Ogre::MovableObject::isAttached(), mMesh, Ogre::TagPoint::setChildObject(), and Ogre::TagPoint::setParentEntity().

void Ogre::Entity::buildSubEntityList Mesh   mesh,
SubEntityList   sublist
[private]
 

Builds a list of SubEntities based on the SubMeshes contained in the Mesh.

Definition at line 425 of file OgreEntity.cpp.

References Ogre::SubMesh::getMaterialName(), Ogre::Mesh::getNumSubMeshes(), Ogre::Mesh::getSubMesh(), Ogre::SubMesh::isMatInitialised(), Ogre::SubEntity::mParentEntity, Ogre::SubEntity::mSubMesh, Ogre::SubEntity::setMaterialName(), and SubEntity.

Referenced by Entity().

void Ogre::Entity::cacheBoneMatrices void    [private]
 

Private method to cache bone matrices from skeleton.

Definition at line 357 of file OgreEntity.cpp.

References Ogre::Mesh::_getBoneMatrices(), Ogre::Mesh::_getNumBoneMatrices(), Ogre::MovableObject::_getParentNodeFullTransform(), Ogre::Mesh::getLodLevel(), Ogre::Mesh::getSkeleton(), Ogre::Mesh::hasSkeleton(), Ogre::Mesh::isLodManual(), mAnimationState, mBoneMatrices, mMesh, mMeshLodIndex, mNumBoneMatrices, and Ogre::Skeleton::setCurrentEntity().

Referenced by _updateRenderQueue().

Entity * Ogre::Entity::clone const String   newName
 

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:
newName  Name for the new entity.

Definition at line 164 of file OgreEntity.cpp.

References Ogre::SceneManager::createEntity(), getMesh(), getName(), getSubEntity(), mAnimationState, mCreatorSceneManager, mSubEntityList, and Ogre::SubEntity::setMaterialName().

MovableObject * Ogre::Entity::detachObjectFromBone const String   movableName
 

detach a MovableObject previously attached using attachObjectToBone

Definition at line 491 of file OgreEntity.cpp.

References Except, and mChildObjectList.

AnimationStateSet * Ogre::Entity::getAllAnimationStates void   
 

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

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.

Definition at line 347 of file OgreEntity.cpp.

References Ogre::AnimationStateSet, and mAnimationState.

AnimationState * Ogre::Entity::getAnimationState const String   name
 

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

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

Definition at line 334 of file OgreEntity.cpp.

References Except, and mAnimationState.

Entity::ChildObjectListIterator Ogre::Entity::getAttachedObjectIterator void   
 

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

Definition at line 506 of file OgreEntity.cpp.

References ChildObjectListIterator, and mChildObjectList.

const AxisAlignedBox & Ogre::Entity::getBoundingBox void    const [virtual]
 

Overridden - see MovableObject.

Implements Ogre::MovableObject.

Definition at line 239 of file OgreEntity.cpp.

References Ogre::Node::_getDerivedScale(), Ogre::Mesh::getBounds(), getChildObjectsBoundingBox(), Ogre::AxisAlignedBox::merge(), mFullBoundingBox, mMesh, Ogre::MovableObject::mParentNode, and Ogre::AxisAlignedBox::scale().

Real Ogre::Entity::getBoundingRadius void    const [virtual]
 

See also:
MovableObject::getBoundingRadius

Implements Ogre::MovableObject.

Definition at line 511 of file OgreEntity.cpp.

References Ogre::Node::_getDerivedScale(), Ogre::Mesh::getBoundingSphereRadius(), mMesh, Ogre::MovableObject::mParentNode, Ogre::Real, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

AxisAlignedBox Ogre::Entity::getChildObjectsBoundingBox void    const
 

merge all the child object Bounds a return it

Definition at line 254 of file OgreEntity.cpp.

References Ogre::TagPoint::_getFullLocalTransform(), mChildObjectList, Ogre::AxisAlignedBox::merge(), Ogre::AxisAlignedBox::setNull(), and Ogre::AxisAlignedBox::transform().

Referenced by getBoundingBox().

Mesh * Ogre::Entity::getMesh void   
 

Gets the Mesh that this Entity is based on.

Definition at line 134 of file OgreEntity.cpp.

References mMesh.

Referenced by clone().

const String & Ogre::Entity::getMovableType void    const [virtual]
 

Overridden from MovableObject.

Implements Ogre::MovableObject.

Definition at line 352 of file OgreEntity.cpp.

References msMovableType.

const String & Ogre::Entity::getName void    const [virtual]
 

Overridden from MovableObject.

Implements Ogre::MovableObject.

Definition at line 139 of file OgreEntity.cpp.

References mName.

Referenced by clone(), and Ogre::SubEntity::setMaterialName().

bool Ogre::Entity::getNormaliseNormals void    const
 

Returns true if this entity has auto-normalisation of normals set.

Definition at line 340 of file OgreEntity.h.

unsigned int Ogre::Entity::getNumSubEntities void    const
 

Retrieves the number of SubEntity objects making up this entity.

Definition at line 159 of file OgreEntity.cpp.

References mSubEntityList.

Node * Ogre::MovableObject::getParentNode void    const [virtual, inherited]
 

Returns the node to which this object is attached.

Remarks:
An object is not visible in the scene unless attached to a SceneNode.

Attaching an object is done via the SceneNode::attachObject method.

Definition at line 60 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mParentNode.

Referenced by Ogre::TagPoint::_updateFromParent(), Ogre::BspIntersectionSceneQuery::execute(), Ogre::TagPoint::getLights(), Ogre::SubEntity::getLights(), Ogre::SubEntity::getSquaredViewDepth(), Ogre::TagPoint::needUpdate(), and Ogre::BspSceneManager::processVisibleLeaf().

virtual unsigned long Ogre::MovableObject::getQueryFlags void    const [virtual, inherited]
 

Returns the query flags relevant for this object.

Definition at line 175 of file OgreMovableObject.h.

Referenced by Ogre::BspIntersectionSceneQuery::execute().

RenderQueueGroupID Ogre::MovableObject::getRenderQueueGroup void    const [virtual, inherited]
 

Gets the queue group for this entity, see setRenderQueueGroup for full details.

Definition at line 87 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mRenderQueueID, and Ogre::RenderQueueGroupID.

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

Gets a pointer to a SubEntity by name.

Remarks:
- names should be initialized during a Mesh creation.

Definition at line 153 of file OgreEntity.cpp.

References Ogre::Mesh::_getSubMeshIndex(), getSubEntity(), mMesh, and Ogre::ushort.

SubEntity * Ogre::Entity::getSubEntity unsigned int    index
 

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

Definition at line 144 of file OgreEntity.cpp.

References Except, and mSubEntityList.

Referenced by Ogre::SceneManager::_queueSkiesForRendering(), clone(), and getSubEntity().

virtual UserDefinedObject* Ogre::MovableObject::getUserObject void    [virtual, inherited]
 

Retrieves a pointer to a custom application object associated with this movable by an earlier call to setUserObject.

Definition at line 136 of file OgreMovableObject.h.

const AxisAlignedBox & Ogre::MovableObject::getWorldBoundingBox bool    derive = false const [virtual, inherited]
 

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

Definition at line 104 of file OgreMovableObject.cpp.

References Ogre::MovableObject::_getParentNodeFullTransform(), Ogre::MovableObject::getBoundingBox(), Ogre::MovableObject::mWorldAABB, and Ogre::AxisAlignedBox::transform().

Referenced by Ogre::BspIntersectionSceneQuery::execute(), and Ogre::BspSceneManager::processVisibleLeaf().

const Sphere & Ogre::MovableObject::getWorldBoundingSphere bool    derive = false const [virtual, inherited]
 

Retrieves the worldspace bounding sphere for this object.

Definition at line 116 of file OgreMovableObject.cpp.

References Ogre::Node::_getDerivedPosition(), Ogre::MovableObject::getBoundingRadius(), Ogre::MovableObject::mParentNode, Ogre::MovableObject::mWorldBoundingSphere, Ogre::Sphere::setCenter(), and Ogre::Sphere::setRadius().

bool Ogre::MovableObject::isAttached void    const [virtual, inherited]
 

Returns true if this object is attached to a SceneNode or TagPoint.

Definition at line 65 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mParentNode.

Referenced by attachObjectToBone().

bool Ogre::MovableObject::isVisible void    const [virtual, inherited]
 

Returns whether or not this object is supposed to be visible or not.

Definition at line 76 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mVisible.

Referenced by Ogre::OctreeNode::_addToRenderQueue(), Ogre::SceneManager::_populateLightList(), and Ogre::BspSceneManager::processVisibleLeaf().

virtual void Ogre::MovableObject::removeQueryFlags unsigned long    flags [virtual, inherited]
 

As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object.

Definition at line 172 of file OgreMovableObject.h.

void Ogre::Entity::setDisplaySkeleton bool    display
 

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

Definition at line 402 of file OgreEntity.cpp.

References mDisplaySkeleton.

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

Definition at line 416 of file OgreEntity.cpp.

References mMaterialLodFactorInv, mMaxMaterialLodIndex, mMinMaterialLodIndex, Ogre::Real, and Ogre::ushort.

void Ogre::Entity::setMaterialName const String   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.

Definition at line 179 of file OgreEntity.cpp.

References mSubEntityList.

Referenced by Ogre::SceneManager::setSkyBox(), Ogre::SceneManager::setSkyDome(), and Ogre::SceneManager::setSkyPlane().

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

Definition at line 407 of file OgreEntity.cpp.

References mMaxMeshLodIndex, mMeshLodFactorInv, mMinMeshLodIndex, Ogre::Real, and Ogre::ushort.

void Ogre::Entity::setNormaliseNormals bool    normalise
 

If set to true, this forces normals of this entity to be normalised dynamically by the hardware.

Remarks:
This option can be used to prevent lighting variations when scaling an Entity using a SceneNode - normally because this scaling is hardware based, the normals get scaled too which causes lighting to become inconsistent. However, this has an overhead so only do this if you really need to.

Definition at line 337 of file OgreEntity.h.

virtual void Ogre::MovableObject::setQueryFlags unsigned long    flags [virtual, inherited]
 

Sets the query flags for this object.

Remarks:
When performing a scene query, this object will be included or excluded according to flags on the object and flags on the query. This is a bitwise value, so only when a bit on these flags is set, will it be included in a query asking for that flag. The meaning of the bits is application-specific.

Definition at line 164 of file OgreMovableObject.h.

void Ogre::Entity::setRenderDetail SceneDetailLevel    renderDetail
 

Sets the rendering detail of this entire entity (solid, wireframe etc).

Definition at line 445 of file OgreEntity.cpp.

References mSubEntityList, and Ogre::SceneDetailLevel.

void Ogre::MovableObject::setRenderQueueGroup RenderQueueGroupID    queueID [virtual, inherited]
 

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

Definition at line 82 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mRenderQueueID, and Ogre::RenderQueueGroupID.

virtual void Ogre::MovableObject::setUserObject UserDefinedObject   obj [virtual, inherited]
 

Call this to associate your own custom user object instance with this MovableObject.

Remarks:
By simply making your game / application object a subclass of UserDefinedObject, you can establish a link between an OGRE instance of MovableObject and your own application classes. Call this method to establish the link.

Definition at line 132 of file OgreMovableObject.h.

void Ogre::MovableObject::setVisible bool    visible [virtual, inherited]
 

Tells this object whether to be visible or not, if it has a renderable component.

Reimplemented in Ogre::Light.

Definition at line 71 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mVisible.


Friends And Related Function Documentation

friend class SceneManager [friend]
 

Definition at line 73 of file OgreEntity.h.

friend class SubEntity [friend]
 

Definition at line 74 of file OgreEntity.h.

Referenced by buildSubEntityList().


Member Data Documentation

AnimationStateSet Ogre::Entity::mAnimationState [private]
 

State of animation for animable meshes.

Definition at line 104 of file OgreEntity.h.

Referenced by cacheBoneMatrices(), clone(), Entity(), getAllAnimationStates(), and getAnimationState().

Matrix4* Ogre::Entity::mBoneMatrices [private]
 

Cached bone matrices, including any world transform.

Definition at line 111 of file OgreEntity.h.

Referenced by cacheBoneMatrices(), Entity(), Ogre::SubEntity::getWorldTransforms(), and ~Entity().

ChildObjectList Ogre::Entity::mChildObjectList [protected]
 

Definition at line 157 of file OgreEntity.h.

Referenced by _notifyCurrentCamera(), _updateRenderQueue(), attachObjectImpl(), detachObjectFromBone(), getAttachedObjectIterator(), and getChildObjectsBoundingBox().

SceneManager* Ogre::Entity::mCreatorSceneManager [private]
 

Pointer back to the SceneManager that created this instance, for notification purposes.

Definition at line 100 of file OgreEntity.h.

Referenced by clone().

bool Ogre::Entity::mDisplaySkeleton [private]
 

Flag determines whether or not to display skeleton.

Definition at line 118 of file OgreEntity.h.

Referenced by _updateRenderQueue(), Entity(), and setDisplaySkeleton().

AxisAlignedBox* Ogre::Entity::mFullBoundingBox [protected]
 

Bounding box that 'contains' all the mesh of each child entity.

Definition at line 161 of file OgreEntity.h.

Referenced by Entity(), getBoundingBox(), and ~Entity().

LODSubEntityList Ogre::Entity::mLodSubEntityList [private]
 

Definition at line 145 of file OgreEntity.h.

Referenced by _updateRenderQueue(), Entity(), and ~Entity().

Real Ogre::Entity::mMaterialLodFactorInv [private]
 

LOD bias factor, inverted for optimisation when calculating adjusted depth.

Definition at line 132 of file OgreEntity.h.

Referenced by _notifyCurrentCamera(), Entity(), and setMaterialLodBias().

ushort Ogre::Entity::mMaxMaterialLodIndex [private]
 

Index of maximum detail LOD (NB lower index is higher detail).

Definition at line 136 of file OgreEntity.h.

Referenced by _notifyCurrentCamera(), Entity(), and setMaterialLodBias().

ushort Ogre::Entity::mMaxMeshLodIndex [private]
 

Index of maximum detail LOD (NB lower index is higher detail).

Definition at line 129 of file OgreEntity.h.

Referenced by _notifyCurrentCamera(), Entity(), and setMeshLodBias().

Mesh* Ogre::Entity::mMesh [private]
 

The Mesh that this Entity is based on.

Definition at line 90 of file OgreEntity.h.

Referenced by _notifyCurrentCamera(), _updateRenderQueue(), attachObjectToBone(), cacheBoneMatrices(), getBoundingBox(), getBoundingRadius(), getMesh(), and getSubEntity().

Real Ogre::Entity::mMeshLodFactorInv [private]
 

LOD bias factor, inverted for optimisation when calculating adjusted depth.

Definition at line 125 of file OgreEntity.h.

Referenced by _notifyCurrentCamera(), Entity(), and setMeshLodBias().

ushort Ogre::Entity::mMeshLodIndex [private]
 

The LOD number of the mesh to use, calculated by _notifyCurrentCamera.

Definition at line 122 of file OgreEntity.h.

Referenced by _notifyCurrentCamera(), _updateRenderQueue(), cacheBoneMatrices(), Entity(), and Ogre::SubEntity::getRenderOperation().

ushort Ogre::Entity::mMinMaterialLodIndex [private]
 

Index of minimum detail LOD (NB higher index is lower detail).

Definition at line 134 of file OgreEntity.h.

Referenced by _notifyCurrentCamera(), Entity(), and setMaterialLodBias().

ushort Ogre::Entity::mMinMeshLodIndex [private]
 

Index of minimum detail LOD (NB higher index is lower detail).

Definition at line 127 of file OgreEntity.h.

Referenced by _notifyCurrentCamera(), Entity(), and setMeshLodBias().

String Ogre::Entity::mName [private]
 

Name of the entity; used for location in the scene.

Definition at line 86 of file OgreEntity.h.

Referenced by getName().

bool Ogre::Entity::mNormaliseNormals [protected]
 

Definition at line 163 of file OgreEntity.h.

Referenced by Entity(), and Ogre::SubEntity::getNormaliseNormals().

unsigned short Ogre::Entity::mNumBoneMatrices [private]
 

Definition at line 112 of file OgreEntity.h.

Referenced by cacheBoneMatrices(), Entity(), Ogre::SubEntity::getNumWorldTransforms(), and Ogre::SubEntity::getWorldTransforms().

bool Ogre::MovableObject::mParentIsTagPoint [protected, inherited]
 

Definition at line 48 of file OgreMovableObject.h.

Referenced by Ogre::MovableObject::_notifyAttached(), Ogre::MovableObject::MovableObject(), and Ogre::MovableObject::~MovableObject().

Node* Ogre::MovableObject::mParentNode [protected, inherited]
 

node to which this object is attached

Definition at line 47 of file OgreMovableObject.h.

Referenced by Ogre::MovableObject::_getParentNodeFullTransform(), Ogre::MovableObject::_notifyAttached(), _notifyCurrentCamera(), Ogre::ParticleSystem::_triggerEmitters(), Ogre::ParticleSystem::_updateBounds(), Ogre::BillboardSet::_updateBounds(), Ogre::Camera::Camera(), Ogre::Frustum::Frustum(), Ogre::BillboardSet::genBillboardAxes(), getBoundingBox(), getBoundingRadius(), Ogre::TerrainRenderable::getLights(), Ogre::SimpleRenderable::getLights(), Ogre::BillboardSet::getLights(), Ogre::MovableObject::getParentNode(), Ogre::Frustum::getSquaredViewDepth(), Ogre::BillboardSet::getSquaredViewDepth(), Ogre::MovableObject::getWorldBoundingSphere(), Ogre::TerrainRenderable::getWorldOrientation(), Ogre::SubEntity::getWorldOrientation(), Ogre::SimpleRenderable::getWorldOrientation(), Ogre::ParticleSystem::getWorldOrientation(), Ogre::Frustum::getWorldOrientation(), Ogre::BillboardSet::getWorldOrientation(), Ogre::TerrainRenderable::getWorldPosition(), Ogre::SubEntity::getWorldPosition(), Ogre::SimpleRenderable::getWorldPosition(), Ogre::ParticleSystem::getWorldPosition(), Ogre::Frustum::getWorldPosition(), Ogre::BillboardSet::getWorldPosition(), Ogre::TerrainRenderable::getWorldTransforms(), Ogre::SimpleRenderable::getWorldTransforms(), Ogre::Frustum::getWorldTransforms(), Ogre::MovableObject::isAttached(), Ogre::Frustum::isViewOutOfDate(), Ogre::Camera::isViewOutOfDate(), Ogre::Light::Light(), Ogre::MovableObject::MovableObject(), Ogre::SimpleRenderable::SimpleRenderable(), Ogre::Light::update(), and Ogre::MovableObject::~MovableObject().

unsigned long Ogre::MovableObject::mQueryFlags [protected, inherited]
 

Flags determining whether this object is included / excluded from scene queries.

Definition at line 56 of file OgreMovableObject.h.

Referenced by Ogre::MovableObject::MovableObject().

RenderQueueGroupID Ogre::MovableObject::mRenderQueueID [protected, inherited]
 

The render queue to use when rendering this object.

Definition at line 54 of file OgreMovableObject.h.

Referenced by _updateRenderQueue(), Ogre::BillboardSet::_updateRenderQueue(), Ogre::MovableObject::getRenderQueueGroup(), Ogre::MovableObject::MovableObject(), and Ogre::MovableObject::setRenderQueueGroup().

String Ogre::Entity::msMovableType = "Entity" [static, private]
 

Shared class-level name for Movable type.

Definition at line 41 of file OgreEntity.cpp.

Referenced by getMovableType().

SubEntityList Ogre::Entity::mSubEntityList [private]
 

Definition at line 95 of file OgreEntity.h.

Referenced by _notifyCurrentCamera(), _updateRenderQueue(), clone(), Entity(), getNumSubEntities(), getSubEntity(), setMaterialName(), setRenderDetail(), and ~Entity().

UserDefinedObject* Ogre::MovableObject::mUserObject [protected, inherited]
 

User defined object which is linked to this object.

Definition at line 52 of file OgreMovableObject.h.

Referenced by Ogre::MovableObject::MovableObject().

bool Ogre::Entity::mUsingManualLOD [private]
 

Flag indicating that mesh uses manual LOD and so might have multiple SubEntity versions.

Definition at line 139 of file OgreEntity.h.

bool Ogre::MovableObject::mVisible [protected, inherited]
 

Is this object visible?

Definition at line 50 of file OgreMovableObject.h.

Referenced by Ogre::Frustum::Frustum(), Ogre::MovableObject::isVisible(), Ogre::MovableObject::MovableObject(), and Ogre::MovableObject::setVisible().

AxisAlignedBox Ogre::MovableObject::mWorldAABB [protected, inherited]
 

Cached world AABB of this object.

Definition at line 58 of file OgreMovableObject.h.

Referenced by Ogre::MovableObject::getWorldBoundingBox(), and Ogre::MovableObject::MovableObject().

Sphere Ogre::MovableObject::mWorldBoundingSphere [protected, inherited]
 

Definition at line 60 of file OgreMovableObject.h.

Referenced by Ogre::MovableObject::getWorldBoundingSphere().


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

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:17:19 2004