godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.22k stars 21.04k forks source link

Confusing with CollisionPolygon2D, shape don't exist #19550

Closed Nutriz closed 4 years ago

Nutriz commented 6 years ago

Godot version: Godot 3.0.3RC3

Issue description: For 2D physics, we can use CollisionShape2D or CollisionPolygon2D. For CollisionShape2D we have Shape2D objects associated to it, and we can call some useful methods like collide(), collide_and_get_contacts(), but for CollisionPolygon2D we don't have a Shape2D and methods like collide() can't be used. It's a bite confusing. I'm forced to use a CollisionShape2D with ConcavePolygonShape2D/ConvexPolygonShape2D ? but the aspect of shape like that isn't the as with CollisionPolygon2D, seems to be segment based, not polygon based.

My goal is to make a destructible terrain, so I have an initial shape (generated from an bitmap terrain), and I make hole in it with CircleShape2D, so collide_and_get_contacts() will be very useful for that :)

eon-s commented 6 years ago

It is indeed confusing, some tutorials for advanced use of the shape owner system are really needed.

CollisionPolygon2D generates many convex shapes, and it does not have an array of the created shapes which may be handy.

You may need to access them with the CollisionObject2D.shape_owner_get_* methods.

madmiraal commented 4 years ago

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!