Vector3

data class Vector3(x: Double, y: Double, z: Double) : LinearType<Vector3>

Double-precision 3D vector.

Constructors

Vector3
Link copied to clipboard
fun Vector3(x: Double)
Vector3
Link copied to clipboard
fun Vector3(x: Double, y: Double, z: Double)

Types

Companion
Link copied to clipboard
object Companion

Functions

cross
Link copied to clipboard
infix fun cross(v: Vector3): Vector3

Calculates a cross product between this Vector2 and v.

distanceTo
Link copied to clipboard
fun distanceTo(other: Vector3): Double

Calculates the Euclidean distance to other.

div
Link copied to clipboard
open operator override fun div(scale: Double): Vector3
operator fun div(v: Vector3): Vector3
dot
Link copied to clipboard
infix fun dot(v: Vector3): Double

Calculates a dot product between this Vector2 and v.

get
Link copied to clipboard
operator fun get(i: Int): Double
minus
Link copied to clipboard
operator fun minus(d: Double): Vector3
open operator override fun minus(right: Vector3): Vector3
mix
Link copied to clipboard
fun mix(o: Vector3, mix: Double): Vector3
plus
Link copied to clipboard
operator fun plus(d: Double): Vector3
open operator override fun plus(right: Vector3): Vector3
projectedOn
Link copied to clipboard
infix fun projectedOn(v: Vector3): Vector3
reflect
Link copied to clipboard
infix fun reflect(surfaceNormal: Vector3): Vector3
squaredDistanceTo
Link copied to clipboard
fun squaredDistanceTo(other: Vector3): Double

Calculates the squared Euclidean distance to other.

times
Link copied to clipboard
open operator override fun times(scale: Double): Vector3
operator fun times(v: Vector3): Vector3
toDoubleArray
Link copied to clipboard
fun toDoubleArray(): DoubleArray

Casts to DoubleArray.

toInt
Link copied to clipboard
fun toInt(): IntVector3

Casts to IntVector3.

unaryMinus
Link copied to clipboard
operator fun unaryMinus(): Vector3

Properties

length
Link copied to clipboard
val length: Double

The Euclidean length of the vector.

normalized
Link copied to clipboard
val normalized: Vector3

Returns a normalized version of the vector. (i.e. unit vector)

spherical
Link copied to clipboard
val spherical: Spherical
squaredLength
Link copied to clipboard
val squaredLength: Double

The squared Euclidean length of the vector.

x
Link copied to clipboard
val x: Double
xy
Link copied to clipboard
val xy: Vector2
xyz0
Link copied to clipboard
val xyz0: Vector4
xyz1
Link copied to clipboard
val xyz1: Vector4
xz
Link copied to clipboard
val xz: Vector2
y
Link copied to clipboard
val y: Double
yx
Link copied to clipboard
val yx: Vector2
z
Link copied to clipboard
val z: Double
zx
Link copied to clipboard
val zx: Vector2

Extensions

clamp
Link copied to clipboard
fun Vector3.clamp(min: Vector3, max: Vector3): Vector3

Returns Vector3 whose value is limited between min and max per vector component.

map
Link copied to clipboard
fun Vector3.map(beforeLeft: Vector3, beforeRight: Vector3, afterLeft: Vector3, afterRight: Vector3, clamp: Boolean = false): Vector3
mod
Link copied to clipboard
fun Vector3.mod(b: Vector3): Vector3
saturate
Link copied to clipboard
fun Vector3.saturate(): Vector3
smoothstep
Link copied to clipboard
fun Vector3.smoothstep(edge0: Vector3, edge1: Vector3): Vector3