Skip to content

Commit

Permalink
VR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
willeastcott committed Nov 21, 2024
1 parent 636d3df commit a58c588
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions examples/positional-sound.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<pc-entity name="camera" position="0 1 7">
<pc-camera clear-color="#8099e6"></pc-camera>
<pc-listener></pc-listener>
<pc-scripts>
<pc-script name="vr"></pc-script>
</pc-scripts>
</pc-entity>
<!-- Light -->
<pc-entity name="light" rotation="45 0 0">
Expand Down
6 changes: 3 additions & 3 deletions examples/scripts/vr.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ export default class Vr extends Script {
});

this.app.xr.input.on('remove', (inputSource) => {
const entity = this.controllers.get(inputSource);
if (entity) {
entity.destroy();
const controller = this.controllers.get(inputSource);
if (controller) {
controller.entity.destroy();
this.controllers.delete(inputSource);
}
});
Expand Down
2 changes: 1 addition & 1 deletion examples/splat.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"zoomMax": 3
}'
></pc-script>
<pc-script name="vr"></pc-script>
</pc-scripts>
<pc-script name="vr"></pc-script>
</pc-entity>
<!-- Statue -->
<pc-entity name="statue" position="0 1 0" rotation="0 45 0">
Expand Down

0 comments on commit a58c588

Please sign in to comment.