Skip to content

Commit 53332e3

Browse files
authored
Update README.md
1 parent aa7d92e commit 53332e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,9 @@ We obtained point A and now we have a complete triangle of three points in total
436436
437437
![The GJK simplex after completing the 3rd stage of evolution](https://cloud.githubusercontent.com/assets/1294454/25315541/3a5b5ad6-285f-11e7-8783-3acb05b25606.jpg "The GJK simplex after completing the 3rd stage of evolution")
438438
439-
Now that we have all three points for a complete triangle (a full 2-simplex), the only task that's left is to test if the Origin is really contained inside that triangle. In other words, if the resulting simplex surround the Origin from all sides, then the whole Minkowski sum also does surround the Origin as well and it follows that there was a collision between two initial shapes. The most straightforward way to test if a point is inside a triangle (the Origin is a point at zero), is to do a bunch of dot product operations.
439+
Now that we have all three points for a complete triangle (a full 2-simplex), the only task that's left is to test if the Origin is really contained inside that triangle. In other words, if our resulting simplex surrounds the Origin from all sides, then the whole Minkowski sum also does surround the Origin as well, and it follows that there was a collision between two initial shapes. The most straightforward way to test if a point is inside a triangle (the Origin is a point at zero), is to do a bunch of dot product operations.
440440
441-
For each edge (each side) of a triangle you need two things: a normal vector (a perpendicular) towards Origin and a vector from opposite vertex to the Origin. Then you check if dot product of the two vectors is positive (greater than zero)...
441+
For each edge (each side) of a triangle you need two things: a normal vector (a perpendicular) to that side towards Origin and a vector from opposite vertex to the Origin. Then you check if dot product of the two vectors is positive (greater than zero)...
442442
443443
WORK IN PROGRESS, to be continued soom... A live demo of GJK in a 2D-space and a video of GJK in action coming up )
444444

0 commit comments

Comments
 (0)