-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Buggy collision detection when ConvexPolygonShape2D is given a concave polygon with set_points() #8611
Comments
This is being rewritten in 3.0
…On May 3, 2017 9:34 AM, "ret80" ***@***.***> wrote:
http://docs.godotengine.org/en/stable/classes/class_
concavepolygonshape2d.html
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#8611 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF-Z22NDuQzNjtqhzjdfy9lba4D371suks5r2DwhgaJpZM4NNMD9>
.
|
@ret80 Aware of this. The docs say ConcavePolygonShape2D's are not recommended for rigidbodies. Right now it seems like it is only possible to use the concave polygon decomposer by creating polygons in the editor. I think it would be good if it could be accessed through scripting as well. |
@Smellyhobo101
|
@ret80 |
@Smellyhobo101 As I understand it, the problem was connected with the concave polygon created in the script. If so, the above code solves this problem. If you wanted to break a concave polygon into convex then it's likely your link fits better.
If you have static objects and there are a few of them that can be used and do not worry |
That's what I've been doing for large static polygons. The problem I was trying to bring attention to is that the function to decompose concave polygons into convex polygons is not exposed to gdscript, and can only be accessed with a CollisionPolygon2D in the editor. In cases where you need to make small dynamic rigidbodies from code with concave bits it would be nice to have. |
@Smellyhobo101 I support. Only this is not a bug but an improvement |
Operating system or device - Godot version:
Windows 7 - Godot 2.1.3 win64
Issue description:
I have a Polygon2D, and I am trying to create a static rigidbody with the polygons shape through code:
This works fine if the polygon is actually convex, but for concave polygons the collision detection breaks:
https://gfycat.com/WideNaiveDwarfrabbit
The left and right polygons are polygon2D's with the above script. The bottom polygon was created in the editor and has the expected behavior. It looks like ConvexPolygonShape2D doesn't decompose concave polygons when using set_points(). Is there a class that can do this?
Link to minimal example project:
Example project from the gif: https://drive.google.com/open?id=0B_tU7BWC-5CkY0JGNWpuU1ZVWFk
Drive link because:
![image](https://cloud.githubusercontent.com/assets/5416313/25585651/eb637cc4-2e58-11e7-9e5c-c45ff2e14e80.png)
When I drop in a zip.
The text was updated successfully, but these errors were encountered: