#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 Methods | |
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. | |
Protected Methods | |
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 |
std::vector< Vector3 > | 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 Bezier patch.
Definition at line 43 of file OgrePatchSurface.h.
|
Constant for indicating automatic determination of subdivision level for patches.
Definition at line 56 of file OgrePatchSurface.h. |
|
Definition at line 49 of file OgrePatchSurface.h. |
|
Definition at line 61 of file OgrePatchSurface.h. |
|
Definition at line 44 of file OgrePatchSurface.cpp. References mType, and PST_BEZIER. |
|
Definition at line 49 of file OgrePatchSurface.cpp. |
|
Tells the system to build the mesh relating to the surface into externally created buffers.
Definition at line 162 of file OgrePatchSurface.cpp. References distributeControlPoints(), Ogre::VertexDeclaration::getVertexSize(), makeTriangles(), mDeclaration, mIndexBuffer, mIndexOffset, mMaxULevel, mMaxVLevel, mMeshHeight, mMeshWidth, mRequiredVertexCount, mULevel, mVecCtlPoints, mVertexBuffer, mVertexOffset, mVLevel, and subdivideCurve(). Referenced by Ogre::BspLevel::buildQuake3Patches(), and Ogre::PatchMesh::load(). |
|
Sets up the surface by defining it's control points, type and initial subdivision level.
Definition at line 53 of file OgrePatchSurface.cpp. References AUTO_LEVEL, Ogre::VertexElement::baseVertexPointerToElement(), Ogre::VertexDeclaration::findElementBySemantic(), getAutoULevel(), getAutoVLevel(), Ogre::VertexDeclaration::getVertexSize(), LEVEL_WIDTH, mAABB, Ogre::Vector3::makeCeil(), Ogre::Vector3::makeFloor(), mBoundingSphere, mControlPointBuffer, mCtlCount, mCtlHeight, mCtlWidth, mDeclaration, mMaxULevel, mMaxVLevel, mMeshHeight, mMeshWidth, mRequiredIndexCount, mRequiredVertexCount, mSubdivisionFactor, mType, mULevel, mVecCtlPoints, mVLevel, mVSide, Ogre::Real, Ogre::AxisAlignedBox::setExtents(), Ogre::Vector3::squaredLength(), Ogre::VES_POSITION, and VS_BOTH. Referenced by Ogre::BspLevel::initQuake3Patches(), and Ogre::PatchMesh::PatchMesh(). |
|
Definition at line 387 of file OgrePatchSurface.cpp. References Ogre::VertexElement::baseVertexPointerToElement(), Ogre::VertexDeclaration::findElementBySemantic(), Ogre::VertexElement::getType(), Ogre::VertexDeclaration::getVertexSize(), mControlPointBuffer, mDeclaration, mMeshHeight, mMeshWidth, mULevel, mVLevel, Ogre::Real, Ogre::RGBA, Ogre::VES_DIFFUSE, Ogre::VES_NORMAL, Ogre::VES_POSITION, and Ogre::VES_TEXTURE_COORDINATES. Referenced by build(). |
|
Internal method for finding the subdivision level given 3 control points.
Definition at line 286 of file OgrePatchSurface.cpp. References Ogre::Vector3::dotProduct(), and Ogre::Vector3::midPoint(). Referenced by getAutoULevel(), and getAutoVLevel(). |
|
Definition at line 208 of file OgrePatchSurface.cpp. References Except, findLevel(), mCtlHeight, mCtlWidth, and mVecCtlPoints. Referenced by defineSurface(). |
|
Definition at line 237 of file OgrePatchSurface.cpp. References Except, findLevel(), mCtlHeight, mCtlWidth, and mVecCtlPoints. Referenced by defineSurface(). |
|
Gets the radius of the bounding sphere for this patch, only valid after defineSurface has been called.
Definition at line 147 of file OgrePatchSurface.cpp. References mBoundingSphere, and Ogre::Real. Referenced by Ogre::PatchMesh::load(). |
|
Gets the bounds of this patch, only valid after calling defineSurface.
Definition at line 142 of file OgrePatchSurface.cpp. References mAABB. Referenced by Ogre::PatchMesh::load(). |
|
Definition at line 159 of file OgrePatchSurface.h. Referenced by Ogre::BspLevel::buildQuake3Patches(). |
|
Gets the current index count based on the current subdivision level.
Definition at line 281 of file OgrePatchSurface.cpp. References mCurrIndexCount. Referenced by Ogre::BspSceneManager::cacheGeometry(), and Ogre::PatchMesh::setSubdivision(). |
|
Returns the index offset used by this buffer to write data into the buffer.
Definition at line 118 of file OgrePatchSurface.h. Referenced by Ogre::BspSceneManager::cacheGeometry(). |
|
Based on a previous call to defineSurface, establishes the number of indexes required to hold this patch at the maximum detail level.
Definition at line 157 of file OgrePatchSurface.cpp. References mRequiredIndexCount. Referenced by Ogre::BspLevel::buildQuake3Patches(), Ogre::BspLevel::initQuake3Patches(), and Ogre::PatchMesh::load(). |
|
Based on a previous call to defineSurface, establishes the number of vertices required to hold this patch at the maximum detail level.
Definition at line 152 of file OgrePatchSurface.cpp. References mRequiredVertexCount. Referenced by Ogre::BspLevel::buildQuake3Patches(), Ogre::BspLevel::initQuake3Patches(), and Ogre::PatchMesh::load(). |
|
Gets the current level of subdivision.
Definition at line 276 of file OgrePatchSurface.cpp. References mSubdivisionFactor, and Ogre::Real. |
|
Returns the vertex offset used by this buffer to write data into the buffer.
Definition at line 120 of file OgrePatchSurface.h. Referenced by Ogre::BspSceneManager::cacheGeometry(). |
|
Definition at line 635 of file OgrePatchSurface.cpp. References Ogre::VertexElement::baseVertexPointerToElement(), Ogre::VertexDeclaration::findElementBySemantic(), Ogre::VertexElement::getType(), Ogre::VertexDeclaration::getVertexSize(), mDeclaration, Ogre::Vector3::normalise(), Ogre::Real, Ogre::VES_DIFFUSE, Ogre::VES_NORMAL, Ogre::VES_POSITION, Ogre::VES_TEXTURE_COORDINATES, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z. Referenced by subdivideCurve(). |
|
Definition at line 502 of file OgrePatchSurface.cpp. References LEVEL_WIDTH, mCtlHeight, mCtlWidth, mCurrIndexCount, mIndexBuffer, mIndexOffset, mMaxULevel, mMaxVLevel, mMeshHeight, mMeshWidth, mRequiredIndexCount, mULevel, mVLevel, mVSide, VS_BOTH, and VS_FRONT. Referenced by build(), and setSubdivisionFactor(). |
|
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 165 of file OgrePatchSurface.h. Referenced by Ogre::BspLevel::buildQuake3Patches(). |
|
Alters the level of subdivision for this surface.
Definition at line 263 of file OgrePatchSurface.cpp. References makeTriangles(), mMaxULevel, mMaxVLevel, mSubdivisionFactor, mULevel, mVLevel, and Ogre::Real. Referenced by Ogre::PatchMesh::setSubdivision(). |
|
Definition at line 465 of file OgrePatchSurface.cpp. References interpolateVertexData(). Referenced by build(). |
|
Definition at line 219 of file OgrePatchSurface.h. Referenced by defineSurface(), and getBounds(). |
|
Definition at line 220 of file OgrePatchSurface.h. Referenced by defineSurface(), and getBoundingSphereRadius(). |
|
Buffer containing the system-memory control points.
Definition at line 172 of file OgrePatchSurface.h. Referenced by defineSurface(), and distributeControlPoints(). |
|
TotalNumber of control points.
Definition at line 180 of file OgrePatchSurface.h. Referenced by defineSurface(). |
|
Height in control points.
Definition at line 178 of file OgrePatchSurface.h. Referenced by defineSurface(), getAutoULevel(), getAutoVLevel(), and makeTriangles(). |
|
Width in control points.
Definition at line 176 of file OgrePatchSurface.h. Referenced by defineSurface(), getAutoULevel(), getAutoVLevel(), and makeTriangles(). |
|
Definition at line 217 of file OgrePatchSurface.h. Referenced by getCurrentIndexCount(), and makeTriangles(). |
|
Vertex declaration describing the control point buffer.
Definition at line 170 of file OgrePatchSurface.h. Referenced by build(), defineSurface(), distributeControlPoints(), and interpolateVertexData(). |
|
Definition at line 212 of file OgrePatchSurface.h. Referenced by build(), and makeTriangles(). |
|
Definition at line 214 of file OgrePatchSurface.h. Referenced by build(), and makeTriangles(). |
|
Max subdivision level.
Definition at line 186 of file OgrePatchSurface.h. Referenced by build(), defineSurface(), makeTriangles(), and setSubdivisionFactor(). |
|
Definition at line 187 of file OgrePatchSurface.h. Referenced by build(), defineSurface(), makeTriangles(), and setSubdivisionFactor(). |
|
Height of the subdivided mesh (big enough for max level).
Definition at line 191 of file OgrePatchSurface.h. Referenced by build(), defineSurface(), distributeControlPoints(), and makeTriangles(). |
|
Width of the subdivided mesh (big enough for max level).
Definition at line 189 of file OgrePatchSurface.h. Referenced by build(), defineSurface(), distributeControlPoints(), and makeTriangles(). |
|
Definition at line 216 of file OgrePatchSurface.h. Referenced by defineSurface(), getRequiredIndexCount(), and makeTriangles(). |
|
Definition at line 215 of file OgrePatchSurface.h. Referenced by build(), defineSurface(), and getRequiredVertexCount(). |
|
Definition at line 195 of file OgrePatchSurface.h. Referenced by defineSurface(), getSubdivisionFactor(), and setSubdivisionFactor(). |
|
Type of surface.
Definition at line 174 of file OgrePatchSurface.h. Referenced by defineSurface(), and PatchSurface(). |
|
U-direction subdivision level.
Definition at line 182 of file OgrePatchSurface.h. Referenced by build(), defineSurface(), distributeControlPoints(), makeTriangles(), and setSubdivisionFactor(). |
|
Definition at line 197 of file OgrePatchSurface.h. Referenced by build(), defineSurface(), getAutoULevel(), and getAutoVLevel(). |
|
Definition at line 211 of file OgrePatchSurface.h. Referenced by build(). |
|
Definition at line 213 of file OgrePatchSurface.h. Referenced by build(). |
|
V-direction subdivision level.
Definition at line 184 of file OgrePatchSurface.h. Referenced by build(), defineSurface(), distributeControlPoints(), makeTriangles(), and setSubdivisionFactor(). |
|
Which side is visible.
Definition at line 193 of file OgrePatchSurface.h. Referenced by defineSurface(), and makeTriangles(). |
Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:51:25 2004