Show / Hide Table of Contents

Class XZModifier

Converts a IGrid based in the XY plane to one in the XZ plane. It does this by rotating Y+ to Z- (and Z+ to Y+). This is different from a transform in that it doesn't rotate the cells, it applies XZCellModifier to them.

Inheritance
object
BaseModifier
TransformModifier
XZModifier
XZHexPrismGrid
XZTrianglePrismGrid
Implements
IGrid
Inherited Members
TransformModifier.GetDual()
TransformModifier.Recenter(Cell)
TransformModifier.GetBoundAabb(IBound)
TransformModifier.GetCellCenter(Cell)
TransformModifier.GetCellCorner(Cell, CellCorner)
TransformModifier.GetDeformation(Cell)
TransformModifier.GetPolygon(Cell, out Vector3[], out Matrix4x4)
TransformModifier.GetTriangleMesh(Cell)
TransformModifier.GetMeshData(Cell, out MeshData, out Matrix4x4)
TransformModifier.GetAabb(Cell)
TransformModifier.GetAabb(IEnumerable<Cell>)
TransformModifier.FindCell(Vector3, out Cell)
TransformModifier.GetCellsIntersectsApprox(Vector3, Vector3)
TransformModifier.Raycast(Vector3, Vector3, float)
TransformModifier.Transform
BaseModifier.GetDiagonalGrid()
BaseModifier.GetCompactGrid()
BaseModifier.GetCells()
BaseModifier.IsCellInGrid(Cell)
BaseModifier.TryMove(Cell, CellDir, out Cell, out CellDir, out Connection)
BaseModifier.TryMoveByOffset(Cell, Vector3Int, Vector3Int, CellRotation, out Cell, out CellRotation)
BaseModifier.GetCellDirs(Cell)
BaseModifier.GetCellCorners(Cell)
BaseModifier.FindBasicPath(Cell, Cell)
BaseModifier.GetIndex(Cell)
BaseModifier.GetCellByIndex(int)
BaseModifier.GetBound()
BaseModifier.GetBound(IEnumerable<Cell>)
BaseModifier.BoundBy(IBound)
BaseModifier.IntersectBounds(IBound, IBound)
BaseModifier.UnionBounds(IBound, IBound)
BaseModifier.GetCellsInBounds(IBound)
BaseModifier.IsCellInBound(Cell, IBound)
BaseModifier.FindGridSymmetry(ISet<Cell>, ISet<Cell>, Cell, CellRotation)
BaseModifier.TryApplySymmetry(GridSymmetry, IBound, out IBound)
BaseModifier.TryApplySymmetry(GridSymmetry, Cell, out Cell, out CellRotation)
BaseModifier.Is2d
BaseModifier.Is3d
BaseModifier.IsPlanar
BaseModifier.IsRepeating
BaseModifier.IsOrientable
BaseModifier.IsFinite
BaseModifier.IsSingleCellType
BaseModifier.CoordinateDimension
BaseModifier.Unbounded
BaseModifier.Unwrapped
BaseModifier.Underlying
BaseModifier.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 XZModifier : TransformModifier, IGrid

Constructors

XZModifier(IGrid)

Declaration
public XZModifier(IGrid underlying)
Parameters
Type Name Description
IGrid underlying

Methods

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
TransformModifier.FindCell(Matrix4x4, out Cell, out CellRotation)

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
BaseModifier.GetCellType(Cell)

GetCellTypes()

Returns the full list of cell types that can be returned by GetCellType(Cell)

Declaration
public override IEnumerable<ICellType> GetCellTypes()
Returns
Type Description
IEnumerable<ICellType>
Overrides
BaseModifier.GetCellTypes()

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
TransformModifier.GetTRS(Cell)

ParallelTransport(IGrid, Cell, Cell, Cell, CellRotation, out Cell, out CellRotation)

Given a path in aGrid from aSrcCell to aDestCell follows the same path in the current grid, starting at srcCell, and with the whole path rotated by startRotation. Reports the final spot that the path ends at, and it's rotation. Returns false if this cannot be done (typically because an equivalent pathc annot be found in the grid).

This method is useful for translating co-ordinates between different grids that are similarish, at least having the same celltypes. For example, suppose aGrid = new SquareGrid(1); aSrcCell = new Cell(0, 0) aDestCell = new Cell(5, 0) srcCell = new Cell(100, 100) startRotation = identity

Then the path in aGrid is a straight line moving 5 units to the right, and this method would attempt to move 5 units in the straight line that leads right out of (100, 100).

Declaration
public override bool ParallelTransport(IGrid aGrid, Cell aSrcCell, Cell aDestCell, Cell srcCell, CellRotation startRotation, out Cell destCell, out CellRotation destRotation)
Parameters
Type Name Description
IGrid aGrid
Cell aSrcCell
Cell aDestCell
Cell srcCell
CellRotation startRotation
Cell destCell
CellRotation destRotation
Returns
Type Description
bool
Overrides
BaseModifier.ParallelTransport(IGrid, Cell, Cell, Cell, CellRotation, out Cell, out CellRotation)

Rebind(IGrid)

Creates a new grid applying the current wrapper to a new underlying.

Declaration
protected override IGrid Rebind(IGrid underlying)
Parameters
Type Name Description
IGrid underlying
Returns
Type Description
IGrid
Overrides
TransformModifier.Rebind(IGrid)

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