From 8683ae01fb3fe00d5c45d5e70730009acf58f1d0 Mon Sep 17 00:00:00 2001 From: Rik Cabanier Date: Tue, 25 Oct 2022 17:03:10 -0700 Subject: [PATCH] add support for room capture --- media/gltf/.DS_Store | Bin 0 -> 8196 bytes proposals/plane-detection.html | 23 ++++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 media/gltf/.DS_Store diff --git a/media/gltf/.DS_Store b/media/gltf/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5a3da9c5a4d5b13f8f2386b8c9fad39b88581e16 GIT binary patch literal 8196 zcmeHMTWl3Y7@luiV0WRgMGD=c&_hoUQi`;tRIYM*Q!XW~z0eDnCk z|L@HF^ZhgDpTihKTi$GBteP<djkPrlu6RDz$lMZ{~zE?s{j$A`l$}tYXfh&dy$u z;}_b+i$vMV(u%H@R-~wl^+SW|@Q^*~xqbF&E2Ay*X-WHt?a5gMTFT(4=j6v-KciKS z8qR3mF#@aAak#KQ6j-MMUK{bfT+kj0W;8ADTfG*^*#)bEq)Bx-|5EovV0*5A$jbRd zQ|SgVapnAys@1g*Zfw}PV^7E4uAa*kOP6Vt%T;xRY~u#@leU!`DB5N)Hf;E#mTTJX z@xg-a+gZozca3qY5*bCgymD1_g`UtKD0R(Mk+qaOl+W5H^LFrbIL4Y9T|Hvb1P^*9 zAH~!z$V%9gs?qhsyr(^9QEAF@*t~v&uJ-%1T+N6C>o=)t{|VYu&8I2wi8nT>`ha6( zEk`pIq1N)Sst*>#sxR#`CzTl|*NSuJa3yI2n!CXXqy7uhT99D9eIXP4L~>HcAZ=z4GxSmHcHy@TF2}quNa;0QpPwf+wB4oxda=eN5f=zxvCyCBj4QTT!(p zwP90J%g*!+k_7ZhXuBE1A#i8GJp^vJ&vOvRp`$16S69#HO9O;>>y*r4t1S}JNwroc z#A^!#yG~s%6V|nbf~`x`%j8{}6te2(M597Jq?HM_F0oaSH3(*#x=$-};3;D%sZttIfzR*1PfvOt;8uIBN7=lt*gcQi(<99tl^z};;D zly~%X@Sg$mow7XEPEvk?GEZD?TF_91iZC1}8iwOUXZ|pxdXhxBPCBB~f>H~m|NJ3f R=I3sF|Ht=#2*G=@_!l4k7a9Nn literal 0 HcmV?d00001 diff --git a/proposals/plane-detection.html b/proposals/plane-detection.html index f44f859..e1a941a 100644 --- a/proposals/plane-detection.html +++ b/proposals/plane-detection.html @@ -21,12 +21,15 @@ including implementation of synchronous hit test in JavaScript leveraging obtained plane data and anchors API to position objects.

- +

+ +
+ Back

@@ -69,6 +72,8 @@ let camera, scene, renderer; let controller1, controller2; let controllerGrip1, controllerGrip2; + let startTime; + let launchedCapture = false; const intersected = []; const tempMatrix = new THREE.Matrix4(); @@ -217,15 +222,24 @@ }); } + function onVisibilityChange(event) { + console.log("Visibility change for " + + (event.session.isImmersive ? "immersive" : "non-immersive") + + " session: " + + event.session.visibilityState); + } + function onSessionStarted(session) { useDomOverlay.disabled = true; session.addEventListener('end', onSessionEnded); session.addEventListener('select', onSelect); + session.addEventListener('visibilitychange', onVisibilityChange); renderer.xr.setReferenceSpaceType('local'); renderer.xr.setSession(session); renderer.setAnimationLoop(render); + startTime = new Date(); } function onEndSession(session) { @@ -535,6 +549,13 @@ } function render(timestamp, frame) { + + if ((frame.detectedPlanes.size === 0) && useRoomCapture.checked && ((new Date() - startTime) > 1000) && (launchedCapture === false)) { + if (frame.session.initiateRoomCapture) { + frame.session.initiateRoomCapture(); + } + launchedCapture = true; + } if (frame) { cached_frame = frame; processAnchors(timestamp, frame);