I’m trying to integrate the cable component plugin in my project, but I’m having issue with collisions. I always get a tunnelling effect unless I use a very small substep time (e.g. 0.005), but then it does hundreds of sweep queries per frame. I’ve debugged it a little bit what happens with a bigger time step (e.g. 0.02) and it seems like there’s a recurring pattern for every particle:
- First frame of collision, using `FHitResult::Location`
- Second frame of collision, `FHitResult::bStartPenetrating` is `true`, but `FHitResult::PenetrationDepth` is very small, e.g. < 0.001
- Third frame of collision, `FHitResult::bStartPenetrating` is also `true`, but `FHitResult::Normal` is reversed and `FHitResult::PenetrationDepth` is big, e.g. > 1.0
- Fourth frame has no collision
From what I understand, the issue is with the second frame, where `FHitResult::PenetrationDepth` should be way bigger to get the shape out of penetration. When I look at particle positions, it looks like this:
- First frame, we’re setting particle’s position explicitly to `FHitResult::Location`
- Second frame, particle’s position has moved within the surface, but small depenetration doesn’t counteract this
- Third frame, particles’s position has moved further within the surface, past its center, depenetration is now reversed
- Fourth frame, particle’s position movement, coupled with reversed depenetration, has tunnelled the particle beyond the surface
Is this expected, or is there settings in chaos that can counteract this?