UnitVec Type
An immutable 3D vector guaranteed to be always unitized. A 3D vector represents a direction or an offset in space, but not a location. A 4x4 transformation matrix applied to a vector will only rotate and scale the vector but not translate it. (2D unit-vectors are called 'UnitVc' ) Use UnitVec.create or UnitVec.createUnchecked to created instances. Note: Never use the struct default constructor UnitVec() as it will create an invalid zero length vector. Use UnitVec.create or UnitVec.createUnchecked instead.
Record fields
Record Field |
Description
|
Full Usage:
X
Field type: float
|
Gets the X part of this 3D unit-vector.
|
Full Usage:
Y
Field type: float
|
Gets the Y part of this 3D unit-vector.
|
Full Usage:
Z
Field type: float
|
Gets the Z part of this 3D unit-vector.
|
Instance members
Instance member |
Description
|
Full Usage:
this.AsString
Returns: string
|
Format 3D unit-vector into string with nice floating point number formatting of X, Y and Z But without full type name as in v.ToString()
|
Static members
Static member |
Description
|
Full Usage:
UnitVec.create (x, y, z)
Parameters:
float
y : float
z : float
Returns: UnitVec
Modifiers: inline |
|
|
|
Full Usage:
UnitVec.createUnchecked (x, y, z)
Parameters:
float
y : float
z : float
Returns: UnitVec
Modifiers: inline |
For use as a faster internal constructor. Requires correct input of unitized values.
|
|
The Cross Product. It is also known as the Determinant, Wedge Product or Outer Product. The resulting vector is perpendicular to both input vectors. The length of this resulting vector is the squared area of the parallelogram spanned by the input vectors. Its direction follows the right-hand rule. A x B = |A| * |B| * sin(angle)
|
|
|
Full Usage:
UnitVec.failedCreate (x, y, z)
Parameters:
float
y : float
z : float
Returns: 'a
|
|