Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (207)
games submitted by our members
Games in WIP (781)
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 2422 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: 139
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.

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Galdo (329 views)
2017-01-12 13:44:09

Archive (487 views)
2017-01-02 05:31:41

0AndrewShepherd0 (949 views)
2016-12-16 03:58:39

0AndrewShepherd0 (888 views)
2016-12-15 21:50:57

Lunch (1020 views)
2016-12-06 16:01:40

ral0r2 (1253 views)
2016-11-23 16:08:26

ClaasJG (1350 views)
2016-11-10 17:36:32

CoffeeChemist (1364 views)
2016-11-05 00:46:53

jay4842 (1448 views)
2016-11-01 19:04:52

theagentd (1231 views)
2016-10-24 17:51:53
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 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!