Salta ai contenuti
Seleziona lingua:Italiano
Questa pagina è disponibile solo in inglese.

MCL 1.3.5

class Vec4f(x: Float, y: Float, z: Float, w: Float) : Vecf

Represents a 4D vector of floating-point single precision coordinates.

Parameters

x

X component.

y

Y component.

z

Z component.

w

W component.

Constructors

constructor(x: Float, y: Float, z: Float, w: Float)

Types

Properties

Returns the magnitude (norm) of the vector.

Returns the squared magnitude of the vector.

Returns a normalized copy of the vector.

val size: Int

Returns the size of the vector.

val w: Float

W component.

val x: Float

X component.

val y: Float

Y component.

val z: Float

Z component.

Functions

infix fun dot(o: Vec4f): Float

Computes the dot product of two vectors.

operator fun get(i: Int): Float

Returns the value at the specified index.

operator fun minus(o: Vec4f): Vec4f

Subtracts one vector from another.

operator fun plus(o: Vec4f): Vec4f

Adds two vectors.

operator fun times(s: Float): Vec4f

Multiplies a vector by a scalar.

Converts this vector to a Vec4d object.

open override fun toString(): String

Returns a JSON-like string representation of the vector with components formatted to three decimal digits.

fun toVec3f(): Vec3f

Converts this vector to a Vec3f object.