Re: [Algorithms] Rigid Body impulses
Brought to you by:
vexxed72
From: <Pau...@sc...> - 2004-03-16 09:50:51
|
On 15/03/2004 21:29:31 gdalgorithms-list-admin wrote: > If I dampen the angular momentum things get considerably worse because it > relies > on a very tiny amount of momentum to fall off a single point in the first > place (i.e. > collapse on to it's side), damping it results in it endless hovering on one > vertex. > Unless there is some trick to this? All I'm doing is AngMom *= 0.999 each > frame. You don't need to dampen anything imo. I have whiten very stable impulse based rigid body systems with no damping at all. True you might need to implement some sort of sleeping algorithm to banish floating point errors but this doesn't sound like its your problem. You should be able to get a system without any damping or sleeping in which you can stably stack a pyramid of 28 cubes - just like one of the tokomak demos :-) (you have to change a compile flag on the stacking demo to see their pyramid*). > > When you say it jumps from corner to corner what are you describing? > > It lands on one vertex. The collision impulses push it upwards and it starts > to rotate, > but its pushed a little too hard and rotates a little bit too much so that > instead of > falling on its side, it often lands on the next vertex along, and then repeats. That defiantly sounds like a bad inertia tensor to me. Inertia tensor of a box is (equal sides): ix = iy = iz = 1/6 * (M*L^2) M = mass, L = side length (from http://maths.dur.ac.uk/~dma0cvj/mathphys/supplements/supplement2/supplement2.html) At the risk of describing something which is obvious - you need to invert this and store it, then once per frame you need to transform this to world space by R = rotation matrix RT = transposed rotation matrix IW = inertia tensor in world space IB = inertia tensor in body space IW = R * IB * RT Then when you come to compute angular acceleration aa = IW * (impulse x contact lever) Cheers, Paul. *) Annoyingly you can't disable sleeping in tokamak, so it won't be a totally fair comparison between your stuff, but it'll give you an idea. ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify pos...@sc... This footnote also confirms that this email message has been checked for all known viruses. ********************************************************************** SCEE 2004 |