Page 1 of 1

Problem with angular damping in javascript testbed

Posted: Wed Apr 17, 2013 4:56 pm
by Delta9
Hi iforce2D,

I can't seem to get angular damping to work with scenes running in the javascript testbed, even though it works perfectly in the editor. Is this a known problem/missing feature, or am I just doing something really stupid?

Thanks! :)

Re: Problem with angular damping in javascript testbed

Posted: Wed Apr 17, 2013 10:33 pm
by iforce2d
Looks like it is missing from the loader... sorry!
You can add this to the loadBodyFromRUBE function:

Code: Select all

var bd = new b2BodyDef(); //after this...
...
// add these:
if ( bodyJso.hasOwnProperty('angularDamping') )
    bd.angularDamping = bodyJso.angularDamping;
if ( bodyJso.hasOwnProperty('linearDamping') )
    bd.linearDamping = bodyJso.linearDamping;

Re: Problem with angular damping in javascript testbed

Posted: Wed Apr 17, 2013 11:49 pm
by Delta9
Wow, thanks for the quick answer. That did indeed solve it and I feel only slightly stupid :mrgreen:

Thank you also for a great editor, I've been having a lot of fun prototyping with it and would say it's well worth its money.