Loading...
Searching...
No Matches
CityBuilderCore.IGridRotations Interface Reference

Detailed Description

rotates transforms, 3d implementations might rotate 360° while isometric games may only mirror

Inheritance diagram for CityBuilderCore.IGridRotations:
CityBuilderCore.MapBase CityBuilderCore.Tests.DebugMap CityBuilderCore.DefaultMap CityBuilderCore.HexagonMap CityBuilderCore.IsometricMap CityBuilderCore.TerrainMap

Public Member Functions

void SetRotation (Transform transform, Vector3 direction)
 adjusts a transform in order to visually reflect the direction it is facing
 
void SetRotation (Transform transform, float rotation)
 adjusts a transform by a rotation in degrees
 
float GetRotation (Vector3 direction)
 calculates a numeric rotation in degrees from a direction
 
Vector3 GetDirection (float angle)
 calculates a direction from a numeric roation
 

Member Function Documentation

◆ GetDirection()

Vector3 CityBuilderCore.IGridRotations.GetDirection ( float angle)

calculates a direction from a numeric roation

Parameters
anglerotation indegrees
Returns
direction the angle is facing

Implemented in CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.

◆ GetRotation()

float CityBuilderCore.IGridRotations.GetRotation ( Vector3 direction)

calculates a numeric rotation in degrees from a direction

Parameters
directiondirection the object is facing
Returns
rotation in degrees

Implemented in CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.

◆ SetRotation() [1/2]

void CityBuilderCore.IGridRotations.SetRotation ( Transform transform,
float rotation )

adjusts a transform by a rotation in degrees

Parameters
transformthe transform that will be chaned
rotationthe rotation in degrees

Implemented in CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.

◆ SetRotation() [2/2]

void CityBuilderCore.IGridRotations.SetRotation ( Transform transform,
Vector3 direction )

adjusts a transform in order to visually reflect the direction it is facing

Parameters
transformthe transform that will be changed
directionthe direction the entity moves or looks at

Implemented in CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.