Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::graphics::shapes::MeshChunk Class Reference

A class that contains all information needed to draw a chunk of geometry. More...

#include <omGraphicsMeshChunk.h>

Public Member Functions

 MeshChunk ()
 Create a mesh chunk with no data. More...
 
 MeshChunk (const Matrix4 &newTransform, const AABB3 &newBoundingBox, const Material *newMaterial, const TextureSet *newTextures, const ConstantSet *newConstants, const Skeleton *newSkeleton, const VertexBufferSet *newVertexBuffers, const IndexBuffer *newIndices, const IndexRange &newIndexRange)
 Create an indexed mesh chunk which uses the specified range of indices. More...
 
 MeshChunk (const Matrix4 &newTransform, const AABB3 &newBoundingBox, const Material *newMaterial, const TextureSet *newTextures, const ConstantSet *newConstants, const Skeleton *newSkeleton, const VertexBufferSet *newVertexBuffers, const IndexRange &newIndexRange)
 Create a non-indexed mesh chunk which uses the specified range of vertices. More...
 
Bool hasVertexBuffers () const
 Return whether or not there is a vertex buffer set associated with this mesh chunk. More...
 
const VertexBufferSetgetVertexBuffers () const
 Return a pointer to the vertex buffer set for this mesh chunk. More...
 
void setVertexBuffers (const VertexBufferSet *newVertexBuffers)
 Set a pointer to the vertex buffers for this mesh chunk. More...
 
Bool hasIndexBuffer () const
 Return whether or not there is an index buffer associated with this mesh chunk. More...
 
const IndexBuffergetIndexBuffer () const
 Return a pointer to the index buffer for this mesh chunk. More...
 
void setIndexBuffer (const IndexBuffer *newIndexBuffer)
 Set a pointer to the index buffer for this mesh chunk. More...
 
const IndexRangegetIndexRange () const
 Return a reference to the buffer range for this mesh chunk. More...
 
void setIndexRange (const IndexRange &newIndexRange)
 Set the buffer range for this mesh chunk. More...
 
Bool hasMaterial () const
 Return whether or not this mesh chunk has a material associated with it. More...
 
const MaterialgetMaterial () const
 Return a pointer to the material which should be used to render this mesh chunk. More...
 
void setMaterial (const Material *newMaterial)
 Set a pointer to the material which should be used to render this mesh chunk. More...
 
Bool hasTextures () const
 Return whether or not this mesh chunk has a texture set associated with it. More...
 
const TextureSetgetTextures () const
 Return a pointer to a set of textures that should be used for the mesh chunk. More...
 
void setTextures (const TextureSet *newTextures)
 Set a pointer to a set of textures that should be used for the mesh chunk. More...
 
Bool hasSkeleton () const
 Return whether or not this mesh chunk has a skeleton associated with it. More...
 
const SkeletongetSkeleton () const
 Return a pointer to the skeleton which should be used to render this mesh chunk, or NULL if there is none. More...
 
void setSkeleton (const Skeleton *newSkeleton)
 Set a pointer to the skeleton which should be used to render this mesh chunk. More...
 
Bool hasConstants () const
 Return whether or not this mesh chunk has a constant set associated with it. More...
 
const ConstantSetgetConstants () const
 Return a pointer to a set of shader constants that should be used for the mesh chunk. More...
 
void setConstants (const ConstantSet *newConstants)
 Set a pointer to a set of shader constants that should be used for the mesh chunk. More...
 
const Matrix4getTransformMatrix () const
 Return a 4x4 matrix representing the homogeneous coordinate transform from the mesh's object to world space. More...
 
void setTransformMatrix (const Matrix4 &newTransform)
 Set a 4x4 matrix representing the homogeneous coordinate transform from the mesh's object to world space. More...
 
const AABB3getBoundingBox () const
 Return a reference to a bounding box for this mesh chunk in world space. More...
 
void setBoundingBox (const AABB3 &newBoundingBox)
 Return a reference to a bounding box for this mesh chunk in world space. More...
 

Detailed Description

A class that contains all information needed to draw a chunk of geometry.

A MeshChunk is used as a intermediate universal data format which should work for almost any rendering technique. It contains a pointer to a vertex buffer, an optional index buffer pointer, a range of elements to draw, an object-to-world- space transformation matrix, and a material for the specified geometry.

If an index buffer is specified, the range of elements to draw refers to the index range which should be drawn. If no index buffer is provided, the range refers to the range of vertices which should be drawn from the vertex buffer.

Constructor & Destructor Documentation

om::graphics::shapes::MeshChunk::MeshChunk ( )
inline

Create a mesh chunk with no data.

om::graphics::shapes::MeshChunk::MeshChunk ( const Matrix4 newTransform,
const AABB3 newBoundingBox,
const Material newMaterial,
const TextureSet newTextures,
const ConstantSet newConstants,
const Skeleton newSkeleton,
const VertexBufferSet newVertexBuffers,
const IndexBuffer newIndices,
const IndexRange newIndexRange 
)
inline

Create an indexed mesh chunk which uses the specified range of indices.

om::graphics::shapes::MeshChunk::MeshChunk ( const Matrix4 newTransform,
const AABB3 newBoundingBox,
const Material newMaterial,
const TextureSet newTextures,
const ConstantSet newConstants,
const Skeleton newSkeleton,
const VertexBufferSet newVertexBuffers,
const IndexRange newIndexRange 
)
inline

Create a non-indexed mesh chunk which uses the specified range of vertices.

Member Function Documentation

Bool om::graphics::shapes::MeshChunk::hasVertexBuffers ( ) const
inline

Return whether or not there is a vertex buffer set associated with this mesh chunk.

const VertexBufferSet* om::graphics::shapes::MeshChunk::getVertexBuffers ( ) const
inline

Return a pointer to the vertex buffer set for this mesh chunk.

void om::graphics::shapes::MeshChunk::setVertexBuffers ( const VertexBufferSet newVertexBuffers)
inline

Set a pointer to the vertex buffers for this mesh chunk.

Bool om::graphics::shapes::MeshChunk::hasIndexBuffer ( ) const
inline

Return whether or not there is an index buffer associated with this mesh chunk.

If this method returns FALSE, it means that the mesh chunk should use the in-order vertices in the vertex buffer when it is drawn. Otherwise, the index buffer is used to index into the vertex buffer for the chunk's range of elements.

const IndexBuffer* om::graphics::shapes::MeshChunk::getIndexBuffer ( ) const
inline

Return a pointer to the index buffer for this mesh chunk.

If this method returns NULL, it means that the mesh chunk should use the in-order vertices in the vertex buffer when it is drawn. Otherwise, the index buffer is used to index into the vertex buffer for the chunk's range of elements.

void om::graphics::shapes::MeshChunk::setIndexBuffer ( const IndexBuffer newIndexBuffer)
inline

Set a pointer to the index buffer for this mesh chunk.

const IndexRange& om::graphics::shapes::MeshChunk::getIndexRange ( ) const
inline

Return a reference to the buffer range for this mesh chunk.

If the mesh chunk has an index buffer, the valid range refers to the indices which should be used when drawing the chunk. Otherwise, the range refers to the valid contiguous range of vertices to use.

void om::graphics::shapes::MeshChunk::setIndexRange ( const IndexRange newIndexRange)
inline

Set the buffer range for this mesh chunk.

If the mesh chunk has an index buffer, the valid range refers to the indices which should be used when drawing the chunk. Otherwise, the range refers to the valid contiguous range of vertices to use.

Bool om::graphics::shapes::MeshChunk::hasMaterial ( ) const
inline

Return whether or not this mesh chunk has a material associated with it.

const Material* om::graphics::shapes::MeshChunk::getMaterial ( ) const
inline

Return a pointer to the material which should be used to render this mesh chunk.

If the method returns NULL, the renderer can either choose to use a default material when rendering the chunk or can skip the chunk entirely.

void om::graphics::shapes::MeshChunk::setMaterial ( const Material newMaterial)
inline

Set a pointer to the material which should be used to render this mesh chunk.

Bool om::graphics::shapes::MeshChunk::hasTextures ( ) const
inline

Return whether or not this mesh chunk has a texture set associated with it.

const TextureSet* om::graphics::shapes::MeshChunk::getTextures ( ) const
inline

Return a pointer to a set of textures that should be used for the mesh chunk.

void om::graphics::shapes::MeshChunk::setTextures ( const TextureSet newTextures)
inline

Set a pointer to a set of textures that should be used for the mesh chunk.

Bool om::graphics::shapes::MeshChunk::hasSkeleton ( ) const
inline

Return whether or not this mesh chunk has a skeleton associated with it.

const Skeleton* om::graphics::shapes::MeshChunk::getSkeleton ( ) const
inline

Return a pointer to the skeleton which should be used to render this mesh chunk, or NULL if there is none.

void om::graphics::shapes::MeshChunk::setSkeleton ( const Skeleton newSkeleton)
inline

Set a pointer to the skeleton which should be used to render this mesh chunk.

Bool om::graphics::shapes::MeshChunk::hasConstants ( ) const
inline

Return whether or not this mesh chunk has a constant set associated with it.

const ConstantSet* om::graphics::shapes::MeshChunk::getConstants ( ) const
inline

Return a pointer to a set of shader constants that should be used for the mesh chunk.

void om::graphics::shapes::MeshChunk::setConstants ( const ConstantSet newConstants)
inline

Set a pointer to a set of shader constants that should be used for the mesh chunk.

const Matrix4& om::graphics::shapes::MeshChunk::getTransformMatrix ( ) const
inline

Return a 4x4 matrix representing the homogeneous coordinate transform from the mesh's object to world space.

void om::graphics::shapes::MeshChunk::setTransformMatrix ( const Matrix4 newTransform)
inline

Set a 4x4 matrix representing the homogeneous coordinate transform from the mesh's object to world space.

const AABB3& om::graphics::shapes::MeshChunk::getBoundingBox ( ) const
inline

Return a reference to a bounding box for this mesh chunk in world space.

void om::graphics::shapes::MeshChunk::setBoundingBox ( const AABB3 newBoundingBox)
inline

Return a reference to a bounding box for this mesh chunk in world space.


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