-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
ERROR: set_data: Condition ' len % 2 ' is true #19353
Comments
Seems like |
You can only add segments to ConcavePolygonShape2D, not points, so they need to be pairs of points to define the segments. |
Thanks for the answer, but why can't it create a segment from for example 3 points? |
Well, 3 points might not be in the same line, if you need it you can add the middle point twice (and if they are in the same line, you don't need the middle point anyway). Internally it stores everything in a contiguous array of points and it assumes it contains pair of points to define segments. This is done for performance reasons. |
I think the performance impact is negligible, at least in terms of that the collisions against concave shapes are slower already compared to using convex shapes (for rigid bodies at least). I mean, isn't it possible to use segments internally, defining a polygon via points is more intuitive in contrast to segments. Also, it may be difficult to edit concave shapes in the editor in the future (if not using |
commit hash: 8684b63
I'm getting a lot of those errors when dynamically changing the array of segments in ConcavePolygonShape2D (adding points). Collisions on some of the segments don't work. Errors are from
servers/physics_2d/shape_2d_sw.cpp:910
.What does this error mean?
The text was updated successfully, but these errors were encountered: