Constructor
new ThreeJSPlugin(THREE, cameraFOVopt)
Set up the three.js rendering layer, call in gameInit
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
THREE | Object | The three.js module, supplied by the user | ||
cameraFOV | number | <optional> | 60 | Vertical field of view in degrees |
- Source
Example
// in gameInit, with three.js loaded by the user
new ThreeJSPlugin(THREE);
threeJS.scene.add(new THREE.AmbientLight);Members
THREE
Properties| Type | Description |
|---|---|
| Object | The three.js module passed into the constructor |
- Source
camera
Properties| Type | Description |
|---|---|
| Object | The three.js perspective camera |
- Source
cameraAlign2D
Properties| Type | Description |
|---|---|
| boolean | Lock the camera to the LittleJS 2D camera so the z=0 plane matches world space |
- Source
renderer
Properties| Type | Description |
|---|---|
| Object | The three.js renderer |
- Source
scene
Properties| Type | Description |
|---|---|
| Object | The three.js scene, add lights and meshes here |
- Source
Methods
alignCamera2D()
Position the camera so the z=0 plane exactly matches LittleJS world space, called automatically when cameraAlign2D is set
- Source
render()
Sync the canvas layout and render the scene, called automatically each frame
- Source