C# Class Axiom.Core.PatchSurface

A surface which is defined by curves of some kind to form a patch, e.g. a Bezier patch.
This object will take a list of control points with various assorted data, and will subdivide it into a patch mesh. Currently only Bezier curves are supported for defining the surface, but other techniques such as NURBS would follow the same basic approach.
Afficher le fichier Open project: WolfgangSt/axiom Class Usage Examples

Protected Properties

Свойство Type Description
aabb Axiom.MathLib.AxisAlignedBox
boundingSphereRadius float
controlCount int
controlHeight int
controlPointBuffer System.IntPtr
controlPoints List
controlWidth int
currentIndexCount int
declaration Axiom.Graphics.VertexDeclaration
indexBuffer Axiom.Graphics.HardwareIndexBuffer
indexOffset int
maxULevel int
maxVLevel int
meshHeight int
meshWidth int
requiredIndexCount int
requiredVertexCount int
side VisibleSide
subdivisionFactor float
type PatchSurfaceType
uLevel int
vLevel int
vertexBuffer Axiom.Graphics.HardwareVertexBuffer
vertexOffset int

Méthodes publiques

Méthode Description
Build ( HardwareVertexBuffer destVertexBuffer, int vertexStart, HardwareIndexBuffer destIndexBuffer, int indexStart ) : void

Tells the system to build the mesh relating to the surface into externally created buffers.

The VertexDeclaration of the vertex buffer must be identical to the one passed into DefineSurface(Array, VertexDeclaration, int, int). In addition, there must be enough space in the buffer to accommodate the patch at full detail level; you should check RequiredVertexCount and RequiredIndexCount to determine this. This method does not create an internal mesh for this patch and so GetMesh will return null if you call it after building the patch this way.

DefineSurface ( Array controlPointArray, Axiom.Graphics.VertexDeclaration decl, int width, int height ) : void

Sets up the surface by defining it's control points, type and initial subdivision level.

This method initializes the surface by passing it a set of control points. The type of curves to be used are also defined here, although the only supported option currently is a bezier patch. You can also specify a global subdivision level here if you like, although it is recommended that the parameter is left as AUTO_LEVEL, which means the system decides how much subdivision is required (based on the curvature of the surface).

DefineSurface ( Array controlPointArray, Axiom.Graphics.VertexDeclaration declaration, int width, int height, PatchSurfaceType type, int uMaxSubdivisionLevel, int vMaxSubdivisionLevel, VisibleSide visibleSide ) : void

Sets up the surface by defining it's control points, type and initial subdivision level.

This method initialises the surface by passing it a set of control points. The type of curves to be used are also defined here, although the only supported option currently is a bezier patch. You can also specify a global subdivision level here if you like, although it is recommended that the parameter is left as AUTO_LEVEL, which means the system decides how much subdivision is required (based on the curvature of the surface).

PatchSurface ( ) : System

Default contructor.

Méthodes protégées

Méthode Description
DistributeControlPoints ( IntPtr lockedBuffer ) : void

FindLevel ( Vector3 &a, Vector3 &b, Vector3 &c ) : int

Internal method for finding the subdivision level given 3 control points.

GetAutoULevel ( ) : int

GetAutoULevel ( bool forMax ) : int

GetAutoVLevel ( ) : int

GetAutoVLevel ( bool forMax ) : int

InterpolateVertexData ( IntPtr lockedBuffer, int leftIndex, int rightIndex, int destIndex ) : void

LevelWidth ( int level ) : int
MakeTriangles ( ) : void

SubdivideCurve ( IntPtr lockedBuffer, int startIdx, int stepSize, int numSteps, int iterations ) : void

Method Details

Build() public méthode

Tells the system to build the mesh relating to the surface into externally created buffers.
The VertexDeclaration of the vertex buffer must be identical to the one passed into DefineSurface(Array, VertexDeclaration, int, int). In addition, there must be enough space in the buffer to accommodate the patch at full detail level; you should check RequiredVertexCount and RequiredIndexCount to determine this. This method does not create an internal mesh for this patch and so GetMesh will return null if you call it after building the patch this way.
public Build ( HardwareVertexBuffer destVertexBuffer, int vertexStart, HardwareIndexBuffer destIndexBuffer, int indexStart ) : void
destVertexBuffer Axiom.Graphics.HardwareVertexBuffer The destination vertex buffer in which to build the patch.
vertexStart int The offset at which to start writing vertices for this patch.
destIndexBuffer Axiom.Graphics.HardwareIndexBuffer The destination index buffer in which to build the patch.
indexStart int The offset at which to start writing indexes for this patch.
Résultat void

DefineSurface() public méthode

Sets up the surface by defining it's control points, type and initial subdivision level.
This method initializes the surface by passing it a set of control points. The type of curves to be used are also defined here, although the only supported option currently is a bezier patch. You can also specify a global subdivision level here if you like, although it is recommended that the parameter is left as AUTO_LEVEL, which means the system decides how much subdivision is required (based on the curvature of the surface).
public DefineSurface ( Array controlPointArray, Axiom.Graphics.VertexDeclaration decl, int width, int height ) : void
controlPointArray System.Array /// An array containing the vertex data which define 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 array is internally treated as a contiguous memory buffer without any gaps between the elements. /// The format of the buffer is defined in the VertexDeclaration parameter. ///
decl Axiom.Graphics.VertexDeclaration /// VertexDeclaration describing the contents of the buffer. /// Note this declaration must _only_ draw on buffer source 0! ///
width int Specifies the width of the patch in control points.
height int Specifies the height of the patch in control points.
Résultat void

DefineSurface() public méthode

Sets up the surface by defining it's control points, type and initial subdivision level.
This method initialises the surface by passing it a set of control points. The type of curves to be used are also defined here, although the only supported option currently is a bezier patch. You can also specify a global subdivision level here if you like, although it is recommended that the parameter is left as AUTO_LEVEL, which means the system decides how much subdivision is required (based on the curvature of the surface).
public DefineSurface ( Array controlPointArray, Axiom.Graphics.VertexDeclaration declaration, int width, int height, PatchSurfaceType type, int uMaxSubdivisionLevel, int vMaxSubdivisionLevel, VisibleSide visibleSide ) : void
controlPointArray System.Array /// An array containing the vertex data which define 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 array is internally treated as a contiguous memory buffer without any gaps between the elements. /// The format of the buffer is defined in the VertexDeclaration parameter. ///
declaration Axiom.Graphics.VertexDeclaration /// VertexDeclaration describing the contents of the buffer. /// Note this declaration must _only_ draw on buffer source 0! ///
width int Specifies the width of the patch in control points.
height int Specifies the height of the patch in control points.
type PatchSurfaceType The type of surface.
uMaxSubdivisionLevel int /// If you want to manually set the top level of subdivision, /// do it here, otherwise let the system decide. ///
vMaxSubdivisionLevel int /// If you want to manually set the top level of subdivision, /// do it here, otherwise let the system decide. ///
visibleSide VisibleSide Determines which side of the patch (or both) triangles are generated for.
Résultat void

DistributeControlPoints() protected méthode

protected DistributeControlPoints ( IntPtr lockedBuffer ) : void
lockedBuffer System.IntPtr
Résultat void

FindLevel() protected méthode

Internal method for finding the subdivision level given 3 control points.
protected FindLevel ( Vector3 &a, Vector3 &b, Vector3 &c ) : int
a Vector3 First control point.
b Vector3 Second control point.
c Vector3 Third control point.
Résultat int

GetAutoULevel() protected méthode

protected GetAutoULevel ( ) : int
Résultat int

GetAutoULevel() protected méthode

protected GetAutoULevel ( bool forMax ) : int
forMax bool
Résultat int

GetAutoVLevel() protected méthode

protected GetAutoVLevel ( ) : int
Résultat int

GetAutoVLevel() protected méthode

protected GetAutoVLevel ( bool forMax ) : int
forMax bool
Résultat int

InterpolateVertexData() protected méthode

protected InterpolateVertexData ( IntPtr lockedBuffer, int leftIndex, int rightIndex, int destIndex ) : void
lockedBuffer System.IntPtr
leftIndex int
rightIndex int
destIndex int
Résultat void

LevelWidth() protected méthode

protected LevelWidth ( int level ) : int
level int
Résultat int

MakeTriangles() protected méthode

protected MakeTriangles ( ) : void
Résultat void

PatchSurface() public méthode

Default contructor.
public PatchSurface ( ) : System
Résultat System

SubdivideCurve() protected méthode

protected SubdivideCurve ( IntPtr lockedBuffer, int startIdx, int stepSize, int numSteps, int iterations ) : void
lockedBuffer System.IntPtr
startIdx int
stepSize int
numSteps int
iterations int
Résultat void

Property Details

aabb protected_oe property

protected AxisAlignedBox,Axiom.MathLib aabb
Résultat Axiom.MathLib.AxisAlignedBox

boundingSphereRadius protected_oe property

protected float boundingSphereRadius
Résultat float

controlCount protected_oe property

Total number of control level.
protected int controlCount
Résultat int

controlHeight protected_oe property

Height in control points.
protected int controlHeight
Résultat int

controlPointBuffer protected_oe property

Buffer containing the system-memory control points.
protected IntPtr,System controlPointBuffer
Résultat System.IntPtr

controlPoints protected_oe property

List of control points.
protected List controlPoints
Résultat List

controlWidth protected_oe property

Width in control points.
protected int controlWidth
Résultat int

currentIndexCount protected_oe property

protected int currentIndexCount
Résultat int

declaration protected_oe property

Vertex declaration describing the control point buffer.
protected VertexDeclaration,Axiom.Graphics declaration
Résultat Axiom.Graphics.VertexDeclaration

indexBuffer protected_oe property

protected HardwareIndexBuffer,Axiom.Graphics indexBuffer
Résultat Axiom.Graphics.HardwareIndexBuffer

indexOffset protected_oe property

protected int indexOffset
Résultat int

maxULevel protected_oe property

Max U subdivision level.
protected int maxULevel
Résultat int

maxVLevel protected_oe property

Max V subdivision level.
protected int maxVLevel
Résultat int

meshHeight protected_oe property

Height of the subdivided mesh (big enough for max level).
protected int meshHeight
Résultat int

meshWidth protected_oe property

Width of the subdivided mesh (big enough for max level).
protected int meshWidth
Résultat int

requiredIndexCount protected_oe property

protected int requiredIndexCount
Résultat int

requiredVertexCount protected_oe property

protected int requiredVertexCount
Résultat int

side protected_oe property

Which side is visible.
protected VisibleSide side
Résultat VisibleSide

subdivisionFactor protected_oe property

Mesh subdivision factor.
protected float subdivisionFactor
Résultat float

type protected_oe property

Type of surface.
protected PatchSurfaceType type
Résultat PatchSurfaceType

uLevel protected_oe property

U-direction subdivision level.
protected int uLevel
Résultat int

vLevel protected_oe property

V-direction subdivision level.
protected int vLevel
Résultat int

vertexBuffer protected_oe property

protected HardwareVertexBuffer,Axiom.Graphics vertexBuffer
Résultat Axiom.Graphics.HardwareVertexBuffer

vertexOffset protected_oe property

protected int vertexOffset
Résultat int