28 #ifndef __PatchSurface_H__
29 #define __PatchSurface_H__
109 size_t uMaxSubdivisionLevel = AUTO_LEVEL,
size_t vMaxSubdivisionLevel = AUTO_LEVEL,
171 return mControlPointBuffer;
176 mControlPointBuffer = 0;
214 void subdivideCurve(
void* lockedBuffer,
size_t startIdx,
size_t stepSize,
size_t numSteps,
size_t iterations);
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
A 3D box aligned with the x/y/z axes.
Shared pointer implementation used to share index buffers.
Shared pointer implementation used to share vertex buffers.
A surface which is defined by curves of some kind to form a patch, e.g.
size_t mULevel
U-direction subdivision level.
size_t getAutoULevel(bool forMax=false)
size_t mCtlWidth
Width in control points.
size_t getRequiredVertexCount(void) const
Based on a previous call to defineSurface, establishes the number of vertices required to hold this p...
void setSubdivisionFactor(Real factor)
Alters the level of subdivision for this surface.
@ VS_BACK
The side from which u goes right and v goes down (reverse of texture coords)
@ VS_FRONT
The side from which u goes right and v goes up (as in texture coords)
size_t mMeshWidth
Width of the subdivided mesh (big enough for max level)
void notifyControlPointBufferDeallocated(void)
Convenience method for telling the patch that the control points have been deleted,...
VertexDeclaration * mDeclaration
Vertex declaration describing the control point buffer.
size_t mCtlCount
TotalNumber of control points.
size_t mRequiredVertexCount
size_t mMeshHeight
Height of the subdivided mesh (big enough for max level)
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.
size_t mMaxULevel
Max subdivision level.
const AxisAlignedBox & getBounds(void) const
Gets the bounds of this patch, only valid after calling defineSurface.
void * getControlPointBuffer(void) const
void interpolateVertexData(void *lockedBuffer, size_t leftIndex, size_t rightIndex, size_t destIndex)
Real getSubdivisionFactor(void) const
Gets the current level of subdivision.
void distributeControlPoints(void *lockedBuffer)
vector< Vector3 >::type mVecCtlPoints
size_t getCurrentIndexCount(void) const
Gets the current index count based on the current subdivision level.
PatchSurfaceType mType
Type of surface.
size_t mRequiredIndexCount
Real getBoundingSphereRadius(void) const
Gets the radius of the bounding sphere for this patch, only valid after defineSurface has been called...
size_t findLevel(Vector3 &a, Vector3 &b, Vector3 &c)
Internal method for finding the subdivision level given 3 control points.
HardwareVertexBufferSharedPtr mVertexBuffer
void * mControlPointBuffer
Buffer containing the system-memory control points.
size_t getIndexOffset(void) const
Returns the index offset used by this buffer to write data into the buffer.
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 getRequiredIndexCount(void) const
Based on a previous call to defineSurface, establishes the number of indexes required to hold this pa...
size_t mCtlHeight
Height in control points.
HardwareIndexBufferSharedPtr mIndexBuffer
size_t mVLevel
V-direction subdivision level.
size_t getVertexOffset(void) const
Returns the vertex offset used by this buffer to write data into the buffer.
void subdivideCurve(void *lockedBuffer, size_t startIdx, size_t stepSize, size_t numSteps, size_t iterations)
VisibleSide mVSide
Which side is visible.
size_t getAutoVLevel(bool forMax=false)
Standard 3-dimensional vector.
This class declares the format of a set of vertex inputs, which can be issued to the rendering API th...
float Real
Software floating point type.