Dungeon Architect  17.0.0
SharpNav.Heightfield Class Reference

A Heightfield represents a "voxel" grid represented as a 2-dimensional grid of Cells. More...

Public Member Functions

 Heightfield (BBox3 b, NavMeshGenerationSettings settings)
 Initializes a new instance of the Heightfield class. More...
 
 Heightfield (BBox3 b, float cellSize, float cellHeight)
 Initializes a new instance of the Heightfield class. More...
 
void FilterLowHangingWalkableObstacles (int walkableClimb)
 Filters the heightmap to allow two neighboring spans have a small difference in maximum height (such as stairs) to be walkable. More...
 
void FilterWalkableLowHeightSpans (int walkableHeight)
 If two spans have little vertical space in between them, then span is considered unwalkable More...
 
void FilterLedgeSpans (int walkableHeight, int walkableClimb)
 A ledge is unwalkable because the difference between the maximum height of two spans is too large of a drop (i.e. greater than walkableClimb). More...
 
void RasterizeTrianglesIndexedWithAreas (Vector3[] verts, int[] inds, Area[] areas)
 Rasterizes several triangles at once from an indexed array with per-triangle area flags. More...
 
void RasterizeTrianglesIndexedWithAreas (Vector3[] verts, int[] inds, int vertOffset, int vertStride, int indexOffset, int triCount, Area[] areas)
 Rasterizes several triangles at once from an indexed array with per-triangle area flags. More...
 
void RasterizeTrianglesIndexedWithAreas (float[] verts, int[] inds, Area[] areas)
 Rasterizes several triangles at once from an indexed array with per-triangle area flags. More...
 
void RasterizeTrianglesIndexedWithAreas (float[] verts, int[] inds, int floatOffset, int floatStride, int indexOffset, int triCount, Area[] areas)
 Rasterizes several triangles at once from an indexed array with per-triangle area flags. More...
 
void RasterizeTrianglesWithAreas (Triangle3[] tris, Area[] areas)
 Rasterizes several triangles at once with per-triangle area flags. More...
 
void RasterizeTrianglesWithAreas (Triangle3[] tris, int triOffset, int triCount, Area[] areas)
 Rasterizes several triangles at once with per-triangle area flags. More...
 
void RasterizeTrianglesWithAreas (Vector3[] verts, Area[] areas)
 Rasterizes several triangles at once with per-triangle area flags. More...
 
void RasterizeTrianglesWithAreas (Vector3[] verts, int vertOffset, int vertStride, int triCount, Area[] areas)
 Rasterizes several triangles at once with per-triangle area flags. More...
 
void RasterizeTrianglesWithAreas (float[] verts, Area[] areas)
 Rasterizes several triangles at once with per-triangle area flags. More...
 
void RasterizeTrianglesWithAreas (float[] verts, int floatOffset, int floatStride, int triCount, Area[] areas)
 Rasterizes several triangles at once with per-triangle area flags. More...
 
void RasterizeTrianglesIndexed (Vector3[] verts, int[] inds)
 Rasterizes several triangles at once from an indexed array. More...
 
void RasterizeTrianglesIndexed (Vector3[] verts, int[] inds, Area area)
 Rasterizes several triangles at once from an indexed array. More...
 
void RasterizeTrianglesIndexed (Vector3[] verts, int[] inds, int vertOffset, int vertStride, int indexOffset, int triCount)
 Rasterizes several triangles at once from an indexed array. More...
 
void RasterizeTrianglesIndexed (Vector3[] verts, int[] inds, int vertOffset, int vertStride, int indexOffset, int triCount, Area area)
 Rasterizes several triangles at once from an indexed array. More...
 
void RasterizeTrianglesIndexed (float[] verts, int[] inds)
 Rasterizes several triangles at once from an indexed array. More...
 
void RasterizeTrianglesIndexed (float[] verts, int[] inds, Area area)
 Rasterizes several triangles at once from an indexed array. More...
 
void RasterizeTrianglesIndexed (float[] verts, int[] inds, int floatOffset, int floatStride, int indexOffset, int triCount)
 Rasterizes several triangles at once from an indexed array. More...
 
void RasterizeTrianglesIndexed (float[] verts, int[] inds, int floatOffset, int floatStride, int indexOffset, int triCount, Area area)
 Rasterizes several triangles at once from an indexed array. More...
 
void RasterizeTriangles (IEnumerable< Triangle3 > tris)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangles (IEnumerable< Triangle3 > tris, Area area)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangles (Triangle3[] tris)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangles (Triangle3[] tris, Area area)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangles (Triangle3[] tris, int triOffset, int triCount)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangles (Triangle3[] tris, int triOffset, int triCount, Area area)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangles (Vector3[] verts)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangles (Vector3[] verts, Area area)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangles (Vector3[] verts, int vertOffset, int vertStride, int triCount)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangles (Vector3[] verts, int vertOffset, int vertStride, int triCount, Area area)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangles (float[] verts)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangles (float[] verts, Area area)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangles (float[] verts, int floatOffset, int floatStride, int triCount)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangles (float[] verts, int floatOffset, int floatStride, int triCount, Area area)
 Rasterizes several triangles at once. More...
 
void RasterizeTriangle (ref Triangle3 tri)
 Rasterizes a triangle using conservative voxelization. More...
 
void RasterizeTriangle (ref Triangle3 tri, Area area)
 Rasterizes a triangle using conservative voxelization. More...
 
void RasterizeTriangle (float ax, float ay, float az, float bx, float by, float bz, float cx, float cy, float cz)
 Rasterizes a triangle using conservative voxelization. More...
 
void RasterizeTriangle (float ax, float ay, float az, float bx, float by, float bz, float cx, float cy, float cz, Area area)
 Rasterizes a triangle using conservative voxelization. More...
 
void RasterizeTriangle (ref Vector3 a, ref Vector3 b, ref Vector3 c)
 Rasterizes a triangle using conservative voxelization. More...
 
void RasterizeTriangle (ref Vector3 a, ref Vector3 b, ref Vector3 c, Area area)
 Rasterizes a triangle using conservative voxelization. More...
 

Properties

BBox3 Bounds [get]
 Gets the bounding box of the heightfield. More...
 
Vector3 Minimum [get]
 Gets the world-space minimum. More...
 
Vector3 Maximum [get]
 Gets the world-space maximum. More...
 
int Width [get]
 Gets the number of cells in the X direction. More...
 
int Height [get]
 Gets the number of cells in the Y (up) direction. More...
 
int Length [get]
 Gets the number of cells in the Z direction. More...
 
Vector3 CellSize [get]
 Gets the size of a cell (voxel). More...
 
float CellSizeXZ [get]
 Gets the size of a cell on the X and Z axes. More...
 
float CellHeight [get]
 Gets the size of a cell on the Y axis. More...
 
int SpanCount [get]
 Gets the total number of spans. More...
 
Cell this[int x, int y] [get]
 Gets the Cell at the specified coordinate. More...
 
Cell this[int i] [get]
 Gets the Cell at the specified index. More...
 
Span this[SpanReference spanRef] [get]
 Gets the Span at the reference. More...
 

Detailed Description

A Heightfield represents a "voxel" grid represented as a 2-dimensional grid of Cells.

<content> This file contains various methods to rasterize objects into voxel data. </content>

Definition at line 22 of file Heightfield.cs.

Constructor & Destructor Documentation

◆ Heightfield() [1/2]

SharpNav.Heightfield.Heightfield ( BBox3  b,
NavMeshGenerationSettings  settings 
)

Initializes a new instance of the Heightfield class.

Parameters
bThe world-space bounds.
settingsThe settings to build with.

Definition at line 36 of file Heightfield.cs.

◆ Heightfield() [2/2]

SharpNav.Heightfield.Heightfield ( BBox3  b,
float  cellSize,
float  cellHeight 
)

Initializes a new instance of the Heightfield class.

Parameters
bThe world-space bounds.
cellSizeThe world-space size of each cell in the XZ plane.
cellHeightThe world-space height of each cell.

Definition at line 47 of file Heightfield.cs.

Member Function Documentation

◆ FilterLedgeSpans()

void SharpNav.Heightfield.FilterLedgeSpans ( int  walkableHeight,
int  walkableClimb 
)

A ledge is unwalkable because the difference between the maximum height of two spans is too large of a drop (i.e. greater than walkableClimb).

Parameters
walkableHeightThe maximum walkable height to filter.
walkableClimbThe maximum walkable climb to filter.

Definition at line 321 of file Heightfield.cs.

◆ FilterLowHangingWalkableObstacles()

void SharpNav.Heightfield.FilterLowHangingWalkableObstacles ( int  walkableClimb)

Filters the heightmap to allow two neighboring spans have a small difference in maximum height (such as stairs) to be walkable.

This filter may override the results of FilterLedgeSpans.

Parameters
walkableClimbThe maximum difference in height to filter.

Definition at line 250 of file Heightfield.cs.

◆ FilterWalkableLowHeightSpans()

void SharpNav.Heightfield.FilterWalkableLowHeightSpans ( int  walkableHeight)

If two spans have little vertical space in between them, then span is considered unwalkable

Parameters
walkableHeightThe clearance.

Definition at line 293 of file Heightfield.cs.

◆ RasterizeTriangle() [1/6]

void SharpNav.Heightfield.RasterizeTriangle ( float  ax,
float  ay,
float  az,
float  bx,
float  by,
float  bz,
float  cx,
float  cy,
float  cz 
)

Rasterizes a triangle using conservative voxelization.

Parameters
axThe X component of the first vertex of the triangle.
ayThe Y component of the first vertex of the triangle.
azThe Z component of the first vertex of the triangle.
bxThe X component of the second vertex of the triangle.
byThe Y component of the second vertex of the triangle.
bzThe Z component of the second vertex of the triangle.
cxThe X component of the third vertex of the triangle.
cyThe Y component of the third vertex of the triangle.
czThe Z component of the third vertex of the triangle.

Definition at line 784 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangle() [2/6]

void SharpNav.Heightfield.RasterizeTriangle ( float  ax,
float  ay,
float  az,
float  bx,
float  by,
float  bz,
float  cx,
float  cy,
float  cz,
Area  area 
)

Rasterizes a triangle using conservative voxelization.

Parameters
axThe X component of the first vertex of the triangle.
ayThe Y component of the first vertex of the triangle.
azThe Z component of the first vertex of the triangle.
bxThe X component of the second vertex of the triangle.
byThe Y component of the second vertex of the triangle.
bzThe Z component of the second vertex of the triangle.
cxThe X component of the third vertex of the triangle.
cyThe Y component of the third vertex of the triangle.
czThe Z component of the third vertex of the triangle.
areaThe area flags for the triangle.

Definition at line 802 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangle() [3/6]

void SharpNav.Heightfield.RasterizeTriangle ( ref Triangle3  tri)

Rasterizes a triangle using conservative voxelization.

Parameters
triThe triangle as a Triangle3 struct.

Definition at line 757 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangle() [4/6]

void SharpNav.Heightfield.RasterizeTriangle ( ref Triangle3  tri,
Area  area 
)

Rasterizes a triangle using conservative voxelization.

Parameters
triThe triangle as a Triangle3 struct.
areaThe area flags for the triangle.

Definition at line 767 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangle() [5/6]

void SharpNav.Heightfield.RasterizeTriangle ( ref Vector3  a,
ref Vector3  b,
ref Vector3  c 
)

Rasterizes a triangle using conservative voxelization.

Parameters
aThe first vertex of the triangle.
bThe second vertex of the triangle.
cThe third vertex of the triangle.

Definition at line 825 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangle() [6/6]

void SharpNav.Heightfield.RasterizeTriangle ( ref Vector3  a,
ref Vector3  b,
ref Vector3  c,
Area  area 
)

Rasterizes a triangle using conservative voxelization.

Parameters
aThe first vertex of the triangle.
bThe second vertex of the triangle.
cThe third vertex of the triangle.
areaThe area flags for the triangle.

Definition at line 837 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [1/14]

void SharpNav.Heightfield.RasterizeTriangles ( float[]  verts)

Rasterizes several triangles at once.

If the length of the array is not a multiple of 9, the extra floats at the end will be skipped.

Parameters
vertsAn array of vertices.

Definition at line 669 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [2/14]

void SharpNav.Heightfield.RasterizeTriangles ( float[]  verts,
Area  area 
)

Rasterizes several triangles at once.

If the length of the array is not a multiple of 9, the extra floats at the end will be skipped.

Parameters
vertsAn array of vertices.
areaThe area flags for all of the triangles.

Definition at line 682 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [3/14]

void SharpNav.Heightfield.RasterizeTriangles ( float[]  verts,
int  floatOffset,
int  floatStride,
int  triCount 
)

Rasterizes several triangles at once.

Parameters
vertsAn array of vertices.
floatOffsetAn offset into the array.
floatStrideThe number of array elements that make up a vertex. A value of 0 is interpreted as tightly-packed data (3 floats per vertex).
triCountThe number of triangles to rasterize.

Definition at line 694 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [4/14]

void SharpNav.Heightfield.RasterizeTriangles ( float[]  verts,
int  floatOffset,
int  floatStride,
int  triCount,
Area  area 
)

Rasterizes several triangles at once.

Parameters
vertsAn array of vertices.
floatOffsetAn offset into the array.
floatStrideThe number of array elements that make up a vertex. A value of 0 is interpreted as tightly-packed data (3 floats per vertex).
triCountThe number of triangles to rasterize.
areaThe area flags for all of the triangles.

Definition at line 707 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [5/14]

void SharpNav.Heightfield.RasterizeTriangles ( IEnumerable< Triangle3 tris)

Rasterizes several triangles at once.

Parameters
trisA collection of triangles.

Definition at line 475 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [6/14]

void SharpNav.Heightfield.RasterizeTriangles ( IEnumerable< Triangle3 tris,
Area  area 
)

Rasterizes several triangles at once.

Parameters
trisA collection of triangles.
areaThe area flags for all of the triangles.

Definition at line 485 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [7/14]

void SharpNav.Heightfield.RasterizeTriangles ( Triangle3[]  tris)

Rasterizes several triangles at once.

Parameters
trisAn array of triangles.

Definition at line 503 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [8/14]

void SharpNav.Heightfield.RasterizeTriangles ( Triangle3[]  tris,
Area  area 
)

Rasterizes several triangles at once.

Parameters
trisAn array of triangles.
areaThe area flags for all of the triangles.

Definition at line 513 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [9/14]

void SharpNav.Heightfield.RasterizeTriangles ( Triangle3[]  tris,
int  triOffset,
int  triCount 
)

Rasterizes several triangles at once.

Parameters
trisAn array of triangles.
triOffsetAn offset into the array.
triCountThe number of triangles to rasterize, starting from the offset.

Definition at line 524 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [10/14]

void SharpNav.Heightfield.RasterizeTriangles ( Triangle3[]  tris,
int  triOffset,
int  triCount,
Area  area 
)

Rasterizes several triangles at once.

Parameters
trisAn array of triangles.
triOffsetAn offset into the array.
triCountThe number of triangles to rasterize, starting from the offset.
areaThe area flags for all of the triangles.

Definition at line 536 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [11/14]

void SharpNav.Heightfield.RasterizeTriangles ( Vector3[]  verts)

Rasterizes several triangles at once.

If the length of the array is not a multiple of 3, the extra vertices at the end will be skipped.

Parameters
vertsAn array of vertices.

Definition at line 595 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [12/14]

void SharpNav.Heightfield.RasterizeTriangles ( Vector3[]  verts,
Area  area 
)

Rasterizes several triangles at once.

If the length of the array is not a multiple of 3, the extra vertices at the end will be skipped.

Parameters
vertsAn array of vertices.
areaThe area flags for all of the triangles.

Definition at line 608 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [13/14]

void SharpNav.Heightfield.RasterizeTriangles ( Vector3[]  verts,
int  vertOffset,
int  vertStride,
int  triCount 
)

Rasterizes several triangles at once.

Parameters
vertsAn array of vertices.
vertOffsetAn offset into the array.
vertStrideThe number of array elements that make up a vertex. A value of 0 is interpreted as tightly-packed data (1 Vector3 per vertex).
triCountThe number of triangles to rasterize, starting from the offset.

Definition at line 620 of file Heightfield.Rasterization.cs.

◆ RasterizeTriangles() [14/14]

void SharpNav.Heightfield.RasterizeTriangles ( Vector3[]  verts,
int  vertOffset,
int  vertStride,
int  triCount,
Area  area 
)

Rasterizes several triangles at once.

Parameters
vertsAn array of vertices.
vertOffsetAn offset into the array.
vertStrideThe number of array elements that make up a vertex. A value of 0 is interpreted as tightly-packed data (1 Vector3 per vertex).
triCountThe number of triangles to rasterize, starting from the offset.
areaThe area flags for all of the triangles.

Definition at line 633 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesIndexed() [1/8]

void SharpNav.Heightfield.RasterizeTrianglesIndexed ( float[]  verts,
int[]  inds 
)

Rasterizes several triangles at once from an indexed array.

Parameters
vertsAn array of vertices.
indsAn array of indices.

Definition at line 386 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesIndexed() [2/8]

void SharpNav.Heightfield.RasterizeTrianglesIndexed ( float[]  verts,
int[]  inds,
Area  area 
)

Rasterizes several triangles at once from an indexed array.

Parameters
vertsAn array of vertices.
indsAn array of indices.
areaThe area flags for all the triangles.

Definition at line 397 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesIndexed() [3/8]

void SharpNav.Heightfield.RasterizeTrianglesIndexed ( float[]  verts,
int[]  inds,
int  floatOffset,
int  floatStride,
int  indexOffset,
int  triCount 
)

Rasterizes several triangles at once from an indexed array.

Parameters
vertsAn array of vertices.
indsAn array of indices.
floatOffsetAn offset into the vertex array.
floatStrideThe number of array elements that make up a vertex. A value of 0 is interpreted as tightly-packed data (3 floats per vertex).
indexOffsetAn offset into the index array.
triCountThe number of triangles to rasterize.

Definition at line 411 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesIndexed() [4/8]

void SharpNav.Heightfield.RasterizeTrianglesIndexed ( float[]  verts,
int[]  inds,
int  floatOffset,
int  floatStride,
int  indexOffset,
int  triCount,
Area  area 
)

Rasterizes several triangles at once from an indexed array.

Parameters
vertsAn array of vertices.
indsAn array of indices.
floatOffsetAn offset into the vertex array.
floatStrideThe number of array elements that make up a vertex. A value of 0 is interpreted as tightly-packed data (3 floats per vertex).
indexOffsetAn offset into the index array.
triCountThe number of triangles to rasterize.
areaThe area flags for all of the triangles.

Definition at line 426 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesIndexed() [5/8]

void SharpNav.Heightfield.RasterizeTrianglesIndexed ( Vector3[]  verts,
int[]  inds 
)

Rasterizes several triangles at once from an indexed array.

Parameters
vertsAn array of vertices.
indsAn array of indices.

Definition at line 310 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesIndexed() [6/8]

void SharpNav.Heightfield.RasterizeTrianglesIndexed ( Vector3[]  verts,
int[]  inds,
Area  area 
)

Rasterizes several triangles at once from an indexed array.

Parameters
vertsAn array of vertices.
indsAn array of indices.
areaThe area flags for all the triangles.

Definition at line 321 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesIndexed() [7/8]

void SharpNav.Heightfield.RasterizeTrianglesIndexed ( Vector3[]  verts,
int[]  inds,
int  vertOffset,
int  vertStride,
int  indexOffset,
int  triCount 
)

Rasterizes several triangles at once from an indexed array.

Parameters
vertsAn array of vertices.
indsAn array of indices.
vertOffsetAn offset into the vertex array.
vertStrideThe number of array elements that make up a vertex. A value of 0 is interpreted as tightly-packed data (one Vector3 per vertex).
indexOffsetAn offset into the index array.
triCountThe number of triangles to rasterize.

Definition at line 335 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesIndexed() [8/8]

void SharpNav.Heightfield.RasterizeTrianglesIndexed ( Vector3[]  verts,
int[]  inds,
int  vertOffset,
int  vertStride,
int  indexOffset,
int  triCount,
Area  area 
)

Rasterizes several triangles at once from an indexed array.

Parameters
vertsAn array of vertices.
indsAn array of indices.
vertOffsetAn offset into the vertex array.
vertStrideThe number of array elements that make up a vertex. A value of 0 is interpreted as tightly-packed data (one Vector3 per vertex).
indexOffsetAn offset into the index array.
triCountThe number of triangles to rasterize.
areaThe area flags for all of the triangles.

Definition at line 350 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesIndexedWithAreas() [1/4]

void SharpNav.Heightfield.RasterizeTrianglesIndexedWithAreas ( float[]  verts,
int[]  inds,
Area[]  areas 
)

Rasterizes several triangles at once from an indexed array with per-triangle area flags.

Parameters
vertsAn array of vertices.
indsAn array of indices.
areasAn array of area flags, one for each triangle.

Definition at line 86 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesIndexedWithAreas() [2/4]

void SharpNav.Heightfield.RasterizeTrianglesIndexedWithAreas ( float[]  verts,
int[]  inds,
int  floatOffset,
int  floatStride,
int  indexOffset,
int  triCount,
Area[]  areas 
)

Rasterizes several triangles at once from an indexed array with per-triangle area flags.

Parameters
vertsAn array of vertices.
indsAn array of indices.
floatOffsetAn offset into the vertex array.
floatStrideThe number of array elements that make up a vertex. A value of 0 is interpreted as tightly-packed data (3 floats per vertex).
indexOffsetAn offset into the index array.
triCountThe number of triangles to rasterize.
areasAn array of area flags, one for each triangle.

Definition at line 101 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesIndexedWithAreas() [3/4]

void SharpNav.Heightfield.RasterizeTrianglesIndexedWithAreas ( Vector3[]  verts,
int[]  inds,
Area[]  areas 
)

Rasterizes several triangles at once from an indexed array with per-triangle area flags.

Parameters
vertsAn array of vertices.
indsAn array of indices.
areasAn array of area flags, one for each triangle.

Definition at line 31 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesIndexedWithAreas() [4/4]

void SharpNav.Heightfield.RasterizeTrianglesIndexedWithAreas ( Vector3[]  verts,
int[]  inds,
int  vertOffset,
int  vertStride,
int  indexOffset,
int  triCount,
Area[]  areas 
)

Rasterizes several triangles at once from an indexed array with per-triangle area flags.

Parameters
vertsAn array of vertices.
indsAn array of indices.
vertOffsetAn offset into the vertex array.
vertStrideThe number of array elements that make up a vertex. A value of 0 is interpreted as tightly-packed data (one Vector3 per vertex).
indexOffsetAn offset into the index array.
triCountThe number of triangles to rasterize.
areasAn array of area flags, one for each triangle.

Definition at line 46 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesWithAreas() [1/6]

void SharpNav.Heightfield.RasterizeTrianglesWithAreas ( float[]  verts,
Area[]  areas 
)

Rasterizes several triangles at once with per-triangle area flags.

If the length of the array is not a multiple of 9, the extra floats at the end will be skipped.

Parameters
vertsAn array of vertices.
areasAn array of area flags, one for each triangle.

Definition at line 246 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesWithAreas() [2/6]

void SharpNav.Heightfield.RasterizeTrianglesWithAreas ( float[]  verts,
int  floatOffset,
int  floatStride,
int  triCount,
Area[]  areas 
)

Rasterizes several triangles at once with per-triangle area flags.

Parameters
vertsAn array of vertices.
floatOffsetAn offset into the array.
floatStrideThe number of array elements that make up a vertex. A value of 0 is interpreted as tightly-packed data (3 floats per vertex).
triCountThe number of triangles to rasterize.
areasAn array of area flags, one for each triangle.

Definition at line 259 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesWithAreas() [3/6]

void SharpNav.Heightfield.RasterizeTrianglesWithAreas ( Triangle3[]  tris,
Area[]  areas 
)

Rasterizes several triangles at once with per-triangle area flags.

Parameters
trisAn array of triangles.
areasAn array of area flags, one for each triangle.

Definition at line 154 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesWithAreas() [4/6]

void SharpNav.Heightfield.RasterizeTrianglesWithAreas ( Triangle3[]  tris,
int  triOffset,
int  triCount,
Area[]  areas 
)

Rasterizes several triangles at once with per-triangle area flags.

Parameters
trisAn array of triangles.
triOffsetAn offset into the array.
triCountThe number of triangles to rasterize, starting from the offset.
areasAn array of area flags, one for each triangle.

Definition at line 166 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesWithAreas() [5/6]

void SharpNav.Heightfield.RasterizeTrianglesWithAreas ( Vector3[]  verts,
Area[]  areas 
)

Rasterizes several triangles at once with per-triangle area flags.

If the length of the array is not a multiple of 3, the extra vertices at the end will be skipped.

Parameters
vertsAn array of vertices.
areasAn array of area flags, one for each triangle.

Definition at line 197 of file Heightfield.Rasterization.cs.

◆ RasterizeTrianglesWithAreas() [6/6]

void SharpNav.Heightfield.RasterizeTrianglesWithAreas ( Vector3[]  verts,
int  vertOffset,
int  vertStride,
int  triCount,
Area[]  areas 
)

Rasterizes several triangles at once with per-triangle area flags.

Parameters
vertsAn array of vertices.
vertOffsetAn offset into the array.
vertStrideThe number of array elements that make up a vertex. A value of 0 is interpreted as tightly-packed data (1 Vector3 per vertex).
triCountThe number of triangles to rasterize, starting from the offset.
areasAn array of area flags, one for each triangle.

Definition at line 210 of file Heightfield.Rasterization.cs.

Property Documentation

◆ Bounds

BBox3 SharpNav.Heightfield.Bounds
get

Gets the bounding box of the heightfield.

Definition at line 79 of file Heightfield.cs.

◆ CellHeight

float SharpNav.Heightfield.CellHeight
get

Gets the size of a cell on the Y axis.

Definition at line 173 of file Heightfield.cs.

◆ CellSize

Vector3 SharpNav.Heightfield.CellSize
get

Gets the size of a cell (voxel).

The size of the cell.

Definition at line 151 of file Heightfield.cs.

◆ CellSizeXZ

float SharpNav.Heightfield.CellSizeXZ
get

Gets the size of a cell on the X and Z axes.

Definition at line 162 of file Heightfield.cs.

◆ Height

int SharpNav.Heightfield.Height
get

Gets the number of cells in the Y (up) direction.

The height.

Definition at line 127 of file Heightfield.cs.

◆ Length

int SharpNav.Heightfield.Length
get

Gets the number of cells in the Z direction.

The length.

Definition at line 139 of file Heightfield.cs.

◆ Maximum

Vector3 SharpNav.Heightfield.Maximum
get

Gets the world-space maximum.

The maximum.

Definition at line 103 of file Heightfield.cs.

◆ Minimum

Vector3 SharpNav.Heightfield.Minimum
get

Gets the world-space minimum.

The minimum.

Definition at line 91 of file Heightfield.cs.

◆ SpanCount

int SharpNav.Heightfield.SpanCount
get

Gets the total number of spans.

Definition at line 184 of file Heightfield.cs.

◆ this[int i]

Cell SharpNav.Heightfield.this[int i]
get

Gets the Cell at the specified index.

Parameters
iThe index.
Returns
The cell at index i.

Definition at line 218 of file Heightfield.cs.

◆ this[int x, int y]

Cell SharpNav.Heightfield.this[int x, int y]
get

Gets the Cell at the specified coordinate.

Parameters
xThe x coordinate.
yThe y coordinate.
Returns
The cell at [x, y].

Definition at line 202 of file Heightfield.cs.

◆ this[SpanReference spanRef]

Span SharpNav.Heightfield.this[SpanReference spanRef]
get

Gets the Span at the reference.

Parameters
spanRefA reference to a span.
Returns
The span at the reference.

Definition at line 234 of file Heightfield.cs.

◆ Width

int SharpNav.Heightfield.Width
get

Gets the number of cells in the X direction.

The width.

Definition at line 115 of file Heightfield.cs.


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