# SAT Revisited

This topic is 2456 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello all!

I'm building a SAT test method for two polytopes, and got to wondering: why must I test every edge axis? If I have the center point of each polytope, why can't I project onto the axis formed by the line between the centers? Could anyone give me an example of why that wouldn't always work?

Sorry if that's a silly question, but I have the most amazing migraine right now and thinking hurts.

##### Share on other sites
Ha, never mind! Migrane went away and I figured out why shortly later.

Just for anyone else who might have the same question:

If you rotate each shape around its center you can end up with false positives. Same if one shape is significantly smaller and very close.

##### Share on other sites
Even though you already figured it out, here is my favorite example for people who read this thread in the future. It's just two boxes close to each other but offset:

##### Share on other sites
What you can do, is use the direction vector from one center to the other to discard faces unlikely to form a separating axis.

Say if you have convex shapes A and B with d as the vector (Center of B) - (Center of A) any faces from A with a Normal 'Na' for which Dot(d,Na) is a negative number and any faces of B with Normal 'Nb' for which Dot(d,Nb) is a positive number can be discarded as separating axis.

This is something I came up with as an optimization so use it at your own risk , the logic is that you are discarding the faces that are farther away from a posible instersection point and keeping the ones that are closest to it.

1. 1
2. 2
3. 3
Rutin
27
4. 4
khawk
14
5. 5

• 11
• 11
• 23
• 10
• 9
• ### Forum Statistics

• Total Topics
633648
• Total Posts
3013113
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!