Hey guys,
I'm doing a cloth simulation with verlet intergration, I assume you've all heard about it. But I came across with 2 main problems:
1. How to respond to collisions?
Now my update looks like:
world::Update()
{
a. AllSoftBodies:UpdatePosition(); // Update the position using verlet integration, via particle.position and particle.lastPosition
b. UpdateCollisions(); // using a grid-devided space to calculate collisions. And set particle.position = Contact.position.
c. AllSoftBodies:UpdateConstraints(); // update all constraints within a certain amount of iterations.
}
My problem is that, every time my collided particles' contact position are found and set, but in the constraints update method, the collided particles are pulled away by its connected particles which were not collided.
No matter what's the order of the a.b.c, they always won't stay at the collision state.
2. How to implement a stiffness in constraints?
Now the constraints update look like :