I'm getting the following error when raycasting:
I'm raycasting the following bodies:
The error occurs when the raycasting hits the last body.
The errors seems the same as this one:
http://www.box2d.org/forum/viewtopic.php?f=4&t=4559
Code:
Assertion failed: (0.0f <= lower && lower <= input.maxFraction), function RayCast, file ../Box2D/Collision/Shapes/b2PolygonShape.cpp, line 253.
I'm raycasting the following bodies:
Code:
b2Def.polygon.SetAsBox(400/30, 50/30);
b2Def.body.position.x = 400/30;
b2Def.body.position.y = 550/30;
b2Def.body.type = b2Body.b2_staticBody;
b2Def.body.fixedRotation = true;
b2Def.body.allowSleep = true;
mBody = mPhysicsWorld.CreateBody(b2Def.body);
b2Def.fixture.shape = b2Def.polygon;
b2Def.fixture.friction = 0;
b2Def.fixture.density = 0;
b2Def.fixture.restitution = 0;
mBody.CreateFixture(b2Def.fixture);
bodies.push(mBody);
b2Def.polygon.SetAsBox(1000/30, 50/30);
b2Def.body.position.x = 500/30;
b2Def.body.position.y = 50/30;
b2Def.body.type = b2Body.b2_staticBody;
b2Def.body.fixedRotation = true;
b2Def.body.allowSleep = true;
mBody = mPhysicsWorld.CreateBody(b2Def.body);
b2Def.fixture.shape = b2Def.polygon;
b2Def.fixture.friction = 0;
b2Def.fixture.density = 0;
b2Def.fixture.restitution = 0;
mBody.CreateFixture(b2Def.fixture);
bodies.push(mBody);
b2Def.polygon.SetAsBox(400/30, 200/30);
b2Def.body.position.x = 1500/30;
b2Def.body.position.y = 550/30;
b2Def.body.type = b2Body.b2_staticBody;
b2Def.body.fixedRotation = true;
b2Def.body.allowSleep = true;
mBody = mPhysicsWorld.CreateBody(b2Def.body);
b2Def.fixture.shape = b2Def.polygon;
b2Def.fixture.friction = 0;
b2Def.fixture.density = 0;
b2Def.fixture.restitution = 0;
mBody.CreateFixture(b2Def.fixture);
bodies.push(mBody);
b2Def.body.position.x = 400/30;
b2Def.body.position.y = 550/30;
b2Def.body.type = b2Body.b2_staticBody;
b2Def.body.fixedRotation = true;
b2Def.body.allowSleep = true;
mBody = mPhysicsWorld.CreateBody(b2Def.body);
b2Def.fixture.shape = b2Def.polygon;
b2Def.fixture.friction = 0;
b2Def.fixture.density = 0;
b2Def.fixture.restitution = 0;
mBody.CreateFixture(b2Def.fixture);
bodies.push(mBody);
b2Def.polygon.SetAsBox(1000/30, 50/30);
b2Def.body.position.x = 500/30;
b2Def.body.position.y = 50/30;
b2Def.body.type = b2Body.b2_staticBody;
b2Def.body.fixedRotation = true;
b2Def.body.allowSleep = true;
mBody = mPhysicsWorld.CreateBody(b2Def.body);
b2Def.fixture.shape = b2Def.polygon;
b2Def.fixture.friction = 0;
b2Def.fixture.density = 0;
b2Def.fixture.restitution = 0;
mBody.CreateFixture(b2Def.fixture);
bodies.push(mBody);
b2Def.polygon.SetAsBox(400/30, 200/30);
b2Def.body.position.x = 1500/30;
b2Def.body.position.y = 550/30;
b2Def.body.type = b2Body.b2_staticBody;
b2Def.body.fixedRotation = true;
b2Def.body.allowSleep = true;
mBody = mPhysicsWorld.CreateBody(b2Def.body);
b2Def.fixture.shape = b2Def.polygon;
b2Def.fixture.friction = 0;
b2Def.fixture.density = 0;
b2Def.fixture.restitution = 0;
mBody.CreateFixture(b2Def.fixture);
bodies.push(mBody);
The error occurs when the raycasting hits the last body.
The errors seems the same as this one:
http://www.box2d.org/forum/viewtopic.php?f=4&t=4559