Skip to content

SDF_SHAPE_PROXYTYPE is equal to CUSTOM_CONCAVE_SHAPE_TYPE might break the convex/concave collision for custom concave shape. #3104

@eminor1988

Description

@eminor1988

Hi, I encountered a problem since update from 2.87 to 2.88(or above).
Sorry about my bad English skill...

Situation

I implemented a custom concave class (inherit from "btConcaveShape"), and I used the "CUSTOM_CONCAVE_SHAPE_TYPE" as shape type for it.
But convex(a sphere)/custom concave collision is not working after I updated bullet from 2.87 to 2.88(and I also tried 2.89 and 3.05).

Cause

I find out the problem might be caused by the value of shape type "SDF_SHAPE_PROXYTYPE" is equal to "CUSTOM_CONCAVE_SHAPE_TYPE".

SDF_SHAPE_PROXYTYPE is defined in file "BulletCollison/BroadphaseProxy.h"

In the versions since 2.88, the collision algorithm treat the shape type "SDF_SHAPE_PROXYTYPE" as different function from original convex/concave collision algorithm, but "SDF_SHAPE_PROXYTYPE" and "CUSTOM_CONCAVE_SHAPE_TYPE" shared same value.

The method "btConvexConcaveCollisionAlgorithm::processCollision" is in file "BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp"

So it will break my convex/custom concave collision because the shape type "CUSTOM_CONCAVE_SHAPE_TYPE" will be treated as "SDF_SHAPE_PROXYTYPE" and run different(wrong) function.

I tried to change the shape type of my custom concave to "MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE"(it's also a concave shape type) and collision is working again.
But the most top of file "BulletCollison/BroadphaseProxy.h" described that we can use "CUSTOM_CONCAVE_SHAPE_TYPE" for extend shape.

Possible solution

So I consider it might be a bug, "SDF_SHAPE_PROXYTYPE" should be new value not an old one.
But I am not sure the fixing is correct or not, so I just report it.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions