28 #ifndef __PatchSurface_H__
29 #define __PatchSurface_H__
105 void defineSurface(
void* controlPointBuffer,
107 PatchSurfaceType pType = PST_BEZIER,
108 size_t uMaxSubdivisionLevel = AUTO_LEVEL,
size_t vMaxSubdivisionLevel = AUTO_LEVEL,
109 VisibleSide visibleSide = VS_FRONT);
116 size_t getRequiredVertexCount(
void)
const;
122 size_t getRequiredIndexCount(
void)
const;
125 size_t getCurrentIndexCount(
void)
const;
136 Real getBoundingSphereRadius(
void)
const;
163 void setSubdivisionFactor(
Real factor);
166 Real getSubdivisionFactor(
void)
const;
170 return mControlPointBuffer;
175 mControlPointBuffer = 0;
212 void distributeControlPoints(
void* lockedBuffer);
213 void subdivideCurve(
void* lockedBuffer,
size_t startIdx,
size_t stepSize,
size_t numSteps,
size_t iterations);
214 void interpolateVertexData(
void* lockedBuffer,
size_t leftIndex,
size_t rightIndex,
size_t destIndex);
215 void makeTriangles(
void);
217 size_t getAutoULevel(
bool forMax =
false);
218 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 index 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.