Commit Graph

10 Commits

Author SHA1 Message Date
Pablo Ariel Mayobre (Positive07)
93fa069474 Removed unnecessary statements 2017-11-05 19:46:31 -03:00
Pablo Ariel Mayobre (Positive07)
1bee6093e6 Fixed error in do_line
Add start and end arguments to unpack
2017-11-05 19:38:18 -03:00
Pablo Ariel Mayobre (Positive07)
14aa6450b9 Use a for loop instead of table.insert
To increase performance (by @pfirsich)
2017-11-05 19:14:43 -03:00
Pablo Ariel Mayobre (Positive07)
0645bae6a9 Reuse the edge table in closest_edge
Avoid unnecessary allocations of tables
2017-11-05 19:08:07 -03:00
Pablo Ariel Mayobre (Positive07)
002fee0bd6 Reuse the simplex table
Always use the same simplex table
2017-11-05 18:53:03 -03:00
Matthias Richter
9d432517b7 Hackish fix for 97ae2d89 and parent.
A clean solution needs more investigation, but this will work for now.
2013-09-04 10:20:19 +02:00
Matthias Richter
97ae2d8928 Fix commit adfe9a9a breaking EPA. 2013-09-03 17:13:27 +02:00
Matthias Richter
adfe9a9a5d Issue #25 (2): Collision detection sometimes hangs.
Sometimes the expanding polytype algorithm takes a long time to
terminate, e.g. in situations like this:

 .-.
: +-:-+
 '-'  |
  |   |
  +---+

The issue here is that the EPA adds vertices very close to each other,
which makes the separation distance change very slowly. If this is the
case, consider the current separation distance as approximately correct
and continue.
2013-08-13 15:34:58 +02:00
Matthias Richter
0dc1e6c719 Issue #25: Division by 0 in CircleShape:support().
support(A,B, 1,0) returns 0,0 when A and B are touching in a vertex of
both A and B AND this vertex is on the right of A's center (in direction
(1,0)), e.g. this situation:

    .---.
 .-.| B |
: A x---'
 '-'

Then: support(A,B, 1,0) = A:support(1,0) - B:support(-1,0) = x - x = 0

Since CircleShape:support(dx,dy) normalizes dx,dy this will result in a
division by 0 error in the subsequent execution of the GJK algorithm.

An early out with result 'not colliding' (in accordance to the other
edge cases) prevents this error.
2013-08-13 15:13:25 +02:00
Matthias Richter
ce4b8011da Collision detection using GJK/EPA instead of SAT.
The Gilbert–Johnson–Keerthi collision detection algorithm is
significantly faster than collision detection using the separating axis
theorem. GJK can only determine whether two shapes collide, but not the
penetration vector. The expanding polytype algorithm can use information
from GJK to quickly find the required vector.
2012-05-20 16:50:35 +02:00