Namespace Gamelogic.Grids
Classes
- AbstractMap<TPoint>
This class is suitable to use as base class for most maps.
AbstractMap implements the IMap interface almost completely; you only have to implement to methods that correspond to the two calculations: converting from world to grid coordinates, and converting from grid to world coordinates.
- AbstractOp<TShapeInfo>
The base class for all shape operators.A shape operator provides a mechanism to construct grids in a certain shape.Shape operators are used with the shape info classes.
- AbstractShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp>
The base class of shape info classes
- AbstractSplicedGrid<TCell, TPoint, TBasePoint>
A spliced grid represents a simple grid where all cells has been sliced in an equal numbers of cells. This class implements the common features of tri and rhomb grids. It is the most probable class to use to define your own grid.
- AbstractSplicedShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp>
This is the base class of all ShapeInfo classes for spliced grids.
- AbstractUniformGridObsoleteExtensions
This class provides extensions that implement obsolete methods.
- AbstractUniformGrid<TCell, TPoint>
This is the base class for grids that are not spliced; in other words, grids that have identical cells, with identical orientation, and in which grid points behave as (integer) vectors.
- Algorithms
This class provide generic functions for common grid operations, such as finding a shortest path or connected shapes.
- AnimatableMap<TPoint>
A map that changes over time.
- ArchimedeanSpiralMap
A map that maps points of a LineGrid in an archimedean spiral.
- Block
A tile that is represented by a simple 3D object (such as a cube), typically an object with a single mesh and material.
- CairoGrid<TCell>
A CiaroGrid is a grid where all the cells are pentagons (so each cell has five neighbors). See http://en.wikipedia.org/wiki/Cairo_pentagonal_tiling.
- CairoMap
Maps between world points and CiaroPoints.
This example shows how to implement a map for a grid with arbitrary polygons, using PolygonMap.
- CairoOp<TCell>
Class for making CairoGrids in different shapes. Copyright Gamelogic. Author Herman Tulleken Since version 1.0 See also AbstractOp
- CairoShapeInfo<TCell>
Provides the implementation for AbstractSplicedShapeInfo to be used with CairoGrid.
- CairoTileGridBuilder
Class for building a Cairo grid in the Unity editor. This component should(generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- ColorFunction
This is an inspectable presentation of a grid coloring, using three parameters as explained here:
http://gamelogic.co.za/2013/12/18/what-are-grid-colorings/
The three values represent two corners of a parallelogram (x0, 0) and(xq, y1) that describe the patch to repeat for the coloring.
- CompoundMap<TPoint>
A maps that combines two maps through function composition.
- CustomGridBuilder
Inherit from this class to implement custom grid shapes.
This class should return a grid.To have the grid builder used this grid, you should set the Shape to Custom in the editor, and attached this script to the same game object as the grid builder.
- CustomMap3DBuilder
Base class for 3D grid builders using a custom map.
- CustomMapBuilder
Inherit from this class to implement custom map for an grid builder. This class should return a map. To have the grid builder used this map, you should set the Map to Custom in the editor, and attach this script to the same game object as the grid builder.
- DiamondGrid<TCell>
Represents a diamond grid. At its simplest, diamond grids are square grids that are rotated 45 degrees.
By using suitable dimensions in the map, DiamondGrids can be used to implement isometric grids.
- DiamondHorizontalWrapper
Wraps points horizontally.
Since version 1.7
- DiamondMap
Maps between grid points and world points.
- DiamondMeshGridBuilder
Builder for building diamond mesh grid.
- DiamondMeshMap
Map for diamond mesh grids.
- DiamondOp<TCell>
Documentation in Op.cs
- DiamondParallelogramWrapper
Wraps points both horizontally and vertically.
Since version 1.7
- DiamondShapeInfo<TCell>
Provides the implementation for AbstractShapeInfo to be used with DiamondGrid.
- DiamondTileGridBuilder
Class for building a diamond grid in the Unity editor.
This component should(generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- DiamondVerticalWrapper
Wraps points vertically.
Since version 1.7
- FlatBrickMap
A map that can be used with a PointyHexGrid to get a brick-wall pattern (rotated by 90 degrees). The cells are rectangular.
- FlatBrickMeshMap
Map for flat brick mesh grids.
- FlatHexGrid<TCell>
A grid for flat hexagons, that is, hexagons with two horizontal edges.
- FlatHexHexagonWrapper
Since version 1.7
- FlatHexHorizontalWrapper
Wraps points horizontally.
Since version 1.7
- FlatHexMap
The default Map to be used with a FlatHexGrid.
- FlatHexMeshGridBuilder
Builder for building flat hex mesh grid.
- FlatHexMeshMap
Map for flat hex mesh grids.
- FlatHexOp<TCell>
Documentation in Op.cs
- FlatHexParallelogramWrapper
Wraps points both horizontally and vertically.
Since version 1.7
- FlatHexShapeInfo<TCell>
Provides the implementation for AbstractShapeInfo to be used with FlatHexGrid.
- FlatHexTileGridBuilder
Class for building a flat hex grid in the Unity editor. This builder can also make flat brick grids.
This component should (generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- FlatHexVerticalWrapper
Wraps points vertically.
Since version 1.7
- FlatRhombGrid<TCell>
A rhombille grid in the flat orientation, that is, there are rhombusses with horizontal edges.
- FlatRhombMap
The default map to be used with FlatRhombGrid.
- FlatRhombOp<TCell>
Documentation in Op.cs
- FlatRhombShapeInfo<TCell>
Provides the implementation for AbstractSplicedShapeInfo to be used with FlatRhombGrid.
- FlatRhombTileGridBuilder
Class for building a flat rhomb grid in the Unity editor.
This component should(generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- FlatTriGrid<TCell>
A grid of triangles in the flat orientation. All triangles have one horizontal edge.
- FlatTriHexagonWrapper
A wrapper that wraps tri points over a hexagon, similar to the way hex points are wrapped in this example:
http://www.redblobgames.com/grids/hexagons/
Since version 1.7
- FlatTriMap
The default map between world coordinates and FlatTri coordinates.
- FlatTriOp<TCell>
Documentation in Op.cs
- FlatTriShapeInfo<TCell>
Provides the implementation for AbstractSplicedShapeInfo to be used with FlatTriGrid.
- FlatTriTileGridBuilder
Class for building a flat tri grid in the Unity editor.
This component should(generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- GLGizmos
Provides methods for drawing Gizmos in for grids in the Unity editor.
- GridBehaviour<TPoint>
Extend from this class to hook in your own grid initialization code.
- GridBuilderUtils
Provides utility functions for grid builders. Renamed from GridBuilderUtil to GridBuilderUtils(1.8.1)
- GridBuilder<TPoint>
Base class for grid builders.
- GridExtensions
Defines extension methods for the IGrid interface. This is implemented as an extension so that implementers need not extend from a common base class, but provide it to their clients.
- IEnumerableExtensions
Extensions for IEnumerable.
- IMapObsoleteExtensions
This class provides extensions that implement obsolete methods.
These methods will be removed in a future version of this library.
- ImageMap<TPoint>
Map that maps a grid to an image; useful for texturing a grid with a single image, or point an image with a grid.
- InspectableSplicedVectorPoint
This class provides is a mutable class that can be used to construct partial vector points.
It is provided for use in Unity's inspector.
- InspectableVectorPoint
This class provides is a mutable class that can be used to construct VectorPoints.
It is provided for use in Unity's inspector.
- LayeredGrid<TCell, TPoint>
A layered grid is a 3D grid made out of layers of 2D grids with the same point type. Each layer can have a different shape.
Layered grids are accessed through LayeredPoints.
Note that neighbors are not implemented for this grid.If you need to use neighbor relationships, you need
to extend this class and configure neighbors. See also A new look at layered grids: setting up neighbors.
- LineGrid<TCell>
Represents a one dimensional grid; essentially an array that can work with maps.
LinePoints are automatically convertible to integers.
- LineMap
The default map for a LineGrid, that maps points in a straight horizontal line.
- LineOp<TCell>
Class for making LineGrids in different shapes. AbstractOp<TShapeInfo>
- LineShapeInfo<TCell>
Provides the implementation for AbstractShapeInfo to be used with LineGrid.
- LineTileGridBuilder
Class for building a line grid in the Unity editor.
This component should(generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- Map3DExtensions
Extensions for IMap3D.
- Map3DXY<TPoint>
The default maps for putting a grid in 3D space in the XY-plane.
- Map3DXZ<TPoint>
The default maps for putting a grid in 3D space in the XZ-plane.
- MapAnimationExtensions
These functions are defined as extensions so that IMap can remain pure (that is, not access Time.time).
These methods are implemented as extension methods so that they do not become part of the "pure" interface of IMap. (Time.time is a "non-pure", very Unity-specific feature).
- MapExtensions
Extensions for IMap.
- Mathi
Contains methods for integer arithmetic that works consistently for both positive and negative integers.
- MeshCell
A cell that can be used in mesh grids. It contains information about the texture to use, and can be extended to contain other cell information.
- MeshGridBehaviour<TPoint>
Attach this component to Mesh Grid Builders to change the grid's behaviour.
- MeshGridBuilder<TPoint>
Base class for tile grid builders where grid is rendered as a single mesh.
- MeshMap
Contains various mesh maps used by builders.
- MeshTileCell
A cell represented by a mesh, such as used by the polar grids.
- MeshUtils
Provides methods for making specialised meshes that can be used with grids.
- NestedRectGrid<TCell>
Represents a composite grid, where each cell contains a grid.
Big points access the "big" cells(which contain grids). Small points access the cells of the grids in the big cells.
The grid can also be accessed with "normal" points.For example: suppose the grid is a 3x3 grid, where each cell is a 2x2 grid. Then the "normal" point[7, 2] corresponds to "big" point[3, 1] and "small" point[1, 1].
- PointComparer<TPoint>
Use this class in constructors of HashSets and Dictionaries that take point types(such as PointyHexPoint) as keys.
- PointListMap
A one-way map map that maps a sequence of LinePoints to an arbitrary list of world points.
- PointListTileGridBuilder
Class for building a point list grid in the Unity editor.
This component should(generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- PointList<TPoint>
An implementation of IList for grid points that is safe to use with the AOT compiler.
- PointStack<TPoint>
An implementation of a stack for grid points that is safe to use with the AOT compiler.
- PointyBrickMap
A map that can be used with a PointyHexGrid to get a brick-wall pattern. The cells are rectangular.
- PointyBrickMeshMap
Map for pointy brick mesh grids.
- PointyHexGrid<TCell>
A grid for pointy hexagons, that is, hexagons with two vertical edges.
- PointyHexHexagonWrapper
Since version 1.7
- PointyHexHorizontalRectangleWrapper
This wrapper wraps pointy hex points horizontally.
- PointyHexHorizontalWrapper
Wraps points horizontally.
Since version 1.7
- PointyHexMap
The default Map to be used with a PointyHexGrid.
- PointyHexMeshGridBuilder
Builder for building flat hex mesh grid.
- PointyHexMeshMap
Map for pointy hex mesh grids.
- PointyHexOp<TCell>
Documentation in Op.cs
- PointyHexParallelogramWrapper
Wraps points both horizontally and vertically.
Since version 1.7
- PointyHexShapeInfo<TCell>
Provides the implementation for AbstractShapeInfo to be used with PointyHexGrid.
- PointyHexTileGridBuilder
Class for building a pointy hex grid in the Unity editor. This builder can also make pointy brick grids.
This component should (generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- PointyHexVerticalWrapper
Wraps points vertically.
Since version 1.7
- PointyRhombGrid<TCell>
A rhombille grid in the pointy orientation, that is, there are rhombusses with vertical edges.
- PointyRhombMap
The default maps that works with PointyRhombGrids.
- PointyRhombOp<TCell>
Documentation in Op.cs
- PointyRhombShapeInfo<TCell>
Provides the implementation for AbstractSplicedShapeInfo to be used with PointyRhombGrid.
- PointyRhombTileGridBuilder
Class for building a pointy rhomb grid in the Unity editor.
This component should(generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- PointyTriGrid<TCell>
A grid of triangles in the pointy orientation. All triangles have one vertical edge.
- PointyTriHexagonWrapper
A wrapper that wraps tri points over a hexagon, similar to the way hex points are wrapped in this example:
http://www.redblobgames.com/grids/hexagons/
Since version 1.7
- PointyTriMap
The default map between world coordinates and PointyTri coordinates.
- PointyTriOp<TCell>
Documentation in Op.cs
- PointyTriShapeInfo<TCell>
Provides the implementation for AbstractSplicedShapeInfo to be used with PointyTriGrid.
- PointyTriTileGridBuilder
Class for building a pointy tri grid in the Unity editor.
This component should(generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- PoissonDisk
Used to generate Poisson disk sample points.
- PoissonDiskProperties
Class for holding properties for generating a Poisson disk sample set.
- PolarFlatBrickMap
This map can be used with a horizontally wrapped FlatHexGrid. For now, alignment does not work as with the other maps.
- PolarFlatBrickTileGridBuilder
Class for building a polar flat brick grid in the Unity editor.
This component should(generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- PolarGridProperties
A class for storing properties to setup a polar grid.
- PolarPointyBrickMap
This map can be used with a horizontally wrapped PointyHexGrid.
For now, alignment does not work as with the other maps.
- PolarPointyBrickTileGridBuilder
Class for building a polar pointy brick grid in the Unity editor.
This component should(generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- PolarRectMap
This map can be used with a horizontally wrapped RectGrid.
For now, alignment does not work as with the other maps.
- PolarRectTileGridBuilder
Class for building a polar rect grid in the Unity editor.
This component should(generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- PolarTileGridBuilder<TPoint>
Base class for polar tile grid builders.
- PolygonGridMap<TPoint, TBasePoint>
A map that can be used for general spliced grids made from polygons.
To use this map: - Find a rectangular tessellation for your grid. - This rectangle will consist out of several polygons, each which represents a (partial) cell of your grid. - One of these polygons should correspond to the splice point (0, 0, 0). - Find the center of this polygon relative to the rectangle in normalized coordinates, that is, so that the entire rectangle corresponds to (0, 0) -> (1, 1). - Label the polygons 0, 1, 2, ... etc. - Find the vertices of each polygon in normalized coordinates. - Now calculate the spliced vector point offsets for each polygon, relative to the (0, 0, 0) polygon, in normalized coordinates.
- RectGrid<TCell>
Represents a rectangular grid.
- RectHorizontalWrapper
Wraps points horizontally.
Since version 1.7
- RectMap
Maps between RectPoints grid points and Vector2 world points.
- RectMeshGridBuilder
Builder for building flat hex mesh grid.
- RectMeshMap
Map for rect mesh grids.
- RectOp<TCell>
Documentation in Op.cs
- RectParallelogramWrapper
Wraps points both horizontally and vertically.
Since version 1.7
- RectShapeInfo<TCell>
Provides the implementation for AbstractShapeInfo to be used with RectGrid.
- RectTileGridBuilder
Class for building a rectangular grid in the Unity editor.
This component should(generally) not be accessed directly.Instead, add your own component that inherits from GridBebaviour, and access the grid and map through there.
- RectVerticalWrapper
Wraps points vertically.
Since version 1.7
- SerializableRect
Class used for keeping the proeprties of a rectangle.
- ShapeMethodAttribute
Methods in an Op (sublcasses of AbstractOp) marked with this attribute are automatically added as static methods to the appropriate grid class for convenience.
- ShapeStorageInfo<TPoint>
This class handles how the cells of a grid is represented in memeory. This class is used by shape info classes.
- Shape<TPoint>
Class that represents a grid shape.
- SimpleLayeredMap<TPoint>
A simple map that can be used for Layered Grids.
- SplicedGrid<TCell, TBasePoint>
A SplicedGrid is a grid formed from another grid, where each cell is "spliced" in a certain number of cells. For example, a triangular grid can be implemented as a diamond grid where each diamond cell is spliced into two triangles.
- SplicedMap<TBasePoint>
A one-way map that can be used to make maps for arbitrary spliced grids, where each point is mapped to the base point location, plus an offset, where each index has a different offset.
For example, if the spliced grid is a diamond grid, with each cell spliced into a top and bottom triangle, then the two offsets will be above and below the origin (for example, (0, 1) and(0, -1)).
- SpriteCell
A tile cell that uses a Unity sprite to render.
- TextureCell
Similar to a sprite cell, but with custom UV coordinates. This type of cell is useful when placing a single texture across multiple cells.
- TileCell
A TileCell is a cell that is represented by a single Unity object.
They can be anything, including Sprites, Models, or compound objects, as long as they can be instantiated, and each corresponds to exactly one cell in a grid.They are used with TileGrid builders.
- TileGridBuilder<TPoint>
Base class for tile grid builders where all the tiles are the same.
- UIImageCell
This component represents a cell that can be used with Unity's GUI system, using an Image compoenent to render the cell.
It expects an Image component in the hierarchy (on the same game object or a child).
To use it with grid builders: Make a new cell prefab with this component Add the grid builder to the canvas or to some child of the canvas Set the cell prefab proeprty oof the grid builder to the new prefab.
Grids ships with a few example prefabs that uses UIImageCells; check them out to see how they work.
- UIImageTextCell
This is the same as UIImageCell, except that it supports a text component as well.
This class is also suitable to use with Unity's Buttons (since they are rendered with Image and Text components).
In addition to the Image component that is expected down the hierarchy, this component also expects a Text component down the hierarchy (on this object or a child).
- UITextCell
This component represents a cell that can be used with Unity's GUI system, using a Text component to render the cell.
It expects a Text component in the hierarchy (on the same game object or a child).
To use it with grid builders: Make a new cell prefab with this component Add the grid builder to the canvas or to some child of the canvas Set the cell prefab property oof the grid builder to the new prefab.
Grids ships with a few example prefabs that uses UITextCells; check them out to see how they work.
- UVCell
Similar to a sprite cell, but with custom UV coordinates. This type of cell is useful when placing a single texture across multiple cells.
- Vector2Extensions
Extension methods for Vector2.
- Vector2Transforms
Provides extension methods for transforming Vector2 instances.
- VoronoiMap<TPoint>
A map that uses a Voronoi diagram to map points.
- WindowedMapObsoleteExtensions
This class provides extensions that implement obsolete methods.
These methods will be removed in a future version of this library.
- WindowedMap<TPoint>
A WindowedMap maps grid points relative to a window (a rectangle in world space) and provides methods that makes alignment with respect to this window simple.
- WrappedGrid<TCell, TPoint>
A general implementation of Wrapped grids, that use arbitrary internal grids and point wrappers.
A "true point" of a wrapped grid is a point that stays the same after the wrapping.
- Contains returns true only for true points.
- GetAllNeighbors return true points (that is, the neighbors are already wrapped)
- the index operator takes all points, and wrap them before access
- Iterators iterate over true points
- __CellType
Place holder class.
- __CompilerHints
This class provides static methods that ensure all the code is generated by to AOT compiler for iOS.
The easiest way to use it is to copy the appropriate methods to one of your classes, modify the __CellType type, and call the methods.
- __CompilerHintsGL
Compiler hints for our examples. Since 1.8
Structs
- ArrayPoint
This class is used for accessing 2D arrays.
It is mainly used as a convenient wrapper for returning results of coordinate calculations.
- CairoPoint
A coordinate for a cell in a CiaroGrid. The base point is a pointy hex point, and indices run from 0 to 3.
- DiamondPoint
Class that represents a points of a DiamondGrid.
- FlatHexPoint
A point of a hexagonal grid, where the hexagons have two horizontal edges.
- FlatRhombPoint
A struct that represents a point of a FlatRhombGrid.
- FlatTriPoint
A struct that represents a point of a FlatTriGrid.
- IntRect
A rectangle where coordinates are non-negative integers (that is, the corners are ArrayPoints).
This class is useful for implementing storage operations for shapes.
- LayeredPoint<TPoint>
A point that represent cells in a LayeredGrid.
- LinePoint
Represents 1D grid points. These are auto-convertible to integers, making it possible to write, for example,
grid[6]instead ofgrid[new LinePoint(6)].
- Pair
Struct for representing a pair of integers.
- PointyHexPoint
Represents coordinates of the faces in a regular hexagonal lattice.The hexagons have the Pointy orientation.
- PointyRhombPoint
A struct that represents a point of a PointyRhombPoint.
- PointyTriPoint
A struct that represents a point of a PointyTriGrid.
- RectPoint
The point to be used with rectangular grids.
- SplicedPoint<TBasePoint>
A point that can be use that access a generic SplicedGrid. It has two components, a base point (which is another grid point), and a splice index. Note that for these points to be truly immutable, the base point on which they are based must also be immutable.
- VectorPoint
A VectorPoint behaves like a vector, except that it's coordinates are integers.
Interfaces
- ICell
A common interface for all cells.
This class does not specify any methods, but is used to identify cells so they can be handled in a special way by the editor.
- IColorableCell
Represents a cell whose color can be set.
- IEdge<TPoint>
A point type implements this interface if that point type can be the edge grid of TPoint.
For example, FlatRhombPoints are the points of the edge grid for FlatHexPoints, and hence FlatRombPoint implements "IEdge<FlatHexPoint>." (This class replaces IEdgeAnchor).
- IEvenGrid<TCell, TPoint, TBasePoint>
A grid where cells have an even number of neighbors. In an even grid each neighbor has an opposite neighbor.
- IGLScriptableObject
Classes that can be edited in the inspector using a custum editor should implement this interface to allow the editor to update the presentation when necessary.
- IGridBuilderBase
A common interface implemented by all grid builders to allow identification by type.
- IGridPoint
Non generic interface for grid points.
- IGridPoint<TPoint>
Represents a "point" that is used to access a cell in a Grid.
For built-in 2D grids, these points are often 2D integer vectors, or spliced vectors, and hence they implement additional interfaces such as IVectorPoint, ISplicedPoint, andISplicedVectorPoint.These points supports arithmetic, colorings, and some other geometric operations.
In general, points do not "know" their neighbors.Use the grid methods IGrid<TCell, TPoint>.GetNeighbors and IGrid<TCell, TPoint>.GetAllNeighbors to make queries about a point's neighbors.
GridPoint base classes must be immutable for many of the algorithms to work correctly.In particular, GridPoints are used as keys in dictionaries and sets.
It is also a good idea to overload the
==and!=operators.
- IGridSpace<TPoint>
A grid space is an object that can determine whether a point is inside it our not. Unlike grids, it does not contain data, and therefore there is no data at points.
- IGridToWorldMap<TPoint>
A one-way map that converts grid points to worls points. One-way maps are useful for maps that can automatically invert the map, such as VoronoiMap.
- IGrid<TPoint>
A grid interface that is not generic in the cell type. This is useful if you do not care about the cell type, and for implementing casting of grid contents.
- IGrid<TCell, TPoint>
The base class of all types of grids.
Grids are similar to 2D arrays.Elements in the grid are called cells.Grids support random access to cells through grid points(IGridPoint), using square bracket syntax.
Cell cell = squareGrid[squarePoint]; Most grids support enumeration of points, making it possible to useLINQ on grids as well.
foreach(var point in grid) doSomethingWithCell(grid[point]); var pointsThatSatsifyPointPredicate = grid.Where(pointPredicate);
General algorithms are provided in Algorithms. If you want to implement your own grid, you can implement th is interface to have your grid work with many grid algorithms.
- IMap3D<TPoint>
An IMap maps 3D world coordinates to Grid coordinates and vice versa.
Many grids provide 2D maps, which can be converted to standard 3D maps using commands such as To3DXY.
You can also provide your own maps, either as implementations of IMap, or IMap3D.
- IMap<TPoint>
An IMap maps 2D world coordinates to Grid coordinates and vice versa.
Most of the methods of this class are meant to be chained to the constructor.The last command in the chain is suaully a conversion to IMap3D, which converts the 2D coordinates to 3D for use in the game engine.
The order of chained calls sometimes make a difference.
The standard order is this: - set grid point transforms - set cell anchoring - set world transforms (such as translate, rotate) - do layout (using WithWindow) - convert to 3D
Transformations only apply to the world points returned and processed by the map, the grid contents is not transformed.
For example, applying scale to the map, will not scale the cells
physically , in the sense that if the grid contains GameObjects, cells will remain the same size. The cells will be logically bigger, so they will appear further apart from each other.Built-in 2D grids generally have associated built-in maps.See the Grid Index for the list.
You can also provide your own maps, either as implementations of IMap, or IMap3D.
- IMeshMap<TPoint>
Interface for maps for mesh grids.
- IPointWrapper<TPoint>
Provides a function for wrapping points that is used by wrapped grids.
Since many such functions require lookup tables, it's more suitable to provide it as a class than providing it as a delagate.
- IPolarMap<TPoint>
An interface for polar maps that make it easier to build meshes for them.
- IShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp>
All Shape Info classes should implement this interface. This provides basic transformations and set operations to combine shape info instances.
- IShape<TPoint>
Interface for grid shapes.
- ISplicedPoint<TPoint, TBasePoint>
Interface for working with compound points.
Spliced points are used for periodic grids where not all faces are identical(see AbstractSplicedGrid).
Every spliced grid can be seen as a uniform regular grid, where each cell has been divided.Therefore, a spliced point consists of a coordinate on the base grid, and an index denoting the particular cell.
- ISplicedVectorPoint<TPoint, TVectorPoint>
A partial vector point is a point that can be translated by "adding" a vector point.
Partial vectors can be seen as a pair, one of which is a vector(of type TVectorPoint). All the operations actually operate on the vector of this pair.
Partial vector points are used in SplicedGrids, where the second of the pair is an index that denotes the sub-cell.For example, for a tri point, the vector is a hex point, and the index denotes whether the point refers to the up or down triangle.
- ISupportsEdgeGrid<TPoint>
Indicates that a grid supports an edge grid.
- ISupportsEdges<TVertexPoint>
Used to indicated that grids of this point type can support edge grids. Replaces ISupportsEdgeGrid that is now applied to grids, not Interface
- ISupportsVertexGrid<TPoint>
Indicates that a grid supports an vertex grid.
- ISupportsVertices<TVertexPoint>
Used to indicate hat grids of this point type can support vertex grids. Replaces ISupportsVertexGrid that is now aplied to grids and not points.
- ITileGrid<TPoint>
An interface that all tile grid builder implement. This gives common hooks that are used by the grid editors.
- IVectorGrid<TCell, TPoint, TBasePoint>
IVectorGrids are build on (spliced) vector points. They are regular and uniform.
- IVectorPoint<TPoint>
A VectorPoint is a point that is also an algebraic vector.
- IVertex<TPoint>
This point type is the type of vertex anchor point of the type parmater. The vertex anchor is the point from which all the vertices are calculated.
For example, if TriPoint implements ISupportsVertexGrid<HexPoint>, then HexPoint will implement IVertex<TriPoint>.
(This class replaces IVertexAnchor).
Enums
- MapPlane
An enumeration of the two basic types of 2D planes (in 3D space) used in the library.