Add examples/webxr/ single-html example. Linked in index.html. Improved the experimental hands.ts interface. Fixed issue with single-camera WebXR. Added valley.spz to assets.json, added to assets repo.

This commit is contained in:
Andreas Sundquist
2025-06-17 18:32:42 -07:00
committed by Andreas Sundquist
parent 6f08561914
commit d4f174677c
6 changed files with 144 additions and 9 deletions
+1 -4
View File
@@ -375,10 +375,7 @@ export class SparkRenderer extends THREE.Mesh {
// In WebXR mode we are called multiple times, once for each eye,
// so use their average to compute the sort center.
const cameras = renderer.xr.getCamera().cameras;
this.defaultCameras = [
cameras[0].matrixWorld,
cameras[1].matrixWorld,
];
this.defaultCameras = cameras.map((camera) => camera.matrixWorld);
this.defaultView.viewToWorld =
averageOriginToWorlds(this.defaultCameras) ?? new THREE.Matrix4();
}