js/Mobilizing/renderer/3D/three/scene/Scene.js
x
1
import * as THREE from "three";
2
import Transform from "./Transform";
3
4
/**
5
* Simple wrapper around Three Scene. Should never be used by user. Internal usage only!
6
*/
7
export default class Scene {
8
9
constructor({
10
name = undefined
11
} = {}) {
12
13
this.name = name;
14
this._scene = new THREE.Scene();
15
this.transform = new Transform(this);
16
}
17
18
/**
19
* @returns the Three.js native object used in this class
20
*/
21
getNativeObject() {
22
return this._scene;
23
}
24
25
setVisible(val){
26
this._scene.visible = val;
27
}
28
29
getVisible(){
30
return this._scene.visible;
31
}
32
33
setAutoUpdate(val){
34
this._scene.autoUpdate = val;
35
}
36
37
getAutoUpdate(){
38
return this._scene.autoUpdate;
39
}
40
41
setBackground(object){
42
this._scene.background = object;
43
}
44
45
getBackground(){
46
return this._scene.background;
47
}
48
49
setOverrideMaterial(material){
50
this._scene.overrideMaterial = material;
51
}
52
}
53