@needle-tools/engine
Version:
Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.
38 lines (35 loc) • 1.1 kB
text/typescript
import { PerspectiveCamera } from "three";
// Wrap camera FOV to allow animation of fov
Object.defineProperty(PerspectiveCamera.prototype, "fov", {
get: function () {
return this._fov;;
},
set: function (val) {
const changed = val !== this._fov;
this._fov = val;
if (changed && this.view !== undefined) this.updateProjectionMatrix();
},
configurable: true
});
Object.defineProperty(PerspectiveCamera.prototype, "near", {
get: function () {
return this._near;
},
set: function (val) {
const changed = val !== this._near;
this._near = val;
if (changed && this.view !== undefined) this.updateProjectionMatrix();
},
configurable: true
});
Object.defineProperty(PerspectiveCamera.prototype, "far", {
get: function () {
return this._far;
},
set: function (val) {
const changed = val !== this._far;
this._far = val;
if (changed && this.view !== undefined) this.updateProjectionMatrix();
},
configurable: true
});