Special Types
Learn what special types exist, including Vector, Quaternions, and more.
Vector3
const myVector: Vector3 = { x: 8, y: 1, z: 8 }// Create a vector object
let myVector = Vector3.create(3, 1, 5)
// Alternative syntax to create a vector object
let myOtherVector: Vector3 = { x: 8, y: 1, z: 8 }
// Edit one of its values
myVector.x = 5
// Call functions from the Vector3 namespace,
// All these functions require passing Vector3 objects in their parameters
let normalizedVector = Vector3.normalize(myVector)
let distance = Vector3.distance(myVector, myOtherVector)
let midPoint = Vector3.lerp(myVector, myOtherVector, 0.5)Shortcuts for writing direction vectors
Quaternions
Scalars
Last updated