@xviewer.js/core 1.0.0-alpha.34 → 1.0.0-alpha.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +208 -116
- package/dist/main.js.map +1 -1
- package/dist/module.js +209 -117
- package/dist/module.js.map +1 -1
- package/package.json +1 -1
- package/types/cinestation/FreelookVirtualCamera.d.ts +28 -15
- package/types/cinestation/VirtualCamera.d.ts +7 -5
- package/types/tween/Tween.d.ts +1 -1
package/dist/module.js
CHANGED
|
@@ -3,7 +3,7 @@ import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader.js';
|
|
|
3
3
|
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
4
4
|
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
|
|
5
5
|
import { MeshoptDecoder } from 'three/examples/jsm/libs/meshopt_decoder.module.js';
|
|
6
|
-
import { EquirectangularReflectionMapping, FileLoader, TextureLoader, SRGBColorSpace, MathUtils, Vector3, Quaternion, Raycaster, Vector2, LinearInterpolant, Spherical,
|
|
6
|
+
import { EquirectangularReflectionMapping, FileLoader, TextureLoader, SRGBColorSpace, MathUtils, Vector3, Quaternion, Raycaster, Vector2, LinearInterpolant, Spherical, Mesh, BoxGeometry, SphereGeometry, PlaneGeometry, Plane as Plane$1, Matrix4, Vector4, PerspectiveCamera, WebGLRenderTarget, HalfFloatType, LinearMipMapLinearFilter, LinearFilter, ShaderMaterial, UniformsUtils, Color, Scene, OrthographicCamera, NoBlending, AdditiveBlending, FloatType, UnsignedByteType, BufferGeometry, Float32BufferAttribute, Object3D, ClampToEdgeWrapping, NearestFilter, LinearSRGBColorSpace, WebGLCubeRenderTarget, DataTexture, RGBAFormat, UVMapping, WebGLRenderer, PCFSoftShadowMap, LoadingManager, LinearToneMapping, PMREMGenerator, MeshBasicMaterial, CubeCamera, Box3Helper, Box3, ShaderLib, ShaderChunk } from 'three';
|
|
7
7
|
import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader.js';
|
|
8
8
|
|
|
9
9
|
class EventEmitter {
|
|
@@ -704,7 +704,6 @@ class Tween {
|
|
|
704
704
|
union(headTween, tailTween) {
|
|
705
705
|
this._headTween = headTween;
|
|
706
706
|
this._tailTween = tailTween.chain(this);
|
|
707
|
-
this._headStart = true;
|
|
708
707
|
return this;
|
|
709
708
|
}
|
|
710
709
|
repeat(times = 0) {
|
|
@@ -801,11 +800,13 @@ class Tween {
|
|
|
801
800
|
if (this._onFinishCallback) {
|
|
802
801
|
this._onFinishCallback(this._object);
|
|
803
802
|
}
|
|
804
|
-
if (this._headTween
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
803
|
+
if (this._headTween) {
|
|
804
|
+
if (this._headTweenStartFired === false) {
|
|
805
|
+
this._headTweenStartFired = true;
|
|
806
|
+
this._headTween.start(this._startTime + this._duration);
|
|
807
|
+
this._isPlaying = false;
|
|
808
|
+
return false;
|
|
809
|
+
}
|
|
809
810
|
}
|
|
810
811
|
}
|
|
811
812
|
const status = this._calculateCompletionStatus(elapsedTime, durationAndDelay);
|
|
@@ -828,7 +829,7 @@ class Tween {
|
|
|
828
829
|
this._onRepeatCallback(this._object);
|
|
829
830
|
}
|
|
830
831
|
if (this._headTween) {
|
|
831
|
-
this.
|
|
832
|
+
this._headTweenStartFired = false;
|
|
832
833
|
this._initialRepeat = this._repeat;
|
|
833
834
|
}
|
|
834
835
|
this._onEveryStartCallbackFired = false;
|
|
@@ -971,7 +972,7 @@ class Tween {
|
|
|
971
972
|
this._propertiesAreSetUp = false;
|
|
972
973
|
this._headTween = null;
|
|
973
974
|
this._tailTween = null;
|
|
974
|
-
this.
|
|
975
|
+
this._headTweenStartFired = false;
|
|
975
976
|
this._goToEnd = false;
|
|
976
977
|
}
|
|
977
978
|
}
|
|
@@ -1440,13 +1441,13 @@ class CinestationBrain extends Component {
|
|
|
1440
1441
|
}
|
|
1441
1442
|
_lerpToMainCamera(vcam, t) {
|
|
1442
1443
|
const from = this.node, to = vcam;
|
|
1443
|
-
const {
|
|
1444
|
-
const isLensChanged = from.fov != fov || from.near != near || from.far != far;
|
|
1444
|
+
const { lens, finalPosition, finalRotation } = to;
|
|
1445
|
+
const isLensChanged = from.fov != lens.fov || from.near != lens.near || from.far != lens.far;
|
|
1445
1446
|
from.position.lerp(finalPosition, t);
|
|
1446
1447
|
from.quaternion.slerp(finalRotation, t);
|
|
1447
|
-
from.fov = lerp$1(from.fov, fov, t);
|
|
1448
|
-
from.near = near;
|
|
1449
|
-
from.far = far;
|
|
1448
|
+
from.fov = lerp$1(from.fov, lens.fov, t);
|
|
1449
|
+
from.near = lens.near;
|
|
1450
|
+
from.far = lens.far;
|
|
1450
1451
|
if (isLensChanged) {
|
|
1451
1452
|
from.updateProjectionMatrix();
|
|
1452
1453
|
}
|
|
@@ -1464,6 +1465,28 @@ __decorate([
|
|
|
1464
1465
|
property
|
|
1465
1466
|
], CinestationBrain.prototype, "brainBlend", void 0);
|
|
1466
1467
|
|
|
1468
|
+
class Lens {
|
|
1469
|
+
constructor(){
|
|
1470
|
+
this.fov = 45;
|
|
1471
|
+
this.near = 0.1;
|
|
1472
|
+
this.far = 1000;
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
__decorate([
|
|
1476
|
+
property({
|
|
1477
|
+
dir: "lens"
|
|
1478
|
+
})
|
|
1479
|
+
], Lens.prototype, "fov", void 0);
|
|
1480
|
+
__decorate([
|
|
1481
|
+
property({
|
|
1482
|
+
dir: "lens"
|
|
1483
|
+
})
|
|
1484
|
+
], Lens.prototype, "near", void 0);
|
|
1485
|
+
__decorate([
|
|
1486
|
+
property({
|
|
1487
|
+
dir: "lens"
|
|
1488
|
+
})
|
|
1489
|
+
], Lens.prototype, "far", void 0);
|
|
1467
1490
|
class VirtualCamera extends Component {
|
|
1468
1491
|
get finalPosition() {
|
|
1469
1492
|
return this._finalPosition.copy(this.node.position).add(this.correctPosition);
|
|
@@ -1474,9 +1497,9 @@ class VirtualCamera extends Component {
|
|
|
1474
1497
|
onLoad() {
|
|
1475
1498
|
this.node.isCamera = true;
|
|
1476
1499
|
const camera = this.viewer.camera;
|
|
1477
|
-
this.fov = camera.fov;
|
|
1478
|
-
this.near = camera.near;
|
|
1479
|
-
this.far = camera.far;
|
|
1500
|
+
this.lens.fov = camera.fov;
|
|
1501
|
+
this.lens.near = camera.near;
|
|
1502
|
+
this.lens.far = camera.far;
|
|
1480
1503
|
this.node.position.set(0, 0, 4);
|
|
1481
1504
|
this.brain = this.viewer.getComponent(camera, CinestationBrain, true);
|
|
1482
1505
|
this.brain.addCamera(this);
|
|
@@ -1489,30 +1512,14 @@ class VirtualCamera extends Component {
|
|
|
1489
1512
|
this._finalPosition = new Vector3();
|
|
1490
1513
|
this._finalRotation = new Quaternion();
|
|
1491
1514
|
this.priority = 10;
|
|
1492
|
-
this.
|
|
1493
|
-
this.follow = null;
|
|
1494
|
-
this.fov = 45;
|
|
1495
|
-
this.near = 0.1;
|
|
1496
|
-
this.far = 1000;
|
|
1515
|
+
this.lens = new Lens();
|
|
1497
1516
|
this.correctPosition = new Vector3();
|
|
1498
1517
|
this.correctRotation = new Quaternion();
|
|
1499
1518
|
}
|
|
1500
1519
|
}
|
|
1501
1520
|
__decorate([
|
|
1502
|
-
property
|
|
1503
|
-
|
|
1504
|
-
})
|
|
1505
|
-
], VirtualCamera.prototype, "fov", void 0);
|
|
1506
|
-
__decorate([
|
|
1507
|
-
property({
|
|
1508
|
-
dir: "lens"
|
|
1509
|
-
})
|
|
1510
|
-
], VirtualCamera.prototype, "near", void 0);
|
|
1511
|
-
__decorate([
|
|
1512
|
-
property({
|
|
1513
|
-
dir: "lens"
|
|
1514
|
-
})
|
|
1515
|
-
], VirtualCamera.prototype, "far", void 0);
|
|
1521
|
+
property
|
|
1522
|
+
], VirtualCamera.prototype, "lens", void 0);
|
|
1516
1523
|
|
|
1517
1524
|
const PressState = {
|
|
1518
1525
|
NONE: 1 << 0,
|
|
@@ -2609,16 +2616,40 @@ Perlin._Permutation = [
|
|
|
2609
2616
|
];
|
|
2610
2617
|
|
|
2611
2618
|
const { clamp, degToRad } = MathUtils;
|
|
2612
|
-
const { abs, tan } = Math;
|
|
2619
|
+
const { abs, tan, PI } = Math;
|
|
2620
|
+
const PI2 = PI * 2;
|
|
2621
|
+
const ESP = 0.001;
|
|
2613
2622
|
class FreelookVirtualCamera extends VirtualCamera {
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2623
|
+
get lookAt() {
|
|
2624
|
+
return this._lookAt;
|
|
2625
|
+
}
|
|
2626
|
+
set lookAt(v) {
|
|
2627
|
+
this._lookAt.copy(v);
|
|
2628
|
+
this._targetLookAt.copy(v);
|
|
2629
|
+
}
|
|
2630
|
+
get springLength() {
|
|
2631
|
+
return this._spherical.radius;
|
|
2632
|
+
}
|
|
2633
|
+
set springLength(v) {
|
|
2634
|
+
this._spherical.radius = this._targetSpringLength = v;
|
|
2635
|
+
}
|
|
2636
|
+
get theta() {
|
|
2637
|
+
return this._spherical.theta;
|
|
2638
|
+
}
|
|
2639
|
+
set theta(v) {
|
|
2640
|
+
this._spherical.theta = this._targetTheta = v;
|
|
2641
|
+
}
|
|
2642
|
+
get phi() {
|
|
2643
|
+
return this._spherical.phi;
|
|
2644
|
+
}
|
|
2645
|
+
set phi(v) {
|
|
2646
|
+
this._spherical.phi = this._targetPhi = v;
|
|
2647
|
+
}
|
|
2648
|
+
get fov() {
|
|
2649
|
+
return this.lens.fov;
|
|
2650
|
+
}
|
|
2651
|
+
set fov(v) {
|
|
2652
|
+
this.lens.fov = this._targetFov = v;
|
|
2622
2653
|
}
|
|
2623
2654
|
onEnable() {
|
|
2624
2655
|
this.viewer.on(DeviceInput.POINTER_DOWN, this._onPointerDown, this);
|
|
@@ -2640,16 +2671,12 @@ class FreelookVirtualCamera extends VirtualCamera {
|
|
|
2640
2671
|
reset() {
|
|
2641
2672
|
this._button = -1;
|
|
2642
2673
|
this._touchID = -1;
|
|
2643
|
-
this._setSpherical(this.node.position, this.
|
|
2644
|
-
}
|
|
2645
|
-
get lookAtPosition() {
|
|
2646
|
-
return this._lookAtPosition.copy(this.lookAt.position).add(this._lookAtOffset);
|
|
2674
|
+
this._setSpherical(this.node.position, this._lookAt);
|
|
2647
2675
|
}
|
|
2648
2676
|
_setSpherical(position, lookAt) {
|
|
2649
2677
|
const { __posDelta } = FreelookVirtualCamera;
|
|
2650
2678
|
__posDelta.copy(position).sub(lookAt);
|
|
2651
2679
|
this._spherical.setFromVector3(__posDelta);
|
|
2652
|
-
this._targetSpherical.copy(this._spherical);
|
|
2653
2680
|
}
|
|
2654
2681
|
_onPointerDown(e) {
|
|
2655
2682
|
if (SystemInfo.isMobile) return;
|
|
@@ -2667,59 +2694,55 @@ class FreelookVirtualCamera extends VirtualCamera {
|
|
|
2667
2694
|
switch(this._button){
|
|
2668
2695
|
case 0:
|
|
2669
2696
|
this._calculateRotatelDelta(__rotateDelta, this._preLoc0, __loc0);
|
|
2670
|
-
this.
|
|
2697
|
+
this._calculateTargetSpringArm(__rotateDelta);
|
|
2671
2698
|
break;
|
|
2672
2699
|
case 1:
|
|
2673
2700
|
case 2:
|
|
2674
2701
|
this._calculatePanDelta(__panDelta, this._preLoc0, __loc0);
|
|
2675
|
-
this.
|
|
2702
|
+
this._calculateTargetLookAt(__panDelta);
|
|
2676
2703
|
break;
|
|
2677
2704
|
}
|
|
2678
2705
|
this._preLoc0.copy(__loc0);
|
|
2679
2706
|
}
|
|
2680
2707
|
_onMouseWheel(e) {
|
|
2681
|
-
if (
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
this._targetSpherical.radius *= this._calculateDistanceScale(0.85);
|
|
2686
|
-
}
|
|
2708
|
+
if (e.deltaY > 0) {
|
|
2709
|
+
this._targetSpringLength *= this._calculateDistanceScale(1 / 0.85);
|
|
2710
|
+
} else if (e.deltaY < 0) {
|
|
2711
|
+
this._targetSpringLength *= this._calculateDistanceScale(0.85);
|
|
2687
2712
|
}
|
|
2688
2713
|
}
|
|
2689
2714
|
_onTouchStart(e) {
|
|
2690
2715
|
if (!SystemInfo.isMobile) return;
|
|
2691
2716
|
let touches = e.touches;
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
this.
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
this.
|
|
2698
|
-
this._preLoc0.set(touches[rotateTouchID].pageX, touches[rotateTouchID].pageY);
|
|
2717
|
+
if (touches.length > 1) {
|
|
2718
|
+
this._preLoc0.set(touches[0].pageX, touches[0].pageY);
|
|
2719
|
+
this._preLoc1.set(touches[1].pageX, touches[1].pageY);
|
|
2720
|
+
} else if (touches.length > 0) {
|
|
2721
|
+
this._touchID = touches[0].identifier;
|
|
2722
|
+
this._preLoc0.set(touches[0].pageX, touches[0].pageY);
|
|
2699
2723
|
}
|
|
2700
2724
|
}
|
|
2701
2725
|
_onTouchMove(e) {
|
|
2702
2726
|
if (!SystemInfo.isMobile) return;
|
|
2703
2727
|
const { __loc0, __loc1, __panDelta, __rotateDelta, __preCenter, __center } = FreelookVirtualCamera;
|
|
2704
2728
|
let touches = e.touches;
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
__loc1.set(touches[rotateTouchID + 1].pageX, touches[rotateTouchID + 1].pageY);
|
|
2729
|
+
if (touches.length > 1) {
|
|
2730
|
+
__loc0.set(touches[0].pageX, touches[0].pageY);
|
|
2731
|
+
__loc1.set(touches[1].pageX, touches[1].pageY);
|
|
2709
2732
|
if (this.lookAt) {
|
|
2710
|
-
this.
|
|
2733
|
+
this._targetSpringLength *= this._calculateDistanceScale(this._preLoc0.distanceTo(this._preLoc1) / __loc0.distanceTo(__loc1));
|
|
2711
2734
|
}
|
|
2712
2735
|
__preCenter.copy(this._preLoc0).add(this._preLoc1).multiplyScalar(0.5);
|
|
2713
2736
|
__center.copy(__loc0).add(__loc1).multiplyScalar(0.5);
|
|
2714
2737
|
this._calculatePanDelta(__panDelta, __preCenter, __center);
|
|
2715
|
-
this.
|
|
2738
|
+
this._calculateTargetLookAt(__panDelta);
|
|
2716
2739
|
this._preLoc0.copy(__loc0);
|
|
2717
2740
|
this._preLoc1.copy(__loc1);
|
|
2718
|
-
} else if (touches.length >
|
|
2719
|
-
if (this._touchID === touches[
|
|
2720
|
-
__loc0.set(touches[
|
|
2741
|
+
} else if (touches.length > 0) {
|
|
2742
|
+
if (this._touchID === touches[0].identifier) {
|
|
2743
|
+
__loc0.set(touches[0].pageX, touches[0].pageY);
|
|
2721
2744
|
this._calculateRotatelDelta(__rotateDelta, this._preLoc0, __loc0);
|
|
2722
|
-
this.
|
|
2745
|
+
this._calculateTargetSpringArm(__rotateDelta);
|
|
2723
2746
|
this._preLoc0.copy(__loc0);
|
|
2724
2747
|
}
|
|
2725
2748
|
}
|
|
@@ -2756,7 +2779,7 @@ class FreelookVirtualCamera extends VirtualCamera {
|
|
|
2756
2779
|
}
|
|
2757
2780
|
return out;
|
|
2758
2781
|
}
|
|
2759
|
-
|
|
2782
|
+
_calculateTargetLookAt(panDelta) {
|
|
2760
2783
|
const { __xAxis, __yAxis, __posDelta } = FreelookVirtualCamera;
|
|
2761
2784
|
__xAxis.setFromMatrixColumn(this.node.matrix, 0);
|
|
2762
2785
|
__yAxis.setFromMatrixColumn(this.node.matrix, 1);
|
|
@@ -2764,46 +2787,43 @@ class FreelookVirtualCamera extends VirtualCamera {
|
|
|
2764
2787
|
__yAxis.y = 0;
|
|
2765
2788
|
__yAxis.normalize();
|
|
2766
2789
|
}
|
|
2767
|
-
__posDelta.copy(this.node.position).sub(this.
|
|
2790
|
+
__posDelta.copy(this.node.position).sub(this.lookAt);
|
|
2768
2791
|
const length = __posDelta.length() * 2 * tan(degToRad(this.fov * 0.5));
|
|
2769
|
-
|
|
2792
|
+
this._targetLookAt.sub(__xAxis.multiplyScalar(panDelta.x * length)).add(__yAxis.multiplyScalar(panDelta.y * length));
|
|
2770
2793
|
}
|
|
2771
|
-
|
|
2772
|
-
const spherical = this._targetSpherical;
|
|
2794
|
+
_calculateTargetSpringArm(rotateDelta, radius) {
|
|
2773
2795
|
if (rotateDelta) {
|
|
2774
|
-
|
|
2775
|
-
|
|
2796
|
+
this._targetTheta -= rotateDelta.x;
|
|
2797
|
+
this._targetPhi += rotateDelta.y;
|
|
2776
2798
|
}
|
|
2777
2799
|
if (radius) {
|
|
2778
|
-
|
|
2800
|
+
this._targetSpringLength = radius;
|
|
2779
2801
|
}
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
return spherical;
|
|
2802
|
+
this._targetTheta = clamp(this._targetTheta, this.thetaMin, this.thetaMax);
|
|
2803
|
+
this._targetPhi = clamp(this._targetPhi, this.phiMin, this.phiMax);
|
|
2804
|
+
this._targetSpringLength = clamp(this._targetSpringLength, this.distanceMin, this.distanceMax);
|
|
2784
2805
|
}
|
|
2785
|
-
gotoPOI(springLength,
|
|
2806
|
+
gotoPOI({ springLength = this._targetSpringLength, theta = this._targetTheta, phi = this._targetPhi, lookAt = this._lookAt, fov = this.lens.fov, smoothing = this.smoothing }) {
|
|
2786
2807
|
this._targetFov = fov;
|
|
2787
2808
|
this._tempSmoothing = smoothing;
|
|
2788
|
-
this.
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
}
|
|
2809
|
+
this._targetSpringLength = springLength;
|
|
2810
|
+
this._targetPhi = phi;
|
|
2811
|
+
this._targetTheta = theta;
|
|
2812
|
+
this._calculateTargetSpringArm();
|
|
2813
|
+
const theta0 = MathUtils.euclideanModulo(this._spherical.theta, PI2);
|
|
2814
|
+
const theta1 = theta0 - PI2;
|
|
2815
|
+
this._spherical.theta = abs(theta0 - this._targetTheta) < abs(theta1 - this._targetTheta) ? theta0 : theta1;
|
|
2816
|
+
this._targetLookAt.copy(lookAt);
|
|
2797
2817
|
}
|
|
2798
2818
|
update(dt) {
|
|
2799
2819
|
const smoothing = this._tempSmoothing;
|
|
2800
|
-
this._spherical.theta = FInterpTo(this._spherical.theta, this.
|
|
2801
|
-
this._spherical.phi = FInterpTo(this._spherical.phi, this.
|
|
2802
|
-
this._spherical.radius = FInterpTo(this._spherical.radius, this.
|
|
2803
|
-
this.
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
this.node.lookAt(this.
|
|
2820
|
+
this._spherical.theta = FInterpTo(this._spherical.theta, this._targetTheta, dt, smoothing);
|
|
2821
|
+
this._spherical.phi = FInterpTo(this._spherical.phi, this._targetPhi, dt, smoothing);
|
|
2822
|
+
this._spherical.radius = FInterpTo(this._spherical.radius, this._targetSpringLength, dt, smoothing);
|
|
2823
|
+
this.lens.fov = FInterpTo(this.lens.fov, this._targetFov, dt, smoothing);
|
|
2824
|
+
VInterpTo(this._lookAt, this._targetLookAt, dt, smoothing);
|
|
2825
|
+
this.node.position.setFromSpherical(this._spherical).add(this._lookAt);
|
|
2826
|
+
this.node.lookAt(this._lookAt);
|
|
2807
2827
|
}
|
|
2808
2828
|
constructor(...args){
|
|
2809
2829
|
super(...args);
|
|
@@ -2812,30 +2832,28 @@ class FreelookVirtualCamera extends VirtualCamera {
|
|
|
2812
2832
|
this._preLoc0 = new Vector2();
|
|
2813
2833
|
this._preLoc1 = new Vector2();
|
|
2814
2834
|
this._spherical = new Spherical();
|
|
2815
|
-
this.
|
|
2816
|
-
this._lookAtOffset = new Vector3();
|
|
2835
|
+
this._lookAt = new Vector3();
|
|
2817
2836
|
this._tempSmoothing = 0;
|
|
2837
|
+
this._targetTheta = 0;
|
|
2838
|
+
this._targetPhi = 0;
|
|
2839
|
+
this._targetSpringLength = 1;
|
|
2818
2840
|
this._targetFov = this.fov;
|
|
2819
|
-
this.
|
|
2820
|
-
this._targetSpherical = new Spherical();
|
|
2841
|
+
this._targetLookAt = new Vector3();
|
|
2821
2842
|
this.forbidX = false;
|
|
2822
2843
|
this.forbidY = false;
|
|
2823
2844
|
this.forbidZ = false;
|
|
2824
2845
|
this.forbidPanX = false;
|
|
2825
2846
|
this.forbidPanY = false;
|
|
2826
2847
|
this.forbitPanOffsetY = false;
|
|
2848
|
+
this.panSpeed = 1;
|
|
2849
|
+
this.rotateSpeed = 1;
|
|
2827
2850
|
this.smoothing = 5;
|
|
2828
|
-
this.
|
|
2829
|
-
this.
|
|
2830
|
-
this.panScale = new Vector3(1, 1, 1);
|
|
2831
|
-
this.phiMin = 0.001;
|
|
2832
|
-
this.phiMax = Math.PI - 0.001;
|
|
2851
|
+
this.phiMin = ESP;
|
|
2852
|
+
this.phiMax = Math.PI - ESP;
|
|
2833
2853
|
this.thetaMin = -Infinity;
|
|
2834
2854
|
this.thetaMax = Infinity;
|
|
2835
|
-
this.distanceMin =
|
|
2855
|
+
this.distanceMin = ESP;
|
|
2836
2856
|
this.distanceMax = Infinity;
|
|
2837
|
-
this.rotateTouchID = 0;
|
|
2838
|
-
this.lookAt = new Object3D();
|
|
2839
2857
|
}
|
|
2840
2858
|
}
|
|
2841
2859
|
FreelookVirtualCamera.__loc0 = new Vector2();
|
|
@@ -2879,9 +2897,83 @@ __decorate([
|
|
|
2879
2897
|
dir: "set"
|
|
2880
2898
|
})
|
|
2881
2899
|
], FreelookVirtualCamera.prototype, "forbitPanOffsetY", void 0);
|
|
2900
|
+
__decorate([
|
|
2901
|
+
property({
|
|
2902
|
+
dir: "set",
|
|
2903
|
+
step: 0.01
|
|
2904
|
+
})
|
|
2905
|
+
], FreelookVirtualCamera.prototype, "panSpeed", void 0);
|
|
2906
|
+
__decorate([
|
|
2907
|
+
property({
|
|
2908
|
+
dir: "set",
|
|
2909
|
+
step: 0.01
|
|
2910
|
+
})
|
|
2911
|
+
], FreelookVirtualCamera.prototype, "rotateSpeed", void 0);
|
|
2912
|
+
__decorate([
|
|
2913
|
+
property({
|
|
2914
|
+
dir: "set",
|
|
2915
|
+
step: 0.01
|
|
2916
|
+
})
|
|
2917
|
+
], FreelookVirtualCamera.prototype, "smoothing", void 0);
|
|
2918
|
+
__decorate([
|
|
2919
|
+
property({
|
|
2920
|
+
dir: "set",
|
|
2921
|
+
step: 0.01
|
|
2922
|
+
})
|
|
2923
|
+
], FreelookVirtualCamera.prototype, "phiMin", void 0);
|
|
2924
|
+
__decorate([
|
|
2925
|
+
property({
|
|
2926
|
+
dir: "set",
|
|
2927
|
+
step: 0.01
|
|
2928
|
+
})
|
|
2929
|
+
], FreelookVirtualCamera.prototype, "phiMax", void 0);
|
|
2930
|
+
__decorate([
|
|
2931
|
+
property({
|
|
2932
|
+
dir: "set",
|
|
2933
|
+
step: 0.01
|
|
2934
|
+
})
|
|
2935
|
+
], FreelookVirtualCamera.prototype, "thetaMin", void 0);
|
|
2936
|
+
__decorate([
|
|
2937
|
+
property({
|
|
2938
|
+
dir: "set",
|
|
2939
|
+
step: 0.01
|
|
2940
|
+
})
|
|
2941
|
+
], FreelookVirtualCamera.prototype, "thetaMax", void 0);
|
|
2942
|
+
__decorate([
|
|
2943
|
+
property({
|
|
2944
|
+
dir: "set",
|
|
2945
|
+
step: 0.01
|
|
2946
|
+
})
|
|
2947
|
+
], FreelookVirtualCamera.prototype, "distanceMin", void 0);
|
|
2948
|
+
__decorate([
|
|
2949
|
+
property({
|
|
2950
|
+
dir: "set",
|
|
2951
|
+
step: 0.01
|
|
2952
|
+
})
|
|
2953
|
+
], FreelookVirtualCamera.prototype, "distanceMax", void 0);
|
|
2954
|
+
__decorate([
|
|
2955
|
+
property({
|
|
2956
|
+
step: 0.01
|
|
2957
|
+
})
|
|
2958
|
+
], FreelookVirtualCamera.prototype, "lookAt", null);
|
|
2959
|
+
__decorate([
|
|
2960
|
+
property({
|
|
2961
|
+
step: 0.01
|
|
2962
|
+
})
|
|
2963
|
+
], FreelookVirtualCamera.prototype, "springLength", null);
|
|
2964
|
+
__decorate([
|
|
2965
|
+
property({
|
|
2966
|
+
step: 0.01
|
|
2967
|
+
})
|
|
2968
|
+
], FreelookVirtualCamera.prototype, "theta", null);
|
|
2969
|
+
__decorate([
|
|
2970
|
+
property({
|
|
2971
|
+
step: 0.01
|
|
2972
|
+
})
|
|
2973
|
+
], FreelookVirtualCamera.prototype, "phi", null);
|
|
2882
2974
|
__decorate([
|
|
2883
2975
|
property
|
|
2884
|
-
], FreelookVirtualCamera.prototype, "
|
|
2976
|
+
], FreelookVirtualCamera.prototype, "fov", null);
|
|
2885
2977
|
|
|
2886
2978
|
class Box extends Mesh {
|
|
2887
2979
|
constructor(...args){
|