-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad collision polygons of some objects #348
Comments
|
|
First of all, keep in mind that all polygons have to be convex. That already makes a single form for a bowling pin impossible. I believe you can assign a mass per polygon,but e.g. Cactus doesn't do that. You're correct: in order to make physics calculations doable, objects need a certain thickness, otherwise, a small object may move through without the algorithms detecting a collision. BowlingPin: the polygons are defined such that the behavior of the pin matches reality. The top had to be of different size and different density. |
Be careful when fixing this: you may inadvertently break levels. |
Ugh, the wedge thing really annoys me. Box2D really doesn't let us have a freaking simple triangle? Wow, that's a huge disappointment. :-( Maybe the documentation should be checked out to see if Box2D is really that limited. Ah, ok the bowling pin makes sense. But the polygons should at least not have that weird gap. |
New CardboardBox polygons:
(hopefully this is large enough) New Hammer polygons:
I wasn't able to fix |
I have read the Box2D manual and there's no indication that simple triangles are disallowed. In fact, there's even an example of a triangle in the manual https://github.com/erincatto/box2d/blob/ecatto/manual/docs/manual.md, so I guess wedges actually can be perfect triangles, so there's no need for that weird 4th point. I can also confirm this in testing. |
Some objects have bad collision polygons that need improvement. The points of collision polygons should be as close to the image as possible. Some simplifications are acceptable, but what is unacceptable is when a point in the polygon is outside or inside the image.
The text was updated successfully, but these errors were encountered: