Constraint solver: properly take non-zero center of masses into account.

This commit is contained in:
Sébastien Crozet
2020-08-31 19:02:37 +02:00
parent df2156ffd0
commit c286f44c4e
4 changed files with 14 additions and 11 deletions

View File

@@ -155,8 +155,8 @@ impl VelocityGroundConstraint {
rb2.position * manifold_point.local_p2,
)
};
let dp2 = p2.coords - rb2.position.translation.vector;
let dp1 = p1.coords - rb1.position.translation.vector;
let dp2 = p2 - rb2.world_com;
let dp1 = p1 - rb1.world_com;
let vel1 = rb1.linvel + rb1.angvel.gcross(dp1);
let vel2 = rb2.linvel + rb2.angvel.gcross(dp2);