Skip to content

Commit

Permalink
Fix #1298 gyroscope: invalid orientation in landscape
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed May 18, 2024
1 parent 16150cc commit 35e94cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/gyroscope-plugin/src/GyroscopePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ export class GyroscopePlugin extends AbstractConfigurablePlugin<

// force reset
this.controls.deviceOrientation = null;
this.controls.screenOrientation = 0;
this.controls.alphaOffset = 0;

this.state.alphaOffset = this.config.absolutePosition ? 0 : null;
Expand Down
2 changes: 2 additions & 0 deletions packages/markers-plugin/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ function greatArcIntermediaryPoint(p1: [number, number], p2: [number, number], f
const [λ1, φ1] = p1;
const [λ2, φ2] = p2;

// note: "r" should be the angular distance, see "intermediatePointTo" in the above article
// but "greatArcDistance" gives identiqual results up to 0.00001 radians and is faster
const r = utils.greatArcDistance(p1, p2);
const a = Math.sin((1 - f) * r) / Math.sin(r);
const b = Math.sin(f * r) / Math.sin(r);
Expand Down

0 comments on commit 35e94cb

Please sign in to comment.