Table of Contents

Class GridMap<TDiscreteType>

Namespace
Gamelogic.Grids2
Assembly
Gamelogic.Grids2.dll

A grid map is used to convert from grid space to world space.

The map is composed from two separate maps. The space map takes a point in grid space, and positions it in world space. The points from grid space need not be discrete. For example, in a rect grid, the point (0.5, 0.5) represents the top right vertex of the cell at (0,0).

The round map makes continuous grid points discrete. I a rect grid, for example, the point (0.3, 0.3) is rounded to (0, 0).

public class GridMap<TDiscreteType> : IGridMap<TDiscreteType, Vector3, Vector3>

Type Parameters

TDiscreteType

The type of the t discrete type.

Inheritance
GridMap<TDiscreteType>
Implements
IGridMap<TDiscreteType, Vector3, Vector3>
Inherited Members

Constructors

GridMap(IMap<Vector3, Vector3>, IMap<Vector3, TDiscreteType>)

Properties

RoundMap
SpaceMap

Methods

DeRound(TDiscreteType)
GridToWorld(Vector3)

Converts a discrete grid point to world point.

GridToWorld(TDiscreteType)

Converts a discrete grid point to world point.

Round(Vector3)
WorldToGrid(Vector3)

Converts a world point to a continuous grid point.

WorldToGridToDiscrete(Vector3)

Converts a world point to a discrete world point.

See Also

IGridMap<TDiscreteInputType, TContinuousInputType, TOutput>