Skip to content

Commit 86bcf1e

Browse files
committed
Add XR support for shapes example
1 parent 4d6e066 commit 86bcf1e

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

examples/basic-shapes.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
<pc-app>
1919
<!-- Assets -->
2020
<pc-asset id="camera-controls" src="../node_modules/playcanvas/scripts/esm/camera-controls.mjs" preload></pc-asset>
21+
<pc-asset id="xr-controllers" src="../node_modules/playcanvas/scripts/esm/xr-controllers.mjs" preload></pc-asset>
22+
<pc-asset id="xr-navigation" src="../node_modules/playcanvas/scripts/esm/xr-navigation.mjs" preload></pc-asset>
2123
<!-- Materials -->
2224
<pc-material id="crimson" diffuse="crimson"></pc-material>
2325
<pc-material id="mediumseagreen" diffuse="mediumseagreen"></pc-material>
@@ -27,16 +29,22 @@
2729
<pc-material id="lightgrey" diffuse="lightgrey"></pc-material>
2830
<!-- Scene -->
2931
<pc-scene>
30-
<!-- Camera -->
31-
<pc-entity name="camera" position="-3 2 -3.25">
32-
<pc-camera></pc-camera>
33-
<pc-scripts>
34-
<pc-script name="cameraControls" attributes='{
32+
<!-- Camera (with XR support) -->
33+
<pc-entity name="camera root">
34+
<pc-entity name="camera" position="-3 2 -3.25">
35+
<pc-camera></pc-camera>
36+
<pc-scripts>
37+
<pc-script name="cameraControls" attributes='{
3538
"enableFly": false,
3639
"enablePan": false,
3740
"focusPoint": [0, 0.5, 0],
3841
"pitchRange": [-90, 0]
39-
}'></pc-script>
42+
}'></pc-script>
43+
</pc-scripts>
44+
</pc-entity>
45+
<pc-scripts>
46+
<pc-script name="xrControllers"></pc-script>
47+
<pc-script name="xrNavigation"></pc-script>
4048
</pc-scripts>
4149
</pc-entity>
4250
<!-- Key Light (Spot) -->

0 commit comments

Comments
 (0)