MCPcopy Create free account
hub / github.com/SuboptimalEng/three-js-tutorials / constructor

Method constructor

02-setup-guide/src/lib/SceneInit.js:6–26  ·  view source on GitHub ↗
(canvasId)

Source from the content-addressed store, hash-verified

4
5export default class SceneInit {
6 constructor(canvasId) {
7 // NOTE: Core components to initialize Three.js app.
8 this.scene = undefined;
9 this.camera = undefined;
10 this.renderer = undefined;
11
12 // NOTE: Camera params;
13 this.fov = 45;
14 this.nearPlane = 1;
15 this.farPlane = 1000;
16 this.canvasId = canvasId;
17
18 // NOTE: Additional components.
19 this.clock = undefined;
20 this.stats = undefined;
21 this.controls = undefined;
22
23 // NOTE: Lighting is basically required.
24 this.ambientLight = undefined;
25 this.directionalLight = undefined;
26 }
27
28 initialize() {
29 this.scene = new THREE.Scene();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected