Skip to content

Commit cc67928

Browse files
authored
Merge pull request #6 from ma2yama/marmot_setAltitudeOffset
Set altitude offset
2 parents ac085ba + b1fea6d commit cc67928

File tree

10 files changed

+12
-10
lines changed

10 files changed

+12
-10
lines changed

aframe/build/aframe-ar-new-location-only.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aframe/build/aframe-ar-new-location-only.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

aframe/build/aframe-ar-nft.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aframe/build/aframe-ar-nft.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

aframe/build/aframe-ar.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aframe/build/aframe-ar.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

three.js/build/ar-threex-location-only.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

three.js/build/ar-threex-location-only.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

three.js/examples/location-based/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ function main() {
1111
const geom = new THREE.BoxGeometry(20,20,20);
1212

1313
const useAltitude = false;
14-
const arjs = new LocationBased(scene, camera, { useAltitude });
14+
const altitudeOffset = 0;
15+
const arjs = new LocationBased(scene, camera, { useAltitude, altitudeOffset });
1516

1617
// You can change the minimum GPS accuracy needed to register a position - by default 1000m
1718
//const arjs = new LocationBased(scene, camera, { gpsMinAccuracy: 30 } );

three.js/src/location-based/js/location-based.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class LocationBased {
2525
options.initialPositionAsOrigin ||
2626
false;
2727
this.useAltitude = options.useAltitude || false;
28+
this.altitudeOffset = options.altitudeOffset || 0;
2829
}
2930

3031
setProjection(proj) {
@@ -154,7 +155,7 @@ class LocationBased {
154155
position.coords.longitude,
155156
position.coords.latitude,
156157
this.useAltitude && position.coords.altitude != null
157-
? position.coords.altitude
158+
? position.coords.altitude + this.altitudeOffset
158159
: undefined,
159160
);
160161

0 commit comments

Comments
 (0)