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.
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.
Destroys the engine instance, freeing memory and removing all global event 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.
ProtectedonCalled once after the GadgetInspector is created. Override in subclasses to register scene-specific inspector controls.
The newly created inspector instance.
ProtectedonCentral keyboard control for all showcasess. Inheriting classes can override this method and call super.onKeyDown(event).
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.