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

Ogre::SubEntity Class Reference

Utility class which defines the sub-parts of an Entity. More...

#include <OgreSubEntity.h>

Inheritance diagram for Ogre::SubEntity:

Ogre::Renderable List of all members.

Public Methods

const StringgetMaterialName () const
 Gets the name of the Material in use by this instance. More...

void setMaterialName (const String &name)
 Sets the name of the Material to be used. More...

SubMeshgetSubMesh (void)
 Accessor method to read mesh data. More...

MaterialgetMaterial (void) const
 Overridden - see Renderable. More...

void getRenderOperation (RenderOperation &rend)
 Overridden - see Renderable. More...

void getWorldTransforms (Matrix4 *xform)
 Overridden - see Renderable. More...

unsigned short getNumWorldTransforms (void)
 Overridden - see Renderable. More...

Real getSquaredViewDepth (const Camera *cam) const
 Overridden, see Renderable. More...

void setRenderDetail (SceneDetailLevel renderDetail)
 Sets the rendering level (solid, wireframe) of this SubEntity. More...

SceneDetailLevel getRenderDetail ()
 Overridden, see Renderable. More...

virtual bool useIdentityProjection (void)
 Returns whether or not to use an 'identity' projection. More...

virtual bool useIdentityView (void)
 Returns whether or not to use an 'identity' projection. More...


Private Methods

 SubEntity ()
 Private constructor - don't allow creation by anybody else. More...

virtual ~SubEntity ()
 Private destructor. More...


Private Attributes

EntitymParentEntity
 Pointer to parent. More...

String mMaterialName
 Name of Material in use by this SubEntity. More...

MaterialmpMaterial
 Cached pointer to material. More...

SubMeshmSubMesh
SceneDetailLevel mRenderDetail

Friends

class Entity
class SceneManager

Detailed Description

Utility class which defines the sub-parts of an Entity.

Remarks:
Just as meshes are split into submeshes, an Entity is made up of potentially multiple SubMeshes. These are mainly here to provide the link between the Material which the SubEntity uses (which may be the default Material for the SubMesh or may have been changed for this object) and the SubMesh data.

The SubEntity also allows the application some flexibility in the material properties for this section of a particular instance of this Mesh, e.g. tinting the windows on a car model.

SubEntity instances are never created manually. They are created at the same time as their parent Entity by the SceneManager method createEntity.


Constructor & Destructor Documentation

Ogre::SubEntity::SubEntity   [private]
 

Private constructor - don't allow creation by anybody else.

virtual Ogre::SubEntity::~SubEntity   [inline, private, virtual]
 

Private destructor.


Member Function Documentation

Material * Ogre::SubEntity::getMaterial void    const [virtual]
 

Overridden - see Renderable.

Implements Ogre::Renderable.

const String & Ogre::SubEntity::getMaterialName   const
 

Gets the name of the Material in use by this instance.

unsigned short Ogre::SubEntity::getNumWorldTransforms void    [virtual]
 

Overridden - see Renderable.

Reimplemented from Ogre::Renderable.

SceneDetailLevel Ogre::SubEntity::getRenderDetail   [inline, virtual]
 

Overridden, see Renderable.

Reimplemented from Ogre::Renderable.

void Ogre::SubEntity::getRenderOperation RenderOperation   rend [virtual]
 

Overridden - see Renderable.

Implements Ogre::Renderable.

Real Ogre::SubEntity::getSquaredViewDepth const Camera   cam const [virtual]
 

Overridden, see Renderable.

Implements Ogre::Renderable.

SubMesh * Ogre::SubEntity::getSubMesh void   
 

Accessor method to read mesh data.

void Ogre::SubEntity::getWorldTransforms Matrix4   xform [virtual]
 

Overridden - see Renderable.

Implements Ogre::Renderable.

void Ogre::SubEntity::setMaterialName const String   name
 

Sets the name of the Material to be used.

Remarks:
By default a SubEntity uses the default Material that the SubMesh uses. This call can alter that so that the Material is different for this instance.

void Ogre::SubEntity::setRenderDetail SceneDetailLevel    renderDetail [inline]
 

Sets the rendering level (solid, wireframe) of this SubEntity.

virtual bool Ogre::Renderable::useIdentityProjection void    [inline, virtual, inherited]
 

Returns whether or not to use an 'identity' projection.

Remarks:
Usually Renderable objects will use a projection matrix as determined by the active camera. However, if they want they can cancel this out and use an identity projection, which effectively projects in 2D using a {-1, 1} view space. Useful for overlay rendering. Normal renderables need not override this.

Reimplemented in Ogre::GuiElement.

virtual bool Ogre::Renderable::useIdentityView void    [inline, virtual, inherited]
 

Returns whether or not to use an 'identity' projection.

Remarks:
Usually Renderable objects will use a view matrix as determined by the active camera. However, if they want they can cancel this out and use an identity matrix, which means all geometry is assumed to be relative to camera space already. Useful for overlay rendering. Normal renderables need not override this.

Reimplemented in Ogre::GuiElement.


Friends And Related Function Documentation

friend class Entity [friend]
 

friend class SceneManager [friend]
 


Member Data Documentation

String Ogre::SubEntity::mMaterialName [private]
 

Name of Material in use by this SubEntity.

Entity* Ogre::SubEntity::mParentEntity [private]
 

Pointer to parent.

Material* Ogre::SubEntity::mpMaterial [private]
 

Cached pointer to material.

SceneDetailLevel Ogre::SubEntity::mRenderDetail [private]
 

SubMesh* Ogre::SubEntity::mSubMesh [private]
 

Copyright © 2002 by The OGRE Team