Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Define Particle Position without inertia
#3
(25-02-2022, 08:56 AM)Hi Jose,I review code and now it works fine. Thank you very much for your help.Obisoftbody need RecalculateRestShapeMatching() after set valuesis it the same process for obi rope ?I set positions, prevpositions, startPositions and velocities, but when I generate rope it has too much inertial.Thanksjosemendez Wrote: Make sure that the "prevPositions" and "startPositions" arrays are set to the same values as "positions". Obi is a position-based dynamics engine, which means velocities are derived from positions. This happens at the end of each simulation step (pseudocode):

Code:
particle.velocity = (particle.position - particle.prevPosition) / deltaTime;

The values in "startPositions" are used to interpolate physics state, then velocities are used to update particle positions at the start of the next frame. If the initial particle position doesn't match is previous position, velocity will not be zero. Note this is only an issue during instantiation, generally when you set a custom particle velocity it overrides the one calculated by the engine at the end of each frame.

You can read more about how position-based dynamics (or PBD for short) work here:
https://matthias-research.github.io/page...sedDyn.pdf
Reply


Messages In This Thread
RE: Define Particle Position without inertia - by promero - 10-03-2022, 08:16 PM