Show / Hide Table of Contents

Class RawSubstitutionTilingGrid

Inheritance
object
BaseSubstitutionTilingGrid
RawSubstitutionTilingGrid
Implements
IGrid
Inherited Members
BaseSubstitutionTilingGrid.DeadZone
BaseSubstitutionTilingGrid.prototiles
BaseSubstitutionTilingGrid.tileBits
BaseSubstitutionTilingGrid.prototileBits
BaseSubstitutionTilingGrid.cellTypes
BaseSubstitutionTilingGrid.hierarchy
BaseSubstitutionTilingGrid.bound
BaseSubstitutionTilingGrid.baseTransform
BaseSubstitutionTilingGrid.Up(Matrix4x4, BaseSubstitutionTilingGrid.InternalPrototile)
BaseSubstitutionTilingGrid.Down(Matrix4x4, BaseSubstitutionTilingGrid.InternalPrototile, int)
BaseSubstitutionTilingGrid.GetCellTypes()
BaseSubstitutionTilingGrid.GetDual()
BaseSubstitutionTilingGrid.GetDiagonalGrid()
BaseSubstitutionTilingGrid.GetCompactGrid()
BaseSubstitutionTilingGrid.Recenter(Cell)
BaseSubstitutionTilingGrid.GetCells()
BaseSubstitutionTilingGrid.TryMoveByOffset(Cell, Vector3Int, Vector3Int, CellRotation, out Cell, out CellRotation)
BaseSubstitutionTilingGrid.ParallelTransport(IGrid, Cell, Cell, Cell, CellRotation, out Cell, out CellRotation)
BaseSubstitutionTilingGrid.GetCellDirs(Cell)
BaseSubstitutionTilingGrid.GetCellCorners(Cell)
BaseSubstitutionTilingGrid.FindBasicPath(Cell, Cell)
BaseSubstitutionTilingGrid.GetIndex(Cell)
BaseSubstitutionTilingGrid.GetCellByIndex(int)
BaseSubstitutionTilingGrid.GetBound()
BaseSubstitutionTilingGrid.GetBound(IEnumerable<Cell>)
BaseSubstitutionTilingGrid.IntersectBounds(IBound, IBound)
BaseSubstitutionTilingGrid.UnionBounds(IBound, IBound)
BaseSubstitutionTilingGrid.GetCellsInBounds(IBound)
BaseSubstitutionTilingGrid.IsCellInBound(Cell, IBound)
BaseSubstitutionTilingGrid.GetBoundAabb(IBound)
BaseSubstitutionTilingGrid.GetCellCorner(Cell, CellCorner)
BaseSubstitutionTilingGrid.GetTRS(BaseSubstitutionTilingGrid.InternalPrototile, Matrix4x4, int)
BaseSubstitutionTilingGrid.GetDeformation(Cell)
BaseSubstitutionTilingGrid.GetTriangleMesh(Cell)
BaseSubstitutionTilingGrid.GetMeshData(Cell, out MeshData, out Matrix4x4)
BaseSubstitutionTilingGrid.GetAabb(Cell)
BaseSubstitutionTilingGrid.GetAabb(IEnumerable<Cell>)
BaseSubstitutionTilingGrid.FindGridSymmetry(ISet<Cell>, ISet<Cell>, Cell, CellRotation)
BaseSubstitutionTilingGrid.TryApplySymmetry(GridSymmetry, IBound, out IBound)
BaseSubstitutionTilingGrid.TryApplySymmetry(GridSymmetry, Cell, out Cell, out CellRotation)
BaseSubstitutionTilingGrid.Is2d
BaseSubstitutionTilingGrid.Is3d
BaseSubstitutionTilingGrid.IsPlanar
BaseSubstitutionTilingGrid.IsRepeating
BaseSubstitutionTilingGrid.IsOrientable
BaseSubstitutionTilingGrid.IsFinite
BaseSubstitutionTilingGrid.IsSingleCellType
BaseSubstitutionTilingGrid.CoordinateDimension
BaseSubstitutionTilingGrid.Unwrapped
BaseSubstitutionTilingGrid.IndexCount
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Sylves
Assembly: Sylves.dll
Syntax
public class RawSubstitutionTilingGrid : BaseSubstitutionTilingGrid, IGrid

Constructors

RawSubstitutionTilingGrid(Prototile[], Func<int, string>, SubstitutionTilingBound)

Declaration
public RawSubstitutionTilingGrid(Prototile[] prototiles, Func<int, string> hierarchy, SubstitutionTilingBound bound = null)
Parameters
Type Name Description
Prototile[] prototiles
Func<int, string> hierarchy
SubstitutionTilingBound bound

RawSubstitutionTilingGrid(Prototile[], string[], SubstitutionTilingBound)

Declaration
public RawSubstitutionTilingGrid(Prototile[] prototiles, string[] hierarchy, SubstitutionTilingBound bound = null)
Parameters
Type Name Description
Prototile[] prototiles
string[] hierarchy
SubstitutionTilingBound bound

Properties

Unbounded

Returns the grid with any bounds removed.

Declaration
public override IGrid Unbounded { get; }
Property Value
Type Description
IGrid
Overrides
BaseSubstitutionTilingGrid.Unbounded

Methods

BoundBy(IBound)

Returns a new grid restricted to just the given bound. If the grid already has a bound, the new grid will have the intersection of both.

Declaration
public override IGrid BoundBy(IBound bound)
Parameters
Type Name Description
IBound bound
Returns
Type Description
IGrid
Overrides
BaseSubstitutionTilingGrid.BoundBy(IBound)

CellToParentGrid(Cell, int)

Declaration
public Cell CellToParentGrid(Cell cell, int n = 1)
Parameters
Type Name Description
Cell cell
int n
Returns
Type Description
Cell

FindCell(Matrix4x4, out Cell, out CellRotation)

Returns the cell and rotation corresponding to a given transform matrix.

Declaration
public override bool FindCell(Matrix4x4 matrix, out Cell cell, out CellRotation rotation)
Parameters
Type Name Description
Matrix4x4 matrix
Cell cell
CellRotation rotation
Returns
Type Description
bool
Overrides
BaseSubstitutionTilingGrid.FindCell(Matrix4x4, out Cell, out CellRotation)

FindCell(Vector3, out Cell)

Finds the cell containg the give position

Declaration
public override bool FindCell(Vector3 position, out Cell cell)
Parameters
Type Name Description
Vector3 position
Cell cell
Returns
Type Description
bool
Overrides
BaseSubstitutionTilingGrid.FindCell(Vector3, out Cell)

GetCellCenter(Cell)

Returns the center of the cell in local space

Declaration
public override Vector3 GetCellCenter(Cell cell)
Parameters
Type Name Description
Cell cell
Returns
Type Description
Vector3
Overrides
BaseSubstitutionTilingGrid.GetCellCenter(Cell)

GetCellType(Cell)

Returns the cell type associated with a given cell

Declaration
public override ICellType GetCellType(Cell cell)
Parameters
Type Name Description
Cell cell
Returns
Type Description
ICellType
Overrides
BaseSubstitutionTilingGrid.GetCellType(Cell)

GetCellsIntersectsApprox(Vector3, Vector3)

Gets the set of cells that potentially overlap bounds.

Declaration
public override IEnumerable<Cell> GetCellsIntersectsApprox(Vector3 min, Vector3 max)
Parameters
Type Name Description
Vector3 min
Vector3 max
Returns
Type Description
IEnumerable<Cell>
Overrides
BaseSubstitutionTilingGrid.GetCellsIntersectsApprox(Vector3, Vector3)

GetPolygon(Cell, out Vector3[], out Matrix4x4)

For 2d cells, returns the polygon of the boundary of the cell. For performance reasons, cells can share a vertices array, so you need to apply a specific transform to get the polygon specific to a particular cell.

Declaration
public override void GetPolygon(Cell cell, out Vector3[] vertices, out Matrix4x4 transform)
Parameters
Type Name Description
Cell cell
Vector3[] vertices

The vertices of the polygon. This should not be mutated.

Matrix4x4 transform

A transformation that needs to be applied to each vertex.

Overrides
BaseSubstitutionTilingGrid.GetPolygon(Cell, out Vector3[], out Matrix4x4)

GetPrototile(Cell, int)

Declaration
protected override BaseSubstitutionTilingGrid.InternalPrototile GetPrototile(Cell cell, int height)
Parameters
Type Name Description
Cell cell
int height
Returns
Type Description
BaseSubstitutionTilingGrid.InternalPrototile
Overrides
BaseSubstitutionTilingGrid.GetPrototile(Cell, int)

GetTRS(Cell)

Returns the appropriate transform for the cell. The translation will always be to GetCellCenter, rotation reflects the particular orientation of this cell and the scale will reflect cell sizing. GetTRS is often "best effort", there might not be an obvious linear transformation from the canonical cell to the grid cell.

Declaration
public override TRS GetTRS(Cell cell)
Parameters
Type Name Description
Cell cell
Returns
Type Description
TRS
Overrides
BaseSubstitutionTilingGrid.GetTRS(Cell)

IsCellInGrid(Cell)

Returns true if the cell is in the grid (and within bounds). This is one of the few methods that accepts any Cell object, most other methods only work with the cells in the grid.

Declaration
public override bool IsCellInGrid(Cell cell)
Parameters
Type Name Description
Cell cell
Returns
Type Description
bool
Overrides
BaseSubstitutionTilingGrid.IsCellInGrid(Cell)

ParentGrid(int)

Declaration
public RawSubstitutionTilingGrid ParentGrid(int n = 1)
Parameters
Type Name Description
int n
Returns
Type Description
RawSubstitutionTilingGrid

Raycast(Vector3, Vector3, float)

Returns the cells intersecting a ray starting at origin, of length direction.magnitude * maxDistance, in order.

Declaration
public override IEnumerable<RaycastInfo> Raycast(Vector3 origin, Vector3 direction, float maxDistance = Infinity)
Parameters
Type Name Description
Vector3 origin
Vector3 direction
float maxDistance
Returns
Type Description
IEnumerable<RaycastInfo>
Overrides
BaseSubstitutionTilingGrid.Raycast(Vector3, Vector3, float)

TryMove(Cell, CellDir, out Cell, out CellDir, out Connection)

Attempts to move from a cell in a given direction, and returns information about the move if successful.

Declaration
public override bool TryMove(Cell cell, CellDir dir, out Cell dest, out CellDir inverseDir, out Connection connection)
Parameters
Type Name Description
Cell cell

The cell to move from

CellDir dir

The direction to move in

Cell dest

The cell moved to

CellDir inverseDir

The direction leading back from dest to cell.

Connection connection

A descriptor of how cell-local space relates between cell and dest.

Returns
Type Description
bool
Overrides
BaseSubstitutionTilingGrid.TryMove(Cell, CellDir, out Cell, out CellDir, out Connection)

Implements

IGrid

Extension Methods

GridExtensions.FindCell(IGrid, Vector3)
GridExtensions.GetCellsIntersectsApprox(IGrid, Aabb)
GridExtensions.GetMeshData(IGrid, Cell)
GridExtensions.GetNeighbours(IGrid, Cell)
GridExtensions.GetPolygon(IGrid, Cell)
GridExtensions.Masked(IGrid, ISet<Cell>)
GridExtensions.Masked(IGrid, Func<Cell, bool>, IEnumerable<Cell>)
GridExtensions.Move(IGrid, Cell, CellDir)
GridExtensions.ToMeshData(IGrid)
GridExtensions.ToMeshData(IGrid, IEnumerable<Cell>)
GridExtensions.Transformed(IGrid, Matrix4x4)
In this article
Back to top Generated by DocFX