Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
441 changes: 441 additions & 0 deletions examples/assets/scripts/first-person-teleport.mjs

Large diffs are not rendered by default.

Binary file removed examples/assets/splats/angel.sog
Binary file not shown.
Binary file added examples/assets/splats/statues/angel-kneeling.sog
Binary file not shown.
Binary file not shown.
Binary file added examples/assets/splats/statues/angel.sog
Binary file not shown.
Binary file added examples/assets/splats/statues/massa.sog
Binary file not shown.
Binary file added examples/assets/splats/statues/narcissus.sog
Binary file not shown.
Binary file added examples/assets/splats/statues/st-peter.sog
Binary file not shown.
Binary file added examples/assets/splats/statues/trumpet.sog
Binary file not shown.
Binary file added examples/assets/textures/dark-tiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions examples/first-person-teleport.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
<title>PlayCanvas Web Components - First Person Teleport</title>
<script type="importmap">
{
"imports": {
"playcanvas": "../node_modules/playcanvas/build/playcanvas.mjs"
}
}
</script>
<script type="module" src="../dist/pwc.mjs"></script>
<link rel="stylesheet" href="css/example.css">
</head>
<body>
<pc-app antialias="false" stencil="false">
<!-- Assets -->
<pc-asset src="../node_modules/playcanvas/scripts/esm/xr-controllers.mjs"></pc-asset>
<pc-asset src="../node_modules/playcanvas/scripts/esm/xr-navigation.mjs"></pc-asset>
<pc-asset src="../node_modules/playcanvas/scripts/esm/xr-session.mjs"></pc-asset>
<pc-asset src="assets/scripts/first-person-teleport.mjs"></pc-asset>
<pc-asset src="assets/splats/statues/angel.sog" id="angel"></pc-asset>
<pc-asset src="assets/splats/statues/angel-kneeling.sog" id="angel-kneeling"></pc-asset>
<pc-asset src="assets/splats/statues/angel-with-candlestick.sog" id="angel-with-candlestick"></pc-asset>
<pc-asset src="assets/splats/statues/massa.sog" id="massa"></pc-asset>
<pc-asset src="assets/splats/statues/narcissus.sog" id="narcissus"></pc-asset>
<pc-asset src="assets/splats/statues/st-peter.sog" id="st-peter"></pc-asset>
<pc-asset src="assets/splats/statues/trumpet.sog" id="trumpet"></pc-asset>
<pc-asset src="assets/skies/sepulchral-chapel-rotunda-4k.webp" id="rotunda"></pc-asset>
<pc-asset src="assets/textures/dark-tiles.png" id="dark-tiles"></pc-asset>
<pc-material id="ground" diffuse-map="dark-tiles"></pc-material>
<!-- Scene -->
<pc-scene>
<!-- Camera (with XR support) -->
<pc-entity name="camera root">
<pc-entity name="camera" position="0 1.7 10">
<pc-camera fov="60"></pc-camera>
<pc-scripts>
<pc-script name="firstPersonTeleport"></pc-script>
</pc-scripts>
</pc-entity>
<pc-scripts>
<pc-script name="xrControllers"></pc-script>
<pc-script name="xrNavigation"></pc-script>
<pc-script name="xrSession"></pc-script>
</pc-scripts>
</pc-entity>
<!-- Light -->
<pc-entity name="light" position="2 2 -2" rotation="45 -35 0">
<pc-light type="directional"></pc-light>
</pc-entity>
<!-- Ground -->
<pc-entity name="ground" scale="25 25 25">
<pc-render type="plane" material="ground"></pc-render>
</pc-entity>
<!-- Statues -->
<pc-entity name="statues">
<pc-entity name="angel" position="-5 0.7 0" rotation="180 0 0">
<pc-splat asset="angel"></pc-splat>
</pc-entity>
<pc-entity name="angel-kneeling" position="5 0.7 0" rotation="0 0 180">
<pc-splat asset="angel-kneeling"></pc-splat>
</pc-entity>
<pc-entity name="angel-with-candlestick" position="-5 0.7 5" rotation="180 0 0">
<pc-splat asset="angel-with-candlestick"></pc-splat>
</pc-entity>
<pc-entity name="massa" position="0 0.7 -5" rotation="0 0 180">
<pc-splat asset="massa"></pc-splat>
</pc-entity>
<pc-entity name="narcissus" position="5 0.7 5" rotation="180 0 0">
<pc-splat asset="narcissus"></pc-splat>
</pc-entity>
<pc-entity name="st-peter" position="5 0.7 -5" rotation="0 0 180">
<pc-splat asset="st-peter"></pc-splat>
</pc-entity>
<pc-entity name="trumpet" position="-5 0.7 -5" rotation="0 0 180">
<pc-splat asset="trumpet"></pc-splat>
</pc-entity>
</pc-entity>
</pc-scene>
</pc-app>
<script type="module" src="js/example.mjs"></script>
</body>
</html>
1 change: 1 addition & 0 deletions examples/js/example-list.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const examples = [
{ name: 'Basic Shapes', path: 'basic-shapes.html' },
{ name: 'Basic Particles', path: 'basic-particles.html' },
{ name: 'Car Configurator', path: 'car-configurator.html' },
{ name: 'First Person Teleport', path: 'first-person-teleport.html' },
{ name: 'FPS Controller', path: 'fps-controller.html' },
{ name: 'Gaussian Splatting', path: 'splat.html' },
{ name: 'GLB Loader', path: 'glb.html' },
Expand Down
2 changes: 1 addition & 1 deletion examples/splat.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<pc-asset src="../node_modules/playcanvas/scripts/esm/xr-controllers.mjs"></pc-asset>
<pc-asset src="../node_modules/playcanvas/scripts/esm/xr-navigation.mjs"></pc-asset>
<pc-asset src="../node_modules/playcanvas/scripts/esm/xr-session.mjs"></pc-asset>
<pc-asset src="assets/splats/angel.sog" id="angel"></pc-asset>
<pc-asset src="assets/splats/statues/angel.sog" id="angel"></pc-asset>
<pc-asset src="assets/skies/sepulchral-chapel-rotunda-4k.webp" id="rotunda"></pc-asset>
<!-- Scene -->
<pc-scene>
Expand Down