C# Class LibTessDotNet.Geom

Mostrar archivo Open project: Ideefixze/TutorialUnityMultiplayer Class Usage Examples

Public Methods

Method Description
AddWinding ( LibTessDotNet.MeshUtils.Edge eDst, LibTessDotNet.MeshUtils.Edge eSrc ) : void
EdgeEval ( LibTessDotNet.MeshUtils.Vertex u, LibTessDotNet.MeshUtils.Vertex v, LibTessDotNet.MeshUtils.Vertex w ) : Real

Given three vertices u,v,w such that VertLeq(u,v) && VertLeq(v,w), evaluates the t-coord of the edge uw at the s-coord of the vertex v. Returns v->t - (uw)(v->s), ie. the signed distance from uw to v. If uw is vertical (and thus passes thru v), the result is zero. The calculation is extremely accurate and stable, even when v is very close to u or w. In particular if we set v->t = 0 and let r be the negated result (this evaluates (uw)(v->s)), then r is guaranteed to satisfy MIN(u->t,w->t) <= r <= MAX(u->t,w->t).

EdgeGoesLeft ( LibTessDotNet.MeshUtils.Edge e ) : bool
EdgeGoesRight ( LibTessDotNet.MeshUtils.Edge e ) : bool
EdgeIntersect ( LibTessDotNet.MeshUtils.Vertex o1, LibTessDotNet.MeshUtils.Vertex d1, LibTessDotNet.MeshUtils.Vertex o2, LibTessDotNet.MeshUtils.Vertex d2, LibTessDotNet.MeshUtils.Vertex v ) : void

Given edges (o1,d1) and (o2,d2), compute their point of intersection. The computed point is guaranteed to lie in the intersection of the bounding rectangles defined by each edge.

EdgeSign ( LibTessDotNet.MeshUtils.Vertex u, LibTessDotNet.MeshUtils.Vertex v, LibTessDotNet.MeshUtils.Vertex w ) : Real

Returns a number whose sign matches EdgeEval(u,v,w) but which is cheaper to evaluate. Returns > 0, == 0 , or < 0 as v is above, on, or below the edge uw.

Interpolate ( Real a, Real x, Real b, Real y ) : Real
IsWindingInside ( WindingRule rule, int n ) : bool
TransEval ( LibTessDotNet.MeshUtils.Vertex u, LibTessDotNet.MeshUtils.Vertex v, LibTessDotNet.MeshUtils.Vertex w ) : Real
TransLeq ( LibTessDotNet.MeshUtils.Vertex lhs, LibTessDotNet.MeshUtils.Vertex rhs ) : bool
TransSign ( LibTessDotNet.MeshUtils.Vertex u, LibTessDotNet.MeshUtils.Vertex v, LibTessDotNet.MeshUtils.Vertex w ) : Real
VertCCW ( LibTessDotNet.MeshUtils.Vertex u, LibTessDotNet.MeshUtils.Vertex v, LibTessDotNet.MeshUtils.Vertex w ) : bool
VertEq ( LibTessDotNet.MeshUtils.Vertex lhs, LibTessDotNet.MeshUtils.Vertex rhs ) : bool
VertL1dist ( LibTessDotNet.MeshUtils.Vertex u, LibTessDotNet.MeshUtils.Vertex v ) : Real
VertLeq ( LibTessDotNet.MeshUtils.Vertex lhs, LibTessDotNet.MeshUtils.Vertex rhs ) : bool

Private Methods

Method Description
Swap ( LibTessDotNet.MeshUtils.Vertex &a, LibTessDotNet.MeshUtils.Vertex &b ) : void

Method Details

AddWinding() public static method

public static AddWinding ( LibTessDotNet.MeshUtils.Edge eDst, LibTessDotNet.MeshUtils.Edge eSrc ) : void
eDst LibTessDotNet.MeshUtils.Edge
eSrc LibTessDotNet.MeshUtils.Edge
return void

EdgeEval() public static method

Given three vertices u,v,w such that VertLeq(u,v) && VertLeq(v,w), evaluates the t-coord of the edge uw at the s-coord of the vertex v. Returns v->t - (uw)(v->s), ie. the signed distance from uw to v. If uw is vertical (and thus passes thru v), the result is zero. The calculation is extremely accurate and stable, even when v is very close to u or w. In particular if we set v->t = 0 and let r be the negated result (this evaluates (uw)(v->s)), then r is guaranteed to satisfy MIN(u->t,w->t) <= r <= MAX(u->t,w->t).
public static EdgeEval ( LibTessDotNet.MeshUtils.Vertex u, LibTessDotNet.MeshUtils.Vertex v, LibTessDotNet.MeshUtils.Vertex w ) : Real
u LibTessDotNet.MeshUtils.Vertex
v LibTessDotNet.MeshUtils.Vertex
w LibTessDotNet.MeshUtils.Vertex
return Real

EdgeGoesLeft() public static method

public static EdgeGoesLeft ( LibTessDotNet.MeshUtils.Edge e ) : bool
e LibTessDotNet.MeshUtils.Edge
return bool

EdgeGoesRight() public static method

public static EdgeGoesRight ( LibTessDotNet.MeshUtils.Edge e ) : bool
e LibTessDotNet.MeshUtils.Edge
return bool

EdgeIntersect() public static method

Given edges (o1,d1) and (o2,d2), compute their point of intersection. The computed point is guaranteed to lie in the intersection of the bounding rectangles defined by each edge.
public static EdgeIntersect ( LibTessDotNet.MeshUtils.Vertex o1, LibTessDotNet.MeshUtils.Vertex d1, LibTessDotNet.MeshUtils.Vertex o2, LibTessDotNet.MeshUtils.Vertex d2, LibTessDotNet.MeshUtils.Vertex v ) : void
o1 LibTessDotNet.MeshUtils.Vertex
d1 LibTessDotNet.MeshUtils.Vertex
o2 LibTessDotNet.MeshUtils.Vertex
d2 LibTessDotNet.MeshUtils.Vertex
v LibTessDotNet.MeshUtils.Vertex
return void

EdgeSign() public static method

Returns a number whose sign matches EdgeEval(u,v,w) but which is cheaper to evaluate. Returns > 0, == 0 , or < 0 as v is above, on, or below the edge uw.
public static EdgeSign ( LibTessDotNet.MeshUtils.Vertex u, LibTessDotNet.MeshUtils.Vertex v, LibTessDotNet.MeshUtils.Vertex w ) : Real
u LibTessDotNet.MeshUtils.Vertex
v LibTessDotNet.MeshUtils.Vertex
w LibTessDotNet.MeshUtils.Vertex
return Real

Interpolate() public static method

public static Interpolate ( Real a, Real x, Real b, Real y ) : Real
a Real
x Real
b Real
y Real
return Real

IsWindingInside() public static method

public static IsWindingInside ( WindingRule rule, int n ) : bool
rule WindingRule
n int
return bool

TransEval() public static method

public static TransEval ( LibTessDotNet.MeshUtils.Vertex u, LibTessDotNet.MeshUtils.Vertex v, LibTessDotNet.MeshUtils.Vertex w ) : Real
u LibTessDotNet.MeshUtils.Vertex
v LibTessDotNet.MeshUtils.Vertex
w LibTessDotNet.MeshUtils.Vertex
return Real

TransLeq() public static method

public static TransLeq ( LibTessDotNet.MeshUtils.Vertex lhs, LibTessDotNet.MeshUtils.Vertex rhs ) : bool
lhs LibTessDotNet.MeshUtils.Vertex
rhs LibTessDotNet.MeshUtils.Vertex
return bool

TransSign() public static method

public static TransSign ( LibTessDotNet.MeshUtils.Vertex u, LibTessDotNet.MeshUtils.Vertex v, LibTessDotNet.MeshUtils.Vertex w ) : Real
u LibTessDotNet.MeshUtils.Vertex
v LibTessDotNet.MeshUtils.Vertex
w LibTessDotNet.MeshUtils.Vertex
return Real

VertCCW() public static method

public static VertCCW ( LibTessDotNet.MeshUtils.Vertex u, LibTessDotNet.MeshUtils.Vertex v, LibTessDotNet.MeshUtils.Vertex w ) : bool
u LibTessDotNet.MeshUtils.Vertex
v LibTessDotNet.MeshUtils.Vertex
w LibTessDotNet.MeshUtils.Vertex
return bool

VertEq() public static method

public static VertEq ( LibTessDotNet.MeshUtils.Vertex lhs, LibTessDotNet.MeshUtils.Vertex rhs ) : bool
lhs LibTessDotNet.MeshUtils.Vertex
rhs LibTessDotNet.MeshUtils.Vertex
return bool

VertL1dist() public static method

public static VertL1dist ( LibTessDotNet.MeshUtils.Vertex u, LibTessDotNet.MeshUtils.Vertex v ) : Real
u LibTessDotNet.MeshUtils.Vertex
v LibTessDotNet.MeshUtils.Vertex
return Real

VertLeq() public static method

public static VertLeq ( LibTessDotNet.MeshUtils.Vertex lhs, LibTessDotNet.MeshUtils.Vertex rhs ) : bool
lhs LibTessDotNet.MeshUtils.Vertex
rhs LibTessDotNet.MeshUtils.Vertex
return bool