@needle-tools/engine 4.12.0-next.dd87659 → 4.12.0-next.e42c144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/components.needle.json +1 -1
- package/dist/generateMeshBVH.worker-iyfPIK6R.js +21 -0
- package/dist/{gltf-progressive-DZrY8VT6.min.js → gltf-progressive-BmSygnAC.min.js} +2 -2
- package/dist/{gltf-progressive-DgYz5BYa.js → gltf-progressive-DnLBuGK5.js} +24 -24
- package/dist/{gltf-progressive-DWcmTMCh.umd.cjs → gltf-progressive-Rs-ojtXy.umd.cjs} +1 -1
- package/dist/{loader.worker-Dip-PthR.js → loader.worker-DWzfDpAl.js} +4 -4
- package/dist/needle-engine.bundle-CW5U4a3u.umd.cjs +1647 -0
- package/dist/needle-engine.bundle-HNQiYV9e.min.js +1647 -0
- package/dist/{needle-engine.bundle-CiqX7AtA.js → needle-engine.bundle-qrrKb_xn.js} +8886 -8598
- package/dist/needle-engine.d.ts +142 -43
- package/dist/needle-engine.js +48 -48
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-DYDtB188.min.js → postprocessing-B5ksn9-G.min.js} +54 -54
- package/dist/{postprocessing-CMgoN5t5.umd.cjs → postprocessing-DZtb9Nnn.umd.cjs} +81 -81
- package/dist/{postprocessing-BTW9pD_s.js → postprocessing-__7s9wON.js} +450 -441
- package/dist/{three-DfMvBzXi.js → three-BCCkyCA5.js} +1 -7
- package/dist/{three-qj71I7J3.umd.cjs → three-Bf2NBxAw.umd.cjs} +2 -2
- package/dist/{three-B7CT31Bt.min.js → three-W7zWTcfP.min.js} +1 -1
- package/dist/{three-examples-CsW4_6LI.umd.cjs → three-examples-Dho7cuu4.umd.cjs} +4 -4
- package/dist/{three-examples-D1P7eEhn.min.js → three-examples-MsJjauyk.min.js} +10 -10
- package/dist/{three-examples-D1SK93ek.js → three-examples-y2GeYlze.js} +2 -20
- package/dist/{three-mesh-ui-C_uSB5dD.js → three-mesh-ui-3nSSizT4.js} +1 -1
- package/dist/{three-mesh-ui-LQ44s0AL.min.js → three-mesh-ui-CIez6qJQ.min.js} +1 -1
- package/dist/{three-mesh-ui-DpATDXwU.umd.cjs → three-mesh-ui-zsOOA5Pq.umd.cjs} +1 -1
- package/dist/{vendor-D0zoswDa.js → vendor-DMZcbVO1.js} +3707 -3527
- package/dist/vendor-sURMCFSI.min.js +1116 -0
- package/dist/{vendor-UCpFAwt1.umd.cjs → vendor-tyBvnMF-.umd.cjs} +39 -39
- package/lib/engine/codegen/register_types.js +0 -2
- package/lib/engine/codegen/register_types.js.map +1 -1
- package/lib/engine/debug/debug_console.js +403 -1
- package/lib/engine/debug/debug_console.js.map +1 -1
- package/lib/engine/engine_components.js +3 -3
- package/lib/engine/engine_components.js.map +1 -1
- package/lib/engine/engine_context.js +2 -0
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_input.d.ts +5 -0
- package/lib/engine/engine_input.js +6 -0
- package/lib/engine/engine_input.js.map +1 -1
- package/lib/engine/engine_license.d.ts +18 -0
- package/lib/engine/engine_license.js +115 -18
- package/lib/engine/engine_license.js.map +1 -1
- package/lib/engine/engine_networking.js +5 -5
- package/lib/engine/engine_networking.js.map +1 -1
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/engine_physics_rapier.js +1 -1
- package/lib/engine/engine_physics_rapier.js.map +1 -1
- package/lib/engine/engine_serialization_builtin_serializer.js +1 -1
- package/lib/engine/engine_serialization_builtin_serializer.js.map +1 -1
- package/lib/engine/engine_utils.d.ts +4 -1
- package/lib/engine/engine_utils.js +28 -4
- package/lib/engine/engine_utils.js.map +1 -1
- package/lib/engine/extensions/extensions.d.ts +29 -7
- package/lib/engine/extensions/extensions.js.map +1 -1
- package/lib/engine/webcomponents/WebXRButtons.js +13 -5
- package/lib/engine/webcomponents/WebXRButtons.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu.js +4 -5
- package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.ar-overlay.js +4 -0
- package/lib/engine/webcomponents/needle-engine.ar-overlay.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.js +1 -1
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine/xr/NeedleXRSession.d.ts +1 -1
- package/lib/engine/xr/NeedleXRSession.js +101 -22
- package/lib/engine/xr/NeedleXRSession.js.map +1 -1
- package/lib/engine/xr/TempXRContext.js +12 -2
- package/lib/engine/xr/TempXRContext.js.map +1 -1
- package/lib/engine/xr/usdz.js +6 -2
- package/lib/engine/xr/usdz.js.map +1 -1
- package/lib/engine-components/AlignmentConstraint.d.ts +1 -2
- package/lib/engine-components/AlignmentConstraint.js +1 -2
- package/lib/engine-components/AlignmentConstraint.js.map +1 -1
- package/lib/engine-components/Animation.d.ts +2 -0
- package/lib/engine-components/Animation.js +2 -0
- package/lib/engine-components/Animation.js.map +1 -1
- package/lib/engine-components/Animator.d.ts +1 -0
- package/lib/engine-components/Animator.js +1 -0
- package/lib/engine-components/Animator.js.map +1 -1
- package/lib/engine-components/AudioListener.d.ts +1 -1
- package/lib/engine-components/AudioListener.js +1 -1
- package/lib/engine-components/AudioSource.d.ts +1 -1
- package/lib/engine-components/AudioSource.js +1 -1
- package/lib/engine-components/BasicIKConstraint.d.ts +8 -0
- package/lib/engine-components/BasicIKConstraint.js +8 -0
- package/lib/engine-components/BasicIKConstraint.js.map +1 -1
- package/lib/engine-components/BoxHelperComponent.d.ts +1 -0
- package/lib/engine-components/BoxHelperComponent.js +1 -0
- package/lib/engine-components/BoxHelperComponent.js.map +1 -1
- package/lib/engine-components/Camera.d.ts +2 -2
- package/lib/engine-components/Camera.js +6 -3
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/CharacterController.d.ts +6 -2
- package/lib/engine-components/CharacterController.js +6 -2
- package/lib/engine-components/CharacterController.js.map +1 -1
- package/lib/engine-components/Collider.d.ts +2 -2
- package/lib/engine-components/Collider.js +1 -1
- package/lib/engine-components/Collider.js.map +1 -1
- package/lib/engine-components/Component.d.ts +2 -1
- package/lib/engine-components/Component.js +3 -2
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/ContactShadows.d.ts +1 -1
- package/lib/engine-components/ContactShadows.js +1 -1
- package/lib/engine-components/DragControls.js +4 -1
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/Gizmos.d.ts +2 -0
- package/lib/engine-components/Gizmos.js +2 -0
- package/lib/engine-components/Gizmos.js.map +1 -1
- package/lib/engine-components/Joints.d.ts +20 -0
- package/lib/engine-components/Joints.js +20 -0
- package/lib/engine-components/Joints.js.map +1 -1
- package/lib/engine-components/LODGroup.d.ts +1 -1
- package/lib/engine-components/LODGroup.js +1 -1
- package/lib/engine-components/LookAtConstraint.d.ts +1 -1
- package/lib/engine-components/LookAtConstraint.js +1 -1
- package/lib/engine-components/Networking.d.ts +1 -1
- package/lib/engine-components/Networking.js +1 -1
- package/lib/engine-components/OrbitControls.d.ts +1 -1
- package/lib/engine-components/OrbitControls.js +1 -1
- package/lib/engine-components/Renderer.d.ts +6 -0
- package/lib/engine-components/Renderer.js +6 -0
- package/lib/engine-components/Renderer.js.map +1 -1
- package/lib/engine-components/RendererInstancing.js +5 -3
- package/lib/engine-components/RendererInstancing.js.map +1 -1
- package/lib/engine-components/SceneSwitcher.js +18 -14
- package/lib/engine-components/SceneSwitcher.js.map +1 -1
- package/lib/engine-components/ShadowCatcher.d.ts +1 -1
- package/lib/engine-components/ShadowCatcher.js +1 -1
- package/lib/engine-components/SpectatorCamera.d.ts +1 -1
- package/lib/engine-components/SpectatorCamera.js +16 -8
- package/lib/engine-components/SpectatorCamera.js.map +1 -1
- package/lib/engine-components/SpriteRenderer.d.ts +2 -1
- package/lib/engine-components/SpriteRenderer.js +2 -1
- package/lib/engine-components/SpriteRenderer.js.map +1 -1
- package/lib/engine-components/Voip.d.ts +1 -1
- package/lib/engine-components/Voip.js +1 -1
- package/lib/engine-components/api.d.ts +1 -0
- package/lib/engine-components/api.js +1 -0
- package/lib/engine-components/api.js.map +1 -1
- package/lib/engine-components/codegen/components.d.ts +0 -1
- package/lib/engine-components/codegen/components.js +0 -1
- package/lib/engine-components/codegen/components.js.map +1 -1
- package/lib/engine-components/export/gltf/GltfExport.d.ts +5 -0
- package/lib/engine-components/export/gltf/GltfExport.js +5 -0
- package/lib/engine-components/export/gltf/GltfExport.js.map +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.d.ts +1 -0
- package/lib/engine-components/export/usdz/USDZExporter.js +1 -0
- package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
- package/lib/engine-components/particlesystem/ParticleSystem.d.ts +1 -1
- package/lib/engine-components/particlesystem/ParticleSystem.js +1 -1
- package/lib/engine-components/timeline/SignalAsset.d.ts +1 -1
- package/lib/engine-components/timeline/SignalAsset.js +1 -1
- package/lib/engine-components/ui/Button.d.ts +1 -1
- package/lib/engine-components/ui/Button.js +1 -1
- package/lib/engine-components/ui/Canvas.d.ts +1 -1
- package/lib/engine-components/ui/Canvas.js +1 -1
- package/lib/engine-components/ui/CanvasGroup.d.ts +1 -1
- package/lib/engine-components/ui/CanvasGroup.js +1 -1
- package/lib/engine-components/ui/EventSystem.d.ts +1 -1
- package/lib/engine-components/ui/EventSystem.js +1 -1
- package/lib/engine-components/ui/Image.d.ts +1 -1
- package/lib/engine-components/ui/Image.js +1 -1
- package/lib/engine-components/ui/InputField.d.ts +1 -1
- package/lib/engine-components/ui/InputField.js +1 -1
- package/lib/engine-components/ui/Outline.d.ts +1 -1
- package/lib/engine-components/ui/Outline.js +1 -1
- package/lib/engine-components/ui/Raycaster.d.ts +3 -2
- package/lib/engine-components/ui/Raycaster.js +3 -2
- package/lib/engine-components/ui/Raycaster.js.map +1 -1
- package/lib/engine-components/ui/RectTransform.d.ts +6 -0
- package/lib/engine-components/ui/RectTransform.js +6 -0
- package/lib/engine-components/ui/RectTransform.js.map +1 -1
- package/lib/engine-components/ui/SpatialHtml.d.ts +7 -0
- package/lib/engine-components/ui/SpatialHtml.js +7 -0
- package/lib/engine-components/ui/SpatialHtml.js.map +1 -1
- package/lib/engine-components/ui/Text.d.ts +2 -0
- package/lib/engine-components/ui/Text.js +2 -0
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/lib/engine-components/utils/LookAt.d.ts +2 -1
- package/lib/engine-components/utils/LookAt.js +2 -1
- package/lib/engine-components/utils/LookAt.js.map +1 -1
- package/lib/engine-components/web/CursorFollow.d.ts +1 -1
- package/lib/engine-components/web/CursorFollow.js +1 -1
- package/lib/engine-components/web/HoverAnimation.d.ts +1 -1
- package/lib/engine-components/web/HoverAnimation.js +1 -1
- package/lib/engine-components/web/ViewBox.d.ts +1 -1
- package/lib/engine-components/web/ViewBox.js +1 -1
- package/lib/engine-components/webxr/Avatar.js +2 -0
- package/lib/engine-components/webxr/Avatar.js.map +1 -1
- package/lib/engine-components/webxr/WebXR.js +18 -12
- package/lib/engine-components/webxr/WebXR.js.map +1 -1
- package/package.json +5 -5
- package/plugins/vite/poster-client.js +8 -1
- package/src/engine/codegen/register_types.ts +0 -2
- package/src/engine/debug/debug_console.ts +449 -1
- package/src/engine/engine_components.ts +4 -4
- package/src/engine/engine_context.ts +2 -0
- package/src/engine/engine_input.ts +7 -0
- package/src/engine/engine_license.ts +128 -17
- package/src/engine/engine_networking.ts +5 -5
- package/src/engine/engine_physics.ts +3 -3
- package/src/engine/engine_physics_rapier.ts +1 -1
- package/src/engine/engine_serialization_builtin_serializer.ts +1 -1
- package/src/engine/engine_utils.ts +23 -4
- package/src/engine/extensions/extensions.ts +30 -6
- package/src/engine/webcomponents/WebXRButtons.ts +15 -5
- package/src/engine/webcomponents/needle menu/needle-menu.ts +4 -5
- package/src/engine/webcomponents/needle-engine.ar-overlay.ts +6 -0
- package/src/engine/webcomponents/needle-engine.ts +2 -2
- package/src/engine/xr/NeedleXRSession.ts +114 -24
- package/src/engine/xr/TempXRContext.ts +12 -2
- package/src/engine/xr/usdz.ts +6 -1
- package/src/engine-components/AlignmentConstraint.ts +1 -2
- package/src/engine-components/Animation.ts +2 -0
- package/src/engine-components/Animator.ts +1 -0
- package/src/engine-components/AudioListener.ts +1 -1
- package/src/engine-components/AudioSource.ts +1 -1
- package/src/engine-components/BasicIKConstraint.ts +8 -0
- package/src/engine-components/BoxHelperComponent.ts +1 -0
- package/src/engine-components/Camera.ts +6 -3
- package/src/engine-components/CharacterController.ts +6 -2
- package/src/engine-components/Collider.ts +2 -2
- package/src/engine-components/Component.ts +5 -4
- package/src/engine-components/ContactShadows.ts +1 -1
- package/src/engine-components/DragControls.ts +5 -1
- package/src/engine-components/Gizmos.ts +2 -0
- package/src/engine-components/Joints.ts +20 -0
- package/src/engine-components/LODGroup.ts +1 -1
- package/src/engine-components/LookAtConstraint.ts +1 -1
- package/src/engine-components/Networking.ts +1 -1
- package/src/engine-components/OrbitControls.ts +1 -1
- package/src/engine-components/Renderer.ts +6 -0
- package/src/engine-components/RendererInstancing.ts +6 -3
- package/src/engine-components/SceneSwitcher.ts +17 -17
- package/src/engine-components/ShadowCatcher.ts +1 -1
- package/src/engine-components/SpectatorCamera.ts +22 -11
- package/src/engine-components/SpriteRenderer.ts +2 -1
- package/src/engine-components/Voip.ts +1 -1
- package/src/engine-components/api.ts +2 -1
- package/src/engine-components/codegen/components.ts +0 -1
- package/src/engine-components/export/gltf/GltfExport.ts +5 -0
- package/src/engine-components/export/usdz/USDZExporter.ts +1 -0
- package/src/engine-components/particlesystem/ParticleSystem.ts +1 -1
- package/src/engine-components/timeline/SignalAsset.ts +1 -1
- package/src/engine-components/ui/Button.ts +1 -1
- package/src/engine-components/ui/Canvas.ts +1 -1
- package/src/engine-components/ui/CanvasGroup.ts +1 -1
- package/src/engine-components/ui/EventSystem.ts +1 -1
- package/src/engine-components/ui/Image.ts +1 -1
- package/src/engine-components/ui/InputField.ts +1 -1
- package/src/engine-components/ui/Outline.ts +1 -1
- package/src/engine-components/ui/Raycaster.ts +3 -2
- package/src/engine-components/ui/RectTransform.ts +6 -0
- package/src/engine-components/ui/SpatialHtml.ts +7 -0
- package/src/engine-components/ui/Text.ts +2 -0
- package/src/engine-components/utils/LookAt.ts +2 -1
- package/src/engine-components/web/CursorFollow.ts +1 -1
- package/src/engine-components/web/HoverAnimation.ts +1 -1
- package/src/engine-components/web/ViewBox.ts +1 -1
- package/src/engine-components/webxr/Avatar.ts +4 -0
- package/src/engine-components/webxr/WebXR.ts +19 -11
- package/dist/generateMeshBVH.worker-mO20N_b8.js +0 -21
- package/dist/needle-engine.bundle-CiL59iU3.min.js +0 -1647
- package/dist/needle-engine.bundle-DzYZGJbS.umd.cjs +0 -1647
- package/dist/vendor-BKGa4GE0.min.js +0 -1116
|
@@ -261,7 +261,7 @@ export class SceneSwitcher extends Behaviour {
|
|
|
261
261
|
if (scene && !scene.hasUrl && scene.asset instanceof Object3D) {
|
|
262
262
|
GameObject.remove(scene.asset);
|
|
263
263
|
}
|
|
264
|
-
else if(scene instanceof Object3D) {
|
|
264
|
+
else if (scene instanceof Object3D) {
|
|
265
265
|
GameObject.remove(scene);
|
|
266
266
|
}
|
|
267
267
|
}
|
|
@@ -477,13 +477,13 @@ export class SceneSwitcher extends Behaviour {
|
|
|
477
477
|
* @returns a promise that resolves to true if the scene was loaded successfully
|
|
478
478
|
*/
|
|
479
479
|
select(index: number | string): Promise<boolean> {
|
|
480
|
-
if (debug) console.log("select", index);
|
|
480
|
+
if (debug) console.log("[SceneSwitcher] select", index);
|
|
481
481
|
|
|
482
482
|
if (typeof index === "object") {
|
|
483
483
|
// If a user tries to reference a scene object in a UnityEvent and invoke select(obj)
|
|
484
484
|
// Then the object will be serialized as a object { guid : ... } or with the index json pointer
|
|
485
485
|
// This case is not supported right now. Object references in the editor must not be scene references
|
|
486
|
-
console.warn("Switching to \"" + index + "\" might not work. Please either use an index or a AssetReference (not a scene reference)");
|
|
486
|
+
console.warn("[SceneSwitcher] Switching to \"" + index + "\" might not work. Please either use an index or a AssetReference (not a scene reference)");
|
|
487
487
|
}
|
|
488
488
|
|
|
489
489
|
if (typeof index === "string") {
|
|
@@ -595,7 +595,7 @@ export class SceneSwitcher extends Behaviour {
|
|
|
595
595
|
const current = this._currentScene;
|
|
596
596
|
this._currentScene = undefined;
|
|
597
597
|
if (current) {
|
|
598
|
-
if (debug) console.log("UNLOAD", current.url, "HasURL?: " + current.hasUrl)
|
|
598
|
+
if (debug) console.log("[SceneSwitcher] UNLOAD", current.url, "HasURL?: " + current.hasUrl)
|
|
599
599
|
const sceneListener = this.tryGetSceneEventListener(current.asset as any as Object3D);
|
|
600
600
|
if (sceneListener?.sceneClosing) {
|
|
601
601
|
const res = sceneListener.sceneClosing();
|
|
@@ -620,6 +620,7 @@ export class SceneSwitcher extends Behaviour {
|
|
|
620
620
|
const index = this._currentIndex = this.scenes?.indexOf(scene) ?? -1;
|
|
621
621
|
|
|
622
622
|
try {
|
|
623
|
+
if (debug) console.debug(`${Date.now()} [SceneSwitcher] Loading scene start: ${scene.url} (index: ${index})`);
|
|
623
624
|
this._currentlyLoadingScene = scene;
|
|
624
625
|
this._currentLoadingProgress = new ProgressEvent("progress", { loaded: 0, total: 1 });
|
|
625
626
|
|
|
@@ -632,7 +633,7 @@ export class SceneSwitcher extends Behaviour {
|
|
|
632
633
|
if (debug) {
|
|
633
634
|
const t01 = prog.loaded / prog.total;
|
|
634
635
|
const progressBarString = "[" + "=".repeat(Math.floor(t01 * 20)) + "-".repeat(20 - Math.floor(t01 * 20)) + "]";
|
|
635
|
-
console.debug(
|
|
636
|
+
console.debug(`${Date.now()} [SceneSwitcher] Loading scene progress: ${(t01 * 100).toFixed(1)} % ${progressBarString}`, scene.url);
|
|
636
637
|
}
|
|
637
638
|
this._currentLoadingProgress = prog;
|
|
638
639
|
this.dispatchEvent(prog);
|
|
@@ -646,15 +647,15 @@ export class SceneSwitcher extends Behaviour {
|
|
|
646
647
|
this._currentlyLoadingScene = undefined;
|
|
647
648
|
|
|
648
649
|
if (finishedEvt.defaultPrevented) {
|
|
649
|
-
if (debug) console.warn("Adding loaded scene prevented:", scene, finishedEvt);
|
|
650
|
+
if (debug) console.warn("[SceneSwitcher] Adding loaded scene prevented:", scene, finishedEvt);
|
|
650
651
|
return false;
|
|
651
652
|
}
|
|
652
653
|
if (!scene.asset) {
|
|
653
|
-
if (debug) console.warn("Failed loading scene:", scene);
|
|
654
|
+
if (debug) console.warn("[SceneSwitcher] Failed loading scene:", scene);
|
|
654
655
|
return false;
|
|
655
656
|
}
|
|
656
657
|
if (this._currentIndex === index) {
|
|
657
|
-
if (debug) console.log("ADD", scene.url);
|
|
658
|
+
if (debug) console.log("[SceneSwitcher] ADD", scene.url);
|
|
658
659
|
this._currentScene = scene;
|
|
659
660
|
|
|
660
661
|
|
|
@@ -683,7 +684,7 @@ export class SceneSwitcher extends Behaviour {
|
|
|
683
684
|
this.context.scene.background = skybox;
|
|
684
685
|
}
|
|
685
686
|
else if (debug) {
|
|
686
|
-
console.warn("SceneSwitcher
|
|
687
|
+
console.warn("[SceneSwitcher] Can't find skybox for scene " + scene.url);
|
|
687
688
|
}
|
|
688
689
|
}
|
|
689
690
|
|
|
@@ -713,10 +714,9 @@ export class SceneSwitcher extends Behaviour {
|
|
|
713
714
|
const res = sceneListener.sceneOpened(this);
|
|
714
715
|
if (res instanceof Promise) await res;
|
|
715
716
|
}
|
|
716
|
-
|
|
717
|
+
if (debug) console.debug(`${Date.now()} [SceneSwitcher] Loading scene finished: ${scene.url} (index: ${index})`);
|
|
717
718
|
const openedEvt = new CustomEvent<LoadSceneEvent>("scene-opened", { detail: { scene: scene, switcher: this, index: index } });
|
|
718
719
|
this.dispatchEvent(openedEvt);
|
|
719
|
-
|
|
720
720
|
this.sceneLoaded?.invoke(this);
|
|
721
721
|
return true;
|
|
722
722
|
}
|
|
@@ -772,7 +772,7 @@ export class SceneSwitcher extends Behaviour {
|
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
774
|
|
|
775
|
-
if (isLocalNetwork()) console.warn("Can not find scene: \"" + value + "\"", this)
|
|
775
|
+
if (isLocalNetwork()) console.warn("[SceneSwitcher] Can not find scene: \"" + value + "\"", this)
|
|
776
776
|
|
|
777
777
|
return couldNotLoadScenePromise;
|
|
778
778
|
}
|
|
@@ -913,7 +913,7 @@ class PreLoadScheduler {
|
|
|
913
913
|
*/
|
|
914
914
|
begin(delay: number) {
|
|
915
915
|
if (this._isRunning) return;
|
|
916
|
-
if (debug) console.log("Preload
|
|
916
|
+
if (debug) console.log("[SceneSwitcher] Preload scheduled", { delay });
|
|
917
917
|
this._isRunning = true;
|
|
918
918
|
let lastRoom: number = -10;
|
|
919
919
|
let searchDistance: number;
|
|
@@ -923,7 +923,7 @@ class PreLoadScheduler {
|
|
|
923
923
|
const interval = setInterval(() => {
|
|
924
924
|
if (this.allLoaded()) {
|
|
925
925
|
if (debug)
|
|
926
|
-
console.log("All scenes (pre-)loaded");
|
|
926
|
+
console.log("[SceneSwitcher] All scenes (pre-)loaded");
|
|
927
927
|
this.stop();
|
|
928
928
|
}
|
|
929
929
|
if (!this._isRunning) {
|
|
@@ -950,7 +950,7 @@ class PreLoadScheduler {
|
|
|
950
950
|
if (roomIndex < 0 || roomIndex >= array.length) return;
|
|
951
951
|
if (!this._loadTasks.some(t => t.index === roomIndex)) {
|
|
952
952
|
const scene = array[roomIndex];
|
|
953
|
-
if (debug) console.log("
|
|
953
|
+
if (debug) console.log("[SceneSwitcher] Schedule preload scene", { roomIndex, searchForward, lastRoom, currentIndex: this._switcher.currentIndex, tasks: this._loadTasks.length }, scene?.url);
|
|
954
954
|
new LoadTask(roomIndex, scene, this._loadTasks);
|
|
955
955
|
}
|
|
956
956
|
}, 200);
|
|
@@ -1019,10 +1019,10 @@ class LoadTask {
|
|
|
1019
1019
|
private async awaitLoading() {
|
|
1020
1020
|
if (this.asset && !this.asset.isLoaded()) {
|
|
1021
1021
|
if (debug)
|
|
1022
|
-
console.log("Preload start: " + this.asset.url, this.index);
|
|
1022
|
+
console.log("[SceneSwitcher] Preload start: " + this.asset.url, this.index);
|
|
1023
1023
|
await this.asset.preload();
|
|
1024
1024
|
if (debug)
|
|
1025
|
-
console.log("Preload finished: " + this.asset.url, this.index);
|
|
1025
|
+
console.log("[SceneSwitcher] Preload finished: " + this.asset.url, this.index);
|
|
1026
1026
|
}
|
|
1027
1027
|
|
|
1028
1028
|
const i = this.tasks.indexOf(this);
|
|
@@ -23,7 +23,7 @@ enum ShadowMode {
|
|
|
23
23
|
*
|
|
24
24
|
* Note that ShadowCatcher meshes are not raycastable by default; if you want them to be raycastable, change the layers in `onEnable()`.
|
|
25
25
|
*
|
|
26
|
-
* @summary
|
|
26
|
+
* @summary Creates a shadow mask or a light occluder
|
|
27
27
|
* @category Rendering
|
|
28
28
|
* @group Components
|
|
29
29
|
*/
|
|
@@ -8,7 +8,8 @@ import { PlayerView, ViewDevice } from "../engine/engine_playerview.js";
|
|
|
8
8
|
import { serializable } from "../engine/engine_serialization.js";
|
|
9
9
|
import { Context } from "../engine/engine_setup.js";
|
|
10
10
|
import type { ICamera } from "../engine/engine_types.js";
|
|
11
|
-
import { getParam } from "../engine/engine_utils.js";
|
|
11
|
+
import { DeviceUtilities, getParam } from "../engine/engine_utils.js";
|
|
12
|
+
import { PlayerState } from "../engine-components-experimental/networking/PlayerSync.js";
|
|
12
13
|
import { Camera } from "./Camera.js";
|
|
13
14
|
import { Behaviour, Component, GameObject } from "./Component.js";
|
|
14
15
|
import { OrbitControls } from "./OrbitControls.js";
|
|
@@ -35,7 +36,7 @@ const debug = getParam("debugspectator");
|
|
|
35
36
|
*
|
|
36
37
|
* Debug mode can be enabled with the URL parameter `?debugspectator`, which provides additional console output.
|
|
37
38
|
*
|
|
38
|
-
* @summary
|
|
39
|
+
* @summary Spectator camera for following other users
|
|
39
40
|
* @category Networking
|
|
40
41
|
* @group Components
|
|
41
42
|
*/
|
|
@@ -98,7 +99,7 @@ export class SpectatorCamera extends Behaviour {
|
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
/** Gets the local player's connection ID */
|
|
101
|
-
private get localId()
|
|
102
|
+
private get localId(): string {
|
|
102
103
|
return this.context.connection.connectionId ?? "local";
|
|
103
104
|
}
|
|
104
105
|
|
|
@@ -196,9 +197,8 @@ export class SpectatorCamera extends Behaviour {
|
|
|
196
197
|
*/
|
|
197
198
|
private isSupportedPlatform() {
|
|
198
199
|
const ua = window.navigator.userAgent;
|
|
199
|
-
const standalone = /Windows|MacOS/.test(ua);
|
|
200
200
|
const isHololens = /Windows NT/.test(ua) && /Edg/.test(ua) && !/Win64/.test(ua);
|
|
201
|
-
return
|
|
201
|
+
return DeviceUtilities.isDesktop() && !DeviceUtilities.isMobileDevice() && !isHololens;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
/**
|
|
@@ -268,11 +268,16 @@ export class SpectatorCamera extends Behaviour {
|
|
|
268
268
|
const previousRenderTarget = renderer.getRenderTarget();
|
|
269
269
|
let oldFramebuffer: WebGLFramebuffer | null = null;
|
|
270
270
|
|
|
271
|
+
|
|
271
272
|
const webglState = renderer.state as WebGLState & { bindXRFramebuffer?: Function };
|
|
272
273
|
|
|
274
|
+
|
|
273
275
|
// seems that in some cases, renderer.getRenderTarget returns null
|
|
274
276
|
// even when we're rendering to a headset.
|
|
275
|
-
if (!previousRenderTarget
|
|
277
|
+
if (!previousRenderTarget ||
|
|
278
|
+
// Prevent rendering if in XR - @TODO: check if we need to allow this for VR?
|
|
279
|
+
previousRenderTarget["isXRRenderTarget"] === true)
|
|
280
|
+
{
|
|
276
281
|
if (!renderer.state.bindFramebuffer || !webglState.bindXRFramebuffer)
|
|
277
282
|
return;
|
|
278
283
|
|
|
@@ -557,12 +562,18 @@ class SpectatorSelectionController {
|
|
|
557
562
|
for (const hit of hits) {
|
|
558
563
|
if (hit.distance < .2) continue;
|
|
559
564
|
const obj = hit.object;
|
|
560
|
-
|
|
561
|
-
const
|
|
565
|
+
// For WebXR
|
|
566
|
+
const state = PlayerState.getFor(obj);
|
|
567
|
+
let id = state?.owner;
|
|
568
|
+
// for SpectatorCamera
|
|
569
|
+
if (!id) {
|
|
570
|
+
const avatar = GameObject.getComponentInParent(obj, AvatarMarker);
|
|
571
|
+
id = avatar?.connectionId;
|
|
572
|
+
}
|
|
562
573
|
if (id) {
|
|
563
574
|
const view = this.context.players.getPlayerView(id);
|
|
564
575
|
this.spectator.target = view;
|
|
565
|
-
if (debug) console.log("spectate", id,
|
|
576
|
+
if (debug) console.log("spectate", id, state);
|
|
566
577
|
break;
|
|
567
578
|
}
|
|
568
579
|
}
|
|
@@ -633,7 +644,7 @@ class SpectatorCamNetworking {
|
|
|
633
644
|
this.context.connection.beginListen("spectator-request-follow", this._requestFollowMethod);
|
|
634
645
|
this.context.connection.beginListen(RoomEvents.JoinedRoom, this._joinedRoomMethod);
|
|
635
646
|
this.context.domElement.addEventListener("keydown", evt => {
|
|
636
|
-
if(!this.spectator.useKeys) return;
|
|
647
|
+
if (!this.spectator.useKeys) return;
|
|
637
648
|
if (evt.key === "f") {
|
|
638
649
|
this.onRequestFollowMe();
|
|
639
650
|
}
|
|
@@ -767,7 +778,7 @@ class SpectatorCamNetworking {
|
|
|
767
778
|
}
|
|
768
779
|
|
|
769
780
|
private _enforceFollowInterval: any;
|
|
770
|
-
|
|
781
|
+
|
|
771
782
|
/**
|
|
772
783
|
* Periodically retries following a user if the initial attempt failed
|
|
773
784
|
*/
|
|
@@ -262,7 +262,8 @@ export class SpriteData {
|
|
|
262
262
|
*
|
|
263
263
|
* - Example: https://engine.needle.tools/samples/spritesheet-animation
|
|
264
264
|
*
|
|
265
|
-
* @
|
|
265
|
+
* @summary Renders 2D images from a sprite sheet
|
|
266
|
+
* @category Rendering
|
|
266
267
|
* @group Components
|
|
267
268
|
*/
|
|
268
269
|
export class SpriteRenderer extends Behaviour {
|
|
@@ -14,7 +14,7 @@ const debugParam = getParam("debugvoip");
|
|
|
14
14
|
/**
|
|
15
15
|
* The Voice over IP component (VoIP) allows you to send and receive audio streams to other users in the same networked room.
|
|
16
16
|
* It requires a networking connection to be working (e.g. by having an active SyncedRoom component in the scene or by connecting to a room manually).
|
|
17
|
-
* @summary Voice over IP
|
|
17
|
+
* @summary Voice over IP for networked audio communication
|
|
18
18
|
* @category Networking
|
|
19
19
|
* @group Components
|
|
20
20
|
*/
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
export * from "./codegen/components.js";
|
|
38
|
-
export {
|
|
38
|
+
export { Collider } from "./Collider.js"; // export abstract type
|
|
39
|
+
export { Behaviour, Component, GameObject } from "./Component.js";
|
|
39
40
|
|
|
40
41
|
// We dont want to export everything in the extensions
|
|
41
42
|
export { ClearFlags } from "./Camera.js"
|
|
@@ -23,7 +23,6 @@ export { BoxHelperComponent } from "../BoxHelperComponent.js";
|
|
|
23
23
|
export { Camera } from "../Camera.js";
|
|
24
24
|
export { CharacterController } from "../CharacterController.js";
|
|
25
25
|
export { CharacterControllerInput } from "../CharacterController.js";
|
|
26
|
-
export { Collider } from "../Collider.js";
|
|
27
26
|
export { SphereCollider } from "../Collider.js";
|
|
28
27
|
export { BoxCollider } from "../Collider.js";
|
|
29
28
|
export { MeshCollider } from "../Collider.js";
|
|
@@ -30,6 +30,11 @@ export class GltfExportBox extends BoxHelperComponent {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
+
* GltfExport is a component that enables exporting selected 3D objects from the scene to the glTF format.
|
|
34
|
+
* You can specify whether to export in binary format (.glb) or JSON format (.gltf), and select specific objects to include in the export.
|
|
35
|
+
* The exported glTF file can be used in various 3D applications and engines that support the glTF standard.
|
|
36
|
+
*
|
|
37
|
+
* @summary Export selected 3D objects to glTF format
|
|
33
38
|
* @category Asset Management
|
|
34
39
|
* @group Components
|
|
35
40
|
*/
|
|
@@ -692,7 +692,7 @@ class ParticlesEmissionState implements EmissionState {
|
|
|
692
692
|
*
|
|
693
693
|
* Needle Engine uses [three.quarks](https://github.com/Alchemist0823/three.quarks) under the hood to handle particles.
|
|
694
694
|
*
|
|
695
|
-
* @summary
|
|
695
|
+
* @summary Handles the motion and rendering of many individual particles
|
|
696
696
|
* @category Rendering
|
|
697
697
|
* @group Components
|
|
698
698
|
*/
|
|
@@ -30,7 +30,7 @@ export class SignalReceiverEvent {
|
|
|
30
30
|
* Signals can be added to a signal track on a {@link PlayableDirector}
|
|
31
31
|
*
|
|
32
32
|
* @summary Receives signals and invokes reactions
|
|
33
|
-
* @category
|
|
33
|
+
* @category Animation and Sequencing
|
|
34
34
|
* @group Components
|
|
35
35
|
*/
|
|
36
36
|
export class SignalReceiver extends Behaviour {
|
|
@@ -64,7 +64,7 @@ class AnimationTriggers {
|
|
|
64
64
|
* Button is a UI component that can be clicked by the user to perform an action.
|
|
65
65
|
* It supports different visual states such as normal, highlighted, pressed, and disabled.
|
|
66
66
|
* You can customize the button's appearance using colors or animations for each state.
|
|
67
|
-
* @summary Button
|
|
67
|
+
* @summary UI Button that can be clicked to perform actions
|
|
68
68
|
* @category User Interface
|
|
69
69
|
* @group Components
|
|
70
70
|
*/
|
|
@@ -29,7 +29,7 @@ const debugLayout = getParam("debuguilayout");
|
|
|
29
29
|
* It defines the area where UI elements are rendered and manages their layout and rendering settings.
|
|
30
30
|
* Canvases can be set to render in world space or screen space (overlay or camera).
|
|
31
31
|
* Multiple canvases can exist in a scene, each with its own settings and hierarchy of UI elements.
|
|
32
|
-
* @summary
|
|
32
|
+
* @summary Root component for UI elements, managing layout and rendering settings
|
|
33
33
|
* @category User Interface
|
|
34
34
|
* @group Components
|
|
35
35
|
*/
|
|
@@ -10,7 +10,7 @@ import { type ICanvasGroup, type IHasAlphaFactor } from "./Interfaces.js";
|
|
|
10
10
|
* CanvasGroup is a UI component that allows you to control the transparency and interactivity of a group of UI elements.
|
|
11
11
|
* By adjusting the alpha property, you can fade in or out all child UI elements simultaneously.
|
|
12
12
|
* The interactable and blocksRaycasts properties let you enable or disable user interaction for the entire group.
|
|
13
|
-
* @summary
|
|
13
|
+
* @summary Group UI elements to control transparency and interactivity
|
|
14
14
|
* @category User Interface
|
|
15
15
|
* @group Components
|
|
16
16
|
*/
|
|
@@ -37,7 +37,7 @@ onInitialized((ctx) => {
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* The EventSystem is responsible for managing and dispatching input events to UI components within the scene.
|
|
40
|
-
* @summary
|
|
40
|
+
* @summary Manages and dispatches input events to UI components
|
|
41
41
|
* @category User Interface
|
|
42
42
|
* @group Components
|
|
43
43
|
*/
|
|
@@ -15,7 +15,7 @@ class Sprite {
|
|
|
15
15
|
* Image is a UI component that displays a sprite (2D image) in the user interface.
|
|
16
16
|
* You can set the image property to assign a texture to be displayed.
|
|
17
17
|
* The sprite can be customized with various properties such as color tinting and pixel density.
|
|
18
|
-
* @summary
|
|
18
|
+
* @summary Display a 2D image in the UI
|
|
19
19
|
* @category User Interface
|
|
20
20
|
* @group Components
|
|
21
21
|
*/
|
|
@@ -13,7 +13,7 @@ const debug = getParam("debuginputfield");
|
|
|
13
13
|
* InputField is a UI component that allows users to enter and edit text.
|
|
14
14
|
* It provides a text input area where users can type, delete, and modify text.
|
|
15
15
|
* The InputField supports placeholder text, events for value changes, and end edit actions.
|
|
16
|
-
* @summary Text
|
|
16
|
+
* @summary Text field for user input
|
|
17
17
|
* @category User Interface
|
|
18
18
|
* @group Components
|
|
19
19
|
*/
|
|
@@ -7,7 +7,7 @@ import { Behaviour } from "../Component.js";
|
|
|
7
7
|
/**
|
|
8
8
|
* Outline is a UI component that adds an outline effect to UI elements.
|
|
9
9
|
* You can customize the outline color and distance to create a visual border around the UI element.
|
|
10
|
-
* @summary
|
|
10
|
+
* @summary Add an outline effect to UI elements
|
|
11
11
|
* @category User Interface
|
|
12
12
|
* @group Components
|
|
13
13
|
*/
|
|
@@ -31,7 +31,7 @@ export abstract class Raycaster extends Behaviour {
|
|
|
31
31
|
/**
|
|
32
32
|
* A Raycaster that performs raycasting against its own GameObject.
|
|
33
33
|
*
|
|
34
|
-
* @category
|
|
34
|
+
* @category Interactivity
|
|
35
35
|
* @group Components
|
|
36
36
|
*/
|
|
37
37
|
export class ObjectRaycaster extends Raycaster {
|
|
@@ -75,7 +75,8 @@ export class ObjectRaycaster extends Raycaster {
|
|
|
75
75
|
/**
|
|
76
76
|
* A Raycaster that performs raycasting against UI elements (objects with a CanvasRenderer component).
|
|
77
77
|
*
|
|
78
|
-
* @
|
|
78
|
+
* @summary Raycaster for UI elements
|
|
79
|
+
* @category User Interface
|
|
79
80
|
* @group Components
|
|
80
81
|
*/
|
|
81
82
|
export class GraphicRaycaster extends ObjectRaycaster {
|
|
@@ -29,6 +29,12 @@ const tempVec = new Vector3();
|
|
|
29
29
|
const tempMatrix = new Matrix4();
|
|
30
30
|
const tempQuaternion = new Quaternion();
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* RectTransform is a component that defines a rectangle for UI layout.
|
|
34
|
+
* @summary UI Rectangle Transform
|
|
35
|
+
* @category User Interface
|
|
36
|
+
* @group Components
|
|
37
|
+
*/
|
|
32
38
|
export class RectTransform extends BaseUIComponent implements IRectTransform, IRectTransformChangedReceiver {
|
|
33
39
|
|
|
34
40
|
get parent() {
|
|
@@ -6,6 +6,13 @@ import { serializable } from '../../engine/engine_serialization.js';
|
|
|
6
6
|
import { getWorldRotation, setWorldRotationXYZ } from '../../engine/engine_three_utils.js';
|
|
7
7
|
import { Behaviour } from '../Component.js';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* SpatialHtml is a component that allows you to integrate HTML elements into a 3D scene.
|
|
11
|
+
* By specifying the ID of an existing HTML element, you can render it as a 3D object within the scene.
|
|
12
|
+
* @summary Render HTML elements as 3D objects in the scene
|
|
13
|
+
* @category User Interface
|
|
14
|
+
* @group Components
|
|
15
|
+
*/
|
|
9
16
|
export class SpatialHtml extends Behaviour {
|
|
10
17
|
|
|
11
18
|
@serializable()
|
|
@@ -13,7 +13,8 @@ import { Behaviour } from "../Component.js";
|
|
|
13
13
|
* It can also invert the forward direction and keep the up direction.
|
|
14
14
|
*
|
|
15
15
|
* @summary Makes the object look at a target object or the camera
|
|
16
|
-
* @category
|
|
16
|
+
* @category Everywhere Actions
|
|
17
|
+
* @category Interactivity
|
|
17
18
|
* @group Components
|
|
18
19
|
*/
|
|
19
20
|
export class LookAt extends Behaviour implements UsdzBehaviour {
|
|
@@ -15,7 +15,7 @@ const debug = getParam("debugcursor");
|
|
|
15
15
|
* - Example: [Look At Cursor sample](https://engine.needle.tools/samples/look-at-cursor-interactive-3d-header/). This sample combines the CursorFollow component with a LookAt component to create an interactive 3D header that looks at the cursor.
|
|
16
16
|
*
|
|
17
17
|
* @summary Makes the object follow the cursor position on screen
|
|
18
|
-
* @category
|
|
18
|
+
* @category Interactivity
|
|
19
19
|
* @group Components
|
|
20
20
|
* @component
|
|
21
21
|
*/
|
|
@@ -14,7 +14,7 @@ import { Behaviour } from "../Component.js";
|
|
|
14
14
|
* By default, a simple scale-up animation is used. You can customize the hover and idle animations by providing your own animation clips.
|
|
15
15
|
*
|
|
16
16
|
* @summary Hover Animation on Pointer Enter/Exit
|
|
17
|
-
* @category
|
|
17
|
+
* @category Interactivity
|
|
18
18
|
* @group Components
|
|
19
19
|
*/
|
|
20
20
|
@registerType
|
|
@@ -2,6 +2,7 @@ import { Mesh, Object3D, Quaternion, Vector3 } from "three";
|
|
|
2
2
|
|
|
3
3
|
import { AssetReference } from "../../engine/engine_addressables.js";
|
|
4
4
|
import { ObjectUtils, PrimitiveType } from "../../engine/engine_create_objects.js";
|
|
5
|
+
import { ViewDevice } from "../../engine/engine_playerview.js";
|
|
5
6
|
import { serializable } from "../../engine/engine_serialization_decorator.js";
|
|
6
7
|
import type { IGameObject } from "../../engine/engine_types.js";
|
|
7
8
|
import { getParam, PromiseAllWithErrors } from "../../engine/engine_utils.js";
|
|
@@ -55,10 +56,13 @@ export class Avatar extends Behaviour {
|
|
|
55
56
|
const marker = this.gameObject.addComponent(AvatarMarker)!;
|
|
56
57
|
marker.avatar = this.gameObject;
|
|
57
58
|
marker.connectionId = playerstate.owner;
|
|
59
|
+
|
|
60
|
+
this.context.players.setPlayerView(playerstate.owner, this.head?.asset, ViewDevice.Headset);
|
|
58
61
|
}
|
|
59
62
|
else if (this.context.connection.isConnected) console.error("No player state found for avatar", this);
|
|
60
63
|
// don't destroy the avatar when entering XR and not connected to a networking backend
|
|
61
64
|
else if (playerstate && !this.context.connection.isConnected) playerstate.dontDestroy = true;
|
|
65
|
+
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
onLeaveXR(_args: NeedleXREventArgs): void {
|
|
@@ -210,17 +210,25 @@ export class WebXR extends Behaviour {
|
|
|
210
210
|
showBalloonWarning("<a href=\"https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API\" target=\"_blank\">WebXR</a> only works on secure connections (https).");
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
213
|
+
// Showing the QuickLook button depends on whether we're on iOS or visionOS –
|
|
214
|
+
// on iOS we have AppClip support, so we don't need QuickLook button there,
|
|
215
|
+
// while on visionOS we use QuickLook for AR experiences for now (unless it happens to have WebXR support by then).
|
|
216
|
+
navigator.xr?.isSessionSupported("immersive-ar").catch(() => false).then((arSupported) => {
|
|
217
|
+
|
|
218
|
+
const isVisionOSFallback = DeviceUtilities.isVisionOS() && !arSupported;
|
|
219
|
+
|
|
220
|
+
if (this.useQuicklookExport || isVisionOSFallback) {
|
|
221
|
+
const existingUSDZExporter = GameObject.findObjectOfType(USDZExporter);
|
|
222
|
+
if (!existingUSDZExporter) {
|
|
223
|
+
// if no USDZ Exporter is found we add one and assign the scene to be exported
|
|
224
|
+
if (debug) console.log("WebXR: Adding USDZExporter");
|
|
225
|
+
this._usdzExporter = GameObject.addComponent(this.gameObject, USDZExporter);
|
|
226
|
+
this._usdzExporter.objectToExport = this.context.scene;
|
|
227
|
+
this._usdzExporter.autoExportAnimations = true;
|
|
228
|
+
this._usdzExporter.autoExportAudioSources = true;
|
|
229
|
+
}
|
|
222
230
|
}
|
|
223
|
-
}
|
|
231
|
+
});
|
|
224
232
|
|
|
225
233
|
this.handleCreatingHTML();
|
|
226
234
|
this.handleOfferSession();
|
|
@@ -360,7 +368,7 @@ export class WebXR extends Behaviour {
|
|
|
360
368
|
|
|
361
369
|
// Handle AR session root
|
|
362
370
|
if (args.xr.isAR) {
|
|
363
|
-
let sessionroot = GameObject.findObjectOfType(WebARSessionRoot);
|
|
371
|
+
let sessionroot = GameObject.findObjectOfType(WebARSessionRoot, this.context, false);
|
|
364
372
|
// Only create a WebARSessionRoot if none is in the scene already
|
|
365
373
|
if (!sessionroot) {
|
|
366
374
|
if (this.usePlacementReticle) {
|