Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  how to remove fixed state
#17
(14-02-2019, 11:37 AM)Richard Wrote: I would like to unfix all fixed particles.

Then iterate over all particles, and set their inverse mass:

Code:
float invMassPerParticle = 0.01f;
for (int i = 0; i < actor.invMasses.Length; ++i){
     int indexInSolver = actor.particleIndices[i];
     actor.invMasses[i] = solver.invMasses[indexInSolver] = invMassPerParticle;
}

You could of course use a more complicated approach to set the particle masses, such as defining a mass for the whole object and dividing it by the number of particles (to distribute it evenly). Or check for those that are fixed and set a different mass only for them, if desired.
Reply


Messages In This Thread
how to remove fixed state - by Richard - 14-02-2019, 02:43 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 08:11 AM
RE: how to remove fixed state - by Richard - 14-02-2019, 08:38 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 08:52 AM
RE: how to remove fixed state - by Richard - 14-02-2019, 09:12 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 09:19 AM
RE: how to remove fixed state - by Richard - 14-02-2019, 10:04 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 10:28 AM
RE: how to remove fixed state - by Richard - 14-02-2019, 10:32 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 10:51 AM
RE: how to remove fixed state - by Richard - 14-02-2019, 11:14 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 11:21 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 11:25 AM
RE: how to remove fixed state - by Richard - 14-02-2019, 11:37 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 12:10 PM
RE: how to remove fixed state - by Richard - 14-02-2019, 12:20 PM
RE: how to remove fixed state - by josemendez - 14-02-2019, 12:28 PM
RE: how to remove fixed state - by Richard - 14-02-2019, 12:47 PM
RE: how to remove fixed state - by josemendez - 14-02-2019, 12:55 PM
RE: how to remove fixed state - by Richard - 14-02-2019, 01:03 PM
RE: how to remove fixed state - by Richard - 14-02-2019, 04:05 PM
RE: how to remove fixed state - by josemendez - 14-02-2019, 04:18 PM
RE: how to remove fixed state - by Richard - 14-02-2019, 04:46 PM
RE: how to remove fixed state - by Richard - 14-02-2019, 10:58 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 11:04 AM