Vec Type
An immutable 3D vector of any length. Made up from 3 floats: X, Y, and Z. 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. (3D unit-vectors of length 1.0 are called 'UnitVec' ) (2D vectors are called 'Vc' )
Record fields
Record Field |
Description
|
Full Usage:
X
Field type: float
|
Gets the X part of this 3D vector.
|
Full Usage:
Y
Field type: float
|
Gets the Y part of this 3D vector.
|
Full Usage:
Z
Field type: float
|
Gets the Z part of this 3D vector.
|
Constructors
Constructor |
Description
|
|
Create a new 3D vector with any length. Made up from 3 floats: X, Y, and Z.
|
Instance members
Instance member |
Description
|
Full Usage:
this.AsString
Returns: string
|
Format 3D vector into string with nice floating point number formatting of X, Y and Z. But without full type name or length as in v.ToString()
|
Full Usage:
this.Length
Returns: float
Modifiers: inline |
Returns the length of the 3D vector.
|
Full Usage:
this.LengthSq
Returns: float
Modifiers: inline |
Returns the squared length of the 3D vector. The square length is faster to calculate and often good enough for use cases such as sorting vectors by length.
|
Static members
Static member |
Description
|
|
|
Returns a zero length vector: Vec(0, 0, 0)
|
|
|
The Cross product, of two 3D vectors. 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)
|
|