30-01-2018, 04:18 PM
(This post was last modified: 30-01-2018, 05:29 PM by josemendez.)
(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.
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.