Tanoda
|
A struct very similar to Vector3, but that prevents itself from ever being converted to Vector3.zero. If the Direction3's components would ever be un-normalizable (normalize to Vector3.zero), it will instead return Vector3.forward. (Direction3 implicitly converts to a normalized Vector3.) More...
Public Member Functions | |
Direction3 (Vector3 v) | |
Direction3 (float x, float y, float z) | |
Vector3 | Vec () |
Explicitly converts this Direction3 to a Vector3. More... | |
Static Public Member Functions | |
static implicit | operator Vector3 (Direction3 dir) |
static implicit | operator Direction3 (Vector3 vec) |
static bool | PointsInSameDirection (Direction3 A, Direction3 B) |
Returns whether two Direction3s point in the same direction without normalizing either of the underlying vectors. More... | |
Properties | |
bool | isValid [get] |
Gets whether this Direction3 will normalize without issue (has nonzero magnitude), otherwise the conversion to Vector3 will sanitize to Vector3.forward. More... | |
A struct very similar to Vector3, but that prevents itself from ever being converted to Vector3.zero. If the Direction3's components would ever be un-normalizable (normalize to Vector3.zero), it will instead return Vector3.forward. (Direction3 implicitly converts to a normalized Vector3.)
Because of this sanitizing behavior, "default(Direction3)" is stored as all zero components, but is converted to Vector3.forward upon implicit conversion to Vector3.
Definition at line 24 of file Direction3.cs.
Leap.Unity.Geometry.Direction3.Direction3 | ( | Vector3 | v | ) |
Definition at line 35 of file Direction3.cs.
Leap.Unity.Geometry.Direction3.Direction3 | ( | float | x, |
float | y, | ||
float | z | ||
) |
Definition at line 39 of file Direction3.cs.
|
static |
Definition at line 63 of file Direction3.cs.
|
static |
Definition at line 55 of file Direction3.cs.
|
static |
Returns whether two Direction3s point in the same direction without normalizing either of the underlying vectors.
This method is intended to cheaply match bit-idential Direction3s; it's subject to precision error if the magnitudes of the underlying vectors are very different.
Definition at line 75 of file Direction3.cs.
Vector3 Leap.Unity.Geometry.Direction3.Vec | ( | ) |
Explicitly converts this Direction3 to a Vector3.
Definition at line 51 of file Direction3.cs.
|
get |
Gets whether this Direction3 will normalize without issue (has nonzero magnitude), otherwise the conversion to Vector3 will sanitize to Vector3.forward.
Definition at line 48 of file Direction3.cs.