I want to destroy some of the colliders of a compound body. For example ones which collide with a chainsaw. What is the best way of doing it?
I’m using Havok.
I want to destroy some of the colliders of a compound body. For example ones which collide with a chainsaw. What is the best way of doing it?
I’m using Havok.
Regardless of which engine you are using, colliders are the same.
To remove some of the instances of the compound collider, I suggest getting the CompoundCollider.Children array, creating a new array with only the ones you need and building a new CompoundCollider for them. I know it’s not super efficient, but supporting a proper mutable compound collider is not easy and would have many implications on the default use case where it’s immutable.
Alternatively, rather the destroying some of the child colliders of the compound, you could just disable the collisions (set (ConvexCollider*)collider->Material.CollisionResponse = CollisionResponsePolicy.None) on the children.