Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ObiClothDragger question
#3
(30-01-2018, 03:23 PM)rendezvous Wrote: Bump - Just hoping to get an answer from Jose or any other savvy user as to whether this is possible.  Huh

Hi there,

Just set the dragged particle's velocity and inverse mass to zero when the user releases it. That will fix it in place. See the last bit of http://obi.virtualmethodstudio.com/tutor...icles.html for info on how to do that.

Edit: To be more specific, modify the Picker_OnParticleReleased function of ObiClothDragger.cs so that it looks like this:

Code:
void Picker_OnParticleReleased (object sender, ObiClothPicker.ParticlePickEventArgs e)
{
    Oni.SetParticleInverseMasses(picker.Cloth.Solver.OniSolver,new float[]{0},1,picker.Cloth.particleIndices[e.particleIndex]);
    Oni.SetParticleVelocities(picker.Cloth.Solver.OniSolver,new Vector4[]{Vector4.zero},1,picker.Cloth.particleIndices[e.particleIndex]);
    picker.Cloth.Solver.RelinquishRenderablePositions();
}

As you can see, I simply replaced "originalMass" by zero and set the velocity to zero.
Reply


Messages In This Thread
ObiClothDragger question - by rendezvous - 21-01-2018, 05:55 AM
RE: ObiClothDragger question - by rendezvous - 30-01-2018, 03:23 PM
RE: ObiClothDragger question - by josemendez - 30-01-2018, 04:18 PM