Jumpy kinematic->dynamic collisions at small timesteps

kate
Posts: 41
Joined: Thu Jan 08, 2009 11:20 am
Location: London, UK
Contact:

Re: Jumpy kinematic->dynamic collisions at small timesteps

Post by kate »

Hi Danny,

Yeah, that sounds plausible. I don't really know much about the internals of Physics simulations (I leave that for the clever people :) ) but if that's how Baumgarte works, I guess it could explain what's happening (though I wonder why it's only happening on collisions involving kinematic objects; those between dynamic rigid bodies don't seem to have the same problem). I just hope there's a way round it...

Anyway, I've tweaked the Dynamica plugin to get a similar behaviour from it (what I'm working on is a Maya plugin too, so it seemed the easier option). I've added a "fixedTimeStep" attribute to the solver node (it shows up in the Extra Attributes section of the Attribute Editor), allowing the third parameter to the stepSimulation function to be changed interactively, and an "interpolate" attribute, which, when false, means that maxSubSteps is 0. Decreasing the fixed time step value, or switching "interpolate" off and increasing the substeps, causes the twitchy behaviour.

I'm wondering if perhaps it is something to do with the way the timing happens in Maya, as reducing the time steps to equivalent values in the demo code I hacked before worked OK (when I set maxSubSteps to something sensible!).

I've attached the modified Dynamica code and a test Maya scene (for Maya 2009). I've also attached, separately, some fixes I had to do to get the plugin to compile (though it could be just our build system being finnicky that meant it didn't work for me as-is).

Thanks,

Kate
Attachments
dynamicaCompileFixes.zip
Some changes to header paths that I needed to make it compile
(29.73 KiB) Downloaded 330 times
dynamicaTimeStepsTest.zip
Changes to allow fixedTimeStep to be set from an attribute, plus a test scene
(19.63 KiB) Downloaded 362 times
kate
Posts: 41
Joined: Thu Jan 08, 2009 11:20 am
Location: London, UK
Contact:

Re: Jumpy kinematic->dynamic collisions at small timesteps

Post by kate »

Little update - I've found that adding calls to rb->setInterpolationWorldTransform, rb->setInterpolationLinearVelocity and
rb->setInterpolationAngularVelocity after updating the kinematic objects' transforms (based on Ellon's suggestion in this thread - thanks Ellon :) ) seems to lessen the problem. We're still getting some slightly odd behaviour, but that could be other things...

K.
kate
Posts: 41
Joined: Thu Jan 08, 2009 11:20 am
Location: London, UK
Contact:

Re: Jumpy kinematic->dynamic collisions at small timesteps

Post by kate »

Just to finish this thread off - it looks like the odd behaviour I mentioned in my last post was due to the collision surfaces intersecting when the rigid bodies became dynamic, so I think we're sorted now!

Thanks for all the help and suggestions :D

Kate
Post Reply