|
|
@ -3,12 +3,11 @@ |
|
|
|
import { createCamera } from "./components/camera.js"; |
|
|
|
import { createLights } from "./components/lights.js"; |
|
|
|
import { createScene } from "./components/scene.js"; |
|
|
|
import { createRenderer } from "./systems/renderer.js"; |
|
|
|
import { createCube, createTerrain } from "./components/objects/terrain.js"; |
|
|
|
import { Loop } from "./systems/Loop.js"; |
|
|
|
import { Resizer } from "./systems/Resizer.js"; |
|
|
|
import { createControls } from "./systems/controls.js"; |
|
|
|
|
|
|
|
import createTerrain from "./components/objects/terrain.js"; |
|
|
|
import { createRenderer } from "./systems/renderer.js"; |
|
|
|
|
|
|
|
// These variables are module-scoped: we cannot access them
|
|
|
|
// from outside the module
|
|
|
@ -61,6 +60,10 @@ class World { |
|
|
|
|
|
|
|
scene.add(light, terrain); |
|
|
|
|
|
|
|
const cube = createCube(); |
|
|
|
loop.updatables.push(cube); |
|
|
|
scene.add(cube); |
|
|
|
|
|
|
|
// Responsive handler
|
|
|
|
const resizer = new Resizer(container, camera, renderer); |
|
|
|
resizer.onResize = () => { |
|
|
|