Class PlanarLazyGrid
An infinite planar grid. It is evaluated lazily by splitting the plane into overlapping periodic rectangles
which then each has a grid associated.
This class requires you to compute inter-chunk neighbours yourself, which is often tricky.
You are recommended to use PlanarLazyMeshGrid instead, which handles this automatically.
This class is simply a specialization of NestedModifier, applied to a grid of overlapping rectangles.
Inheritance
PlanarLazyGrid
Assembly: Sylves.dll
Syntax
public abstract class PlanarLazyGrid : NestedModifier, IGrid
Constructors
PlanarLazyGrid()
Declaration
protected PlanarLazyGrid()
PlanarLazyGrid(PlanarLazyGrid, SquareBound)
Declaration
protected PlanarLazyGrid(PlanarLazyGrid original, SquareBound bound)
Parameters
PlanarLazyGrid(Vector2, Vector2, Vector2, Vector2, SquareBound, IEnumerable<ICellType>, ICachePolicy)
Constructs a planar lazy grid that calls getMeshData to fill a chunked plane with a mesh per chunk.
Declaration
public PlanarLazyGrid(Vector2 strideX, Vector2 strideY, Vector2 aabbBottomLeft, Vector2 aabbSize, SquareBound bound = null, IEnumerable<ICellType> cellTypes = null, ICachePolicy cachePolicy = null)
Parameters
| Type |
Name |
Description |
| Vector2 |
strideX |
The step from one chunk to the next.
|
| Vector2 |
strideY |
The step from one chunk to the next.
|
| Vector2 |
aabbBottomLeft |
The bottom left point of the central chunk. This should bound getMeshData(new Vector2(0, 0))
|
| Vector2 |
aabbSize |
The size of each chunk. This should bound getMeshData(new Vector2(0, 0))
|
| SquareBound |
bound |
Bounds which chunks are generated.
|
| IEnumerable<ICellType> |
cellTypes |
What should the response of GetCellType
|
| ICachePolicy |
cachePolicy |
Configures how to store the cahced meshes.
|
Properties
AabbBottomLeft
Declaration
public Vector2 AabbBottomLeft { get; }
Property Value
AabbSize
Declaration
public Vector2 AabbSize { get; }
Property Value
StrideX
Declaration
public Vector2 StrideX { get; }
Property Value
StrideY
Declaration
public Vector2 StrideY { get; }
Property Value
Methods
ChunkOffset(Cell)
Declaration
protected Vector3 ChunkOffset(Cell chunk)
Parameters
| Type |
Name |
Description |
| Cell |
chunk |
|
Returns
GetAdjacentChunks(Cell)
Declaration
protected virtual IEnumerable<Cell> GetAdjacentChunks(Cell chunk)
Parameters
| Type |
Name |
Description |
| Cell |
chunk |
|
Returns
GetDiagonalGrid()
Declaration
public IGrid GetDiagonalGrid()
Returns
GetDual()
Returns a second grid which has one cell for every vertex of this grid,
and also methods for mapping corners of one grid to the other.
Declaration
public override IDualMapping GetDual()
Returns
Overrides
MeshTranslation(Cell)
Declaration
protected override Vector3 MeshTranslation(Cell chunk)
Parameters
| Type |
Name |
Description |
| Cell |
chunk |
|
Returns
Overrides
Setup(Vector2, Vector2, Vector2, Vector2, bool, SquareBound, IEnumerable<ICellType>, ICachePolicy)
Declaration
protected void Setup(Vector2 strideX, Vector2 strideY, Vector2 aabbBottomLeft, Vector2 aabbSize, bool translateMeshData = false, SquareBound bound = null, IEnumerable<ICellType> cellTypes = null, ICachePolicy cachePolicy = null)
Parameters
Implements
Extension Methods