.new App(modulesopt)
This component is used to prepare a world scene, setup physics, camera, renderer and all other things that you usually do before making meshes.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
modules |
Array
|
<optional> |
[]
|
Array of Modules |
Extends ModuleSystem
Members
.simulate :Boolean
Same as .updateEnabled, but for physics. Defines if physics is simulated each frame.
- Source:
Methods
(static) .addLoop(loop) → {Promise}
Adds loop to this app.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
loop |
Object
|
the loop to add |
Example
Adding a loop to an app
const loop = new Loop(() => {
// ...
});
const app = new App();
app.addLoop(loop);
loop.start();
(static) .removeLoop(loop) → {Promise}
Removes loop from this app.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
loop |
Object
|
the loop to remove |
(static) .start()
Start rendering loop and physics simulation (if you use version with physics).
- Source: