Companion

object Companion

The companion object of Vector4.

Properties

Link copied to clipboard
@JvmField
val BACK: Vector4

The back Vector4 instance, and its real value is (0f, 0f, -1f, 0f).

Link copied to clipboard
@JvmField
val DOWN: Vector4

The down Vector4 instance, and its real value is (0f, -1f, 0f, 0f).

Link copied to clipboard
@JvmField
val FORWARD: Vector4

The forward Vector4 instance, and its real value is (0f, 0f, 1f, 0f).

Link copied to clipboard
@JvmField
val LEFT: Vector4

The left Vector4 instance, and its real value is (-1f, 0f, 0f, 0f).

Link copied to clipboard
@JvmField
val ONE: Vector4

The one Vector4 instance, and its real value is (1f, 1f, 1f, 1f).

Link copied to clipboard
@JvmField
val RIGHT: Vector4

The right Vector4 instance, and its real value is (1f, 0f, 0f, 0f).

Link copied to clipboard
@JvmField
val UP: Vector4

The up Vector4 instance, and its real value is (0f, 1f, 0f, 0f).

Link copied to clipboard
@JvmField
val ZERO: Vector4

The zero Vector4 instance, and its real value is (0f, 0f, 0f, 0f).

Functions

Link copied to clipboard
@JvmStatic
fun distance(a: Vector4, b: Vector4): Float

Calculates the Euclidean distance between two 4D vectors, a and b.

Link copied to clipboard
@JvmStatic
fun dot(a: Vector4, b: Vector4): Float

Calculates the dot product (scalar product) of two 4D vectors.

Link copied to clipboard
@JvmStatic
fun faceForward(n: Vector4, i: Vector4, nRef: Vector4): Vector4

Orients a 4D vector n to face in a direction consistent with an incident vector i, using a reference vector nRef to determine orientation.

Link copied to clipboard
@JvmStatic
fun lerp(a: Vector4, b: Vector4, t: Float): Vector4

Performs a linear interpolation between two 4D vectors a and b by an interpolant t.

Link copied to clipboard
@JvmStatic
fun lerpUnclamped(a: Vector4, b: Vector4, t: Float): Vector4

Performs an unclamped linear interpolation between two 4D vectors a and b by an interpolant/extrapolant t.

Link copied to clipboard
@JvmStatic
fun moveTowards(from: Vector4, target: Vector4, maxDistanceDeltaInput: Float): Vector4

Moves a 4D point from towards a target point by a maximum distance specified by maxDistanceDeltaInput.

Link copied to clipboard
@JvmStatic
fun project(a: Vector4, b: Vector4): Vector4

Calculates the vector projection of vector a onto vector b for 4D vectors.

Link copied to clipboard
@JvmStatic
fun reflect(i: Vector4, n: Vector4): Vector4

Calculates the reflection of an incident vector i across a surface defined by the normal vector n.