Appearance
World â
world is a global singleton.
Objects â
js
// Use these at runtime to add/remove objects
// World will now call object.update() if it has an update function,
// and will add it to .raycastables if it has interaction events
world.add(object: THREE.Object3D, addToScene: boolean = true)
// Fully remove an interactable object
world.remove(object)
object.removeFromParent()
// list of objects that .update() each frame
world.objects -> Array of Objects
// list of objects which are raycasted each frame
world.raycastables -> Array of Objects
// make an object grabbable at runtime
world.addGrabbable(object)Avatars â
js
world.avatars -> Dict of Objects
world.avatar -> Your avataraddScene â
You can load scenes within scenes, this returns a new group holding the scene/world
js
let subScene = world.addScene("worldID");
let subScene = world.addScene("worldName");Other â
js
// Exclude object from all raycasting
world.setRaycastable(Object3D, boolean)
// or use object.raycastable = false before adding to the scene
world.username -> 'yourUserName' | null
world.scene -> THREE.Scene
world.renderer -> THREE.WebGLRenderer (WebGPU coming when XR is supported)
world.physics -> Physics global, see physics docs
world.storage -> Storage global, see storage docs
world.camera - > THREE.PerspectiveCamera, the player camera
world.animationMixer -> THREE.AnimationMixer, the main animation mixer
world.XR -> Boolean, whether we are in XR or not
world.startXR()
world.stopXR()
world.stats ->
{
triangles: number,
FPS: number,
// if enabled this will log the GPU frame time in ms.
// This uses the EXT_disjoint_timer_query_webgl2 extension
// which is not available on all GPUs
dev: Boolean
}