Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simulate a solid steel chain
#4
(23-01-2018, 03:47 AM)zhuchun Wrote: Thank you! Thank you for both this very detailed answer and that blog post!

At first, I thought Distance/Tether constraints can have a max distance and enable projection mode like the native physics engine. Increasing iteration sounds promising in my game scenario.

Hi! You're welcome Sonrisa

Obi uses constraint projection by default. This is because it relies on position-based dynamics, a simulation paradigm that directly moves bodies around and derives velocities from the resulting position differences.

"Regular" engines constrain velocities instead of positions. When enabling projection, you allow them to cheat a bit and force positions/orientations to be the correct ones for each constraint, which reduces the amount of error. However velocities and positions can get out of sync by doing this so momentum is no longer conserved. Obi works the other way around: first it calculates the correct positions of each body, then derives velocities from that. This way both positions and velocities are correct at the end of each physics step, and the resulting simulation is much more stable.

From PhysX's docs:
Quote:Under stressful conditions, PhysX' dynamics solver may not be able to accurately enforce the constraints specified by the joint. PhysX provides kinematic projection which tries to bring violated constraints back into alignment even when the solver fails. Projection is not a physical process and does not preserve momentum or respect collision geometry. It is best avoided if practical, but can be useful in improving simulation quality where joint separation results in unacceptable artifacts.

Both PhysX and Obi use iterative solvers, so both have the same limitations in regards to completely stiff constraints. However PhysX solves constraints by modifying velocities, and Obi does it by modifying positions which is beneficial for stability.

kind regards,
Reply


Messages In This Thread
Simulate a solid steel chain - by zhuchun - 22-01-2018, 02:12 PM
RE: Simulate a solid steel chain - by josemendez - 22-01-2018, 05:00 PM
RE: Simulate a solid steel chain - by zhuchun - 23-01-2018, 03:47 AM
RE: Simulate a solid steel chain - by josemendez - 23-01-2018, 10:35 AM