Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to fix the collided particle
#1
I tried to set the collided particle's invmass to 0 but it explode the softbody.  I did it in the following way:
Code:
   void Solver_OnCollision(object sender, Obi.ObiSolver.ObiCollisionEventArgs e)
   {
       for (int i = 0; i < e.contacts.Count; ++i)
       {
           if (e.contacts.Data[i].distance < 0.001f)
           {
               Component collider;
               if (ObiCollider.idToCollider.TryGetValue(e.contacts.Data[i].other, out collider))
               {
                   solver.invMasses[e.contacts.Data[i].particle] = 0;
               }
           }
       }
   }

What is the correct way to achieve this ?
Reply


Messages In This Thread
How to fix the collided particle - by apapaxionga - 10-04-2019, 11:43 PM