C# Class SharpNav.PolyMesh

The class of Poly mesh.
Exibir arquivo Open project: Robmaister/SharpNav Class Usage Examples

Public Methods

Method Description
Diagonal ( int i, int j, PolyVertex verts, int indices ) : bool

True if and only if (v[i], v[j]) is a proper internal diagonal of polygon.

Diagonalie ( int i, int j, PolyVertex verts, int indices ) : bool

True if and only if (v[i], v[j]) is internal or external diagonal ignoring edges incident to v[i] or v[j].

HasDiagonalFlag ( int index ) : bool

Determines if it is a diagonal flag on the specified index.

InCone ( int i, int j, PolyVertex verts, int indices ) : bool

True if and only if diagonal (i, j) is strictly internal to polygon in neighborhood of i endpoint.

IsBoundaryEdge ( int flag ) : bool

Determines if it is a boundary edge with the specified flag.

IsInteriorEdge ( int flag ) : bool

Determines if it is an interior edge with the specified flag.

PolyMesh ( ContourSet contSet, SharpNav.NavMeshGenerationSettings settings )

Initializes a new instance of the PolyMesh class.

PolyMesh ( ContourSet contSet, float cellSize, float cellHeight, int borderSize, int numVertsPerPoly )

Initializes a new instance of the PolyMesh class by creating polygons from contours.

Private Methods

Method Description
AddVertex ( int>.Dictionary vertDict, PolyVertex v, List verts ) : int

Generate a new vertices with (x, y, z) coordiates and return the hash code index

BuildMeshAdjacency ( List vertices, List polys, int numVertsPerPoly ) : void

Connect two adjacent vertices with edges.

CanRemoveVertex ( List polys, int remove ) : bool

If vertex can't be removed, there is no need to spend time deleting it.

DiagonalLoose ( int i, int j, PolyVertex verts, int indices ) : bool
DiagonalieLoose ( int i, int j, PolyVertex verts, int indices ) : bool
GetPolyMergeValue ( List polys, int polyA, int polyB, List verts, int &edgeA, int &edgeB ) : int

Try to merge two polygons. If possible, return the distance squared between two vertices.

InConeLoose ( int i, int j, PolyVertex verts, int indices ) : bool
Next ( int i, int n ) : int

Gets the next vertex index

Prev ( int i, int n ) : int

Gets the previous vertex index

RemoveDiagonalFlag ( int index ) : int

Remove the diagonal flag for a vertex

RemoveDiagonalFlag ( int &index ) : void

Remove the diagonal flag for a vertex

RemoveVertex ( List verts, List polys, int vertex ) : void

Removing vertices will leave holes that have to be triangulated again.

SetDiagonalFlag ( int &index ) : void

Sets the diagonal flag for a vertex

Triangulate ( int n, PolyVertex verts, int indices, Triangle tris ) : int

Walk the edges of a contour to determine whether a triangle can be formed. Form as many triangles as possible.

ULeft ( PolyVertex a, PolyVertex b, PolyVertex c ) : bool

Determines whether the vertices follow a certain order

Method Details

Diagonal() public static method

True if and only if (v[i], v[j]) is a proper internal diagonal of polygon.
public static Diagonal ( int i, int j, PolyVertex verts, int indices ) : bool
i int Vertex index i
j int Vertex index j
verts PolyVertex Contour vertices
indices int PolyMesh indices
return bool

Diagonalie() public static method

True if and only if (v[i], v[j]) is internal or external diagonal ignoring edges incident to v[i] or v[j].
public static Diagonalie ( int i, int j, PolyVertex verts, int indices ) : bool
i int Vertex index i
j int Vertex index j
verts PolyVertex Contour vertices
indices int PolyMesh indices
return bool

HasDiagonalFlag() public static method

Determines if it is a diagonal flag on the specified index.
public static HasDiagonalFlag ( int index ) : bool
index int The index
return bool

InCone() public static method

True if and only if diagonal (i, j) is strictly internal to polygon in neighborhood of i endpoint.
public static InCone ( int i, int j, PolyVertex verts, int indices ) : bool
i int Vertex index i
j int Vertex index j
verts PolyVertex Contour vertices
indices int PolyMesh indices
return bool

IsBoundaryEdge() public static method

Determines if it is a boundary edge with the specified flag.
public static IsBoundaryEdge ( int flag ) : bool
flag int The flag.
return bool

IsInteriorEdge() public static method

Determines if it is an interior edge with the specified flag.
public static IsInteriorEdge ( int flag ) : bool
flag int The flag.
return bool

PolyMesh() public method

Initializes a new instance of the PolyMesh class.
public PolyMesh ( ContourSet contSet, SharpNav.NavMeshGenerationSettings settings )
contSet ContourSet The to generate polygons from.
settings SharpNav.NavMeshGenerationSettings The settings to build with.

PolyMesh() public method

Initializes a new instance of the PolyMesh class by creating polygons from contours.
public PolyMesh ( ContourSet contSet, float cellSize, float cellHeight, int borderSize, int numVertsPerPoly )
contSet ContourSet The to generate polygons from.
cellSize float The size of one voxel/cell.
cellHeight float The height of one voxel/cell.
borderSize int The size of the border around the mesh.
numVertsPerPoly int The maximum number of vertices per polygon.