Closed Joncom closed 11 years ago
So far I've seen Assertion:20 when trying to assign a property directly rather than using the corresponding set_xxx() method.
Try this (untested):
var gravity = new Box2D.b2Vec2( 0, 0 );
var world = new Box2D.b2World( gravity );
var bodyDef = new Box2D.b2BodyDef();
bodyDef.set_type( Box2D.b2_staticBody );
bodyDef.set_position(new Box2D.b2Vec2(0,0));
var body = world.CreateBody( bodyDef );
var shape = new Box2D.b2PolygonShape();
shape.SetAsBox(1,1);
var fixture = new Box2D.b2FixtureDef();
fixture.set_shape( shape );
body.CreateFixture( fixture );
Changing fixture.shape = shape;
to fixture.set_shape( shape );
fixed it. Thanks!
This code results in an Assertion: 20 error message. Not sure what I'm doing wrong, and the error message does not give much information.