Skip to content

Vector3D

Oğuz Eroğlu edited this page Jun 14, 2020 · 2 revisions

Definition

Vector3D class represents a 3D vector in Kompute space.

Constructing

// Creates a new vector at (x: 10, y: 20, z: 30)
var vector = new Kompute.Vector3D(10, 20, 30);

// Creates a new vector at (x: 0, y: 0, z: 0)
var vector2 = new Kompute.Vector3D();

Setting a vector

For performance reasons, it's best to create a vector once, then set its value when necessary. See: VectorPool

var vector = new Kompute.Vector3D();

// Sets the vector to (x: 10, y: 20, z: 30)
vector.set(10, 20, 30);

Clone this wiki locally