Fix Fixture:getShape(), for real this time.

All the Memoizer stuff was pointless: when you create a Fixture, it clones the b2Shape, so there was never going to be a memoized Shape to find. And cloning the Shape is incorrect as well, since you should able to modify the Shape retrieved through getShape and have it affect the Fixture. Everything's much simpler now.
This commit is contained in:
Bill Meltsner
2012-02-05 19:22:33 -05:00
parent 6cde0169b6
commit 20f4e567b3
11 changed files with 23 additions and 39 deletions
+7 -5
View File
@@ -37,18 +37,20 @@ namespace physics
namespace box2d
{
Shape::Shape()
: shape(NULL)
: shape(NULL), own(false)
{
}
Shape::Shape(b2Shape * shape)
: shape(shape)
Shape::Shape(b2Shape * shape, bool own)
: shape(shape), own(own)
{
Memoizer::add(shape, this);
if (own)
Memoizer::add(shape, this);
}
Shape::~Shape()
{
if (shape)
if (shape && own)
{
Memoizer::remove(shape);
delete shape;