ClassicCityBuilderKit 1.9.0
|
facade for an integer from 0 to 3 describing the 4 possible directions for a building
used for transforming points in and out of building rotation(keeps building origin the same while rotating size and visuals)
Public Member Functions | |
void | TurnClockwise () |
void | TurnCounterClockwise () |
Vector2Int | RotateOrigin (Vector2Int origin, Vector2Int size) |
calculates the rotated corner of a building from the placement origin so bottom left with rotation 2 returns top right corner can be used to get get the transform position from the origin | |
Vector2Int | UnrotateOrigin (Vector2Int point, Vector2Int size) |
inverse of RotateOrigin(Vector2Int, Vector2Int) calculates the bottom left origin from the transform corner | |
Vector2Int | RotateBuildingPoint (Vector2Int origin, Vector2Int point, Vector2Int size) |
rotates a point relative to the building(access points for example) used to transform points in the building(0|1, 1|1) into world points | |
Vector2Int | RotateSize (Vector2Int size) |
calculates the rotated size on the grid starting from the origin | |
Quaternion | GetRotation () |
returns the world rotation for the building visual | |
Quaternion | GetRotation (bool isXY) |
Static Public Member Functions | |
static BuildingRotation | Create () |
static BuildingRotation | Create (int state) |
static BuildingRotation | Create (Quaternion rotation) |
static BuildingRotation | Create (int state, bool isHex) |
Properties | |
int | State [get, protected set] |
|
abstract |
returns the world rotation for the building visual
|
abstract |
rotates a point relative to the building(access points for example)
used to transform points in the building(0|1, 1|1) into world points
origin | origin of the building in world space |
point | point inside the building space |
size | size of the building |
|
abstract |
calculates the rotated corner of a building from the placement origin
so bottom left with rotation 2 returns top right corner
can be used to get get the transform position from the origin
origin | origin point |
size | building size |
|
abstract |
calculates the rotated size on the grid starting from the origin
size |
|
abstract |
inverse of RotateOrigin(Vector2Int, Vector2Int) calculates the bottom left origin from the transform corner
point | |
size |