I need to get the body of a fixture but when I call the fixture.GetBody() function, It returns this error: Object # has no method 'GetBody';
here is the code:
var bodyDef = new b2BodyDef;
var bouncebodyDef = new b2BodyDef;
bouncebodyDef.type = b2Body.b2_dynamicBody;
var bounceDef = new b2FixtureDef;
bounceDef.density = 1;
bounceDef.body = bouncebodyDef;
bounceDef.friction = 1;
bounceDef.restitution = 0;
bounceDef.userData = 'bounce';
bounceDef.shape = new b2PolygonShape;
bounceDef.shape.SetAsBox(1.5, 0.1);
bouncebodyDef.position.Set(2, 12);
bouncebodyDef.angle = (3.4);
world.CreateBody(bouncebodyDef).CreateFixture(bounceDef);
console.log(bounceDef.GetBody());
Thanks for any suggestions.