Closed MarkusTieche closed 10 years ago
You should be able to use the same shape. You need to update the bounding geometry and other internal shape properties though. See http://www.html5gamedevs.com/topic/5692-p2-increase-body-radius-over-time/
Thanks for your help, tested and works. Here the fiddle
http://jsfiddle.net/inkfood/u7TC4/
Thanks for all the work and effort you put into this physics engine, just to let you know.
Cool!
Is it possible to change simple shapes on the fly?
Something like, create a poly shape with
shape.body.addPolygon({}, polyShape);
, just a regular poly which represents a rectangle. Access the points later on, manipulate and update them. Is this possible? And do you think it would decrease Ram usage and garbage collection by reusing simple shapes, instead of recreating them each time? Just like an object pool?