Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why solver will suddenly stop?
#8
(01-02-2019, 12:16 PM)_gaoyu_ Wrote: Hi,
I want to know how to reset particle’ position  during simulation?

Hi,

simply assign the rest position to the position:
Code:
solver.positions[ball.particleIndices[i]] = ball.restPositions[i];

Note that this will reset the actor to the center of the scene, since restPositions are expressed in local space, while solver positions are expressed in world space. You might want to convert them using Unity's TransformPoint or InverseTransformPoint methods, It depends on whether you want to reset its deformation only, or completely reset all positions.
Reply


Messages In This Thread
Why solver will suddenly stop? - by _gaoyu_ - 01-02-2019, 10:24 AM
RE: Why solver will suddenly stop? - by _gaoyu_ - 01-02-2019, 10:45 AM
RE: Why solver will suddenly stop? - by _gaoyu_ - 01-02-2019, 11:09 AM
RE: Why solver will suddenly stop? - by _gaoyu_ - 01-02-2019, 12:16 PM
RE: Why solver will suddenly stop? - by josemendez - 01-02-2019, 12:53 PM