Spaces:
Running
Running
File size: 1,111 Bytes
2b7aae2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | import { Object3D } from '../core/Object3D.js';
class Scene extends Object3D {
constructor() {
super();
this.type = 'Scene';
this.background = null;
this.environment = null;
this.fog = null;
this.overrideMaterial = null;
this.autoUpdate = true; // checked by the renderer
if (typeof __THREE_DEVTOOLS__ !== 'undefined') {
__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe', { detail: this }));
}
}
copy(source, recursive) {
super.copy(source, recursive);
if (source.background !== null) this.background = source.background.clone();
if (source.environment !== null) this.environment = source.environment.clone();
if (source.fog !== null) this.fog = source.fog.clone();
if (source.overrideMaterial !== null) this.overrideMaterial = source.overrideMaterial.clone();
this.autoUpdate = source.autoUpdate;
this.matrixAutoUpdate = source.matrixAutoUpdate;
return this;
}
toJSON(meta) {
const data = super.toJSON(meta);
if (this.fog !== null) data.object.fog = this.fog.toJSON();
return data;
}
}
Scene.prototype.isScene = true;
export { Scene };
|