Eidolon
Classes | Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
OgreBaseRenderable Class Reference

#include <OgreRenderTypes.h>

Inheritance diagram for OgreBaseRenderable:
Inheritance graph
Collaboration diagram for OgreBaseRenderable:
Collaboration graph

Classes

struct  Vertex
 Fixed definition of a vertex used in the renderer. More...
 

Public Member Functions

 OgreBaseRenderable (const std::string &name, const std::string &matname, Ogre::RenderOperation::OperationType opType, Ogre::SceneManager *mgr) throw (RenderException)
 
virtual ~OgreBaseRenderable ()
 
void setParentObjects (Figure *parent, OgreRenderScene *scene)
 
void setDepthSorting (bool val)
 
MutexgetMutex ()
 
virtual void createBuffers (size_t numVerts, size_t numInds, bool deferCreate=false)
 Create the hardware buffers with the given number of vertices and indices (NOTE: must be executed in renderer thread) More...
 
virtual void destroyBuffers ()
 Delete the hardware and local buffers (NOTE: must be executed in renderer thread) More...
 
virtual void _updateRenderQueue (Ogre::RenderQueue *queue)
 
virtual void getRenderOperation (Ogre::RenderOperation &op)
 
virtual void _notifyCurrentCamera (Ogre::Camera *cam)
 
VertexgetLocalVertBuff ()
 Get (and allocate if needed) the local memory vertex buffer of the same size as the hardware buffer. More...
 
indexvalgetLocalIndBuff ()
 Get (and allocate if needed) the local memory index buffer of the same size as the hardware buffer. More...
 
void commitBuffers (bool commitVert=true, bool commitInd=true)
 Copy the local buffers to the hardware buffers (NOTE: must be executed in renderer thread) More...
 
void commitMatrices (const Matrix< Vertex > *verts, const IndexMatrix *inds)
 Copy the data from matrices to the hardware buffers (NOTE: must be executed in renderer thread) More...
 
void deleteLocalVertBuff ()
 
void deleteLocalIndBuff ()
 
void fillDefaultData (bool deferFill=false)
 
size_t numVertices () const
 
size_t numIndices () const
 
Ogre::RenderOperation::OperationType opType () const
 
Ogre::HardwareVertexBufferSharedPtr getVertexBuffer () const
 
Ogre::HardwareIndexBufferSharedPtr getIndexBuffer () const
 
virtual const Ogre::MaterialPtr & getMaterial () const
 
virtual void setMaterial (const Ogre::MaterialPtr &m)
 
virtual void setMaterial (const std::string &m) throw (RenderException)
 
virtual void getWorldTransforms (Ogre::Matrix4 *xform) const
 
virtual Ogre::Real getSquaredViewDepth (const Ogre::Camera *cam) const
 
virtual const Ogre::LightList & getLights () const
 
virtual const Ogre::String & getMovableType () const
 
virtual const Ogre::AxisAlignedBox & getBoundingBox () const
 
virtual Ogre::Real getBoundingRadius () const
 
virtual void setBoundingBox (vec3 minv, vec3 maxv)
 
virtual void visitRenderables (Ogre::Renderable::Visitor *visitor, bool debugRenderables)
 

Protected Attributes

Figureparent
 Parent figure this renderable is used by. More...
 
OgreRenderScenescene
 The root scene which renders this object. More...
 
Ogre::VertexData * vertexData
 
Ogre::HardwareVertexBufferSharedPtr vertBuf
 
Ogre::IndexData * indexData
 
Ogre::RenderOperation::OperationType _opType
 
bool deferFillOp
 
size_t _numVertices
 
size_t _numIndices
 
VertexlocalVertBuff
 Vertex buffer in main memory used to stage data before being committed to video memory. More...
 
indexvallocalIndBuff
 Index buffer in main memory used to stage data before being committed to video memory. More...
 
Ogre::MaterialPtr mat
 
Ogre::AxisAlignedBox aabb
 
Ogre::Real boundRad
 
Ogre::String movableType
 
vec3 lastCamPos
 
bool depthSorting
 
Mutex mutex
 

Static Protected Attributes

static Ogre::HardwareBuffer::Usage vertexBufferUsage =Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY
 Sets vertex buffer to be write only. More...
 
static Ogre::HardwareBuffer::Usage indexBufferUsage =Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY
 Sets index buffer to be write only. More...
 

Detailed Description

This is the base class for Ogre renderables used by the Figure subtypes.

It manages Ogre vertex and index hardware data buffers directly and provides facilities for filling data into local buffers which are later copied to the hardware buffers. It extends the basic Ogre types needed to represent a renderable object in a scene. It uses an internal Vertex type having position, normal, color, and texture components.

Constructor & Destructor Documentation

◆ OgreBaseRenderable()

OgreBaseRenderable ( const std::string &  name,
const std::string &  matname,
Ogre::RenderOperation::OperationType  opType,
Ogre::SceneManager *  mgr 
)
throw (RenderException
)

◆ ~OgreBaseRenderable()

virtual ~OgreBaseRenderable ( )
inlinevirtual

Member Function Documentation

◆ _notifyCurrentCamera()

void _notifyCurrentCamera ( Ogre::Camera *  cam)
virtual

Reimplemented in TextRenderable, and TextureVolumeRenderable.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _updateRenderQueue()

void _updateRenderQueue ( Ogre::RenderQueue *  queue)
virtual

Reimplemented in TextRenderable, and TextureVolumeRenderable.

Here is the call graph for this function:

◆ commitBuffers()

void commitBuffers ( bool  commitVert = true,
bool  commitInd = true 
)

Copy the local buffers to the hardware buffers (NOTE: must be executed in renderer thread)

Here is the caller graph for this function:

◆ commitMatrices()

void commitMatrices ( const Matrix< Vertex > *  verts,
const IndexMatrix inds 
)

Copy the data from matrices to the hardware buffers (NOTE: must be executed in renderer thread)

Here is the call graph for this function:

◆ createBuffers()

void createBuffers ( size_t  numVerts,
size_t  numInds,
bool  deferCreate = false 
)
virtual

Create the hardware buffers with the given number of vertices and indices (NOTE: must be executed in renderer thread)

Here is the caller graph for this function:

◆ deleteLocalIndBuff()

void deleteLocalIndBuff ( )
inline
Here is the caller graph for this function:

◆ deleteLocalVertBuff()

void deleteLocalVertBuff ( )
inline
Here is the caller graph for this function:

◆ destroyBuffers()

void destroyBuffers ( )
virtual

Delete the hardware and local buffers (NOTE: must be executed in renderer thread)

◆ fillDefaultData()

void fillDefaultData ( bool  deferFill = false)
Here is the caller graph for this function:

◆ getBoundingBox()

virtual const Ogre::AxisAlignedBox& getBoundingBox ( ) const
inlinevirtual

◆ getBoundingRadius()

virtual Ogre::Real getBoundingRadius ( ) const
inlinevirtual

◆ getIndexBuffer()

Ogre::HardwareIndexBufferSharedPtr getIndexBuffer ( ) const
inline

◆ getLights()

virtual const Ogre::LightList& getLights ( ) const
inlinevirtual

◆ getLocalIndBuff()

indexval * getLocalIndBuff ( )

Get (and allocate if needed) the local memory index buffer of the same size as the hardware buffer.

Here is the caller graph for this function:

◆ getLocalVertBuff()

OgreBaseRenderable::Vertex * getLocalVertBuff ( )

Get (and allocate if needed) the local memory vertex buffer of the same size as the hardware buffer.

Here is the caller graph for this function:

◆ getMaterial()

virtual const Ogre::MaterialPtr& getMaterial ( ) const
inlinevirtual
Here is the caller graph for this function:

◆ getMovableType()

virtual const Ogre::String& getMovableType ( ) const
inlinevirtual

◆ getMutex()

Mutex* getMutex ( )
inline
Here is the caller graph for this function:

◆ getRenderOperation()

void getRenderOperation ( Ogre::RenderOperation &  op)
virtual

◆ getSquaredViewDepth()

virtual Ogre::Real getSquaredViewDepth ( const Ogre::Camera *  cam) const
inlinevirtual

◆ getVertexBuffer()

Ogre::HardwareVertexBufferSharedPtr getVertexBuffer ( ) const
inline

◆ getWorldTransforms()

virtual void getWorldTransforms ( Ogre::Matrix4 *  xform) const
inlinevirtual

◆ numIndices()

size_t numIndices ( ) const
inline

◆ numVertices()

size_t numVertices ( ) const
inline

◆ opType()

Ogre::RenderOperation::OperationType opType ( ) const
inline

◆ setBoundingBox()

virtual void setBoundingBox ( vec3  minv,
vec3  maxv 
)
inlinevirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDepthSorting()

void setDepthSorting ( bool  val)
inline

◆ setMaterial() [1/2]

virtual void setMaterial ( const Ogre::MaterialPtr &  m)
inlinevirtual

◆ setMaterial() [2/2]

virtual void setMaterial ( const std::string &  m)
throw (RenderException
)
inlinevirtual

◆ setParentObjects()

void setParentObjects ( Figure parent,
OgreRenderScene scene 
)
inline

◆ visitRenderables()

virtual void visitRenderables ( Ogre::Renderable::Visitor *  visitor,
bool  debugRenderables 
)
inlinevirtual

Reimplemented in TextRenderable.

Member Data Documentation

◆ _numIndices

size_t _numIndices
protected

◆ _numVertices

size_t _numVertices
protected

◆ _opType

Ogre::RenderOperation::OperationType _opType
protected

◆ aabb

Ogre::AxisAlignedBox aabb
protected

◆ boundRad

Ogre::Real boundRad
protected

◆ deferFillOp

bool deferFillOp
protected

◆ depthSorting

bool depthSorting
protected

◆ indexBufferUsage

Ogre::HardwareBuffer::Usage indexBufferUsage =Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY
staticprotected

Sets index buffer to be write only.

◆ indexData

Ogre::IndexData* indexData
protected

◆ lastCamPos

vec3 lastCamPos
protected

◆ localIndBuff

indexval* localIndBuff
protected

Index buffer in main memory used to stage data before being committed to video memory.

◆ localVertBuff

Vertex* localVertBuff
protected

Vertex buffer in main memory used to stage data before being committed to video memory.

◆ mat

Ogre::MaterialPtr mat
protected

◆ movableType

Ogre::String movableType
protected

◆ mutex

Mutex mutex
protected

◆ parent

Figure* parent
protected

Parent figure this renderable is used by.

◆ scene

OgreRenderScene* scene
protected

The root scene which renders this object.

◆ vertBuf

Ogre::HardwareVertexBufferSharedPtr vertBuf
protected

◆ vertexBufferUsage

Ogre::HardwareBuffer::Usage vertexBufferUsage =Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY
staticprotected

Sets vertex buffer to be write only.

◆ vertexData

Ogre::VertexData* vertexData
protected

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