Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Extend API for collision creation for meshes #205

Open
Shatur opened this issue Mar 4, 2022 · 0 comments
Open

Extend API for collision creation for meshes #205

Shatur opened this issue Mar 4, 2022 · 0 comments
Labels
enhancement New feature or improvement

Comments

@Shatur
Copy link
Contributor

Shatur commented Mar 4, 2022

We currently have PendingConvexCollision to import a mesh and a generate collision for it. But it generates ConvexHull which means that it create convex polygon from the vertices. But it doesn't work well if model represented as a concave mesh.
For example, I have a house prototype model:
изображение
If I apply PendingConvexCollision for it, I won't be able to enter the building though the door because the collision is represented as a concave polygon. In Godot you have two options to workaround it:

  1. Use convex decomposition. Rapier supports convex decomposition too, we could export the API.
  2. Create a trimesh polygon from a mesh. Godot uses import hints for it. In 4.0 a nice import menu will be available (which also supports trimesh collision generation!). We could also implement this feature with API similar to PendingConvexCollision: user spawns a scene and adds PendingConvexCollision. This feature depends on Add Body::TriMesh definition #41.
@Shatur Shatur changed the title Add API to create collision from mesh Create collision for complex meshes Mar 5, 2022
@Shatur Shatur changed the title Create collision for complex meshes Extend API for collision creation for meshes Mar 5, 2022
@jcornaz jcornaz added design enhancement New feature or improvement labels Mar 6, 2022
@jcornaz jcornaz removed the design label May 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or improvement
Projects
None yet
Development

No branches or pull requests

2 participants