General discussion about the R.U.B.E editor
Delta9
Posts: 2 Joined: Wed Apr 17, 2013 4:48 pm
Post
by Delta9 » Wed Apr 17, 2013 4:56 pm
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!
iforce2d
Site Admin
Posts: 861 Joined: Sat Dec 22, 2012 7:20 pm
Post
by iforce2d » Wed Apr 17, 2013 10:33 pm
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;
Delta9
Posts: 2 Joined: Wed Apr 17, 2013 4:48 pm
Post
by Delta9 » Wed Apr 17, 2013 11:49 pm
Wow, thanks for the quick answer. That did indeed solve it and I feel only slightly stupid
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.