01-02-2019, 12:53 PM
(This post was last modified: 01-02-2019, 12:56 PM by josemendez.)
(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.