In Google SVN for the C++ box2d, the two SolveVelocityConstraints additions become:
Posted for code review as much as to share. 🙂
Code: Select all
// already there:
b2Vec2 dv = vB + b2Cross(wB, ccp->rB) - vA - b2Cross(wA, ccp->rA);
// new code:
if(c->shape1->conveyorSpeed != 0) {
b2Vec2 t = tangent;
t *= c->shape1->conveyorSpeed;
dv += t;
}
if(c->shape2->conveyorSpeed != 0) {
b2Vec2 t = tangent;
t *= c->shape2->conveyorSpeed;
dv -= t;
}Posted for code review as much as to share. 🙂