-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCollisionSample.html
More file actions
86 lines (74 loc) · 3.45 KB
/
Copy pathCollisionSample.html
File metadata and controls
86 lines (74 loc) · 3.45 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Collision Sample — CNA Samples</title>
<meta name="description" content="Microsoft's XNA 4.0 Collision Sample, ported to C++ with CNA and playable in the browser.">
<link rel="stylesheet" href="assets/site.css">
</head>
<body>
<header class="site-head">
<div class="wrap">
<h1 class="site-title"><a href="index.html">CNA Samples</a></h1>
</div>
</header>
<main class="wrap">
<div class="detail-head">
<h1>Collision Sample</h1>
</div>
<p class="origin">Ported from Microsoft's XNA 4.0 <em>Collision Sample</em>.</p>
<p class="sample-source">
<a href="https://github.com/libcna/cna-samples/tree/develop/samples/CollisionSample">Source for this sample on GitHub ↗</a>
</p>
<img class="shot" src="assets/img/collision.png" width="853" height="480"
alt="A white wireframe viewing frustum with animated boxes, sphere and triangle above a black grid.">
<a class="play" href="CollisionSample/CollisionSample_cna_samples.html" target="_blank" rel="noopener">Play ▸</a>
<p class="play-note">Opens in a new tab. Click the canvas so it receives keyboard input.</p>
<nav class="pager pager-before-about" aria-label="Sample navigation">
<a class="prev" href="Bounce.html"><span class="label">Previous</span>Bounce</a>
<a class="next" href="PerPixelCollision.html"><span class="label">Next</span>Per-Pixel Collision</a>
</nav>
<section>
<h2>About this sample</h2>
<p>
This sample tests containment and intersection between animated triangles, spheres and boxes
and five primary shapes: a sphere, ray, viewing frustum, axis-aligned box and oriented box.
Most primary shapes have white outlines, while the ray is red. Moving shapes turn red
when contained, yellow when intersecting and light gray when disjoint.
</p>
<p>
Switch groups to see each collision pairing. The camera can rotate, zoom and change between
perspective and orthographic projection; the simulation can also be paused and stepped.
</p>
</section>
<section>
<h2>Controls</h2>
<table class="controls">
<tr><th>Action</th><th>Keyboard</th><th>Gamepad</th></tr>
<tr><td>Next shape group</td><td><kbd>G</kbd></td><td>A</td></tr>
<tr><td>Rotate camera</td><td>Arrow keys</td><td>Right stick</td></tr>
<tr><td>Zoom</td><td><kbd>+</kbd> / <kbd>−</kbd></td><td>Triggers</td></tr>
<tr><td>Perspective / orthographic</td><td><kbd>P</kbd> / <kbd>O</kbd>, or <kbd>B</kbd> to toggle</td><td>B</td></tr>
<tr><td>Reset camera</td><td><kbd>Home</kbd></td><td>Y</td></tr>
<tr><td>Pause</td><td><kbd>Space</kbd></td><td>X</td></tr>
<tr><td>Step while paused</td><td><kbd>[</kbd> / <kbd>]</kbd></td><td>—</td></tr>
<tr><td>Exit</td><td><kbd>Esc</kbd> or close the tab</td><td>Back</td></tr>
</table>
<p>On touchscreens, tap to change groups, drag to rotate and pinch to zoom.</p>
</section>
<nav class="pager">
<a class="prev" href="Bounce.html"><span class="label">Previous</span>Bounce</a>
<a class="next" href="PerPixelCollision.html"><span class="label">Next</span>Per-Pixel Collision</a>
</nav>
</main>
<footer class="site-foot">
<div class="wrap">
<p>
The sample is Microsoft's, published under the Microsoft Permissive License.
The C++ port and the WebAssembly build are CNA.
</p>
</div>
</footer>
</body>
</html>