10-04-2019, 11:43 PM
(This post was last modified: 10-04-2019, 11:45 PM by apapaxionga.)
I tried to set the collided particle's invmass to 0 but it explode the softbody. I did it in the following way:
What is the correct way to achieve this ?
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 ?