Skip to content
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

occasional crash: b2PolygonShape::ComputeMass () -> Assertion `m_count >= 3' failed. #54

Open
0XDE57 opened this issue Sep 30, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@0XDE57
Copy link
Owner

0XDE57 commented Sep 30, 2024

(uncommon) sometimes shatter tries to create an asteroid polygon with less than 3 points.

java: /home/runner/work/gdx-box2d/gdx-box2d/gdx-box2d-box2d/jni/src/box2d-2.4.1/src/collision/b2_polygon_shape.cpp:300: virtual void b2PolygonShape::ComputeMass(b2MassData*, float) const: Assertion m_count >= 3' failed.

@0XDE57 0XDE57 added the bug label Sep 30, 2024
@0XDE57 0XDE57 added this to the alpha milestone Sep 30, 2024
@0XDE57 0XDE57 self-assigned this Sep 30, 2024
@0XDE57
Copy link
Owner Author

0XDE57 commented Oct 2, 2024

investigation.

  1. creating a new polygon already checks, and will throw exception is less than 3 points / 6 vertices supplied.
  2. added additional checks on vertices to ensure there are absolutely 3 points.

so how can there be less than 3 by the time the polygon is passed to box2D?

beginning to suspect collinear points... need to find exact poly to reproduce with.

another problem is no stack trace produced for this type of crash...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

1 participant