TruWorlds

Vector3

A three-dimensional vector representing a point or direction in 3D space.

Fields

X float

The X component of the vector.

Y float

The Y component of the vector.

Z float

The Z component of the vector.

Functions

Length() Returns float

Calculates the length (magnitude) of the vector.

Returns: The length of the vector.

Cross(other: Vector3) Returns Vector3

Calculates the cross product of this vector and another vector.

other
The other vector to compute the cross product with.

Returns: The cross product vector.

Dot(other: Vector3) Returns float

Calculates the dot product of this vector and another vector.

other
The other vector to compute the dot product with.

Returns: The dot product as a float

Slide(normal: Vector3) Returns Vector3

Calculates a new vector resulting from sliding this vector along a plane with normal normal.

normal
The normal of the plane

Returns: The vector perpendicular to normal

Normalized() Returns Vector3

Returns a normalized (unit length) version of this vector, with length 1, or the zero vector if the original vector has length 0.

Returns: >The normalized vector.

Abs() Returns Vector3

Returns a vector with each component being the absolute value of the corresponding component in this vector.

Returns: The absolute value vector.

Min() Returns float

Returns the minimum component value of this vector.

Returns: The minimum component value.