C# 클래스 FarseerPhysics.Common.PolygonManipulation.YuPengClipper

파일 보기 프로젝트 열기: prime31/Nez

공개 메소드들

메소드 설명
difference ( Vertices polygon1, Vertices polygon2, PolyClipError &error ) : List
intersect ( Vertices polygon1, Vertices polygon2, PolyClipError &error ) : List
union ( Vertices polygon1, Vertices polygon2, PolyClipError &error ) : List

비공개 메소드들

메소드 설명
buildPolygonsFromChain ( List simplicies, List &result ) : PolyClipError

Calculates the polygon(s) from the result simplical chain.

Used by method Execute().

calculateBeta ( Vector2 point, Edge e, float coefficient ) : float

Needed to calculate the characteristics function of a simplex.

Used by method CalculateEdgeCharacter().

calculateIntersections ( Vertices polygon1, Vertices polygon2, Vertices &slicedPoly1, Vertices &slicedPoly2 ) : void

Calculates all intersections between two polygons.

calculateResultChain ( List poly1Coeff, List poly1Simplicies, List poly2Coeff, List poly2Simplicies, PolyClipType clipType, List &resultSimplices ) : void

Calculates the characteristics function for all edges of the given simplical chains and builds the result chain.

Used by method Execute().

calculateSimplexCoefficient ( Vector2 a, Vector2 b, Vector2 c ) : float

Returns the coefficient of a simplex.

Used by method CalculateSimplicalChain().

calculateSimplicalChain ( Vertices poly, List &coeff, List &simplicies ) : void

Calculates the simplical chain corresponding to the input polygon.

Used by method Execute().

execute ( Vertices subject, Vertices clip, PolyClipType clipType, PolyClipError &error ) : List

Implements "A new algorithm for Boolean operations on general polygons" available here: http://liama.ia.ac.cn/wiki/_media/user:dong:dong_cg_05.pdf Merges two polygons, a subject and a clip with the specified operation. Polygons may not be self-intersecting. Warning: May yield incorrect results or even crash if polygons contain collinear points.

getAlpha ( Vector2 start, Vector2 end, Vector2 point ) : float

Needed for sorting multiple intersections points on the same edge.

Used by method CalculateIntersections().

pointInSimplex ( Vector2 point, Edge edge ) : bool

Winding number test for a point in a simplex.

pointOnLineSegment ( Vector2 start, Vector2 end, Vector2 point ) : bool

Tests if a point lies on a line segment.

Used by method CalculateBeta().

vectorEqual ( Vector2 vec1, Vector2 vec2 ) : bool

메소드 상세

difference() 공개 정적인 메소드

public static difference ( Vertices polygon1, Vertices polygon2, PolyClipError &error ) : List
polygon1 Vertices
polygon2 Vertices
error PolyClipError
리턴 List

intersect() 공개 정적인 메소드

public static intersect ( Vertices polygon1, Vertices polygon2, PolyClipError &error ) : List
polygon1 Vertices
polygon2 Vertices
error PolyClipError
리턴 List

union() 공개 정적인 메소드

public static union ( Vertices polygon1, Vertices polygon2, PolyClipError &error ) : List
polygon1 Vertices
polygon2 Vertices
error PolyClipError
리턴 List