threepipe
Version:
A modern 3D viewer framework built on top of three.js, written in TypeScript, designed to make creating high-quality, modular, and extensible 3D experiences on the web simple and enjoyable.
164 lines • 5.3 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
import { uiInput, uiPanelContainer, uiToggle, uiVector } from 'uiconfig.js';
import { serialize } from 'ts-browser-helpers';
import { Vector3 } from 'three';
let OrbitControls3 = class OrbitControls3 extends OrbitControls {
constructor() {
super(...arguments);
this.type = 'OrbitControls';
this.enabled = true;
this.dollyZoom = false;
this.zoomToCursor = false;
this.enableDamping = true;
this.dampingFactor = 0.08;
this.autoRotate = false;
this.autoRotateSpeed = 2.0;
this.enableZoom = true;
this.zoomSpeed = 0.15;
this.maxZoomSpeed = 0.20;
this.enableRotate = true;
this.rotateSpeed = 2.0;
this.enablePan = true;
this.panSpeed = 1.0;
this.autoPushTarget = false;
this.autoPullTarget = false;
this.minDistance = 0.35;
this.maxDistance = 1e6; // should be Infinity but this breaks the UI
this.minZoom = 0.01;
this.maxZoom = 1e6; // should be Infinity but this breaks the UI
this.minPolarAngle = 0;
this.maxPolarAngle = Math.PI;
this.minAzimuthAngle = -1e6; // should be -Infinity but this breaks the UI
this.maxAzimuthAngle = 1e6; // should be Infinity but this breaks the UI
this.clampMin = new Vector3(-1e6, -1e6, -1e6); // should be -Infinity but this breaks the UI
this.clampMax = new Vector3(1e6, 1e6, 1e6); // should be Infinity but this breaks the UI
// @uiToggle()
this.screenSpacePanning = true;
// @uiInput()
this.keyPanSpeed = 7.0;
this.throttleUpdate = 60; // throttle to 60 updates per second (implemented in OrbitControls.js.update() method)
}
};
__decorate([
serialize()
], OrbitControls3.prototype, "type", void 0);
__decorate([
uiToggle()
], OrbitControls3.prototype, "enabled", void 0);
__decorate([
uiToggle(),
serialize()
], OrbitControls3.prototype, "dollyZoom", void 0);
__decorate([
uiToggle(),
serialize()
], OrbitControls3.prototype, "zoomToCursor", void 0);
__decorate([
uiToggle(),
serialize()
], OrbitControls3.prototype, "enableDamping", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "dampingFactor", void 0);
__decorate([
uiToggle(),
serialize()
], OrbitControls3.prototype, "autoRotate", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "autoRotateSpeed", void 0);
__decorate([
uiToggle(),
serialize()
], OrbitControls3.prototype, "enableZoom", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "zoomSpeed", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "maxZoomSpeed", void 0);
__decorate([
uiToggle(),
serialize()
], OrbitControls3.prototype, "enableRotate", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "rotateSpeed", void 0);
__decorate([
uiToggle(),
serialize()
], OrbitControls3.prototype, "enablePan", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "panSpeed", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "autoPushTarget", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "autoPullTarget", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "minDistance", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "maxDistance", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "minZoom", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "maxZoom", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "minPolarAngle", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "maxPolarAngle", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "minAzimuthAngle", void 0);
__decorate([
uiInput(),
serialize()
], OrbitControls3.prototype, "maxAzimuthAngle", void 0);
__decorate([
uiVector(),
serialize()
], OrbitControls3.prototype, "clampMin", void 0);
__decorate([
uiVector(),
serialize()
], OrbitControls3.prototype, "clampMax", void 0);
__decorate([
serialize()
], OrbitControls3.prototype, "screenSpacePanning", void 0);
__decorate([
serialize()
], OrbitControls3.prototype, "keyPanSpeed", void 0);
OrbitControls3 = __decorate([
uiPanelContainer('Orbit Controls')
], OrbitControls3);
export { OrbitControls3 };
//# sourceMappingURL=OrbitControls3.js.map