Show / Hide Table of Contents

Class PlanarLazyGrid

An infinite planar grid. It is evaluated lazily by splitting the plane into overlapping period 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
System.Object
NestedModifier
PlanarLazyGrid
PlanarLazyMeshGrid
RelaxModifier
Implements
IGrid
Inherited Members
NestedModifier.Setup(IGrid, IEnumerable<ICellType>, ICachePolicy)
NestedModifier.GetChildGrid(Cell)
NestedModifier.GetChildGridCached(Cell)
NestedModifier.Split(Cell)
NestedModifier.Combine(Cell, Cell)
NestedModifier.GetCellTypes()
NestedModifier.GetCells()
NestedModifier.GetCellType(Cell)
NestedModifier.IsCellInGrid(Cell)
NestedModifier.TryMove(Cell, CellDir, Cell, CellDir, Connection)
NestedModifier.TryMoveByOffset(Cell, Vector3Int, Vector3Int, CellRotation, Cell, CellRotation)
NestedModifier.ParallelTransport(IGrid, Cell, Cell, Cell, CellRotation, Cell, CellRotation)
NestedModifier.GetCellDirs(Cell)
NestedModifier.GetCellCorners(Cell)
NestedModifier.FindBasicPath(Cell, Cell)
NestedModifier.GetIndex(Cell)
NestedModifier.GetCellByIndex(Int32)
NestedModifier.GetBound()
NestedModifier.GetBound(IEnumerable<Cell>)
NestedModifier.BoundBy(IBound)
NestedModifier.IntersectBounds(IBound, IBound)
NestedModifier.UnionBounds(IBound, IBound)
NestedModifier.GetCellsInBounds(IBound)
NestedModifier.IsCellInBound(Cell, IBound)
NestedModifier.GetCellCenter(Cell)
NestedModifier.GetCellCorner(Cell, CellCorner)
NestedModifier.GetTRS(Cell)
NestedModifier.GetDeformation(Cell)
NestedModifier.GetPolygon(Cell, Vector3[], Matrix4x4)
NestedModifier.GetTriangleMesh(Cell)
NestedModifier.GetMeshData(Cell, MeshData, Matrix4x4)
NestedModifier.FindCell(Vector3, Cell)
NestedModifier.FindCell(Matrix4x4, Cell, CellRotation)
NestedModifier.GetCellsIntersectsApprox(Vector3, Vector3)
NestedModifier.Raycast(Vector3, Vector3, Single)
NestedModifier.FindGridSymmetry(ISet<Cell>, ISet<Cell>, Cell, CellRotation)
NestedModifier.TryApplySymmetry(GridSymmetry, IBound, IBound)
NestedModifier.TryApplySymmetry(GridSymmetry, Cell, Cell, CellRotation)
NestedModifier.ChunkGrid
NestedModifier.CachePolicy
NestedModifier.Is2d
NestedModifier.Is3d
NestedModifier.IsPlanar
NestedModifier.IsRepeating
NestedModifier.IsOrientable
NestedModifier.IsFinite
NestedModifier.IsSingleCellType
NestedModifier.CoordinateDimension
NestedModifier.Unbounded
NestedModifier.Unwrapped
NestedModifier.IndexCount
Namespace: Sylves
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
Type Name Description
PlanarLazyGrid original
SquareBound bound

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.

System.Collections.Generic.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
Type Description
Vector2

AabbSize

Declaration
public Vector2 AabbSize { get; }
Property Value
Type Description
Vector2

StrideX

Declaration
public Vector2 StrideX { get; }
Property Value
Type Description
Vector2

StrideY

Declaration
public Vector2 StrideY { get; }
Property Value
Type Description
Vector2

Methods

ChunkOffset(Cell)

Declaration
protected Vector3 ChunkOffset(Cell chunk)
Parameters
Type Name Description
Cell chunk
Returns
Type Description
Vector3

GetAdjacentChunks(Cell)

Declaration
protected virtual IEnumerable<Cell> GetAdjacentChunks(Cell chunk)
Parameters
Type Name Description
Cell chunk
Returns
Type Description
System.Collections.Generic.IEnumerable<Cell>

GetDual()

Declaration
public override IDualMapping GetDual()
Returns
Type Description
IDualMapping
Overrides
NestedModifier.GetDual()

MeshTranslation(Cell)

Declaration
protected override Vector3 MeshTranslation(Cell chunk)
Parameters
Type Name Description
Cell chunk
Returns
Type Description
Vector3
Overrides
NestedModifier.MeshTranslation(Cell)

Setup(Vector2, Vector2, Vector2, Vector2, Boolean, 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
Type Name Description
Vector2 strideX
Vector2 strideY
Vector2 aabbBottomLeft
Vector2 aabbSize
System.Boolean translateMeshData
SquareBound bound
System.Collections.Generic.IEnumerable<ICellType> cellTypes
ICachePolicy cachePolicy

Implements

IGrid
In This Article
Back to top Generated by DocFX