Dungeon Architect  17.0.0
SharpNav.CompactSpan Struct Reference

Represents a voxel span in a CompactHeightfield. More...

Public Member Functions

 CompactSpan (int minimum, int height)
 Initializes a new instance of the CompactSpan struct. More...
 
int GetConnection (Direction dir)
 Gets the connection data for a neighboring call in a specified direction. More...
 
bool IsConnected (Direction dir)
 Gets a value indicating whether the span is connected to another span in a specified direction. More...
 

Static Public Member Functions

static void OverlapMin (ref CompactSpan left, ref CompactSpan right, out int min)
 If two CompactSpans overlap, find the minimum of the new overlapping CompactSpans. More...
 
static void OverlapMax (ref CompactSpan left, ref CompactSpan right, out int max)
 If two CompactSpans overlap, find the maximum of the new overlapping CompactSpans. More...
 
static CompactSpan FromMinMax (int min, int max)
 Creates a CompactSpan from a minimum boundary and a maximum boundary. More...
 
static void FromMinMax (int min, int max, out CompactSpan span)
 Creates a CompactSpan from a minimum boundary and a maximum boundary. More...
 
static void SetConnection (Direction dir, int i, ref CompactSpan s)
 Sets connection data to a span contained in a neighboring cell. More...
 
static void UnsetConnection (Direction dir, ref CompactSpan s)
 Un-sets connection data from a neighboring cell. More...
 
static int GetConnection (ref CompactSpan s, Direction dir)
 Gets the connection data for a neighboring cell in a specified direction. More...
 

Public Attributes

int Minimum
 The span minimum. More...
 
int Height
 The number of voxels contained in the span. More...
 
byte ConnectionWest
 A byte representing the index of the connected span in the cell directly to the west. More...
 
byte ConnectionNorth
 A byte representing the index of the connected span in the cell directly to the north. More...
 
byte ConnectionEast
 A byte representing the index of the connected span in the cell directly to the east. More...
 
byte ConnectionSouth
 A byte representing the index of the connected span in the cell directly to the south. More...
 
RegionId Region
 The region the span belongs to. More...
 

Properties

bool HasUpperBound [get]
 Gets a value indicating whether the span has an upper bound or goes to "infinity". More...
 
int Maximum [get]
 Gets the upper bound of the span. More...
 
int ConnectionCount [get]
 Gets the number of connections the current CompactSpan has with its neighbors. More...
 

Detailed Description

Represents a voxel span in a CompactHeightfield.

Definition at line 13 of file CompactSpan.cs.

Constructor & Destructor Documentation

◆ CompactSpan()

SharpNav.CompactSpan.CompactSpan ( int  minimum,
int  height 
)

Initializes a new instance of the CompactSpan struct.

Parameters
minimumThe span minimum.
heightThe number of voxels the span contains.

Definition at line 61 of file CompactSpan.cs.

Member Function Documentation

◆ FromMinMax() [1/2]

static CompactSpan SharpNav.CompactSpan.FromMinMax ( int  min,
int  max 
)
static

Creates a CompactSpan from a minimum boundary and a maximum boundary.

Parameters
minThe minimum.
maxThe maximum.
Returns
A CompactSpan.

Definition at line 153 of file CompactSpan.cs.

◆ FromMinMax() [2/2]

static void SharpNav.CompactSpan.FromMinMax ( int  min,
int  max,
out CompactSpan  span 
)
static

Creates a CompactSpan from a minimum boundary and a maximum boundary.

Parameters
minThe minimum.
maxThe maximum.
spanA CompactSpan.

Definition at line 166 of file CompactSpan.cs.

◆ GetConnection() [1/2]

int SharpNav.CompactSpan.GetConnection ( Direction  dir)

Gets the connection data for a neighboring call in a specified direction.

Parameters
dirThe direction.
Returns
The index of the span in the neighboring cell.

Definition at line 261 of file CompactSpan.cs.

◆ GetConnection() [2/2]

static int SharpNav.CompactSpan.GetConnection ( ref CompactSpan  s,
Direction  dir 
)
static

Gets the connection data for a neighboring cell in a specified direction.

Parameters
sThe CompactSpan to get the connection data from.
dirThe direction.
Returns
The index of the span in the neighboring cell.

Definition at line 239 of file CompactSpan.cs.

◆ IsConnected()

bool SharpNav.CompactSpan.IsConnected ( Direction  dir)

Gets a value indicating whether the span is connected to another span in a specified direction.

Parameters
dirThe direction.
Returns
A value indicating whether the specified direction has a connected span.

Definition at line 271 of file CompactSpan.cs.

◆ OverlapMax()

static void SharpNav.CompactSpan.OverlapMax ( ref CompactSpan  left,
ref CompactSpan  right,
out int  max 
)
static

If two CompactSpans overlap, find the maximum of the new overlapping CompactSpans.

Parameters
leftThe first CompactSpan
rightThe second CompactSpan
maxThe maximum of the overlapping CompactSpans

Definition at line 132 of file CompactSpan.cs.

◆ OverlapMin()

static void SharpNav.CompactSpan.OverlapMin ( ref CompactSpan  left,
ref CompactSpan  right,
out int  min 
)
static

If two CompactSpans overlap, find the minimum of the new overlapping CompactSpans.

Parameters
leftThe first CompactSpan
rightThe second CompactSpan
minThe minimum of the overlapping ComapctSpans

Definition at line 121 of file CompactSpan.cs.

◆ SetConnection()

static void SharpNav.CompactSpan.SetConnection ( Direction  dir,
int  i,
ref CompactSpan  s 
)
static

Sets connection data to a span contained in a neighboring cell.

Parameters
dirThe direction of the cell.
iThe index of the span in the neighboring cell.
sThe CompactSpan to set the data for.

Definition at line 183 of file CompactSpan.cs.

◆ UnsetConnection()

static void SharpNav.CompactSpan.UnsetConnection ( Direction  dir,
ref CompactSpan  s 
)
static

Un-sets connection data from a neighboring cell.

Parameters
dirThe direction of the cell.
sThe CompactSpan to set the data for.

Definition at line 212 of file CompactSpan.cs.

Member Data Documentation

◆ ConnectionEast

byte SharpNav.CompactSpan.ConnectionEast

A byte representing the index of the connected span in the cell directly to the east.

Definition at line 38 of file CompactSpan.cs.

◆ ConnectionNorth

byte SharpNav.CompactSpan.ConnectionNorth

A byte representing the index of the connected span in the cell directly to the north.

Definition at line 33 of file CompactSpan.cs.

◆ ConnectionSouth

byte SharpNav.CompactSpan.ConnectionSouth

A byte representing the index of the connected span in the cell directly to the south.

Definition at line 43 of file CompactSpan.cs.

◆ ConnectionWest

byte SharpNav.CompactSpan.ConnectionWest

A byte representing the index of the connected span in the cell directly to the west.

Definition at line 28 of file CompactSpan.cs.

◆ Height

int SharpNav.CompactSpan.Height

The number of voxels contained in the span.

Definition at line 23 of file CompactSpan.cs.

◆ Minimum

int SharpNav.CompactSpan.Minimum

The span minimum.

Definition at line 18 of file CompactSpan.cs.

◆ Region

RegionId SharpNav.CompactSpan.Region

The region the span belongs to.

Definition at line 48 of file CompactSpan.cs.

Property Documentation

◆ ConnectionCount

int SharpNav.CompactSpan.ConnectionCount
get

Gets the number of connections the current CompactSpan has with its neighbors.

Definition at line 97 of file CompactSpan.cs.

◆ HasUpperBound

bool SharpNav.CompactSpan.HasUpperBound
get

Gets a value indicating whether the span has an upper bound or goes to "infinity".

Definition at line 75 of file CompactSpan.cs.

◆ Maximum

int SharpNav.CompactSpan.Maximum
get

Gets the upper bound of the span.

Definition at line 86 of file CompactSpan.cs.


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