Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  SAT as an allround tool?  (Read 3110 times)
0 Members and 1 Guest are viewing this topic.
Offline Axeman

Senior Devvie

Medals: 7

« Posted 2012-05-04 17:49:26 »

I´m thinking about ways to use SAT ("Separating axis theorem") and when and how it´s useful. Since the test check every possible non-collision (and if there isn´t one, there has to be a collision), it´s hard to get any information. We just know "there is a collision" and how deep the objects are intersecting. Now, say I want to get a physical collision respons and bounce two objects against each other, I would have to resort to additional test, for example a line segment intersection test, get a normal and then a reflection vector... But I can do this without resorting to a SAT test first..?

So basically I´m wondering: Is SAT useful in cases where the collision respons require more information than a "minimum translation vector"? If it is, am I missing something or do you resort to additional test, like "line segment intersection" test?
Offline delt0r

JGO Wizard

Medals: 143
Exp: 18 years

Computers can do that?

« Reply #1 - Posted 2012-05-09 10:37:43 »

I don't think i have ever bothered using the SAT. I normally just use simple bounding geometry where collisions are easy to work out. Say a set of spheres/circles.

I have no special talents. I am only passionately curious.--Albert Einstein
Offline Axeman

Senior Devvie

Medals: 7

« Reply #2 - Posted 2012-05-29 21:29:52 »

Just wanted to clear up a loose end about my SAT question just so nobody is confused by my former ignorance: No further intersection testing is necessary, as the minimum translation vector can be used as the normal when calculating collision respons (like objects boucing off each other). There... Now I can let it go. For now... Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Danny02
« Reply #3 - Posted 2012-05-29 21:50:57 »

Now, say I want to get a physical collision respons and bounce two objects against each other, ...

... I would just use one of the many physic libarys out there.
Offline gouessej
« Reply #4 - Posted 2012-07-03 21:16:45 »

I use bounding volumes like delt0r. You can perform a posteriori collision checks or a priori collision checks. In my case, I plan to do that:
- I compute the bounding volume of the whole tarjectory between 2 instants for each object (if it has not moved, I directly use its bounding volume)
- I compute the intersection of all bounding volumes (called "sweep tests" in the litterature) by pair of objects (if one of them has not moved, I have nothing else to do to check if there is a collision)
- if there is an intersection, I use the equation of the movement of each object to know in which time interval it might have happened
- if the intersection of both time intervals is not empty, I take its smallest value for the time parameter and I consider there is an intersection
- use the physical data about both objects to compute the response if any

This is enough for a first person shooter with moving objects including helicopters. A posteriori collision checks are not enough in my case because a bullet can move a lot in 10 ms (about 3.5m); if I perform checks only at discrete times, I will obviously miss some collisions. Using a ray or a segment instead of the bounding box at discrete times is enough when one of the objects involved is not moving but if it is, using 2 rays may give false collisions.

There are some interesting physics libraries in Java but if you don't understand the concepts, they are useless.

SAT is very easy to use in 2D as potential separating axes are very easy to find on convex polygons.

Julien Gouesse | Personal blog | Website | Jogamp
Pages: [1]
  ignore  |  Print  

EgonOlsen (78 views)
2018-06-10 19:43:48

EgonOlsen (58 views)
2018-06-10 19:43:44

EgonOlsen (78 views)
2018-06-10 19:43:20

DesertCoockie (260 views)
2018-05-13 18:23:11

nelsongames (158 views)
2018-04-24 18:15:36

nelsongames (157 views)
2018-04-24 18:14:32

ivj94 (899 views)
2018-03-24 14:47:39

ivj94 (162 views)
2018-03-24 14:46:31

ivj94 (812 views)
2018-03-24 14:43:53

Solater (175 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!