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