Vector4

class Vector4

Represents a Vector4.

Constructors

Link copied to clipboard
constructor(x: Float, y: Float, z: Float, w: Float)

Constructs a new Vector4 instance with the specified x, y, z, and w positions.

constructor(value: Float)
constructor(other: Vector3, w: Float)
constructor(other: Vector4)

Types

Link copied to clipboard
object Companion

The companion object of Vector4.

Properties

Link copied to clipboard
val w: Float

The w position of the Vector4 instance.

Link copied to clipboard
val x: Float

The x position of the Vector4 instance.

Link copied to clipboard
val y: Float

The y position of the Vector4 instance.

Link copied to clipboard
val z: Float

The z position of the Vector4 instance.

Functions

Link copied to clipboard
operator fun dec(): Vector4

Overloads the unary decrement operator (--).

Link copied to clipboard
operator fun div(other: Vector4): Vector4

Divides this Vector4 instance by another Vector4 instance.

operator fun div(scalar: Float): Vector4

Divides this Vector4 instance by a scalar.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
operator fun inc(): Vector4

Overloads the unary increment operator (++).

Link copied to clipboard
fun isFinite(): Boolean

Checks if the value of the Vector4 instance is finite.

Link copied to clipboard
fun length(): Float

Gets the length of the Vector4 instance.

Link copied to clipboard
operator fun minus(other: Vector4): Vector4

Subtracts another Vector4 instance from this Vector4 instance.

Link copied to clipboard

Normalizes the Vector4 instance.

Link copied to clipboard
operator fun plus(other: Vector4): Vector4

Adds another Vector4 instance to this Vector4 instanc.

Link copied to clipboard
operator fun times(other: Vector4): Vector4

Multiplies this Vector4 instance by another Vector4 instance.

operator fun times(scalar: Float): Vector4

Multiplies this Vector4 instance by a scalar.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Converts this 4D vector to a 3D vector by discarding the w-component.

Link copied to clipboard
operator fun unaryMinus(): Vector4

Overloads the unary minus operator (-).