Dungeon Architect  17.0.0
SharpNav.Contour Class Reference

A contour is formed from a region. More...

Public Member Functions

 Contour (List< ContourVertex > verts, RegionId region, Area area, int borderSize)
 Initializes a new instance of the Contour class. More...
 
void MergeWith (Contour contour)
 Merges another contour into this instance. More...
 

Static Public Member Functions

static void Simplify (List< ContourVertex > rawVerts, List< ContourVertex > simplified, float maxError, int maxEdgeLen, ContourBuildFlags buildFlags)
 Simplify the contours by reducing the number of edges More...
 
static void RemoveDegenerateSegments (List< ContourVertex > simplified)
 Removes degenerate segments from a simplified contour. More...
 

Properties

ContourVertex[] Vertices [get]
 Gets the simplified vertices of the contour. More...
 
bool IsNull [get]
 Gets a value indicating whether the contour is "null" (has less than 3 vertices). More...
 
Area Area [get]
 Gets the area ID of the contour. More...
 
RegionId RegionId [get]
 Gets the region ID of the contour. More...
 
int Area2D [get]
 Gets the 2D area of the contour. A positive area means the contour is going forwards, a negative area maens it is going backwards. More...
 

Detailed Description

A contour is formed from a region.

Definition at line 13 of file Contour.cs.

Constructor & Destructor Documentation

◆ Contour()

SharpNav.Contour.Contour ( List< ContourVertex verts,
RegionId  region,
Area  area,
int  borderSize 
)

Initializes a new instance of the Contour class.

Parameters
vertsThe raw vertices of the contour.
regionThe region ID of the contour.
areaThe area ID of the contour.
borderSizeThe size of the border.

Definition at line 27 of file Contour.cs.

Member Function Documentation

◆ MergeWith()

void SharpNav.Contour.MergeWith ( Contour  contour)

Merges another contour into this instance.

Parameters
contourThe contour to merge.

Definition at line 115 of file Contour.cs.

◆ RemoveDegenerateSegments()

static void SharpNav.Contour.RemoveDegenerateSegments ( List< ContourVertex simplified)
static

Removes degenerate segments from a simplified contour.

Parameters
simplifiedThe simplified contour.

Definition at line 412 of file Contour.cs.

◆ Simplify()

static void SharpNav.Contour.Simplify ( List< ContourVertex rawVerts,
List< ContourVertex simplified,
float  maxError,
int  maxEdgeLen,
ContourBuildFlags  buildFlags 
)
static

Simplify the contours by reducing the number of edges

Parameters
rawVertsInitial vertices
simplifiedNew and simplified vertices
maxErrorMaximum error allowed
maxEdgeLenThe maximum edge length allowed
buildFlagsFlags determines how to split the long edges

Definition at line 192 of file Contour.cs.

Property Documentation

◆ Area

Area SharpNav.Contour.Area
get

Gets the area ID of the contour.

Definition at line 73 of file Contour.cs.

◆ Area2D

int SharpNav.Contour.Area2D
get

Gets the 2D area of the contour. A positive area means the contour is going forwards, a negative area maens it is going backwards.

Definition at line 96 of file Contour.cs.

◆ IsNull

bool SharpNav.Contour.IsNull
get

Gets a value indicating whether the contour is "null" (has less than 3 vertices).

Definition at line 58 of file Contour.cs.

◆ RegionId

RegionId SharpNav.Contour.RegionId
get

Gets the region ID of the contour.

Definition at line 84 of file Contour.cs.

◆ Vertices

ContourVertex [] SharpNav.Contour.Vertices
get

Gets the simplified vertices of the contour.

Definition at line 47 of file Contour.cs.


The documentation for this class was generated from the following file: