Hello All!
During this holiday I decided to revisit the world of physics programming and come across many different new physics engine and physics research. And hence I come to find this website about physics discussion. Doing a search for "Tokamak" come up with a few mentions. I admit I have neglect Tokamak for awhile. In case you are interested, When I released Tokamak back in 2003, I didn't have the skill and connection to take it commercial. I tried a few leads (that's another story), but I quickly returned to the world of game development doing mostly graphics stuffs. What I can say is that it is not easy to maintain a hobby project when you have a full time job and a family (and other hobbies)!
The dynamic solver hasn't change since back in 2003. It is what you can call sequential impulse. But the naive implementation of this doesn't work very well. Simply calculating impulse for zero-relative velocity alone will allow the joints position to drift. So there is an extra term in the impulse calculation for drift correction. The correction impulse should be such that it produce a relative velocity that reduce the displacement "in a frame step time". All the impulses for one body are accumulated before applying.
There is a hack for reducing the number of iteration require for maintaining stable stacking. Tokamak builds a directed graph of contacts pointing away from the gravity vector. And contact constraints are solve in that order.
The other things that was important was putting bodies to sleep. That's mostly done by considering the history of the body's state. I don't remember the exact procedure but I am happy to take a look at it again if anyone is interested.
For collision detection, everything is pretty standard except for narrow-phase convex meshes. I used the algorithm describe in this paper
http://www.cs.hku.hk/research/techreps/ ... 005-01.pdf (Collision Detection of Convex Polyhedra Based on Duality Transformation). The algorithm seems sound, but for some reason I found very few people know or discuss about it. I think there's some numerical issue with my implementation so sometime it can fail.
That's off the top of my head. I am happy to talk about anything which I haven't cover. My view on physics engine is pretty much represented what Tokamak does: the important of speed, memory and stability far outweigh any accuracy concerns. I do intend on going back to work on Tokamak, for my own personal use if not for anything else.
Cheers,
David