I'm new to game physics. Now it seems pretty obvious that there isn't
a best overall approach for making a 3d physics engine. But I don't
care about 3d, I just want a 2d physics engine. I am hoping that since
the computations are greatly reduced in 2d compared to 3d, speed is
not an issue and so there is a golden way of making a 2d physics
engine. I would like such an engine to handle things such as
simultaneous collisions/multiple contact points, resting contact,
friction, and joints.
To that end I was thinking of implementing Baraff's "Fast Contact ..."
paper. But I don't know how to detect collisions. Specifically, given
two polygonal rigid bodies with constant velocity and constant angular
velocity how do I detect if they will collide. If so, I need the time
of collision and moreover I need to compute the set of contact
points. And then of course LCP is used to resolve it.
Any comments/advice about pure 2d physics in general is
appreciated. The key is 2d so I don't need sophisticated stuff to make
things fast. I'm more concerned about correctness.
2d physics engines
Most physics concepts are similar for 2 or 3 dimensions, although most of the 2d cases can be more optimized.
You can have a look at this "2D box contact calculations" demo and source:
http://www.members.lycos.co.uk/olivierrenault/
You can have a look at this "2D box contact calculations" demo and source:
http://www.members.lycos.co.uk/olivierrenault/
-
- Posts: 5
- Joined: Sat Dec 10, 2005 2:51 am
I have been writing a 2D physics engine. You can get the source at:
http://sourceforge.net/projects/physics2d
http://sourceforge.net/projects/physics2d