Closed felix-ri closed 1 year ago
This is primarily caused by a weakness in nonconvex contact reduction. That compound has a lot of small scale complexity such that there are many choices of contacts that are very similar in heuristic quality. Small changes in the source convex contact manifolds can cause large changes in the final nonconvex manifold, and the discontinuity of those changes makes it extremely difficult to find a stable solution for a stack.
The main workaround for this would be to simplify the compound. Ideally, that whole structure would be represented by one box, but anything which makes the contact surface less ambiguous (like fewer coplanar contributing shapes) would help.
Another contributing factor is that the shape is very thin. While using continuous collision detection, stiff contacts, and higher maximum recovery velocity (with appropriate solver settings to retain stability) will help avoid penetration, sufficiently strong impacts will risk compounds getting children stuck between another compound's children. To help avoid this, you can expand adjacent children into each other so that there's not a local minimum to get stuck in:
The real solution is for me to improve contact reduction. It's been on the todo list for a while; at the moment, no collision pair is allowed to use historical data, so explicit hysteresis isn't possible. That makes maintaining temporal coherence extremely hard in these sorts of situations. I can't say with certainty when I'll get to this, but I'd like it to be in 2.5. Convex hulls, even not in compounds, would also benefit a lot from this.
i've had success wiht this blue highlight way to get to "not stuck " but i use triangle primitives and old decomposers, which are really prone to sticking because they can make shards .. in fact i think tesselation should be voronoi ike, less sharp pieces, and i have to hand edit such overlaps in maybe of my rigid bodies, when feet get stuck in ground because i am using an older engine. . Anoteh idea i had, is or adding tempoary one side slop fixtures on pairs that are categorized to just the pair, might help, especailly when you have joints that are being solved. that fight with the collision solver. ( self sticking rag dolls) ( the side away from the collision direction is fattened away from the incoming in its rest frame) .. auto overlap slop in inner tesselation might also help, if it doesnt go ouside the concave hull. in the case of a terrain you dont even need CCD or "bulletting" if you have enough overlap.
partially related question: ¿soft overlaps are supported? I mean: when two objects overlap a contact pair is created, and the collision respose is based on it. soft materials "modulate" the collision response based on the penetration depth, which allows object to penetrate a bit. The pros are that since the collisions responses are smaller, it has the effect of smoothing the jitter, the cons are that it produces lots of collision pairs.
Extending the colliders into the other ones indeed helped massively with stability.
partially related question: ¿soft overlaps are supported? I mean: when two objects overlap a contact pair is created, and the collision respose is based on it. soft materials "modulate" the collision response based on the penetration depth, which allows object to penetrate a bit. The pros are that since the collisions responses are smaller, it has the effect of smoothing the jitter, the cons are that it produces lots of collision pairs.
You can do this, yes- contacts have spring settings. The type of jitter it helps with is primarily a lack of convergence in the solver. It may help smooth out this kind of contact instability a little bit too, but probably not as much.
i think box2d uses Slop factors to soften constraints. I find that lowering mass ratios ( sometimes) cheating by raising mass of stuff under pilles temporarily ,or even by crushing them) if it's shaking chaotically from a grain of sand under a large mass) , and using dynamic and sliding friction helps keep actors from sliding on the feet. A better real solution is using a node graph on islands that inst just pairwise. For example a rope you can put a distance joint from the top segment to the bottom one, or it will stretch. This works at least when the rope is pulled straight. The bias on object A mght affect object C thats not in direct pairwise contact, its a form of ML technique used in AI that can be applied to a hybrid A- priori models and physics engines, but its based on the last frames result and to help converge the next frame faster via better initial guesses for the solver, rather than wait to percolate the errors from the ground to the top via interaction and pairwise mass ratios only.
On Tue, Dec 13, 2022 at 9:47 AM Ross Nordby @.***> wrote:
partially related question: ¿soft overlaps are supported? I mean: when two objects overlap a contact pair is created, and the collision respose is based on it. soft materials "modulate" the collision response based on the penetration depth, which allows object to penetrate a bit. The pros are that since the collisions responses are smaller, it has the effect of smoothing the jitter, the cons are that it produces lots of collision pairs.
You can do this, yes- contacts have spring settings. The type of jitter it helps with is primarily a lack of convergence in the solver. It may help smooth out this kind of contact instability a little bit too, but probably not as much.
— Reply to this email directly, view it on GitHub https://github.com/bepu/bepuphysics2/issues/249#issuecomment-1348856259, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD74XGMCEMUCPNCYJEASR7LWNCLCFANCNFSM6AAAAAAS35A64U . You are receiving this because you commented.Message ID: @.***>
I have a Compound shape of 8 boxes. When stacking multiple of them, the resulting stack wobbles around like crazy.
I tried modifying the Solver and Velocity Iterations, the TimeStep and the Spring Frequency. With some values, it was somwhat stable, but increasing the Timestep or Substeps made it wobble again.
What influences Compound-Compound Collision stability?
Demo is here