LavaUI docs GitHub

struct Vector3

Swift

struct Vector3

A point, direction or per-axis scale in a Scene3D's world.

+x is right, +y up and +z toward the default camera, which sits on the +z axis looking at the origin. Writable as an array literal: [0, 1, 0].

Sources/LavaUI/Spatial.swift:7

Constructors

init(_ x: Float = 0, _ y: Float = 0, _ z: Float = 0)

Creates a vector; missing components are zero.

Sources/LavaUI/Spatial.swift:18

init(arrayLiteral elements: Float...)

Creates a vector from up to three literals, [x, y, z]; missing ones are zero.

Sources/LavaUI/Spatial.swift:23

Properties

var x: Float

The x component.

Sources/LavaUI/Spatial.swift:11

var y: Float

The y component.

Sources/LavaUI/Spatial.swift:13

var z: Float

The z component.

Sources/LavaUI/Spatial.swift:15

Methods

static func interpolate(_ from: Vector3, _ to: Vector3, _ t: Float) -> Vector3

Interpolates each component linearly.

Sources/LavaUI/Spatial.swift:32