Om
1.0.0
A universal framework for multimedia simulation
|
A class that encapsulates geometry and a material with which it should be rendered. More...
#include <omGraphicsMeshGroup.h>
Public Member Functions | |
MeshGroup () | |
Create a new mesh group with no buffers or material. More... | |
MeshGroup (VertexBufferSet *newVertexBuffers, IndexBuffer *newIndexBuffer, const IndexRange &newIndexRange, Material *newMaterial) | |
Create a new mesh group with the specified material and vertex buffer pointers. More... | |
VertexBufferSet * | getVertexBuffers () const |
Return a pointer to the vertex buffers for this mesh group. More... | |
void | setVertexBuffers (VertexBufferSet *newVertexBuffers) |
Set a pointer to the vertex buffers for this mesh group. More... | |
IndexBuffer * | getIndexBuffer () const |
Return a pointer to the index buffer for this mesh group. More... | |
void | setIndexBuffer (IndexBuffer *newIndexBuffer) |
Set a pointer to the index buffer for this mesh group. More... | |
IndexRange & | getIndexRange () |
Return a reference to the buffer range for this mesh group. More... | |
const IndexRange & | getIndexRange () const |
Return a reference to the buffer range for this mesh group. More... | |
void | setIndexRange (const IndexRange &newIndexRange) |
Set the buffer range for this mesh group. More... | |
Material * | getMaterial () const |
Return a pointer to the material of this mesh group. More... | |
void | setMaterial (Material *newMaterial) |
Set a pointer to the material of this mesh group. More... | |
ConstantSet * | getConstants () const |
Return an object that describes a set of shader constants and their corresponding semantic usages for this mesh. More... | |
void | setConstants (ConstantSet *newConstants) |
Set an object that describes a set of shader constants and their corresponding semantic usages for this mesh. More... | |
TextureSet * | getTextures () const |
Return an object that describes a set of textures and their corresponding semantic usages for this mesh. More... | |
void | setTextures (TextureSet *newTextures) |
Set an object that describes a set of textures and their corresponding semantic usages for this mesh. More... | |
virtual void | setContext (devices::GraphicsContext *newContext) |
Set the graphics context that is used to render this mesh group. More... | |
virtual void | upload (UploadRequest &request) |
Upload this mesh group's current CPU representation to the GPU device. More... | |
virtual void | download (DownloadRequest &request) |
Download the mesh group's GPU representation to CPU memory. More... | |
const AABB3 & | getBoundingBox () const |
Return a reference to the bounding box for this mesh group. More... | |
void | updateBoundingBox () |
Force an update the bounding box for this mesh group. More... | |
Bool | getVertices (ArrayList< Vector3 > &vertices) const |
Get the vertex positions in this mesh group and add them to the end of the specified list. More... | |
Bool | getTriangles (ArrayList< Triangle3 > &triangles) const |
Get the triangles in this mesh group and add them to the end of the specified list. More... | |
Public Member Functions inherited from om::graphics::devices::GraphicsContextObject | |
virtual | ~GraphicsContextObject () |
Destory this graphics context object. More... | |
GraphicsContext * | getContext () const |
Return a pointer to the graphics context this context object is using to do rendering. More... | |
void | clearContext () |
Clear the previous context from this object. More... | |
void | upload () |
Upload this resource's CPU representation to the GPU device. More... | |
void | download () |
Upload this resource's CPU representation to the GPU device. More... | |
virtual Bool | isUploaded () const |
Return whether or not this graphics resource has been successfully created and uploaded to the device. More... | |
virtual Bool | isDownloaded () const |
Return whether or not this graphics resource has a copy of its data stored in CPU-side memory. More... | |
virtual Bool | isValid () const |
Return whether or not the state of this graphics resource is valid (either on CPU or GPU) and able to be used for rendering. More... | |
Static Public Attributes | |
static const ResourceType | RESOURCE_TYPE |
The resource type for a mesh group. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from om::graphics::devices::GraphicsContextObject | |
GraphicsContextObject () | |
Create a new graphics context object that doesn't have an associated graphics context. More... | |
GraphicsContextObject (GraphicsContext *newContext) | |
Create a new graphics context object that uses the specified context for rendering. More... | |
Protected Attributes inherited from om::graphics::devices::GraphicsContextObject | |
GraphicsContext * | context |
A pointer to the graphics context this object is using. More... | |
A class that encapsulates geometry and a material with which it should be rendered.
A MeshGroup specifies its geometry relative to the origin of its parent shape and does not have its own transformation.
om::graphics::shapes::MeshGroup::MeshGroup | ( | ) |
Create a new mesh group with no buffers or material.
om::graphics::shapes::MeshGroup::MeshGroup | ( | VertexBufferSet * | newVertexBuffers, |
IndexBuffer * | newIndexBuffer, | ||
const IndexRange & | newIndexRange, | ||
Material * | newMaterial | ||
) |
Create a new mesh group with the specified material and vertex buffer pointers.
|
inline |
Return a pointer to the vertex buffers for this mesh group.
|
inline |
Set a pointer to the vertex buffers for this mesh group.
|
inline |
Return a pointer to the index buffer for this mesh group.
|
inline |
Set a pointer to the index buffer for this mesh group.
|
inline |
Return a reference to the buffer range for this mesh group.
If the mesh group has an index buffer, the valid range refers to the indices which should be used when drawing the group. Otherwise, the range refers to the valid contiguous range of vertices to use.
|
inline |
Return a reference to the buffer range for this mesh group.
If the mesh group has an index buffer, the valid range refers to the indices which should be used when drawing the group. Otherwise, the range refers to the valid contiguous range of vertices to use.
|
inline |
Set the buffer range for this mesh group.
If the mesh group has an index buffer, the valid range refers to the indices which should be used when drawing the group. Otherwise, the range refers to the valid contiguous range of vertices to use.
|
inline |
Return a pointer to the material of this mesh group.
|
inline |
Set a pointer to the material of this mesh group.
|
inline |
Return an object that describes a set of shader constants and their corresponding semantic usages for this mesh.
|
inline |
Set an object that describes a set of shader constants and their corresponding semantic usages for this mesh.
|
inline |
Return an object that describes a set of textures and their corresponding semantic usages for this mesh.
|
inline |
Set an object that describes a set of textures and their corresponding semantic usages for this mesh.
|
virtual |
Set the graphics context that is used to render this mesh group.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
virtual |
Upload this mesh group's current CPU representation to the GPU device.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
virtual |
Download the mesh group's GPU representation to CPU memory.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
inline |
Return a reference to the bounding box for this mesh group.
The bounding box returned here may not represent an accurate bounding volume for the mesh group if any of the underlying geometry changes without notice. If this occurs, call the updateBoundingBox() method directly to force an update of the bounding box.
void om::graphics::shapes::MeshGroup::updateBoundingBox | ( | ) |
Force an update the bounding box for this mesh group.
The user should call this method whenever the mesh group's geometry changes.
Get the vertex positions in this mesh group and add them to the end of the specified list.
The method returns whether or not the vertices were able to be accessed successfully. If there are no vertex positions that are part of this group, the size of the list does not change.
This method is provided so that a mesh's data can be easily accessed for use in external applications that need the raw mesh data.
Get the triangles in this mesh group and add them to the end of the specified list.
The method returns whether or not the triangles were able to be accessed successfully. If there are no triangles or quads that are part of this group, the size of the list does not change.
Quads are converted to triangles by this method. This method is provided so that a mesh can be easily converted to triangles for use in external applications that need the raw mesh data.
|
static |
The resource type for a mesh group.