Skip to content

Commit 826b5bd

Browse files
lafflanmgermerie
authored andcommitted
fix: change THREE.Math to THREE.MathUtils
change THREE.Math to THREE.MathUtils
1 parent e455bdb commit 826b5bd

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

src/Renderer/Camera.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ class Camera {
153153
this.camera3D.bottom = -halfH;
154154
this.camera3D.top = halfH;
155155
} else if (this.camera3D.isPerspectiveCamera) {
156-
this.camera3D.fov = 2 * THREE.Math.radToDeg(Math.atan(
157-
(height / this.height) * Math.tan(THREE.Math.degToRad(this.camera3D.fov) / 2),
156+
this.camera3D.fov = 2 * THREE.MathUtils.radToDeg(Math.atan(
157+
(height / this.height) * Math.tan(THREE.MathUtils.degToRad(this.camera3D.fov) / 2),
158158
));
159159
}
160160
this.camera3D.aspect = ratio;

src/Utils/CameraUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ export default {
457457
cameraTransformOptions.range = 1000;
458458
} else if (camera.isPerspectiveCamera) {
459459
// setup range for camera placement
460-
const verticalFOV = THREE.Math.degToRad(camera.fov);
460+
const verticalFOV = THREE.MathUtils.degToRad(camera.fov);
461461
if (dimensions.x / dimensions.y > camera.aspect) {
462462
const focal = (view.domElement.clientHeight * 0.5) / Math.tan(verticalFOV * 0.5);
463463
const horizontalFOV = 2 * Math.atan(view.domElement.clientWidth * 0.5 / focal);

test/unit/CameraUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ describe('Camera utils unit test', function () {
155155
camera3D.updateMatrixWorld(true);
156156
assert.ok(
157157
CameraUtils.getCameraTransformOptionsFromExtent(view, camera3D, subExtent).range -
158-
subExtent.planarDimensions().y / (2 * Math.tan(THREE.Math.degToRad(camera3D.fov) / 2)) < 10 ** -14,
158+
subExtent.planarDimensions().y / (2 * Math.tan(THREE.MathUtils.degToRad(camera3D.fov) / 2)) < 10 ** -14,
159159
);
160160
});
161161
});

test/unit/globeview.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,8 @@ describe('GlobeView', function () {
103103
new OBB().setFromExtent(extent).box3D.getSize(size);
104104
assert.ok(
105105
CameraUtils.getTransformCameraLookingAtTarget(extentViewer, camera3D).range -
106-
size.x / (2 * Math.tan(THREE.Math.degToRad(camera3D.fov) / 2))
106+
size.x / (2 * Math.tan(THREE.MathUtils.degToRad(camera3D.fov) / 2))
107107
< 10 ** -6,
108108
);
109109
});
110110
});
111-

0 commit comments

Comments
 (0)