Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

MAPSJS-2660: Support off-center projection in MapControls. #2281

Merged
merged 2 commits into from
Aug 23, 2021

Conversation

atomicsulfate
Copy link
Collaborator

No description provided.

@atomicsulfate atomicsulfate changed the base branch from master to MAPSJS-2660_ClipPlanesOffCenterPerspective August 17, 2021 12:10
Base automatically changed from MAPSJS-2660_ClipPlanesOffCenterPerspective to master August 23, 2021 07:51
@atomicsulfate atomicsulfate force-pushed the MAPSJS-2660_OffCenterOrbit branch 2 times, most recently from b068983 to 293c9d6 Compare August 23, 2021 09:32
@nzjony nzjony closed this Aug 23, 2021
@nzjony nzjony reopened this Aug 23, 2021
@atomicsulfate atomicsulfate reopened this Aug 23, 2021
…eenPoint.

Deprecate old orbitAroundScreenPoint signature.
Create new signature where orbit center is optional, defaulting to
camera principal point.

Signed-off-by: Andres Mandado <[email protected]>
@codecov
Copy link

codecov bot commented Aug 23, 2021

Codecov Report

Merging #2281 (10cb72b) into master (fbba18f) will increase coverage by 0.01%.
The diff coverage is 85.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2281      +/-   ##
==========================================
+ Coverage   67.95%   67.96%   +0.01%     
==========================================
  Files         315      315              
  Lines       27766    27775       +9     
  Branches     6215     6219       +4     
==========================================
+ Hits        18869    18878       +9     
  Misses       8897     8897              
Impacted Files Coverage Δ
@here/harp-map-controls/lib/MapControls.ts 71.91% <75.00%> (ø)
@here/harp-mapview/lib/Utils.ts 80.96% <89.47%> (+0.09%) ⬆️
@here/harp-mapview/lib/MapMaterialAdapter.ts 92.85% <0.00%> (+0.71%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fbba18f...10cb72b. Read the comment docs.

/**
* Parameters for {@link orbitAroundScreenPoint}.
*/
export interface OrbitParams {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea, this makes the code much more readable IMO that just passing in parameters.

/**
* Delta tilt in radians.
*/
deltaTilt: number;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could consider to make this optional, at least I see you pass in tilt : 0 a few times.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done for both deltaTilt and deltaAzimuth.

deltaTilt?: number,
maxTiltAngle?: number
): void {
const ppalPoint = CameraUtils.getPrincipalPoint(mapView.camera, cache.vector2[1]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use the cache [1] vector. Do you expect some valid value to be in [0].

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed this one to [0] and the one for the orbit center (below) to [1].

projection === sphereProjection
? 1e-7 // FIXME: Is this huge error expected?
: Number.EPSILON
);
});
it("limits tilt when orbiting around screen point", function () {
for (const startTilt of [0, 20, 45]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you remove 20, 45?

Copy link
Collaborator Author

@atomicsulfate atomicsulfate Aug 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, I forgot to change that back.

@atomicsulfate atomicsulfate merged commit a3b58b6 into master Aug 23, 2021
@atomicsulfate atomicsulfate deleted the MAPSJS-2660_OffCenterOrbit branch August 23, 2021 14:22
ThFischer pushed a commit that referenced this pull request Aug 30, 2021
* MAPSJS-2660: Support oblique perspective projection in orbitAroundScreenPoint.

Deprecate old orbitAroundScreenPoint signature.
Create new signature where orbit center is optional, defaulting to
camera principal point.

Signed-off-by: Andres Mandado <[email protected]>

* MAPSJS-2660: Address review comments.

Signed-off-by: Andres Mandado <[email protected]>
Signed-off-by: Fischer, Thomas <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants