Algorithm 2.
1: | procedure selfCollisionResponse |
2: | for each pair of line segments i, j do |
3: | evaluate direction to move q̂= sign(w(t).w(t+Δt)).ŵ(t+Δt) |
4: | evaluate distance to move u = D − sign(w(t).w(t+Δt))|w(t+Δt)| |
5: | compute displacements Δp̄i and Δp̄j |
6: | evaluate and (points at the end of w̄(t+Δt)) |
7: | compute gi = −Δp̄iq̂, gj = Δp̄jq̂ and g = gi + gj |
8: | compute vectors and |
9: | apply response to line segnrents i,j |
10: | end for |
11: | end procedure |