C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
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

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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

Описание методов

Build() публичный метод

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.
Результат void

DefineSurface() публичный метод

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.
Результат void

DefineSurface() публичный метод

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.
Результат void

DistributeControlPoints() защищенный метод

protected DistributeControlPoints ( IntPtr lockedBuffer ) : void
lockedBuffer System.IntPtr
Результат void

FindLevel() защищенный метод

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.
Результат int

GetAutoULevel() защищенный метод

protected GetAutoULevel ( ) : int
Результат int

GetAutoULevel() защищенный метод

protected GetAutoULevel ( bool forMax ) : int
forMax bool
Результат int

GetAutoVLevel() защищенный метод

protected GetAutoVLevel ( ) : int
Результат int

GetAutoVLevel() защищенный метод

protected GetAutoVLevel ( bool forMax ) : int
forMax bool
Результат int

InterpolateVertexData() защищенный метод

protected InterpolateVertexData ( IntPtr lockedBuffer, int leftIndex, int rightIndex, int destIndex ) : void
lockedBuffer System.IntPtr
leftIndex int
rightIndex int
destIndex int
Результат void

LevelWidth() защищенный метод

protected LevelWidth ( int level ) : int
level int
Результат int

MakeTriangles() защищенный метод

protected MakeTriangles ( ) : void
Результат void

PatchSurface() публичный метод

Default contructor.
public PatchSurface ( ) : System
Результат System

SubdivideCurve() защищенный метод

protected SubdivideCurve ( IntPtr lockedBuffer, int startIdx, int stepSize, int numSteps, int iterations ) : void
lockedBuffer System.IntPtr
startIdx int
stepSize int
numSteps int
iterations int
Результат void

Описание свойств

aabb защищенное свойство

protected AxisAlignedBox,Axiom.MathLib aabb
Результат Axiom.MathLib.AxisAlignedBox

boundingSphereRadius защищенное свойство

protected float boundingSphereRadius
Результат float

controlCount защищенное свойство

Total number of control level.
protected int controlCount
Результат int

controlHeight защищенное свойство

Height in control points.
protected int controlHeight
Результат int

controlPointBuffer защищенное свойство

Buffer containing the system-memory control points.
protected IntPtr,System controlPointBuffer
Результат System.IntPtr

controlPoints защищенное свойство

List of control points.
protected List controlPoints
Результат List

controlWidth защищенное свойство

Width in control points.
protected int controlWidth
Результат int

currentIndexCount защищенное свойство

protected int currentIndexCount
Результат int

declaration защищенное свойство

Vertex declaration describing the control point buffer.
protected VertexDeclaration,Axiom.Graphics declaration
Результат Axiom.Graphics.VertexDeclaration

indexBuffer защищенное свойство

protected HardwareIndexBuffer,Axiom.Graphics indexBuffer
Результат Axiom.Graphics.HardwareIndexBuffer

indexOffset защищенное свойство

protected int indexOffset
Результат int

maxULevel защищенное свойство

Max U subdivision level.
protected int maxULevel
Результат int

maxVLevel защищенное свойство

Max V subdivision level.
protected int maxVLevel
Результат int

meshHeight защищенное свойство

Height of the subdivided mesh (big enough for max level).
protected int meshHeight
Результат int

meshWidth защищенное свойство

Width of the subdivided mesh (big enough for max level).
protected int meshWidth
Результат int

requiredIndexCount защищенное свойство

protected int requiredIndexCount
Результат int

requiredVertexCount защищенное свойство

protected int requiredVertexCount
Результат int

side защищенное свойство

Which side is visible.
protected VisibleSide side
Результат VisibleSide

subdivisionFactor защищенное свойство

Mesh subdivision factor.
protected float subdivisionFactor
Результат float

type защищенное свойство

Type of surface.
protected PatchSurfaceType type
Результат PatchSurfaceType

uLevel защищенное свойство

U-direction subdivision level.
protected int uLevel
Результат int

vLevel защищенное свойство

V-direction subdivision level.
protected int vLevel
Результат int

vertexBuffer защищенное свойство

protected HardwareVertexBuffer,Axiom.Graphics vertexBuffer
Результат Axiom.Graphics.HardwareVertexBuffer

vertexOffset защищенное свойство

protected int vertexOffset
Результат int