Skip to content

VectorPool

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

Definition

VectorPool allocates a defined amount of Vector3D objects to be used when necessary. As it's not adviced to allocate new objects inside hot functions.

Usage

// Allocates 20 Vector3D objects
var vectorPool = new Kompute.VectorPool(20);

// Get a Vector3D from the pool
var vector = vectorPool.get();

// Set its value
vector.set(10, 20, 30);