Can't do a collision query with Cylinders?

Hello! Great work you have here with this library, but I am a little confused… it seems that Cylinders don’t implement the Shape trait, so I can’t use them in collision queries like query::distance. I wonder if it’s intentional (i.e. there is a good reason Cylinders can’t be used as a Shape) or an oversight?

Hi! That’s right, the support for cylinders in ncollide is currently quite limited. The main reason of this is that we have not come up with a good way of representing some of the collision detection elements (for contact kinematics to be precise).

However, you can compute distances involving cylinder by using some functions which are more specific than query::distance. In particular, a cylinder is part of the family of shapes with support-mapping. So you can for example use query::distance_support_map_support_map to compute the distance between two shapes based on support-maps (all convex shapes in ncollide implement the SupportMap trait, except for the Plane).

Ah okay, I’ll give this a try and see if it works for my application. Thanks! This whole effort is great work. :slight_smile: