Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lock Softbody Movement & Cut it
#7
(27-05-2020, 10:47 AM)josemendez Wrote: "Locking" a particle basically means setting its mass to infinite. Which is equivalent to setting its inverse mass to zero, Obi internally works with inverse masses to avoid dealing with nasty Inf/NaN values. Setting the velocity to zero is usually also needed, to keep the particle from moving if they already had some momentum.

The ObiParticleAttachment simply wraps this all up nicely for you: It finds all particles in a particle group, stores their old inverse mass, and sets both their inverse mass and velocity to zero. When the attachment is deactivated, it also takes care of resetting their inverse masses to whatever values they had. It also sets the position of the now "locked" particles to match the transform they're attached to.

Given that you're not working with pre-made particle groups defined in editor, I think it would be easier for you to deal with particles directly. You'll need to find which particles you want to lock by checking their position (or any other attribute that helps you identify them), then setting their inverse mass to zero. See:
http://obi.virtualmethodstudio.com/tutor...icles.html

Hmm, in that case I have an idea. What if I keep all particles initially locked as slime spawns, then check which particle the knife collider touches as knife is moved, then unlock (remove from locking group) only that particle which is touched by knife collider? Is there a way to detect particle indice based on a box collider collision? 

I have tried the locking now and it works, but then the softbody behaviour is completely gone as the slime particles no longer react to knife touch on it.

The desired behavior is the slime should stay in air, while still being "pressed" visually by the knife before the cut.
Reply


Messages In This Thread
Lock Softbody Movement & Cut it - by arrnav96 - 27-05-2020, 06:42 AM
RE: Lock Softbody Movement & Cut it - by arrnav96 - 27-05-2020, 09:51 AM
RE: Lock Softbody Movement & Cut it - by arrnav96 - 27-05-2020, 10:39 AM
RE: Lock Softbody Movement & Cut it - by arrnav96 - 27-05-2020, 10:59 AM
RE: Lock Softbody Movement & Cut it - by arrnav96 - 27-05-2020, 01:20 PM
RE: Lock Softbody Movement & Cut it - by arrnav96 - 01-06-2020, 10:36 AM
RE: Lock Softbody Movement & Cut it - by arrnav96 - 01-06-2020, 12:24 PM