This commit is contained in:
Erin Catto 2026-10-14 22:16:12 -07:00
commit cc3b0215c8
2 changed files with 5 additions and 3 deletions

View file

@ -1325,11 +1325,12 @@ B3_FORCE_INLINE void b3SolveContactsW( b3SolverBlock block, b3StepContext* conte
b3Vec3W rA = cm->centerA;
b3Vec3W rB = cm->centerB;
b3Vec3W angularRelativeVelocity = b3SubVW( b3CrossW( bB.w, rB ), b3CrossW( bA.w, rA ) );
// Relative tangent velocity at contact
b3Vec3W vr = b3SubVW( b3CrossW( bB.w, rB ), b3CrossW( bA.w, rA ) );
b3Vec2W vt = {
b3AddW( linearTangentVelocity1, b3DotW( vr, tangent1 ) ),
b3AddW( linearTangentVelocity2, b3DotW( vr, tangent2 ) ),
b3AddW( linearTangentVelocity1, b3DotW( angularRelativeVelocity, tangent1 ) ),
b3AddW( linearTangentVelocity2, b3DotW( angularRelativeVelocity, tangent2 ) ),
};
// Incremental tangent impulse

View file

@ -414,6 +414,7 @@ void b3DrawSphericalJoint( b3DebugDraw* draw, b3JointSim* base, b3WorldTransform
void b3DrawWeldJoint( b3DebugDraw* draw, b3JointSim* base, b3WorldTransform transformA, b3WorldTransform transformB, float scale );
void b3DrawWheelJoint( b3DebugDraw* draw, b3JointSim* base, b3WorldTransform transformA, b3WorldTransform transformB, float scale );
// K = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)]
static inline b3Vec3 b3SolvePointConstraint( float mA, float mB, b3Matrix3 iA, b3Matrix3 iB, b3Vec3 rA, b3Vec3 rB, b3Vec3 rhs )
{
float axy = rA.z * iA.cy.y - rA.y * iA.cz.y;