[Solved] physics: Assert fail when creating shapes.
Posted: Wed Dec 15, 2010 1:27 am
Hello.
I'm getting assert failures when creating love.physics shapes. I tried to figure out the reason, but I failed. The fact is, the failure appears when trying to create a very small or thin shapes.
My test script:
This code ends up with message:
Different sizes produce different results. Here are some tests (values are attributes of newRectangleShape):
x2 = 3, y2 = 3 -> Passes
x2 = 10, y2 = 1 -> Assertion `d.y >= 0.0f' failed.
x2 = 1, y2 = 10 -> Assertion `d.x >= 0.0f' failed.
The newPolygonShape function showed me similar behaviour, though I didn't test it.
I suppose Box2D has no problem with tiny shapes, the documentation itself shows a 1 unit wide shapes.
Does anybody know what's going on here?
~An00biS
Edit: marked 'resolved'
I'm getting assert failures when creating love.physics shapes. I tried to figure out the reason, but I failed. The fact is, the failure appears when trying to create a very small or thin shapes.
My test script:
Code: Select all
function love.load()
local world = love.physics.newWorld(0,0,100,100,0,0,true);
local ground = love.physics.newBody(world, 0, 0, 0, 0);
local top = love.physics.newRectangleShape(ground, 10, 10, 2, 2, 0);
end
function love.draw()
love.graphics.printf("Loaded OK", 100, 100, 100);
end
Code: Select all
love: modules/physics/box2d/Source/Collision/Shapes/b2PolygonShape.cpp:224: b2PolygonShape::b2PolygonShape(const b2ShapeDef*): Assertion `d.x >= 0.0f' failed.
Aborted (core dumped)
x2 = 3, y2 = 3 -> Passes
x2 = 10, y2 = 1 -> Assertion `d.y >= 0.0f' failed.
x2 = 1, y2 = 10 -> Assertion `d.x >= 0.0f' failed.
The newPolygonShape function showed me similar behaviour, though I didn't test it.
I suppose Box2D has no problem with tiny shapes, the documentation itself shows a 1 unit wide shapes.
Does anybody know what's going on here?
~An00biS
Edit: marked 'resolved'