28 #ifndef __PatchSurface_H__
29 #define __PatchSurface_H__
106 void defineSurface(
void* controlPointBuffer,
108 PatchSurfaceType pType = PST_BEZIER,
109 size_t uMaxSubdivisionLevel = AUTO_LEVEL,
size_t vMaxSubdivisionLevel = AUTO_LEVEL,
110 VisibleSide visibleSide = VS_FRONT);
117 size_t getRequiredVertexCount(
void)
const;
123 size_t getRequiredIndexCount(
void)
const;
126 size_t getCurrentIndexCount(
void)
const;
137 Real getBoundingSphereRadius(
void)
const;
164 void setSubdivisionFactor(
Real factor);
167 Real getSubdivisionFactor(
void)
const;
171 return mControlPointBuffer;
176 mControlPointBuffer = 0;
213 void distributeControlPoints(
void* lockedBuffer);
214 void subdivideCurve(
void* lockedBuffer,
size_t startIdx,
size_t stepSize,
size_t numSteps,
size_t iterations);
215 void interpolateVertexData(
void* lockedBuffer,
size_t leftIndex,
size_t rightIndex,
size_t destIndex);
216 void makeTriangles(
void);
218 size_t getAutoULevel(
bool forMax =
false);
219 size_t getAutoVLevel(
bool forMax =
false);
size_t mMeshWidth
Width of the subdivided mesh (big enough for max level)
The side from which u goes right and v goes down (reverse of texture coords)
float Real
Software floating point type.
vector< Vector3 >::type mVecCtlPoints
size_t mMeshHeight
Height of the subdivided mesh (big enough for max level)
size_t mULevel
U-direction subdivision level.
Shared pointer implementation used to share vertex buffers.
A 3D box aligned with the x/y/z axes.
size_t mRequiredIndexCount
size_t getVertexOffset(void) const
Returns the vertex offset used by this buffer to write data into the buffer.
Shared pointer implementation used to share index buffers.
size_t mVLevel
V-direction subdivision level.
size_t mCtlCount
TotalNumber of control points.
VisibleSide mVSide
Which side is visible.
A surface which is defined by curves of some kind to form a patch, e.g.
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.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
void * getControlPointBuffer(void) const
size_t mCtlHeight
Height in control points.
Standard 3-dimensional vector.
void * mControlPointBuffer
Buffer containing the system-memory control points.
VertexDeclaration * mDeclaration
Vertex declaration describing the control point buffer.
size_t getIndexOffset(void) const
Returns the index offset used by this buffer to write data into the buffer.
This class declares the format of a set of vertex inputs, which can be issued to the rendering API th...
size_t mRequiredVertexCount
HardwareVertexBufferSharedPtr mVertexBuffer
PatchSurfaceType mType
Type of surface.
The side from which u goes right and v goes up (as in texture coords)
size_t mCtlWidth
Width in control points.
HardwareIndexBufferSharedPtr mIndexBuffer
size_t mMaxULevel
Max subdivision level.