ClassicCityBuilderKit 1.8.8
|
transforms between grid and world positions
Public Member Functions | |
Vector2Int | GetGridPosition (Vector3 position) |
turns a world position into a map point | |
Vector3 | GetWorldPosition (Vector2Int point) |
turns a map point into the world position in its lower corner | |
Vector3 | GetCenterFromPosition (Vector3 position) |
calculates the cells center from its corner position to get the cell center from any position in it use Extensions.GetWorldCenterPosition(IGridPositions, Vector3) | |
Vector3 | GetPositionFromCenter (Vector3 center) |
calculates the cells corner position from its center | |
Vector3 CityBuilderCore.IGridPositions.GetCenterFromPosition | ( | Vector3 | position | ) |
calculates the cells center from its corner position
to get the cell center from any position in it use Extensions.GetWorldCenterPosition(IGridPositions, Vector3)
position | absolute world space position of the cell cornder |
Implemented in CityBuilderCore.IsometricMap, CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.
Vector2Int CityBuilderCore.IGridPositions.GetGridPosition | ( | Vector3 | position | ) |
turns a world position into a map point
position | absolute world space position(transform.position) |
Implemented in CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.
Vector3 CityBuilderCore.IGridPositions.GetPositionFromCenter | ( | Vector3 | center | ) |
calculates the cells corner position from its center
center | absolute world space position of the cell center |
Implemented in CityBuilderCore.IsometricMap, CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.
Vector3 CityBuilderCore.IGridPositions.GetWorldPosition | ( | Vector2Int | point | ) |
turns a map point into the world position in its lower corner
point | map/cell point |
Implemented in CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.