LittleJS 1.28.0

ThreeJS

ThreeJSObject

ThreeJS Object - EngineObject that drives a three.js mesh

  • LittleJS physics moves the object and the mesh follows automatically
  • Destroying the object removes the mesh from the scene

Extends EngineObject

Constructor

new ThreeJSObject(pos, size, mesh, z)threejs.js:132

Create an engine object that drives a three.js mesh

pos Vector2 optional

World space position

size Vector2 optional

World space size

mesh Object optional

The three.js object3d to drive

z number optional, default 0

Mesh height above the 2D plane

Members

Methods

Inherited from EngineObject

Members

mesh : Objectthreejs.js:145

The three.js object3d this object drives

z : numberthreejs.js:147

Mesh height above the 2D plane

Methods

destroy(immediate)threejs.js:176

Destroy this object and remove its mesh from the scene

immediate boolean optional

The mesh is this object's visual, the default 2D rendering is skipped

syncMesh()threejs.js:164

Copy this object's transform to the mesh

updateTransforms(updateChildren)threejs.js:157

Update the transform and sync the mesh to it, after the parent has placed a child, and while paused too

updateChildren boolean optional, default true

Also update the children's transforms