@d5techs/3dgs-lib 1.4.30 → 1.4.32
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/3dgs-lib.cjs +20 -7
- package/dist/3dgs-lib.cjs.map +1 -1
- package/dist/3dgs-lib.js +20 -7
- package/dist/3dgs-lib.js.map +1 -1
- package/package.json +65 -65
package/dist/3dgs-lib.cjs
CHANGED
|
@@ -1105,15 +1105,28 @@ const _OrbitControls = class _OrbitControls {
|
|
|
1105
1105
|
const fovRad = this.camera.fov;
|
|
1106
1106
|
const halfFov = fovRad / 2;
|
|
1107
1107
|
const marginFactor = 1.5;
|
|
1108
|
-
const
|
|
1109
|
-
const
|
|
1108
|
+
const totalDistance = radius / Math.tan(halfFov) * marginFactor;
|
|
1109
|
+
const surfaceOffset = radius * 0.85;
|
|
1110
|
+
const sinPhi = Math.sin(this.phi);
|
|
1111
|
+
const cosPhi = Math.cos(this.phi);
|
|
1112
|
+
const sinTheta = Math.sin(this.theta);
|
|
1113
|
+
const cosTheta = Math.cos(this.theta);
|
|
1114
|
+
const offsetTarget = [
|
|
1115
|
+
center[0] + sinPhi * sinTheta * surfaceOffset,
|
|
1116
|
+
center[1] + cosPhi * surfaceOffset,
|
|
1117
|
+
center[2] + sinPhi * cosTheta * surfaceOffset
|
|
1118
|
+
];
|
|
1119
|
+
const adjustedDistance = Math.max(
|
|
1120
|
+
this.minDistance,
|
|
1121
|
+
totalDistance - surfaceOffset
|
|
1122
|
+
);
|
|
1110
1123
|
if (animate) {
|
|
1111
|
-
this.animateToFrame(
|
|
1124
|
+
this.animateToFrame(offsetTarget, adjustedDistance);
|
|
1112
1125
|
} else {
|
|
1113
|
-
this.camera.target[0] =
|
|
1114
|
-
this.camera.target[1] =
|
|
1115
|
-
this.camera.target[2] =
|
|
1116
|
-
this.distance =
|
|
1126
|
+
this.camera.target[0] = offsetTarget[0];
|
|
1127
|
+
this.camera.target[1] = offsetTarget[1];
|
|
1128
|
+
this.camera.target[2] = offsetTarget[2];
|
|
1129
|
+
this.distance = adjustedDistance;
|
|
1117
1130
|
this.applySpherical();
|
|
1118
1131
|
}
|
|
1119
1132
|
}
|