Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (577)
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 1943 times)
0 Members and 1 Guest are viewing this topic.
Offline Axeman

Senior Duke


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 Knight


Medals: 27
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 Duke


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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (49 views)
2014-10-17 03:59:02

Norakomi (38 views)
2014-10-16 15:22:06

Norakomi (31 views)
2014-10-16 15:20:20

lcass (34 views)
2014-10-15 16:18:58

TehJavaDev (65 views)
2014-10-14 00:39:48

TehJavaDev (65 views)
2014-10-14 00:35:47

TehJavaDev (54 views)
2014-10-14 00:32:37

BurntPizza (72 views)
2014-10-11 23:24:42

BurntPizza (43 views)
2014-10-11 23:10:45

BurntPizza (84 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org 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‑gaming.org
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!