Page 1 of 1

b2body

Posted: Sun Nov 17, 2013 3:11 am
by vkreal
Whats the best way to recreate/clone a sensor b2Body into a dynamic b2Body? one idea just destroy old body and recreate dynamic with same properties.

Thanks!

Re: b2body

Posted: Sun Nov 17, 2013 5:28 am
by iforce2d
If the body is very simple, just creating a new one might be ok, but if it has a lot of fixtures it would probably be easier to use the b2dJson utility. See the section about replicating bodies: http://www.iforce2d.net/b2djson/#replicating You could then change the type to dynamic after it has been replicated.