Class: Engine

Engine(canvas, optionsopt)

High-level convenience wrapper, that bundles the most common building blocks.

Constructor

new Engine(canvas, optionsopt)

Parameters:
Name Type Attributes Description
canvas HTMLCanvasElement Canvas used for rendering.
options EngineOptions <optional>
Engine options.
Source:

Classes

Engine

Members

camera

Source:

context

Source:

renderer

Source:

scene

Source:

webglRenderingContext

Source:

Methods

createBoxMesh(optionsopt) → {Mesh}

Creates a box mesh using: `BoxGeometry` + `VertexColorMaterial` by default. Ownership rules: geometry is created internally => mesh owns geometry. Material: if not provided then Mesh owns created `VertexColorMaterial`, if provided then Mesh does NOT own the material (shared user resource).
Parameters:
Name Type Attributes Description
options CreateBoxMeshOptions <optional>
Box mesh options.
Source:
Returns:
Type
Mesh

render()

Renders a single frame.
Source:

setCamera(camera)

Sets the active camera used by the engine renderer.
Parameters:
Name Type Description
camera Camera New active camera instance.
Source:

start(frameCallbackopt)

Starts the `requestAnimationFrame` loop.
Parameters:
Name Type Attributes Description
frameCallback EngineFrameCallback <optional>
Optional per-frame callback.
Source:

stop()

Stops the `requestAnimationFrame` loop.
Source: