Overview

In this section you'll find everything related to the VOLTS.Object3D class

import { Object3D } from 'volts';

// Creates a 3D Object located at 0,0,0.
// Because no body argument was provided,
// this will automatically instance a 3D Plane on the scene
const Obj = new Object3D()

// Use null as the body argument
// to prevent a dynamic instance from being created
const noBodyInstanceObj = new Object3D(null)

// Chain functions! 👇
// Create a dynamic instance
new Object3D()
    .setScl(0.1)  // set the scale
    .setPos(0,0,0) // set the position
    .setRot(1,0,0,0) // set the rotation

Object3D.setPos

Sets the position of the Object3D. Takes in a VectorArgsRest

Object3D.setScl

Sets the scale of the Object3D. Takes in a VectorArgsRest

Object3D.setRot

Sets the rotation of the Object3D. Takes in a QuaternionArgsRest

Last updated

Was this helpful?