OGRE 2.1
Object-Oriented Graphics Rendering Engine
|
A surface which is defined by curves of some kind to form a patch, e.g. More...
#include <OgrePatchSurface.h>
Public Types | |
enum | { AUTO_LEVEL = -1 } |
Constant for indicating automatic determination of subdivision level for patches. More... | |
enum | PatchSurfaceType { PST_BEZIER } |
enum | VisibleSide { VS_FRONT , VS_BACK , VS_BOTH } |
Public Member Functions | |
PatchSurface () | |
~PatchSurface () | |
void | build (v1::HardwareVertexBufferSharedPtr destVertexBuffer, size_t vertexStart, v1::HardwareIndexBufferSharedPtr destIndexBuffer, size_t indexStart) |
Tells the system to build the mesh relating to the surface into externally created buffers. | |
void | defineSurface (void *controlPointBuffer, v1::VertexDeclaration *declaration, size_t width, size_t height, PatchSurfaceType pType=PST_BEZIER, size_t uMaxSubdivisionLevel=AUTO_LEVEL, size_t vMaxSubdivisionLevel=AUTO_LEVEL, VisibleSide visibleSide=VS_FRONT) |
Sets up the surface by defining it's control points, type and initial subdivision level. | |
Real | getBoundingSphereRadius (void) const |
Gets the radius of the bounding sphere for this patch, only valid after defineSurface has been called. | |
const AxisAlignedBox & | getBounds (void) const |
Gets the bounds of this patch, only valid after calling defineSurface. | |
void * | getControlPointBuffer (void) const |
size_t | getCurrentIndexCount (void) const |
Gets the current index count based on the current subdivision level. | |
size_t | getIndexOffset (void) const |
Returns the index offset used by this buffer to write data into the buffer. | |
size_t | getRequiredIndexCount (void) const |
Based on a previous call to defineSurface, establishes the number of indexes required to hold this patch at the maximum detail level. | |
size_t | getRequiredVertexCount (void) const |
Based on a previous call to defineSurface, establishes the number of vertices required to hold this patch at the maximum detail level. | |
Real | getSubdivisionFactor (void) const |
Gets the current level of subdivision. | |
size_t | getVertexOffset (void) const |
Returns the vertex offset used by this buffer to write data into the buffer. | |
void | notifyControlPointBufferDeallocated (void) |
Convenience method for telling the patch that the control points have been deleted, since once the patch has been built they are not required. | |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete (void *ptr, void *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, const char *file, int line, const char *func) |
operator new, with debug line info | |
void * | operator new (size_t sz, void *ptr) |
placement operator new | |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info | |
void | setSubdivisionFactor (Real factor) |
Alters the level of subdivision for this surface. | |
A surface which is defined by curves of some kind to form a patch, e.g.
a Bezier patch.
Ogre::v1::PatchSurface::PatchSurface | ( | ) |
Ogre::v1::PatchSurface::~PatchSurface | ( | ) |
void Ogre::v1::PatchSurface::build | ( | v1::HardwareVertexBufferSharedPtr | destVertexBuffer, |
size_t | vertexStart, | ||
v1::HardwareIndexBufferSharedPtr | destIndexBuffer, | ||
size_t | indexStart | ||
) |
Tells the system to build the mesh relating to the surface into externally created buffers.
destVertexBuffer | The destination vertex buffer in which to build the patch. |
vertexStart | The offset at which to start writing vertices for this patch |
destIndexBuffer | The destination index buffer in which to build the patch. |
indexStart | The offset at which to start writing indexes for this patch |
void Ogre::v1::PatchSurface::defineSurface | ( | void * | controlPointBuffer, |
v1::VertexDeclaration * | declaration, | ||
size_t | width, | ||
size_t | height, | ||
PatchSurfaceType | pType = PST_BEZIER , |
||
size_t | uMaxSubdivisionLevel = AUTO_LEVEL , |
||
size_t | vMaxSubdivisionLevel = AUTO_LEVEL , |
||
VisibleSide | visibleSide = VS_FRONT |
||
) |
Sets up the surface by defining it's control points, type and initial subdivision level.
controlPointBuffer | A pointer to a buffer containing the vertex data which defines control points of the curves rather than actual vertices. Note that you are expected to provide not just position information, but potentially normals and texture coordinates too. The format of the buffer is defined in the VertexDeclaration parameter |
declaration | VertexDeclaration describing the contents of the buffer. Note this declaration must only draw on buffer source 0! |
width | Specifies the width of the patch in control points. |
height | Specifies the height of the patch in control points. |
pType | The type of surface - currently only PST_BEZIER is supported |
uMaxSubdivisionLevel,vMaxSubdivisionLevel | If you want to manually set the top level of subdivision, do it here, otherwise let the system decide. |
visibleSide | Determines which side of the patch (or both) triangles are generated for. |
Gets the radius of the bounding sphere for this patch, only valid after defineSurface has been called.
const AxisAlignedBox & Ogre::v1::PatchSurface::getBounds | ( | void | ) | const |
Gets the bounds of this patch, only valid after calling defineSurface.
Gets the current index count based on the current subdivision level.
Returns the index offset used by this buffer to write data into the buffer.
Based on a previous call to defineSurface, establishes the number of indexes required to hold this patch at the maximum detail level.
Based on a previous call to defineSurface, establishes the number of vertices required to hold this patch at the maximum detail level.
Gets the current level of subdivision.
Returns the vertex offset used by this buffer to write data into the buffer.
Convenience method for telling the patch that the control points have been deleted, since once the patch has been built they are not required.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
Alters the level of subdivision for this surface.