Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createScene = () => {
const scene = new THREE.Scene();
// this.scene.background = color;
scene.fog = new THREE.Fog(new THREE.Color(`hsl(20, 100%, 0%)`), 100, 950);
scene.add(this);
return scene;
};
this.materialType = opts.materialType || THREE.MeshLambertMaterial;
this.materialParams = opts.materialParams || {};
this.items = [];
this.voxels = voxel(this);
this.scene = new THREE.Scene();
this.view = opts.view;
this.view.bindToScene(this.scene);
this.camera = opts.getCamera();
// let helper = new THREE.CameraHelper(this.camera);
// this.scene.add(helper);
if (!opts.lightsDisabled) this.addLights(this.scene);
this.fogScale = opts.fogScale || 32;
if (!opts.fogDisabled)
this.scene.fog = new THREE.Fog(
this.skyColor,
0.00025,
this.worldWidth() * this.fogScale,
);
this.collideVoxels = collisions(
this.getBlock.bind(this),
1,
[Infinity, Infinity, Infinity],
[-Infinity, -Infinity, -Infinity],
);
this.timer = this.initializeTimer(opts.tickFPS || 16);
this.paused = false;
this.spatial = new SpatialEventEmitter();
setupScene() {
super.setupScene();
this.scene.fog = new THREE.Fog(0xcccccc, 1, 1000);
}
setupScene() {
super.setupScene();
this.scene.fog = new THREE.Fog(0xcccccc, 1, 1000);
}
setupScene() {
super.setupScene();
this.scene.fog = new THREE.Fog(0xcccccc, 1, 1000);
}
setupScene() {
super.setupScene();
this.scene.fog = new THREE.Fog(0xcccccc, 1, 1000);
}
setupScene() {
super.setupScene();
this.scene.fog = new THREE.Fog(0xcccccc, 1, 1000);
}
setupScene() {
super.setupScene();
this.scene.fog = new THREE.Fog(0xcccccc, 1, 1000);
}
constructor(camera, scene, renderer, onPlay, onUpdateScore) {
this.camera = camera;
this.scene = scene;
this.renderer = renderer;
this.onPlay = onPlay;
this.onUpdateScore = onUpdateScore;
this.camera.position.z = Settings.FLOOR_DEPTH / 2 - 300;
this.scene.fog = new THREE.Fog(
Colors.fog,
Settings.FLOOR_DEPTH / 2,
Settings.FLOOR_DEPTH + 50,
);
this.renderer.setClearColor(Colors.backgroundColor, 1);
}