Read here:
http://developer.coronalabs.com/content/game-edition-physics-bodies
Note that these polygon coordinates must be defined in clockwise order, and the resulting shape must be convex-only.
Read here:
http://developer.coronalabs.com/content/game-edition-physics-bodies
Note that these polygon coordinates must be defined in clockwise order, and the resulting shape must be convex-only.
hej Rob,
thanks for your answer, but what do i have to do, to get a polygonal shape to be added as a physics body the right way? When I add a shape to the addBody my simulator crashes like GamingStudio17 stated - even if I am using a display.newRect as a base.
Thanks
Phil
Read here:
http://developer.coronalabs.com/content/game-edition-physics-bodies
Note that these polygon coordinates must be defined in clockwise order, and the resulting shape must be convex-only.
Dear Rob Miracle or any other Corona Staff, it is your bug so please fix it. If it used to work it should still work. I have the same problem in my code and I find it disturbing that i have to lose countless hours to investigate why the simulator crashes in the first place. If you don’t want to support this anymore you should at least throw an error message and not let the simulator just crash. The code I use is very big and was really hard to track down the issue and figure out what exactly causes the simulator crash.
To those that say that this is a Box2d issue - IT IS NOT!!!
Box2d can do lines just fine. Please do not try to point fingers just so that you can pass on the responsibility.
Following is a copy/paste from Box2d manual. As a C++ user of Box2d I know exactly what Box2d can do and cannot do.
4.5 Edge Shapes
Edge shapes are line segments. These are provided to assist in making a free-form static environment for your game. A major limitation of edge shapes is that they can collide with circles and polygons but not with themselves. The collision algorithms used by Box2D require that at least one of two colliding shapes have volume. Edge shapes have no volume, so edge-edge collision is not possible.
Please let me know if you need something else from me in order to fix this BUG. I will be more then happy to provide any help you need.
Hi all,
This bug should be fixed in one of the next daily builds (check the release notes to confirm). It was related to the “setDebugErrorsEnabled()” function, which is now disabled by default. We may revisit this again later, but for now (from the appropriate build) you should no longer get errors/crashing in the Simulator.
Best regards,
Brent
Will this be fixed in terms of making physics work like before and actually be able to create line shapes or just making the corona simulator not crash ?
You should still be able to create line shapes, although I (and the documentation) do not suggest doing so. The Simulator crash was being caused by the debugging function.
If it used to work (AND IT USED TO WORK) it should still work in the future. You should not break functionality. Creating line physics is very important.
I agree with vladu!
My library Corona SVG Level Builder - http://levelbuilder.karnakgames.com - which is still selling fine, now is completely broken, because the main feature that I announce is creating physical bezier paths and “complex terrains”:
It’s been working since 2011. Now, I have users asking for a refund because the library is simply broken with the last update and people doesn’t want to rollback Corona versions, they want to use the newer versions!
And this is not an “invalid use” of Box2D. Even in the test bed there is an example that uses edges/lines as screen boundaries, not rectangles.
EDIT: Setting physics.setDebugErrorsEnabled(false) didn’t work. Still broken. It’s not my code, since my library has been being used since 2011, there is also a blog post in the Corona blog about the library (from 2011), so the code always worked fine until last month.
This should be fixed in Build 1242 and above. Please test your software and let me know.
Brent
Thank you Brent! Everything seams to work again as it should.
Thank you, it is working now! No refunds were made
Dear Rob Miracle or any other Corona Staff, it is your bug so please fix it. If it used to work it should still work. I have the same problem in my code and I find it disturbing that i have to lose countless hours to investigate why the simulator crashes in the first place. If you don’t want to support this anymore you should at least throw an error message and not let the simulator just crash. The code I use is very big and was really hard to track down the issue and figure out what exactly causes the simulator crash.
To those that say that this is a Box2d issue - IT IS NOT!!!
Box2d can do lines just fine. Please do not try to point fingers just so that you can pass on the responsibility.
Following is a copy/paste from Box2d manual. As a C++ user of Box2d I know exactly what Box2d can do and cannot do.
4.5 Edge Shapes
Edge shapes are line segments. These are provided to assist in making a free-form static environment for your game. A major limitation of edge shapes is that they can collide with circles and polygons but not with themselves. The collision algorithms used by Box2D require that at least one of two colliding shapes have volume. Edge shapes have no volume, so edge-edge collision is not possible.
Please let me know if you need something else from me in order to fix this BUG. I will be more then happy to provide any help you need.
Hi all,
This bug should be fixed in one of the next daily builds (check the release notes to confirm). It was related to the “setDebugErrorsEnabled()” function, which is now disabled by default. We may revisit this again later, but for now (from the appropriate build) you should no longer get errors/crashing in the Simulator.
Best regards,
Brent
Will this be fixed in terms of making physics work like before and actually be able to create line shapes or just making the corona simulator not crash ?
You should still be able to create line shapes, although I (and the documentation) do not suggest doing so. The Simulator crash was being caused by the debugging function.
If it used to work (AND IT USED TO WORK) it should still work in the future. You should not break functionality. Creating line physics is very important.
I agree with vladu!
My library Corona SVG Level Builder - http://levelbuilder.karnakgames.com - which is still selling fine, now is completely broken, because the main feature that I announce is creating physical bezier paths and “complex terrains”:
It’s been working since 2011. Now, I have users asking for a refund because the library is simply broken with the last update and people doesn’t want to rollback Corona versions, they want to use the newer versions!
And this is not an “invalid use” of Box2D. Even in the test bed there is an example that uses edges/lines as screen boundaries, not rectangles.
EDIT: Setting physics.setDebugErrorsEnabled(false) didn’t work. Still broken. It’s not my code, since my library has been being used since 2011, there is also a blog post in the Corona blog about the library (from 2011), so the code always worked fine until last month.
This should be fixed in Build 1242 and above. Please test your software and let me know.
Brent
Hello there Im trying to run my line with physics drawing function in Build 1242 but it is crashing it still with this
Terminal: line 9: 456 Segmentation fault: 11 “$path/Corona Simulator.app/Contents/MacOS/Corona Simulator” $*
logout
What am I doing wrong?
function runTouch(e)
if e.phase == “began” then
prev_x = e.x
prev_y = e.y
elseif e.phase == “moved” then
lines[line_number] = display.newLine(prev_x, prev_y, e.x, e.y)
lines[line_number]:setColor(255,255,255)
lines[line_number].width = line_width
group:insert(lines[line_number])
dist_x = e.x - prev_x
dist_y = e.y - prev_y
– Add a physics body that’s a flat polygon that follows each segment of the line
physics.addBody(lines[line_number], “static”, { density = 1, friction = 1, bounce = .1, shape = {0, 0, dist_x, dist_y, 0, 0} } )
prev_x = e.x
prev_y = e.y
line_number = line_number + 1
elseif e.phase == “ended” then
end
end
Runtime:addEventListener(“touch”, runTouch)