A surface which is defined by curves of some kind to form a patch, e.g.
More...
#include <OgrePatchSurface.h>
|
| 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. More...
|
|
void | defineSurface (void *controlPointBuffer, v1::VertexDeclaration *declaration, size_t width, size_t height, PatchSurfaceType pType=PST_BEZIER, size_t uMaxSubdivisionLevel=(size_t) AUTO_LEVEL, size_t vMaxSubdivisionLevel=(size_t) AUTO_LEVEL, VisibleSide visibleSide=VS_FRONT) |
| Sets up the surface by defining it's control points, type and initial subdivision level. More...
|
|
Real | getBoundingSphereRadius () const |
| Gets the radius of the bounding sphere for this patch, only valid after defineSurface has been called. More...
|
|
const AxisAlignedBox & | getBounds () const |
| Gets the bounds of this patch, only valid after calling defineSurface. More...
|
|
void * | getControlPointBuffer () const |
|
size_t | getCurrentIndexCount () const |
| Gets the current index count based on the current subdivision level. More...
|
|
size_t | getIndexOffset () const |
| Returns the index offset used by this buffer to write data into the buffer. More...
|
|
size_t | getRequiredIndexCount () const |
| Based on a previous call to defineSurface, establishes the number of indexes required to hold this patch at the maximum detail level. More...
|
|
size_t | getRequiredVertexCount () const |
| Based on a previous call to defineSurface, establishes the number of vertices required to hold this patch at the maximum detail level. More...
|
|
Real | getSubdivisionFactor () const |
| Gets the current level of subdivision. More...
|
|
size_t | getVertexOffset () const |
| Returns the vertex offset used by this buffer to write data into the buffer. More...
|
|
void | notifyControlPointBufferDeallocated () |
| Convenience method for telling the patch that the control points have been deleted, since once the patch has been built they are not required. More...
|
|
void | setSubdivisionFactor (Real factor) |
| Alters the level of subdivision for this surface. More...
|
|
A surface which is defined by curves of some kind to form a patch, e.g.
a Bezier patch.
◆ anonymous enum
Constant for indicating automatic determination of subdivision level for patches.
◆ PatchSurfaceType
Enumerator |
---|
PST_BEZIER | A patch defined by a set of bezier curves.
|
◆ VisibleSide
Enumerator |
---|
VS_FRONT | The side from which u goes right and v goes up (as in texture coords)
|
VS_BACK | The side from which u goes right and v goes down (reverse of texture coords)
|
VS_BOTH | Both sides are visible - warning this creates 2x the number of triangles and adds extra overhead for calculating normals.
|
◆ PatchSurface()
Ogre::v1::PatchSurface::PatchSurface |
( |
| ) |
|
◆ ~PatchSurface()
Ogre::v1::PatchSurface::~PatchSurface |
( |
| ) |
|
◆ build()
Tells the system to build the mesh relating to the surface into externally created buffers.
- Parameters
-
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 |
◆ defineSurface()
Sets up the surface by defining it's control points, type and initial subdivision level.
- Parameters
-
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. |
◆ getBoundingSphereRadius()
Real Ogre::v1::PatchSurface::getBoundingSphereRadius |
( |
| ) |
const |
Gets the radius of the bounding sphere for this patch, only valid after defineSurface has been called.
◆ getBounds()
Gets the bounds of this patch, only valid after calling defineSurface.
◆ getControlPointBuffer()
void* Ogre::v1::PatchSurface::getControlPointBuffer |
( |
| ) |
const |
|
inline |
◆ getCurrentIndexCount()
size_t Ogre::v1::PatchSurface::getCurrentIndexCount |
( |
| ) |
const |
Gets the current index count based on the current subdivision level.
◆ getIndexOffset()
size_t Ogre::v1::PatchSurface::getIndexOffset |
( |
| ) |
const |
|
inline |
Returns the index offset used by this buffer to write data into the buffer.
◆ getRequiredIndexCount()
size_t Ogre::v1::PatchSurface::getRequiredIndexCount |
( |
| ) |
const |
Based on a previous call to defineSurface, establishes the number of indexes required to hold this patch at the maximum detail level.
◆ getRequiredVertexCount()
size_t Ogre::v1::PatchSurface::getRequiredVertexCount |
( |
| ) |
const |
Based on a previous call to defineSurface, establishes the number of vertices required to hold this patch at the maximum detail level.
◆ getSubdivisionFactor()
Real Ogre::v1::PatchSurface::getSubdivisionFactor |
( |
| ) |
const |
Gets the current level of subdivision.
◆ getVertexOffset()
size_t Ogre::v1::PatchSurface::getVertexOffset |
( |
| ) |
const |
|
inline |
Returns the vertex offset used by this buffer to write data into the buffer.
◆ notifyControlPointBufferDeallocated()
void Ogre::v1::PatchSurface::notifyControlPointBufferDeallocated |
( |
| ) |
|
|
inline |
Convenience method for telling the patch that the control points have been deleted, since once the patch has been built they are not required.
◆ setSubdivisionFactor()
void Ogre::v1::PatchSurface::setSubdivisionFactor |
( |
Real |
factor | ) |
|
Alters the level of subdivision for this surface.
The documentation for this class was generated from the following file: