![]() |
Nano Brain for Unity v0.1
|
A direction in 3D space.
A direction is represented using two angles:
Public Member Functions | |
| Direction (AngleFloat horizontal, AngleFloat vertical) | |
| Create a new direction. | |
| override readonly string | ToString () |
| readonly UnityEngine.Vector3 | ToVector3 () |
| Convert the direction into a carthesian vector. | |
| readonly Vector3Float | ToVector3 () |
| Convert the direction into a carthesian vector. | |
| override readonly bool | Equals (object obj) |
| override readonly int | GetHashCode () |
Static Public Member Functions | |
| static Direction | Degrees (float horizontal, float vertical) |
| Create a direction using angle values in degrees. | |
| static Direction | Radians (float horizontal, float vertical) |
| Create a direction using angle values in radians. | |
| static Direction | FromVector3 (UnityEngine.Vector3 v) |
| Convert a carthesian vector into a direction. | |
| static Direction | FromVector3 (Vector3Float v) |
| Convert a carthesian vector into a direction. | |
| static Direction | operator- (Direction d) |
| static bool | operator== (Direction d1, Direction d2) |
| Tests the equality of two directions. | |
| static bool | operator!= (Direction d1, Direction d2) |
| Tests the inequality of two directions. | |
| static AngleFloat | UnsignedAngle (Direction d1, Direction d2) |
Public Attributes | |
| AngleFloat | horizontal |
| horizontal angle, range = (-180..180] degrees | |
| AngleFloat | vertical |
| vertical angle, range in degrees = (-90..90] degrees | |
Static Public Attributes | |
| static readonly Direction | forward = Degrees(0, 0) |
| A forward direction with zero for both angles. | |
| static readonly Direction | backward = Degrees(-180, 0) |
| A backward direction with horizontal angle -180 and zero vertical angle. | |
| static readonly Direction | up = Degrees(0, 90) |
| A upward direction with zero horizontal angle and vertical angle 90. | |
| static readonly Direction | down = Degrees(0, -90) |
| A downward direction with zero horizontal angle and vertical angle -90. | |
| static readonly Direction | left = Degrees(-90, 0) |
| A left-pointing direction with horizontal angle -90 and zero vertical angle. | |
| static readonly Direction | right = Degrees(90, 0) |
| A right-pointing direction with horizontal angle 90 and zero vertical angle. | |
| LinearAlgebra.Direction.Direction | ( | AngleFloat | horizontal, |
| AngleFloat | vertical | ||
| ) |
Create a new direction.
| horizontal | The horizontal angle |
| vertical | The vertical angle |
The direction will be normalized automatically to ensure the angles are within the allowed ranges
|
static |
Create a direction using angle values in degrees.
| horizontal | The horizontal angle in degrees |
| vertical | The vertical angle in degrees |
The direction will be normalized automatically to ensure the angles are within the allowed ranges
|
static |
Create a direction using angle values in radians.
| horizontal | The horizontal angle in radians |
| vertical | The vertical angle in radians |
| readonly UnityEngine.Vector3 LinearAlgebra.Direction.ToVector3 | ( | ) |
Convert the direction into a carthesian vector.
|
static |
Convert a carthesian vector into a direction.
| v | The carthesian vector |
Information about the length of the carthesian vector is not included in this transformation
| readonly Vector3Float LinearAlgebra.Direction.ToVector3 | ( | ) |
Convert the direction into a carthesian vector.
|
static |
Convert a carthesian vector into a direction.
| v | The carthesian vector |
Information about the length of the carthesian vector is not included in this transformation
Tests the equality of two directions.
| d1 | |
| d2 |
Tests the inequality of two directions.
| d1 | |
| d2 |