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

Constructor

new ThreeJSObject(posopt, sizeopt, meshopt, zopt)

Create an engine object that drives a three.js mesh

Parameters:
NameTypeAttributesDefaultDescription
posVector2<optional>

World space position

sizeVector2<optional>

World space size

meshObject<optional>

The three.js object3d to drive

znumber<optional>
0

Mesh height above the 2D plane

Extends

  • EngineObject

Members

mesh

Properties
TypeDescription
Object

The three.js object3d this object drives

z

Properties
TypeDescription
number

Mesh height above the 2D plane

Methods

destroy(immediateopt)

Destroy this object and remove its mesh from the scene

Parameters:
NameTypeAttributesDescription
immediateboolean<optional>

render()

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

syncMesh()

Copy this object's transform to the mesh

update()

Update the object and sync the mesh to its transform