mirror of
https://github.com/storytold/spark.git
synced 2026-10-14 23:52:59 +00:00
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:
committed by
Andreas Sundquist
parent
6f08561914
commit
d4f174677c
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user