Hi,
I made an example on paper for 3 bodies connected with 2 constraints, in my math,
body 1 -> distance constraint 1 -> body2 -> distance constraint 2 -> body 3
using notation of Erin Catto's 2005 presentation (http://box2d.googlecode.com/files/GDC2005_ErinCatto.zip), pages 16,
the J M-1 Jt matrix shows that for the 1st constraint, the solution to delta-lambda needs A11 and A12
and in this case A12 is not zero, it has terms from the jacobian of the second constraint.
But on page 17, I see that this term is ignored is this correct? because if not
the delta-lambda term in page 17 should have many terms subtracted from ni and not only Jsp(i,1).A(b1) and Jsp(i,2).A(b2), but could be many others,
actually I think each constraint related to body 1 or body 2 will be there.
Are we removing these terms? I am stuck on this I wanted to try to write a small solver.
Sorry if this is a stupid question, thank you very much.
My example math:
I made an example on paper for 3 bodies connected with 2 constraints, in my math,
body 1 -> distance constraint 1 -> body2 -> distance constraint 2 -> body 3
using notation of Erin Catto's 2005 presentation (http://box2d.googlecode.com/files/GDC2005_ErinCatto.zip), pages 16,
the J M-1 Jt matrix shows that for the 1st constraint, the solution to delta-lambda needs A11 and A12
and in this case A12 is not zero, it has terms from the jacobian of the second constraint.
But on page 17, I see that this term is ignored is this correct? because if not
the delta-lambda term in page 17 should have many terms subtracted from ni and not only Jsp(i,1).A(b1) and Jsp(i,2).A(b2), but could be many others,
actually I think each constraint related to body 1 or body 2 will be there.
Are we removing these terms? I am stuck on this I wanted to try to write a small solver.
Sorry if this is a stupid question, thank you very much.
My example math:
Code:
3 bodies, 2 constraints.
J: 2x(18)
Jt: 18x2
M and M-1 : 18 x 18
6 cols 6 cols 6 cols
J constraint1 | Jac1(body1) Jac1(body2) 0 |
constraint2 | 0 Jac2(body2) Jac2(body3) |
M-1 Jt (18x2) ctrt1 ctrt2
| Jac1(body1)/M1 0 | 6 rows
| Jac1(body2)/M2 Jac2(body2)/M2 | 6 rows
| 0 Jac2(body3)/M2 | 6 rows
Now J M-1 Jt (2x2)
| Jac1(B1).Jac1(B1)/M1 + Jac1(B2).Jac1(B2)/M2 Jac1(B2).Jac2(B2)/M2 |
| Jac2(B2).Jac1(B2)/M2 Jac2(B2).Jac2(B2)/M2 + Jac2(B3).Jac2(B3)/M3 |
The lambda-delta in page 17 only takes the diagonal terms of this 2x2 matrix, so
for ctrt1, Jac1(B1).Jac1(B1)/M1 + Jac1(B2).Jac1(B2)/M2 is Jsp(i,1).A(b1)+Jsp(i,2).A(b2), but where is Jac1(B2).Jac2(B2)/M2 ?
J: 2x(18)
Jt: 18x2
M and M-1 : 18 x 18
6 cols 6 cols 6 cols
J constraint1 | Jac1(body1) Jac1(body2) 0 |
constraint2 | 0 Jac2(body2) Jac2(body3) |
M-1 Jt (18x2) ctrt1 ctrt2
| Jac1(body1)/M1 0 | 6 rows
| Jac1(body2)/M2 Jac2(body2)/M2 | 6 rows
| 0 Jac2(body3)/M2 | 6 rows
Now J M-1 Jt (2x2)
| Jac1(B1).Jac1(B1)/M1 + Jac1(B2).Jac1(B2)/M2 Jac1(B2).Jac2(B2)/M2 |
| Jac2(B2).Jac1(B2)/M2 Jac2(B2).Jac2(B2)/M2 + Jac2(B3).Jac2(B3)/M3 |
The lambda-delta in page 17 only takes the diagonal terms of this 2x2 matrix, so
for ctrt1, Jac1(B1).Jac1(B1)/M1 + Jac1(B2).Jac1(B2)/M2 is Jsp(i,1).A(b1)+Jsp(i,2).A(b2), but where is Jac1(B2).Jac2(B2)/M2 ?