Hello all! I am new to this form and Box2D... which seams so far to be a Godsend. I am working on a 2D game engine and have been for a while. At first, I tried to do my own physics, which was coming allong well, but I got burnt out and finally relised how much work it really is to make a good physics engine (more than I wanted to "re-invent"). So, I started looking for good physics engines out there... after going through a few, I finnally found Box2D, and I must say I am pretty excited to start using it.
I have noticed a few things reading the documentation however, and I have a few questions about Box2D:
1) In the docs, under the "bullet" section, it says Box2D will "sweep" objects if they are in bullet mode. Does this mean that Box2D will actually test the object multiple times along different positions until it reaches the destination?
2) What collision detection method does Box2D use? Is it simple "AABB interesect -> Do more complicated testing -> Get contact information -> Send evernts", or is it mathimatically based? The reason I ask the above two questions is because I ran across this guy on the GameDev.net forms that was really bright, and he had this idea (I don't know if it is his) on how to do collision detection extremely efficiently where the objects can have any number of sides (but must still be convex), and have a velocity vector of ANY speed and still acurately report collisions. It is a great way to handle collisions because it is so simple and because the objects can be traveling at insane speeds and still acurately report collision with any object, including a line (no tunneling). Also, because of the nature of the process, you automatically get resolution normals, and easily get contact points.
I am posting the zip file with the documentation, source, and GLUT examples that he gave me. If this would be benifical to Box2D it should be fairly easy to implement. I just was wondering whats going on because I don't know, and was looking for feedback on my ideas.
Here is the file: http://uk.geocities.com/olivier_rebellion/Polycolly.zip
The collision process (incase you don't want to download the zip):
Basically, all you do is "flatten" the two polygons you are testing against, and see of the "flattened" polygons intersect based on there "projected" positions. This is acomplished with very simple fast math, and, as I said above, works with extreme volocities WITH OUT SWEEPING, because all you do is include the objects velocities into the equation, and the equation basically EXTRUDES the objects along the velocity vector.
I have noticed a few things reading the documentation however, and I have a few questions about Box2D:
1) In the docs, under the "bullet" section, it says Box2D will "sweep" objects if they are in bullet mode. Does this mean that Box2D will actually test the object multiple times along different positions until it reaches the destination?
2) What collision detection method does Box2D use? Is it simple "AABB interesect -> Do more complicated testing -> Get contact information -> Send evernts", or is it mathimatically based? The reason I ask the above two questions is because I ran across this guy on the GameDev.net forms that was really bright, and he had this idea (I don't know if it is his) on how to do collision detection extremely efficiently where the objects can have any number of sides (but must still be convex), and have a velocity vector of ANY speed and still acurately report collisions. It is a great way to handle collisions because it is so simple and because the objects can be traveling at insane speeds and still acurately report collision with any object, including a line (no tunneling). Also, because of the nature of the process, you automatically get resolution normals, and easily get contact points.
I am posting the zip file with the documentation, source, and GLUT examples that he gave me. If this would be benifical to Box2D it should be fairly easy to implement. I just was wondering whats going on because I don't know, and was looking for feedback on my ideas.
Here is the file: http://uk.geocities.com/olivier_rebellion/Polycolly.zip
The collision process (incase you don't want to download the zip):
Basically, all you do is "flatten" the two polygons you are testing against, and see of the "flattened" polygons intersect based on there "projected" positions. This is acomplished with very simple fast math, and, as I said above, works with extreme volocities WITH OUT SWEEPING, because all you do is include the objects velocities into the equation, and the equation basically EXTRUDES the objects along the velocity vector.