godotengine / godot

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

Godot doesn't support mesh collisions for RigidBody and VehicleBody #4159

Open slapin opened 8 years ago

slapin commented 8 years ago

Operating system or device: Any

Issue description (what happened, and what was expected): In Unity you can use any convex shape for RigidBody (one can be generated from mesh). This feature is strangely unimplemented yet.

Steps to reproduce: Well, just adding convex mesh collision to RigidBody and trying to collide should do.

karolgotowala commented 8 years ago

Tip: godot physics can't collide trimesh vs trimesh colliders, other combinations are okay.

slapin commented 8 years ago

Tip: godot physics can't collide trimesh vs trimesh colliders, other combinations are okay. This is not true and unrelated.

Try setting-up Box as StaticBody (make large ground object) and ConvexShape as RigidBody.

Only combination which works is Convex/Concave shape as StaticBody and Box as RigidBody.

Anyway, colliding of trimesh objects works in Unity, so should work in Godot too.

On Sun, Mar 27, 2016 at 11:16 PM, karolgotowala notifications@github.com wrote:

Tip: godot physics can't collide trimesh vs trimesh colliders, other combinations are okay.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/godotengine/godot/issues/4159#issuecomment-202139979

karolgotowala commented 8 years ago

It works doing like you said. Other combinations works too.

for you♥ Devs said thta in godot 3.0, 3D part of engine will be rewritten so for now you have to take it as it is. Greets.

reduz commented 7 years ago

this is not a bug, it's simply that a convex decomposition was never added for 3D.. waiting to see what happens with the 3D physics engine in the next weeks

reduz commented 7 years ago

kicking to 3.1 for now

akien-mga commented 4 years ago

this is not a bug, it's simply that a convex decomposition was never added for 3D.. waiting to see what happens with the 3D physics engine in the next weeks

What's the status of this issue now that convex decomposition was implemented with v-hacd?

MikeSchulze commented 4 years ago

nice to see you added milestones to support trimesh collision support, hopefully rigidbody with trimesh collision too

akien-mga commented 2 years ago

It would be useful to have a minimal reproduction project that can showcase what is expected to work and is not currently working (provided that this issue is still valid, otherwise it should be closed).

Calinou commented 2 years ago

We should improve warning reporting so that users know why their collisions aren't working. Quoting my comment from #30442:

I believe this is expected, as RigidBodies can't use trimesh collision shapes. See this warning for RigidBodies in Kinematic mode: [...]

In the MRP, there's a node configuration warning appearing:

image

Running the MRP won't print a warning message though, as the RigidBody isn't using Kinematic mode. We could print a warning message at run-time to complement this node configuration warning, but this may have a non-negligible performance cost. If checking turns out to be expensive, the check could be enabled in debug builds only.

As for implementing the feature itself, I'm not sure what would be the best way to do it. We could automatically generate simplified convex shapes if the user attempts to use trimesh collision in a RigidBody, but this could result in inaccurate collisions for particularly complex objects. That said, for most small or medium-sized objects, it should work well enough :slightly_smiling_face: