Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Tokamak Open Source
PostPosted: Wed May 23, 2007 8:42 am 
Offline

Joined: Sun Jul 03, 2005 4:06 pm
Posts: 757
Location: Bellevue, WA
From what I saw in comarissons this was actually one of the fastest engines. So quite cool that it is open source now.

http://sourceforge.net/projects/tokamakp/


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 23, 2007 1:16 pm 
Offline

Joined: Sat Jan 06, 2007 9:34 am
Posts: 11
Is this the result of competition?


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 23, 2007 1:36 pm 
Offline

Joined: Sat Aug 19, 2006 11:52 pm
Posts: 198
If only the source was at least somewhat commented!


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 23, 2007 9:20 pm 
Offline

Joined: Fri Jul 01, 2005 5:29 am
Posts: 323
Location: Irvine
Do you know what algorithms it uses?


Top
 Profile  
 
 Post subject: Re: Tokamak Open Source
PostPosted: Wed Jan 02, 2008 7:32 pm 
Offline

Joined: Wed Jan 02, 2008 6:10 am
Posts: 3
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


Top
 Profile  
 
 Post subject: Re: Tokamak Open Source
PostPosted: Wed Jan 02, 2008 8:31 pm 
Offline

Joined: Wed Aug 03, 2005 7:29 pm
Posts: 6
Welcome back to the physics world David. I think many people here were inspired by Tokamak when it first came out. I know I was.


Top
 Profile  
 
 Post subject: Re: Tokamak Open Source
PostPosted: Wed Jan 02, 2008 10:53 pm 
Offline

Joined: Fri Jul 01, 2005 5:29 am
Posts: 323
Location: Irvine
Hi David,

I'm sure many people here would be curious to know about the inner workings of Tokamak.

Quote:
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 actually did implement this algorithm a while back using a quad-edge data structure. However this method doesn't give an accurate distance or penetration depth. How did you manage to use it to create contact points?

Cheers,
Erin


Top
 Profile  
 
 Post subject: Re: Tokamak Open Source
PostPosted: Thu Jan 03, 2008 7:57 pm 
Offline

Joined: Wed Jan 02, 2008 6:10 am
Posts: 3
Erin Catto wrote:
Hi David,

I'm sure many people here would be curious to know about the inner workings of Tokamak.

Quote:
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 actually did implement this algorithm a while back using a quad-edge data structure. However this method doesn't give an accurate distance or penetration depth. How did you manage to use it to create contact points?

Cheers,
Erin


Hi Erin,

This could well be the case. In my test, arbitrary convex mesh colliding with ground box mesh (not as a primitive) seem fine but convex mesh colliding with each other do sometime penetrate. I checked the algorithm, and I can understand it and everything seems good on paper. It would be easy to write a test program and set up the fail case and follow the code to see why it fails, when I find the time :).

David


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group