Closed danzel closed 8 years ago
Maybe this is done on purpose, but it seems a bit weird.
new p2.Box().type == p2.Shape.CONVEX
It looks a bit like we are trying to set the type to box here: https://github.com/schteppe/p2.js/blob/master/src/shapes/Box.js#L53 but then we pass the options up to Convex which overwrites them: https://github.com/schteppe/p2.js/blob/master/src/shapes/Convex.js#L109
Maybe change the second line to options.type = options.type || Shape.Convex?
options.type = options.type || Shape.Convex
Not on purpose! Thanks for the heads up. The supplied options object should probably not be mutated this way either, but that's a different problem...
Maybe this is done on purpose, but it seems a bit weird.
new p2.Box().type == p2.Shape.CONVEX
It looks a bit like we are trying to set the type to box here: https://github.com/schteppe/p2.js/blob/master/src/shapes/Box.js#L53 but then we pass the options up to Convex which overwrites them: https://github.com/schteppe/p2.js/blob/master/src/shapes/Convex.js#L109
Maybe change the second line to
options.type = options.type || Shape.Convex
?