@@ -21,7 +21,7 @@ import {
2121import { EngineRenderer } from '../../renderer/WebGLRendererSystem'
2222import { SkyboxComponent } from '../../scene/components/SkyboxComponent'
2323import { updateSkybox } from '../../scene/functions/loaders/SkyboxFunctions'
24- import { VPSWayspotComponent } from '../VPSComponents '
24+ import { PersistentAnchorComponent } from '../XRAnchorComponents '
2525import { endXRSession , requestXRSession } from '../XRSessionFunctions'
2626import { XRAction , XRState } from '../XRState'
2727import { XR8Pipeline } from './XR8Pipeline'
@@ -30,7 +30,7 @@ import { XR8Type } from './XR8Types'
3030type XR8Assets = {
3131 xr8Script : HTMLScriptElement
3232 xrExtrasScript : HTMLScriptElement
33- xrCoachingOverlayScript : HTMLScriptElement
33+ // xrCoachingOverlayScript: HTMLScriptElement
3434}
3535
3636function loadScript ( url ) : Promise < HTMLScriptElement > {
@@ -48,10 +48,10 @@ function loadScript(url): Promise<HTMLScriptElement> {
4848 * @returns
4949 */
5050const initialize8thwall = async ( ) : Promise < XR8Assets > => {
51- const [ xr8Script , xrExtrasScript , xrCoachingOverlayScript ] = await Promise . all ( [
51+ const [ xr8Script , xrExtrasScript /* , xrCoachingOverlayScript*/ ] = await Promise . all ( [
5252 loadScript ( `https://apps.8thwall.com/xrweb?appKey=${ config . client . key8thWall } ` ) ,
53- loadScript ( `https://cdn.8thwall.com/web/xrextras/xrextras.js` ) ,
54- loadScript ( `https://cdn.8thwall.com/web/coaching-overlay/coaching-overlay.js` )
53+ loadScript ( `https://cdn.8thwall.com/web/xrextras/xrextras.js` )
54+ // loadScript(`https://cdn.8thwall.com/web/coaching-overlay/coaching-overlay.js`)
5555 ] )
5656
5757 /** the global XR8 object will not exist immediately, so wait for it */
@@ -71,18 +71,18 @@ const initialize8thwall = async (): Promise<XR8Assets> => {
7171
7272 XR8 = globalThis . XR8
7373 XRExtras = globalThis . XRExtras
74- VpsCoachingOverlay = globalThis . VpsCoachingOverlay
74+ // VpsCoachingOverlay = globalThis.VpsCoachingOverlay
7575
7676 return {
7777 xr8Script,
78- xrExtrasScript,
79- xrCoachingOverlayScript
78+ xrExtrasScript
79+ // xrCoachingOverlayScript
8080 }
8181}
8282
8383export let XR8 : XR8Type
8484export let XRExtras
85- export let VpsCoachingOverlay
85+ // export let VpsCoachingOverlay
8686
8787const initialize8thwallDevice = async ( existingCanvas : HTMLCanvasElement | null , world : World ) => {
8888 if ( existingCanvas ) {
@@ -161,7 +161,7 @@ const initialize8thwallDevice = async (existingCanvas: HTMLCanvasElement | null,
161161
162162 // if (enableVps) {
163163 // VpsCoachingOverlay.configure({
164- // // wayspotName: vpsWayspotName // todo - support multiple wayspots , for now just use the nearest one
164+ // // persistentanchorName: vpsPersistentAnchorName // todo - support multiple persistentanchors , for now just use the nearest one
165165 // })
166166 // }
167167
@@ -210,6 +210,10 @@ class XRHitTestResultProxy {
210210 createAnchor = undefined
211211}
212212
213+ class XRReferenceSpace { }
214+
215+ class XRHitTestSource { }
216+
213217class XRSessionProxy extends EventDispatcher {
214218 readonly inputSources : XRInputSource [ ]
215219
@@ -218,12 +222,12 @@ class XRSessionProxy extends EventDispatcher {
218222 this . inputSources = inputSources
219223 }
220224 async requestReferenceSpace ( type : 'local' | 'viewer' ) {
221- const space = { }
222- return space as XRReferenceSpace
225+ const space = new XRReferenceSpace ( )
226+ return space
223227 }
224228
225229 async requestHitTestSource ( args : { space : XRReferenceSpace } ) {
226- const source = { }
230+ const source = new XRHitTestSource ( )
227231 return source as XRHitTestSource
228232 }
229233}
@@ -269,7 +273,7 @@ class XRFrameProxy {
269273}
270274
271275const skyboxQuery = defineQuery ( [ SkyboxComponent ] )
272- const vpsQuery = defineQuery ( [ VPSWayspotComponent ] )
276+ const vpsQuery = defineQuery ( [ PersistentAnchorComponent ] )
273277
274278export default async function XR8System ( world : World ) {
275279 let _8thwallScripts = null as XR8Assets | null
@@ -415,16 +419,16 @@ export default async function XR8System(world: World) {
415419 * session, changing the overrides, and entering the session again
416420 */
417421 const vpsReactor = startReactor ( function XR8VPSReactor ( ) {
418- const hasWayspot = useQuery ( vpsQuery ) . length
422+ const hasPersistentAnchor = useQuery ( vpsQuery ) . length
419423
420424 useEffect ( ( ) => {
421425 /** data oriented approach to overriding functions, check if it's already changed, and abort if as such */
422- if ( hasWayspot || using8thWall ) {
426+ if ( hasPersistentAnchor || using8thWall ) {
423427 overrideXRSessionFunctions ( )
424428 } else {
425429 revertXRSessionFunctions ( )
426430 }
427- } , [ hasWayspot ] )
431+ } , [ hasPersistentAnchor ] )
428432
429433 return null
430434 } )
@@ -462,7 +466,7 @@ export default async function XR8System(world: World) {
462466 if ( _8thwallScripts ) {
463467 _8thwallScripts . xr8Script . remove ( )
464468 _8thwallScripts . xrExtrasScript . remove ( )
465- _8thwallScripts . xrCoachingOverlayScript . remove ( )
469+ // _8thwallScripts.xrCoachingOverlayScript.remove()
466470 }
467471 if ( cameraCanvas ) cameraCanvas . remove ( )
468472 revertXRSessionFunctions ( )
0 commit comments