Skip to content

Commit f9cd436

Browse files
author
Lars van Blokland
committed
more merging
1 parent 301ce0a commit f9cd436

File tree

1 file changed

+0
-65
lines changed

1 file changed

+0
-65
lines changed

threejs/src/camera.ts

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,16 @@ const frustumSize = 1;
2121
const MIN_AZIMUTH_ANGLE = -Infinity;
2222
const MAX_AZIMUTH_ANGLE = Infinity;
2323

24-
<<<<<<< HEAD:threejs/src/camera.js
2524
/**
2625
* @param {object} camera: The camera for which the frustrum height and width need to be calculated.
2726
* @param {distance} number: The distance between the camera position and control target
2827
*
2928
* @return {array} An array containing the height and width of the frustrum.
3029
*/
31-
function frustrumHeightWidth(camera, distance) {
32-
=======
3330
function frustrumHeightWidth(
3431
camera: THREE.PerspectiveCamera,
3532
distance: number
3633
) {
37-
>>>>>>> main:threejs/src/camera.ts
3834
const field_of_view = (camera.fov * Math.PI) / 180;
3935
const frustrumHeight = Math.tan(field_of_view / 2) * distance * 2;
4036
const frustrumWidth = frustrumHeight * camera.aspect;
@@ -96,16 +92,12 @@ export class CamerasControls {
9692
this.previousNonNorthPosition = null;
9793
}
9894

99-
<<<<<<< HEAD:threejs/src/camera.js
10095
/**
10196
* @param {THREE.Vector3d} position: The starting position for the initial camera.
10297
*
10398
* Creates all three cameras (map, orbit and ortho) and initializes the map camera.
10499
*/
105-
_initCameras(position) {
106-
=======
107100
_initCameras(position: THREE.Vector3) {
108-
>>>>>>> main:threejs/src/camera.ts
109101
const aspect = window.innerWidth / window.innerHeight;
110102
this.mapCamera = new THREE.PerspectiveCamera(fov, aspect, near, far);
111103
this.orbitCamera = new THREE.PerspectiveCamera(fov, aspect, near, far);
@@ -132,16 +124,12 @@ export class CamerasControls {
132124
];
133125
}
134126

135-
<<<<<<< HEAD:threejs/src/camera.js
136127
/**
137128
* @param {THREE.Vector3d} target: The starting position for the initial target.
138129
*
139130
* Creates all three control schemes.
140131
*/
141-
_initControls(target) {
142-
=======
143132
_initControls(target: THREE.Vector3) {
144-
>>>>>>> main:threejs/src/camera.ts
145133
this.mapControls = new MapControls(this.mapCamera, this.container);
146134
this.mapControls.target.copy(target);
147135
this.mapControls.maxPolarAngle = 0.5 * Math.PI;
@@ -184,17 +172,13 @@ export class CamerasControls {
184172
];
185173
}
186174

187-
<<<<<<< HEAD:threejs/src/camera.js
188175
/**
189176
* @param {int} newCameraInt: The "CameraInt" of the desired camera.
190177
*
191178
* Changes the camera int (which indicates which camera is currently active) and also
192179
* switches the active camera and control objects.
193180
*/
194-
_changeCameraInt(newCameraInt) {
195-
=======
196181
_changeCameraInt(newCameraInt: CameraValue) {
197-
>>>>>>> main:threejs/src/camera.ts
198182
if (
199183
![CameraValue.Map, CameraValue.Orbit, CameraValue.Ortho].includes(
200184
newCameraInt
@@ -296,17 +280,13 @@ export class CamerasControls {
296280
this.compassElement.style.transform = `rotate(${degrees}deg)`;
297281
}
298282

299-
<<<<<<< HEAD:threejs/src/camera.js
300283
/**
301284
* @param {number} width: desired camera width.
302285
* @param {number} heigt: desirec camera height.
303286
*
304287
* Changes the width and height of all three cameras.
305288
*/
306-
resizeCameras(width, height) {
307-
=======
308289
resizeCameras(width: number, height: number) {
309-
>>>>>>> main:threejs/src/camera.ts
310290
const aspect = width / height;
311291

312292
this.mapCamera.aspect = aspect;
@@ -530,30 +510,9 @@ export class CamerasControls {
530510
}
531511
}
532512

533-
<<<<<<< HEAD:threejs/src/camera.js
534513
/**
535514
* Zoom in by the desired degree, or by a factor of 1.8 if unspecified.
536515
*/
537-
=======
538-
// toggleOrthographic() {
539-
// if (this._animating()) {
540-
// return;
541-
// }
542-
// if (this.cameraInt != CameraValue.Ortho) {
543-
// this.switchToOrthographic();
544-
// this.updateCompassRotation();
545-
// } else {
546-
// this.switchToMap();
547-
// if (this.previousCameraInt == CameraValue.Map) {
548-
// this.switchToMap();
549-
// } else {
550-
// this.switchToOrbit();
551-
// }
552-
// this.updateCompassRotation();
553-
// }
554-
// }
555-
556-
>>>>>>> main:threejs/src/camera.ts
557516
zoomIn(factor = 1.8) {
558517
// Fix: make our own function instead of using a private one
559518
const ctrl = this.controls as any;
@@ -704,18 +663,14 @@ export class CamerasControls {
704663
);
705664
}
706665

707-
<<<<<<< HEAD:threejs/src/camera.js
708666
/**
709667
* Zoom function for the perspective camera.
710668
*/
711-
_zoomPerspective(newTarget, distance, onComplete = () => { }) {
712-
=======
713669
_zoomPerspective(
714670
newTarget: THREE.Vector3,
715671
distance: number,
716672
onComplete = () => {}
717673
) {
718-
>>>>>>> main:threejs/src/camera.ts
719674
// Set camera position & orientation
720675
const initTarget = this.controls.target.clone();
721676
const initPosition = this.camera.position.clone();
@@ -744,15 +699,11 @@ export class CamerasControls {
744699
);
745700
}
746701

747-
<<<<<<< HEAD:threejs/src/camera.js
748702
/**
749703
* @param {object} object: The object that needs to be zoomed towards.
750704
* @param {function} onComplete: Function to execute when done with the operation.
751705
*/
752-
_zoomToObjectPerspective(object, onComplete = () => { }) {
753-
=======
754706
_zoomToObjectPerspective(object: THREE.Object3D, onComplete = () => {}) {
755-
>>>>>>> main:threejs/src/camera.ts
756707
this.switchToOrbit();
757708
if (this.camera != this.orbitCamera) {
758709
console.error("Camera is not orbit.");
@@ -771,20 +722,16 @@ export class CamerasControls {
771722
return this._zoomPerspective(sphere.center, distance, onComplete);
772723
}
773724

774-
<<<<<<< HEAD:threejs/src/camera.js
775725
/**
776726
* @param {THREE.vector3d} newTarget: The position that needs to be zoomed towards.
777727
* @param {number} distance: The distance between the current and desired targets
778728
* @param {function} onComplete: Function to execute when done with the operation.
779729
*/
780-
_zoomOrthographic(newTarget, distance, onComplete = () => { }) {
781-
=======
782730
_zoomOrthographic(
783731
newTarget: THREE.Vector3,
784732
distance: number | null,
785733
onComplete = () => {}
786734
) {
787-
>>>>>>> main:threejs/src/camera.ts
788735
// Set camera position & orientation
789736
const initTarget = this.controls.target.clone();
790737
const initPosition = this.camera.position.clone();
@@ -802,15 +749,11 @@ export class CamerasControls {
802749
);
803750
}
804751

805-
<<<<<<< HEAD:threejs/src/camera.js
806752
/**
807753
* @param {object} object: The object that needs to be zoomed towards.
808754
* @param {function} onComplete: Function to execute when done with the operation.
809755
*/
810-
_zoomToObjectOrthographic(object, onComplete = () => { }) {
811-
=======
812756
_zoomToObjectOrthographic(object: THREE.Object3D, onComplete = () => {}) {
813-
>>>>>>> main:threejs/src/camera.ts
814757
if (!object) {
815758
return;
816759
}
@@ -835,36 +778,28 @@ export class CamerasControls {
835778
return this._zoomOrthographic(sphere.center, null, onComplete);
836779
}
837780

838-
<<<<<<< HEAD:threejs/src/camera.js
839781
/**
840782
* @param {object} object: The object that needs to be zoomed towards.
841783
* @param {function} onComplete: Function to execute when done with the operation.
842784
*/
843-
zoomToObject(object, onComplete = () => { }) {
844-
=======
845785
zoomToObject(object: THREE.Object3D, onComplete = () => {}) {
846-
>>>>>>> main:threejs/src/camera.ts
847786
if (this.usesOrthographicCamera()) {
848787
return this._zoomToObjectOrthographic(object, onComplete);
849788
} else {
850789
return this._zoomToObjectPerspective(object, onComplete);
851790
}
852791
}
853792

854-
<<<<<<< HEAD:threejs/src/camera.js
855793
/**
856794
* @param {THREE.vector3d} newTarget: The position that needs to be zoomed towards.
857795
* @param {number} distance: The distance between the current and desired targets
858796
* @param {function} onComplete: Function to execute when done with the operation.
859797
*/
860-
zoomToCoordinates(newTarget, distance, onComplete = () => { }) {
861-
=======
862798
zoomToCoordinates(
863799
newTarget: THREE.Vector3,
864800
distance: number,
865801
onComplete = () => {}
866802
) {
867-
>>>>>>> main:threejs/src/camera.ts
868803
if (this.usesOrthographicCamera()) {
869804
return this._zoomOrthographic(newTarget, distance, onComplete);
870805
} else {

0 commit comments

Comments
 (0)