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.
파일 보기 프로젝트 열기: WolfgangSt/axiom 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
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