![]() |
BomberUnits
...a Unity learning project
|
Unity coordinate System: posZ = 0, posX = 90 -> clockwise, beginning with forward. More...
Collaboration diagram for WorldDirExtensions:Static Public Member Functions | |
| static Vector3 | ToUnitVector (this WorldDir dir) |
| static WorldDir | TrySnapFromAngle (float worldAngle, float snapTolerance=45f) |
| Takes an angle in the x-z-plane (0 to 360 deg) and tries to snap it to a WorldDir. More... | |
Static Public Attributes | |
| static readonly WorldDir [] | all4Dirs = { WorldDir.posZ, WorldDir.posX, WorldDir.negZ, WorldDir.negX } |
Unity coordinate System: posZ = 0, posX = 90 -> clockwise, beginning with forward.
Definition at line 13 of file WorldDir.cs.
|
inlinestatic |
Takes an angle in the x-z-plane (0 to 360 deg) and tries to snap it to a WorldDir.
The tolerance in degrees (0 to 45) lets the snap fail if the world angle is farther away from any worldDir than the given tolerance. Fails are signaled via the INVALID value of the WorldDir enum!
Definition at line 27 of file WorldDir.cs.