Skip to content
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

Collision between CSGPolygon and ConcavePolygonShape not working #30442

Closed
Tracked by #45333
BraindeadBZH opened this issue Jul 8, 2019 · 5 comments
Closed
Tracked by #45333

Collision between CSGPolygon and ConcavePolygonShape not working #30442

BraindeadBZH opened this issue Jul 8, 2019 · 5 comments

Comments

@BraindeadBZH
Copy link

BraindeadBZH commented Jul 8, 2019

Godot version:
3.1.1.stable

OS/device including version:
Windows 10. Geforce 970M

Issue description:
I have a RigidBody with ConcavePolygonShape for collision. I also have a CSGPolygon extruded along a path with collision activated. The RigidBody is able to collide with another StaticBody with a CubeShape but not with the CSGPolygon. Another RigidBody with a CapsuleShape is able to collide with the CSGPolygon.

Steps to reproduce:

  1. Create a CSGPolygonextruded along a path
  2. Create a RigidBody with a ConcavePolygonShape
  3. The RigidBody goes through the CSGPolygon

CSGCollisionTest.zip

@BraindeadBZH BraindeadBZH changed the title Collision between CSGMesh and ConcavePolygon not working Collision between CSGPolygon and ConcavePolygon not working Jul 9, 2019
@BraindeadBZH BraindeadBZH changed the title Collision between CSGPolygon and ConcavePolygon not working Collision between CSGPolygon and ConcavePolygonShape not working Jul 9, 2019
@rhossack
Copy link

I ran into this problem with a SphereShape. I have a RigidBody with a ConcavePolygonShape that collides with RayCasts and ConvexPolygonShapes, but not SphereShapes.

The workaround was to create a convex collision sibling instead of a Trimesh collision sibling.

@pete3000a
Copy link

pete3000a commented Jan 30, 2020

Still happens in 3.2

@KoBeWi
Copy link
Member

KoBeWi commented Dec 19, 2020

Still valid in 3.2.4 beta4

@Calinou
Copy link
Member

Calinou commented Feb 10, 2022

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

switch (shape_wrapper->shape->get_type()) {
case PhysicsServer::SHAPE_SPHERE:
case PhysicsServer::SHAPE_BOX:
case PhysicsServer::SHAPE_CAPSULE:
case PhysicsServer::SHAPE_CYLINDER:
case PhysicsServer::SHAPE_CONVEX_POLYGON:
case PhysicsServer::SHAPE_RAY: {
shapes.write[i].shape = static_cast<btConvexShape *>(shape_wrapper->shape->create_bt_shape(owner_scale * shape_wrapper->scale, safe_margin));
} break;
default:
WARN_PRINT("This shape is not supported to be kinematic!");
shapes.write[i].shape = nullptr;
}

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.

Therefore, I'll close this as a duplicate of #4159.

@rhossack
Copy link

RigidBodies can't use trimesh collision shapes

Then the button that creates trimesh collision shapes should be disabled if there are RigidBodies in the current selection.

At least, that's vaguely how I remember running into the issue 2 years ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants