-
Notifications
You must be signed in to change notification settings - Fork 5
/
ammo-blaster.html
40 lines (37 loc) · 1.95 KB
/
ammo-blaster.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1">
<title>Ball Blaster in Ammo Physics Engine. Press any key to shoot.</title>
<script src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js"></script>
<script src="https://cdn.jsdelivr.net/gh/c-frame/aframe-physics-system@v4.2.2/dist/aframe-physics-system.js"></script>
<script src="../../desktop-vr-controller/dist/desktop-vr-controller.js"></script>
<script src="../index.js"></script>
<link rel="stylesheet" href="../../../styles.css">
</head>
<body>
<div class="text-overlay">
<p>Ball blaster with Ammo Physics. Left Blaster is directly in the scene. Press space to shoot.</p>
<p>Right blaster is a child of the right hand - only visible when in VR. Right trigger to shoot.</p>
</div>
<a class="code-link"
target="_blank"
href="https://github.com/diarmidmackenzie/aframe-components/blob/master/components/ball-blaster/test/ammo-blaster.html">
view code
</a>
<a-scene background="color:#88f" physics="driver: ammo; debug: true;">
<a-entity position='-0.5 1.5 -1' rotation='20 -20 0' ball-blaster="velocity: 5; debug: true"></a-entity>
<a-entity id="right-hand"
hand-controls="hand: right"
position="0.4 1.4 -0.5"
rotation="45 0 0"
desktop-vr-controller>
<a-entity controller-ball-blaster="debug: true" rotation="-80 0 0" position="-0.02 0 -0.01"></a-entity>
</a-entity>
<!--floor-->
<a-box color="green" position="0 -0.5 0" width="100" depth="100" ammo-body="type: static" ammo-shape></a-box>
</a-scene>
</body>
</html>