XVoxel-ASync/modules/render.js

38 lines
909 B
JavaScript
Raw Normal View History

class Renderer extends global.three.WebGLRenderer {
constructor (options = {}) {
super(options);
// if (options.autoResize) this.autoResize = options.autoResize;
// if (options.noAutoResize) this.autoResize = false;
//
// if (this.domElement && this.domElement.parentElement) {
// this.domElement.parentElement.addEventListener("resize", function (event) {
// if (this.autoResize) this.setSize(this.domElement.clientWidth, this.domElement.clientHeight);
// });
// }
}
}
class PerspectiveCamera extends global.three.PerspectiveCamera {
constructor (...options) {
super(...options);
}
get fieldOfView () {
return this.fov;
}
set fieldOfView (value) {
this.fov = value;
this.updateProjectionMatrix();
}
}
module.exports = {
"Renderer": Renderer,
"PerspectiveCamera": PerspectiveCamera
};
global.core.on("pre-init", function () {
global.core.emit("render-init");
});