A surface which is defined by curves of some kind to form a patch, e.g. More...
#include <OgrePatchSurface.h>
Public Types | |
enum | PatchSurfaceType { PST_BEZIER } |
enum | { AUTO_LEVEL = -1 } |
Constant for indicating automatic determination of subdivision level for patches. More... | |
enum | VisibleSide { VS_FRONT, VS_BACK, VS_BOTH } |
Public Member Functions | |
PatchSurface () | |
~PatchSurface () | |
void | defineSurface (void *controlPointBuffer, 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. | |
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. | |
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 | 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 | getVertexOffset (void) const |
Returns the vertex offset used by this buffer to write data into the buffer. | |
const AxisAlignedBox & | getBounds (void) const |
Gets the bounds of this patch, only valid after calling defineSurface. | |
Real | getBoundingSphereRadius (void) const |
Gets the radius of the bounding sphere for this patch, only valid after defineSurface has been called. | |
void | build (HardwareVertexBufferSharedPtr destVertexBuffer, size_t vertexStart, HardwareIndexBufferSharedPtr destIndexBuffer, size_t indexStart) |
Tells the system to build the mesh relating to the surface into externally created buffers. | |
void | setSubdivisionFactor (Real factor) |
Alters the level of subdivision for this surface. | |
Real | getSubdivisionFactor (void) const |
Gets the current level of subdivision. | |
void * | getControlPointBuffer (void) const |
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 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 * | operator new (size_t sz, void *ptr) |
placement operator new | |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info | |
void * | operator new[] (size_t sz) |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
Protected Member Functions | |
size_t | findLevel (Vector3 &a, Vector3 &b, Vector3 &c) |
Internal method for finding the subdivision level given 3 control points. | |
void | distributeControlPoints (void *lockedBuffer) |
void | subdivideCurve (void *lockedBuffer, size_t startIdx, size_t stepSize, size_t numSteps, size_t iterations) |
void | interpolateVertexData (void *lockedBuffer, size_t leftIndex, size_t rightIndex, size_t destIndex) |
void | makeTriangles (void) |
size_t | getAutoULevel (bool forMax=false) |
size_t | getAutoVLevel (bool forMax=false) |
Protected Attributes | |
VertexDeclaration * | mDeclaration |
Vertex declaration describing the control point buffer. | |
void * | mControlPointBuffer |
Buffer containing the system-memory control points. | |
PatchSurfaceType | mType |
Type of surface. | |
size_t | mCtlWidth |
Width in control points. | |
size_t | mCtlHeight |
Height in control points. | |
size_t | mCtlCount |
TotalNumber of control points. | |
size_t | mULevel |
U-direction subdivision level. | |
size_t | mVLevel |
V-direction subdivision level. | |
size_t | mMaxULevel |
Max subdivision level. | |
size_t | mMaxVLevel |
size_t | mMeshWidth |
Width of the subdivided mesh (big enough for max level). | |
size_t | mMeshHeight |
Height of the subdivided mesh (big enough for max level). | |
VisibleSide | mVSide |
Which side is visible. | |
Real | mSubdivisionFactor |
vector< Vector3 >::type | mVecCtlPoints |
HardwareVertexBufferSharedPtr | mVertexBuffer |
HardwareIndexBufferSharedPtr | mIndexBuffer |
size_t | mVertexOffset |
size_t | mIndexOffset |
size_t | mRequiredVertexCount |
size_t | mRequiredIndexCount |
size_t | mCurrIndexCount |
AxisAlignedBox | mAABB |
Real | mBoundingSphere |
A surface which is defined by curves of some kind to form a patch, e.g.
a Bezier patch.
Definition at line 52 of file OgrePatchSurface.h.
anonymous enum |
Constant for indicating automatic determination of subdivision level for patches.
Definition at line 65 of file OgrePatchSurface.h.
Definition at line 58 of file OgrePatchSurface.h.
Definition at line 70 of file OgrePatchSurface.h.
Ogre::PatchSurface::PatchSurface | ( | ) |
Ogre::PatchSurface::~PatchSurface | ( | ) |
void Ogre::PatchSurface::build | ( | HardwareVertexBufferSharedPtr | destVertexBuffer, | |
size_t | vertexStart, | |||
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. | |
vertexStart | The offset at which to start writing indexes for this patch |
void Ogre::PatchSurface::defineSurface | ( | void * | controlPointBuffer, | |
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. |
void Ogre::PatchSurface::distributeControlPoints | ( | void * | lockedBuffer | ) | [protected] |
Internal method for finding the subdivision level given 3 control points.
size_t Ogre::PatchSurface::getAutoULevel | ( | bool | forMax = false |
) | [protected] |
size_t Ogre::PatchSurface::getAutoVLevel | ( | bool | forMax = false |
) | [protected] |
Real Ogre::PatchSurface::getBoundingSphereRadius | ( | void | ) | const |
Gets the radius of the bounding sphere for this patch, only valid after defineSurface has been called.
const AxisAlignedBox& Ogre::PatchSurface::getBounds | ( | void | ) | const |
Gets the bounds of this patch, only valid after calling defineSurface.
void* Ogre::PatchSurface::getControlPointBuffer | ( | void | ) | const |
Definition at line 168 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::getCurrentIndexCount | ( | void | ) | const |
Gets the current index count based on the current subdivision level.
size_t Ogre::PatchSurface::getIndexOffset | ( | void | ) | const |
Returns the index offset used by this buffer to write data into the buffer.
Definition at line 127 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::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 Ogre::PatchSurface::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 Ogre::PatchSurface::getSubdivisionFactor | ( | void | ) | const |
Gets the current level of subdivision.
size_t Ogre::PatchSurface::getVertexOffset | ( | void | ) | const |
Returns the vertex offset used by this buffer to write data into the buffer.
Definition at line 129 of file OgrePatchSurface.h.
void Ogre::PatchSurface::interpolateVertexData | ( | void * | lockedBuffer, | |
size_t | leftIndex, | |||
size_t | rightIndex, | |||
size_t | destIndex | |||
) | [protected] |
void Ogre::PatchSurface::makeTriangles | ( | void | ) | [protected] |
void Ogre::PatchSurface::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.
Definition at line 174 of file OgrePatchSurface.h.
void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr, | |
const char * | , | |||
int | , | |||
const char * | ||||
) | [inherited] |
Definition at line 107 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr, | |
void * | ||||
) | [inherited] |
Definition at line 101 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | [inherited] |
Definition at line 95 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr, | |
const char * | , | |||
int | , | |||
const char * | ||||
) | [inherited] |
Definition at line 118 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | [inherited] |
Definition at line 112 of file OgreMemoryAllocatedObject.h.
void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz, | |
void * | ptr | |||
) | [inherited] |
placement operator new
Definition at line 78 of file OgreMemoryAllocatedObject.h.
void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | [inherited] |
Definition at line 72 of file OgreMemoryAllocatedObject.h.
void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz, | |
const char * | file, | |||
int | line, | |||
const char * | func | |||
) | [inherited] |
operator new, with debug line info
Definition at line 67 of file OgreMemoryAllocatedObject.h.
void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | [inherited] |
Definition at line 90 of file OgreMemoryAllocatedObject.h.
void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz, | |
const char * | file, | |||
int | line, | |||
const char * | func | |||
) | [inherited] |
array operator new, with debug line info
Definition at line 85 of file OgreMemoryAllocatedObject.h.
void Ogre::PatchSurface::setSubdivisionFactor | ( | Real | factor | ) |
Alters the level of subdivision for this surface.
void Ogre::PatchSurface::subdivideCurve | ( | void * | lockedBuffer, | |
size_t | startIdx, | |||
size_t | stepSize, | |||
size_t | numSteps, | |||
size_t | iterations | |||
) | [protected] |
AxisAlignedBox Ogre::PatchSurface::mAABB [protected] |
Definition at line 228 of file OgrePatchSurface.h.
Real Ogre::PatchSurface::mBoundingSphere [protected] |
Definition at line 229 of file OgrePatchSurface.h.
void* Ogre::PatchSurface::mControlPointBuffer [protected] |
Buffer containing the system-memory control points.
Definition at line 181 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mCtlCount [protected] |
TotalNumber of control points.
Definition at line 189 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mCtlHeight [protected] |
Height in control points.
Definition at line 187 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mCtlWidth [protected] |
Width in control points.
Definition at line 185 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mCurrIndexCount [protected] |
Definition at line 226 of file OgrePatchSurface.h.
VertexDeclaration* Ogre::PatchSurface::mDeclaration [protected] |
Vertex declaration describing the control point buffer.
Definition at line 179 of file OgrePatchSurface.h.
Definition at line 221 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mIndexOffset [protected] |
Definition at line 223 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mMaxULevel [protected] |
Max subdivision level.
Definition at line 195 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mMaxVLevel [protected] |
Definition at line 196 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mMeshHeight [protected] |
Height of the subdivided mesh (big enough for max level).
Definition at line 200 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mMeshWidth [protected] |
Width of the subdivided mesh (big enough for max level).
Definition at line 198 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mRequiredIndexCount [protected] |
Definition at line 225 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mRequiredVertexCount [protected] |
Definition at line 224 of file OgrePatchSurface.h.
Real Ogre::PatchSurface::mSubdivisionFactor [protected] |
Definition at line 204 of file OgrePatchSurface.h.
PatchSurfaceType Ogre::PatchSurface::mType [protected] |
Type of surface.
Definition at line 183 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mULevel [protected] |
U-direction subdivision level.
Definition at line 191 of file OgrePatchSurface.h.
vector<Vector3>::type Ogre::PatchSurface::mVecCtlPoints [protected] |
Definition at line 206 of file OgrePatchSurface.h.
Definition at line 220 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mVertexOffset [protected] |
Definition at line 222 of file OgrePatchSurface.h.
size_t Ogre::PatchSurface::mVLevel [protected] |
V-direction subdivision level.
Definition at line 193 of file OgrePatchSurface.h.
VisibleSide Ogre::PatchSurface::mVSide [protected] |
Which side is visible.
Definition at line 202 of file OgrePatchSurface.h.
Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Fri May 25 23:38:55 2012