C# 클래스 Axiom.Core.ProgressiveMesh

Class for handling multiple levels of detail for a Mesh
This class reduces the complexity of the geometry it is given. This class is dedicated to reducing the number of triangles in a given mesh taking into account seams in both geometry and texture co-ordinates and meshes which have multiple frames. The primary use for this is generating LOD versions of Mesh objects, but it can be used by any geometry provider. The only limitation at the moment is that the provider uses a common vertex buffer for all LODs and one index buffer per LOD. Therefore at the moment this class can only handle indexed geometry. NB the interface of this class will certainly change when compiled vertex buffers are supported.
파일 보기 프로젝트 열기: WolfgangSt/axiom 1 사용 예제들

공개 메소드들

메소드 설명
AddExtraVertexPositionBuffer ( VertexData vertexData ) : void

Adds an extra vertex position buffer.

As well as the main vertex buffer, the client of this class may add extra versions of the vertex buffer which will also be taken into account when the cost of simplifying the mesh is taken into account. This is because the cost of simplifying an animated mesh cannot be calculated from just the reference position, multiple positions needs to be assessed in order to find the best simplification option.

DO NOT pass write-only, unshadowed buffers to this method! They will not work. Pass only shadowed buffers, or better yet perform mesh reduction as an offline process using DefaultHardwareBufferManager to manage vertex buffers in system memory.

AddWorkingData ( VertexData vertexData, IndexData indexData ) : void

Internal method for building PMWorkingData from geometry data

BakeNewLOD ( IndexData indexData ) : void

Internal method builds an new LOD based on the current state

Build ( ushort numLevels, List lodFaceList ) : void
Build ( ushort numLevels, List lodFaceList, VertexReductionQuota quota ) : void
Build ( ushort numLevels, List lodFaceList, VertexReductionQuota quota, float reductionValue ) : void

Builds the progressive mesh with the specified number of levels.

Build ( ushort numLevels, List lodFaceList, float reductionValue ) : void
Collapse ( PMVertex src ) : void

Internal method, collapses vertex onto it's saved collapse target.

This updates the working triangle list to drop a triangle and recalculates the edge collapse costs around the collapse target. This also updates all the working vertex lists for the relevant buffer.

ComputeAllCosts ( ) : void
ComputeEdgeCostAtVertex ( uint vertIndex ) : void
InitialiseEdgeCollapseCosts ( ) : void
ProgressiveMesh ( VertexData vertexData, IndexData indexData ) : System

Constructor, takes the geometry data and index buffer.

DO NOT pass write-only, unshadowed buffers to this method! They will not work. Pass only shadowed buffers, or better yet perform mesh reduction as an offline process using DefaultHardwareBufferManager to manage vertex buffers in system memory.

비공개 메소드들

메소드 설명
ComputeEdgeCollapseCost ( PMVertex src, PMVertex dest ) : float
ComputeEdgeCostAtVertexForBuffer ( PMWorkingData workingData, uint vertIndex ) : float

Internal method evaluates all collapse costs from this vertex and picks the lowest for a single buffer

GetNextCollapser ( ) : int

메소드 상세

AddExtraVertexPositionBuffer() 공개 메소드

Adds an extra vertex position buffer.
As well as the main vertex buffer, the client of this class may add extra versions of the vertex buffer which will also be taken into account when the cost of simplifying the mesh is taken into account. This is because the cost of simplifying an animated mesh cannot be calculated from just the reference position, multiple positions needs to be assessed in order to find the best simplification option.

DO NOT pass write-only, unshadowed buffers to this method! They will not work. Pass only shadowed buffers, or better yet perform mesh reduction as an offline process using DefaultHardwareBufferManager to manage vertex buffers in system memory.

public AddExtraVertexPositionBuffer ( VertexData vertexData ) : void
vertexData Axiom.Graphics.VertexData buffer Pointer to x/y/z buffer with vertex positions. /// The number of vertices must be the same as in the original GeometryData passed to the constructor. ///
리턴 void

AddWorkingData() 공개 메소드

Internal method for building PMWorkingData from geometry data
public AddWorkingData ( VertexData vertexData, IndexData indexData ) : void
vertexData Axiom.Graphics.VertexData
indexData Axiom.Graphics.IndexData
리턴 void

BakeNewLOD() 공개 메소드

Internal method builds an new LOD based on the current state
public BakeNewLOD ( IndexData indexData ) : void
indexData Axiom.Graphics.IndexData Index data which will have an index buffer created and initialized
리턴 void

Build() 공개 메소드

public Build ( ushort numLevels, List lodFaceList ) : void
numLevels ushort
lodFaceList List
리턴 void

Build() 공개 메소드

public Build ( ushort numLevels, List lodFaceList, VertexReductionQuota quota ) : void
numLevels ushort
lodFaceList List
quota VertexReductionQuota
리턴 void

Build() 공개 메소드

Builds the progressive mesh with the specified number of levels.
public Build ( ushort numLevels, List lodFaceList, VertexReductionQuota quota, float reductionValue ) : void
numLevels ushort
lodFaceList List
quota VertexReductionQuota
reductionValue float
리턴 void

Build() 공개 메소드

public Build ( ushort numLevels, List lodFaceList, float reductionValue ) : void
numLevels ushort
lodFaceList List
reductionValue float
리턴 void

Collapse() 공개 메소드

Internal method, collapses vertex onto it's saved collapse target.
This updates the working triangle list to drop a triangle and recalculates the edge collapse costs around the collapse target. This also updates all the working vertex lists for the relevant buffer.
public Collapse ( PMVertex src ) : void
src PMVertex
리턴 void

ComputeAllCosts() 공개 메소드

public ComputeAllCosts ( ) : void
리턴 void

ComputeEdgeCostAtVertex() 공개 메소드

public ComputeEdgeCostAtVertex ( uint vertIndex ) : void
vertIndex uint
리턴 void

InitialiseEdgeCollapseCosts() 공개 메소드

public InitialiseEdgeCollapseCosts ( ) : void
리턴 void

ProgressiveMesh() 공개 메소드

Constructor, takes the geometry data and index buffer.
DO NOT pass write-only, unshadowed buffers to this method! They will not work. Pass only shadowed buffers, or better yet perform mesh reduction as an offline process using DefaultHardwareBufferManager to manage vertex buffers in system memory.
public ProgressiveMesh ( VertexData vertexData, IndexData indexData ) : System
vertexData Axiom.Graphics.VertexData
indexData Axiom.Graphics.IndexData
리턴 System