Consider this scenario as shown below. There are two cubes in the scene, one big and one small. The center of the big cube lies at the origin of the world, while the center of the small one is on the diagonal of the big cube, e.g. the vertex of the big cube is at (0.5, 0.5, 0.5), and the center of the small cube is at (0.4, 0.4, 0.4). One of the cubes is represented as fcl::Convexf, the other one can be a fcl::Boxf, or convex as well.
The problem is, when I use fcl::collide function to detect the collision of these two cubes, and request the contact information, the returned normal direction starts from the blue point and is pointing to the yellow point, i.e. pointing to the vertex of the big cube. However, the minimum penetration depth direction should be from the blue point to the red point, i.e. orthogonal to one surface of the big cube, which is also the result when using two boxes (fcl::Boxf) as collision geometries. Accordingly, the penetration depth in this case is sqrt(3) times the actual minimum penetration depth, which is consistent to the normal direction.
As far as I know, this only happens when the deepest penetration point lies on the diagonal of one cube and at least one of the cube is represented as a convex. Could you please take a look at it? A code snippet is attached below.
Hello,
Consider this scenario as shown below. There are two cubes in the scene, one big and one small. The center of the big cube lies at the origin of the world, while the center of the small one is on the diagonal of the big cube, e.g. the vertex of the big cube is at (0.5, 0.5, 0.5), and the center of the small cube is at (0.4, 0.4, 0.4). One of the cubes is represented as fcl::Convexf, the other one can be a fcl::Boxf, or convex as well.
The problem is, when I use fcl::collide function to detect the collision of these two cubes, and request the contact information, the returned normal direction starts from the blue point and is pointing to the yellow point, i.e. pointing to the vertex of the big cube. However, the minimum penetration depth direction should be from the blue point to the red point, i.e. orthogonal to one surface of the big cube, which is also the result when using two boxes (fcl::Boxf) as collision geometries. Accordingly, the penetration depth in this case is sqrt(3) times the actual minimum penetration depth, which is consistent to the normal direction.
As far as I know, this only happens when the deepest penetration point lies on the diagonal of one cube and at least one of the cube is represented as a convex. Could you please take a look at it? A code snippet is attached below.
Thanks!