Vector3

class Vector3

Represents a vector3.

Constructors

Link copied to clipboard
constructor(x: Float = 0.0f, y: Float = 0.0f, z: Float = 0.0f)

Creates a new Vector3 instance with the specified x, y, z positions.

constructor(value: Float = 0.0f)

Initializes a Vector3 instance with a single float value.

constructor(other: Vector3)

Initializes a Vector3 instance from another Vector3 instance.

Types

Link copied to clipboard
object Companion

The companion object of Vector3.

Properties

Link copied to clipboard
val x: Float

The x position of the Vector3 instance.

Link copied to clipboard
val y: Float

The y position of the Vector3 instance.

Link copied to clipboard
val z: Float

The z position of the Vector3 instance.

Functions

Link copied to clipboard
operator fun dec(): Vector3

Overloads the decrement operator -- to decrement each component of the current Vector3 instance.

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

Divides this Vector3 instance by another Vector3 instance.

operator fun div(scalar: Float): Vector3

Divides this Vector3 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(): Vector3

Overloads the unary increment operator (++).

Link copied to clipboard
fun isFinite(): Boolean

Checks if the value of the Vector3 instance is finite.

Link copied to clipboard
fun length(): Float

Gets the length of the Vector3 instance.

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

Subtracts another Vector3 instance from this Vector3 instance.

Link copied to clipboard

Normalizes the Vector3 instance.

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

Adds another Vector3 instance to this Vector3 instance.

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

Multiplies this Vector3 instance by another Vector3 instance.

operator fun times(scalar: Float): Vector3

Multiplies this Vector3 instance by a scalar.

Link copied to clipboard
fun toColor4(alpha: Float): Color4

Converts this vector (interpreted as RGB color components) and a given alpha value into a Color4 object.

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

Converts this 3D vector into a 4D vector, treating it as a point in homogeneous coordinates.

Link copied to clipboard
operator fun unaryMinus(): Vector3

Overloads the unary minus operator (-).