CollisionShape supports being overloaded to allow users to wrap additional btCollisionShapes through UpdateDerivedShape. In working on a MultiSphereHullShape (for btMultiSphereShape), I realized the API could be improved - the UpdateShape function that is called that actually updates the shape_ member is private. This can be worked around by calling SetShapeType twice, but that updates the shape twice rather than once. Instead, I think we should just make UpdateShape protected. Possibly also MarkShapeDirty.
I intend to share the MultiSphereHullShape code as well, so remind me if I forget. Using some geometry nodes with modern Blender, I have a fairly decent workflow for creating them using an edge to mark the position and diameter of each sphere that make up the hull. They have proven fairly useful in generating complex close-fitting collision shapes to detect damage to my game's creatures, while in theory (I have not tested much) remaining more performant than mesh-based alternatives.
CollisionShape
supports being overloaded to allow users to wrap additionalbtCollisionShape
s throughUpdateDerivedShape
. In working on aMultiSphereHullShape
(forbtMultiSphereShape
), I realized the API could be improved - theUpdateShape
function that is called that actually updates theshape_
member is private. This can be worked around by callingSetShapeType
twice, but that updates the shape twice rather than once. Instead, I think we should just makeUpdateShape
protected. Possibly alsoMarkShapeDirty
.I intend to share the
MultiSphereHullShape
code as well, so remind me if I forget. Using some geometry nodes with modern Blender, I have a fairly decent workflow for creating them using an edge to mark the position and diameter of each sphere that make up the hull. They have proven fairly useful in generating complex close-fitting collision shapes to detect damage to my game's creatures, while in theory (I have not tested much) remaining more performant than mesh-based alternatives.