This repository was archived by the owner on Aug 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +23
-7
lines changed Expand file tree Collapse file tree 4 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -43,16 +43,31 @@ export const EmulatorDevtools = () => {
43
43
}
44
44
}
45
45
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
+
46
56
return (
47
57
< >
48
58
< style type = "text/css" > { devtoolCSS . toString ( ) } </ style >
49
59
< div
50
60
id = "devtools"
51
61
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"
52
62
>
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 >
56
71
{ deviceState . value && < Devtool device = { deviceState . value } /> }
57
72
</ div >
58
73
</ >
Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ export class CustomWebXRPolyfill extends WebXRPolyfill {
92
92
if ( mode === 'immersive-vr' || mode === 'immersive-ar' ) {
93
93
activeImmersiveSession = session ;
94
94
95
+ session . interactionMode = 'world-space'
96
+
95
97
// DOM-Overlay API
96
98
const optionalFeatures = enabledFeatures . optionalFeatures ;
97
99
const domOverlay = enabledFeatures . domOverlay ;
Original file line number Diff line number Diff line change @@ -964,7 +964,6 @@ export default class EmulatedXRDevice extends XRDevice {
964
964
WebXREventDispatcher . instance . addEventListener (
965
965
POLYFILL_ACTIONS . HEADSET_POSE_CHANGE ,
966
966
( event ) => {
967
- console . log ( 'HEADSET_POSE_CHANGE' , event . detail ) ;
968
967
const positionArray = event . detail . position ;
969
968
const quaternionArray = event . detail . quaternion ;
970
969
this . _updatePose ( positionArray , quaternionArray ) ;
Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ import XRRay from './XRRay';
5
5
export default class XRHitTestSource {
6
6
constructor ( session , options ) {
7
7
// @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
+ // }
11
11
this [ PRIVATE ] = {
12
12
session,
13
13
space : options . space ,
You can’t perform that action at this time.
0 commit comments