Skip to content
This repository was archived by the owner on Aug 18, 2024. It is now read-only.

Commit 018d3c9

Browse files
committed
bug fixes
1 parent 38e3460 commit 018d3c9

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

devtool/EmulatorDevtools.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,31 @@ export const EmulatorDevtools = () => {
4343
}
4444
}
4545

46+
const togglePlacement = () => {
47+
if (xrState.scenePlacementMode.value !== 'placing') {
48+
xrState.scenePlacementMode.set('placing')
49+
xrState.sceneScaleAutoMode.set(false)
50+
xrState.sceneScaleTarget.set(0.1)
51+
} else {
52+
xrState.scenePlacementMode.set('placed')
53+
}
54+
}
55+
4656
return (
4757
<>
4858
<style type="text/css">{devtoolCSS.toString()}</style>
4959
<div
5060
id="devtools"
5161
className="flex flex-no-wrap flex-col h-full overflow-hidden m-0 bg-gray-900 text-gray-900 text-xs select-none h-full overflow-hidden"
5262
>
53-
<Button className="my-1 ml-auto mr-6 px-10" onClick={toggleXR} disabled={xrState.requestingSession.value}>
54-
{xrActive ? 'Exit XR' : 'Enter XR'}
55-
</Button>
63+
<div className="flex flex-no-wrap flex-row h-10 bg-gray-800 text-gray-900 text-xs select-none">
64+
<Button className="my-1 ml-auto mr-6 px-10" onClick={toggleXR} disabled={xrState.requestingSession.value}>
65+
{xrActive ? 'Exit XR' : 'Enter XR'}
66+
</Button>
67+
<Button className="my-1 ml-auto mr-6 px-10" onClick={togglePlacement} disabled={!xrActive}>
68+
Place Scene
69+
</Button>
70+
</div>
5671
{deviceState.value && <Devtool device={deviceState.value} />}
5772
</div>
5873
</>

webxr-emulator/CustomWebXRPolyfill.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ export class CustomWebXRPolyfill extends WebXRPolyfill {
9292
if (mode === 'immersive-vr' || mode === 'immersive-ar') {
9393
activeImmersiveSession = session;
9494

95+
session.interactionMode = 'world-space'
96+
9597
// DOM-Overlay API
9698
const optionalFeatures = enabledFeatures.optionalFeatures;
9799
const domOverlay = enabledFeatures.domOverlay;

webxr-emulator/EmulatedXRDevice.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,6 @@ export default class EmulatedXRDevice extends XRDevice {
964964
WebXREventDispatcher.instance.addEventListener(
965965
POLYFILL_ACTIONS.HEADSET_POSE_CHANGE,
966966
(event) => {
967-
console.log('HEADSET_POSE_CHANGE', event.detail);
968967
const positionArray = event.detail.position;
969968
const quaternionArray = event.detail.quaternion;
970969
this._updatePose(positionArray, quaternionArray);

webxr-emulator/api/XRHitTestSource.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import XRRay from './XRRay';
55
export default class XRHitTestSource {
66
constructor(session, options) {
77
// @TODO: Support options.entityTypes and options.offsetRay
8-
if (options.entityTypes && options.entityTypes.length > 0) {
9-
throw new Error('XRHitTestSource does not support entityTypes option yet.');
10-
}
8+
// if (options.entityTypes && options.entityTypes.length > 0) {
9+
// throw new Error('XRHitTestSource does not support entityTypes option yet.');
10+
// }
1111
this[PRIVATE] = {
1212
session,
1313
space: options.space,

0 commit comments

Comments
 (0)