summaryrefslogtreecommitdiff
path: root/2d/_collisions/polygon_polygon.html
diff options
context:
space:
mode:
Diffstat (limited to '2d/_collisions/polygon_polygon.html')
-rw-r--r--2d/_collisions/polygon_polygon.html5
1 files changed, 5 insertions, 0 deletions
diff --git a/2d/_collisions/polygon_polygon.html b/2d/_collisions/polygon_polygon.html
index 9826ba4..ace2c17 100644
--- a/2d/_collisions/polygon_polygon.html
+++ b/2d/_collisions/polygon_polygon.html
@@ -312,6 +312,8 @@
<span class="code_comment">// the collision later.</span>
ProjectionResult getProjection(Vector2* vertices, <span class="code_keyword">int</span> numVertices, <span class="code_keyword">Vector2</span> axis) {
ProjectionResult pr;
+ pr.minVertex = vertices[0];
+ pr.maxVertex = vertices[0];
<span class="code_keyword">float32</span> min = axis.dot(vertices[0]);
<span class="code_keyword">float32</span> max = min;
@@ -404,6 +406,9 @@ IntersectionResult getIntersection(ConvexPolygon* first, ConvexPolygon* second)
<h2 id='live_example'>
Live Example of Intersection Detection
</h2>
+ <p>
+ A live example of Separating Axis Theorem running with full collision detection. Click <button id='reverse_gravity'>this button</button>to reverse gravity on the simualtion.
+ </p>
<div class="opengl_canvas_container">
<canvas id="gl_canvas" width="800" height="600"></canvas>
<button id="gl_canvas_play" class="play_button">