C# 클래스 LibTessDotNet.Tess

The main tessellation class
파일 보기 프로젝트 열기: Ideefixze/TutorialUnityMultiplayer 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
NoEmptyPolygons bool
SUnitX Real
SUnitY Real
SentinelCoord Real
UsePooling bool

공개 메소드들

메소드 설명
AddContour ( Array vertices ) : void
AddContour ( Array vertices, ContourOrientation forceOrientation ) : void
Tess ( ) : System
Tessellate ( WindingRule windingRule, ElementType elementType, int polySize ) : void
Tessellate ( WindingRule windingRule, ElementType elementType, int polySize, CombineCallback combineCallback ) : void

비공개 메소드들

메소드 설명
CheckOrientation ( ) : void
ComputeNormal ( LibTessDotNet.Vec3 &norm ) : void
DiscardExterior ( ) : void

DiscardExterior zaps (ie. sets to null) all faces which are not marked "inside" the polygon. Since further mesh operations on NULL faces are not allowed, the main purpose is to clean up the mesh so that exterior loops are not represented in the data structure.

GetNeighbourFace ( LibTessDotNet.MeshUtils.Edge edge ) : int
OutputContours ( ) : void
OutputPolymesh ( ElementType elementType, int polySize ) : void
ProjectPolygon ( ) : void
SetWindingNumber ( int value, bool keepOnlyBoundary ) : void

SetWindingNumber( value, keepOnlyBoundary ) resets the winding numbers on all edges so that regions marked "inside" the polygon have a winding number of "value", and regions outside have a winding number of 0. If keepOnlyBoundary is TRUE, it also deletes all edges which do not separate an interior region from an exterior one.

SignedArea ( Array vertices ) : Real
TessellateInterior ( ) : void

TessellateInterior( mesh ) tessellates each region of the mesh which is marked "inside" the polygon. Each such region must be monotone.

TessellateMonoRegion ( LibTessDotNet.MeshUtils.Face face ) : void

TessellateMonoRegion( face ) tessellates a monotone region (what else would it do??) The region must consist of a single loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this case means that any vertical line intersects the interior of the region in a single interval. Tessellation consists of adding interior edges (actually pairs of half-edges), to split the region into non-overlapping triangles. The basic idea is explained in Preparata and Shamos (which I don't have handy right now), although their implementation is more complicated than this one. The are two edge chains, an upper chain and a lower chain. We process all vertices from both chains in order, from right to left. The algorithm ensures that the following invariant holds after each vertex is processed: the untessellated region consists of two chains, where one chain (say the upper) is a single edge, and the other chain is concave. The left vertex of the single edge is always to the left of all vertices in the concave chain. Each step consists of adding the rightmost unprocessed vertex to one of the two chains, and forming a fan of triangles from the rightmost of two chain endpoints. Determining whether we can add each triangle to the fan is a simple orientation test. By making the fan as large as possible, we restore the invariant (check it yourself).

메소드 상세

AddContour() 공개 메소드

public AddContour ( Array vertices ) : void
vertices Array
리턴 void

AddContour() 공개 메소드

public AddContour ( Array vertices, ContourOrientation forceOrientation ) : void
vertices Array
forceOrientation ContourOrientation
리턴 void

Tess() 공개 메소드

public Tess ( ) : System
리턴 System

Tessellate() 공개 메소드

public Tessellate ( WindingRule windingRule, ElementType elementType, int polySize ) : void
windingRule WindingRule
elementType ElementType
polySize int
리턴 void

Tessellate() 공개 메소드

public Tessellate ( WindingRule windingRule, ElementType elementType, int polySize, CombineCallback combineCallback ) : void
windingRule WindingRule
elementType ElementType
polySize int
combineCallback CombineCallback
리턴 void

프로퍼티 상세

NoEmptyPolygons 공개적으로 프로퍼티

If true, will remove empty (zero area) polygons.
public bool NoEmptyPolygons
리턴 bool

SUnitX 공개적으로 프로퍼티

public Real SUnitX
리턴 Real

SUnitY 공개적으로 프로퍼티

public Real SUnitY
리턴 Real

SentinelCoord 공개적으로 프로퍼티

public Real SentinelCoord
리턴 Real

UsePooling 공개적으로 프로퍼티

If true, will use pooling to reduce GC (compare performance with/without, can vary wildly).
public bool UsePooling
리턴 bool