Skip to content

Commit

Permalink
Fixed an issue with offset reference spaces
Browse files Browse the repository at this point in the history
Turns out we weren't properly passing along the base transform to the new reference space, which would cause it to appear off in cases like `local-floor` or `bounded-floor` reference spaces on devices with real floor detection. (Devices that fell back to the emulated height for `local-floor` did OK.)
  • Loading branch information
toji committed Dec 13, 2019
1 parent 07e4481 commit 6ae23cc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
1 change: 0 additions & 1 deletion src/api/XRFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import {PRIVATE as SESSION_PRIVATE} from './XRSession';
import XRViewerPose from './XRViewerPose';
import XRView from './XRView';
import { mat4 } from 'gl-matrix';

export const PRIVATE = Symbol('@@webxr-polyfill/XRFrame');

Expand Down
16 changes: 1 addition & 15 deletions src/api/XRReferenceSpace.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,11 @@ export default class XRReferenceSpace extends XRSpace {

this[PRIVATE] = {
type,
transform,
originOffset : mat4.identity(new Float32Array(16)),
};
}

/**
* NON-STANDARD
* Called when this space's base pose needs to be updated
* @param {XRDevice} device
*/
_onPoseUpdate(device) {
switch(this[PRIVATE].type) {
case 'viewer':
this._baseMatrix = device.getBasePoseMatrix();
break;
default:
break;
}
}

/**
* NON-STANDARD
* Takes a base pose model matrix and transforms it by the
Expand Down

0 comments on commit 6ae23cc

Please sign in to comment.