AbstractThe constructor is passed to Application. Also registers the global keyboard listener for showcases.
ReadonlyaudioThe main camera.
The canvas element.
The engine configuration.
Whether debug visualization is enabled.
ProtecteddefaultThe default camera controller attached if none is manually registered in setupScene(). 'fly' (default): 6-DOF spectator FlyCam (WASD + QE/Space/C + mouse look + Shift boost + Alt slow). 'orbit': Turntable OrbitController around target. 'none': No camera controller automatically attached.
ProtecteddefaultWhether collisions with scene geometry are enabled for the default FlyController. Defaults to false (noclip).
ProtecteddefaultBase flight speed when using the default FlyController. Defaults to 7.0 units/sec.
The global event bus for this engine instance.
ReadonlyinputThe interaction manager for gamification / picking.
The built-in physics system. Stepped automatically each frame when config.enablePhysics is true.
The active renderer.
The current scene.
Per-instance bundle of DeviceCaps/ShaderRegistry/AssetManager -- see RendererContext.
Destroys the showcase instance, freeing resources and removing showcase-specific DOM/listeners.
ProtectedonA hook method that is called when the canvas element is recreated. By default, it binds the click event to request PointerLock. Inheriting classes can override this if needed.
ProtectedonCentral keyboard control for all showcasess. Inheriting classes can override this method and call super.onKeyDown(event).
Resets the camera to its initial/reference position and orientation. Can be invoked manually or triggered via the 'R' key.
Protected AbstractsetupCalled to setup the scene after the engine is initialized.
Initializes and starts the application loop.
Stops the application loop.
Briefly slows down gameplay (app update, physics, scene behaviors) to sell the impact of a
hit, while the camera and its effects (e.g. shake) keep running in real time. Rendering and
input are unaffected. Global, not per-entity -- see docs/adr/0003-hit-stop-is-global-not-per-entity.md.
Real-time seconds the slowdown lasts.
Multiplier applied to deltaTime for gameplay systems while active. Default 0.05 (near-freeze).
ProtectedupdateDefault update method for examples. Subclasses can override this to implement custom logic.
Time elapsed since the last frame.
ProtectedwaitHelper to wait for all currently loading assets to finish. Useful to call at the end of setupScene.
Base class for applications built with the SmallWorld engine.