From 96b30869286d3f947d5b6749435d3c83b275ae36 Mon Sep 17 00:00:00 2001 From: Erin Catto Date: Thu, 15 Oct 2026 10:09:02 -0700 Subject: [PATCH] clean up --- src/math_internal.h | 10 ---------- src/motor_joint.c | 3 +-- src/revolute_joint.c | 1 - src/spherical_joint.c | 1 - src/weld_joint.c | 1 - 5 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/math_internal.h b/src/math_internal.h index d975c65..b272bdc 100644 --- a/src/math_internal.h +++ b/src/math_internal.h @@ -394,16 +394,6 @@ static inline b3Matrix3 b3MakeDiagonalMatrix( float a, float b, float c ) return (b3Matrix3){ { a, 0.0f, 0.0f }, { 0.0f, b, 0.0f }, { 0.0f, 0.0f, c } }; } -static inline b3Matrix3 b3Skew( b3Vec3 v ) -{ - b3Matrix3 out; - out.cx = (b3Vec3){ 0, v.z, -v.y }; - out.cy = (b3Vec3){ -v.z, 0, v.x }; - out.cz = (b3Vec3){ v.y, -v.x, 0 }; - - return out; -} - static inline b3Plane b3NormalizePlane( b3Plane plane ) { float invLength = 1.0f / b3Length( plane.normal ); diff --git a/src/motor_joint.c b/src/motor_joint.c index dc8913c..9487d0c 100644 --- a/src/motor_joint.c +++ b/src/motor_joint.c @@ -360,7 +360,6 @@ void b3SolveMotorJoint( b3JointSim* base, b3StepContext* context ) b3Vec3 cdot = b3Sub( b3Add( vB, b3Cross( wB, rB ) ), b3Add( vA, b3Cross( wA, rA ) ) ); - //// K = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)] b3Vec3 b = b3SolvePointConstraint( mA, mB, base->invIA, base->invIB, rA, rB, b3Add( cdot, bias ) ); b3Vec3 oldImpulse = joint->linearSpringImpulse; @@ -386,7 +385,7 @@ void b3SolveMotorJoint( b3JointSim* base, b3StepContext* context ) { b3Vec3 cdot = b3Sub( b3Add( vB, b3Cross( wB, rB ) ), b3Add( vA, b3Cross( wA, rA ) ) ); cdot = b3Sub( cdot, joint->linearVelocity ); - //// K = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)] + b3Vec3 b = b3SolvePointConstraint( mA, mB, base->invIA, base->invIB, rA, rB, cdot ); b3Vec3 impulse = b3Neg( b ); diff --git a/src/revolute_joint.c b/src/revolute_joint.c index 0e568f1..5f8b6da 100644 --- a/src/revolute_joint.c +++ b/src/revolute_joint.c @@ -582,7 +582,6 @@ void b3SolveRevoluteJoint( b3JointSim* base, b3StepContext* context, bool useBia impulseScale = base->constraintSoftness.impulseScale; } - //// K = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)] b3Vec3 b = b3SolvePointConstraint( mA, mB, base->invIA, base->invIB, rA, rB, b3Add( cdot, bias ) ); b3Vec3 impulse = b3Sub( b3MulSV( -massScale, b ), b3MulSV( impulseScale, joint->linearImpulse ) ); diff --git a/src/spherical_joint.c b/src/spherical_joint.c index 537cc8a..cc9692c 100644 --- a/src/spherical_joint.c +++ b/src/spherical_joint.c @@ -633,7 +633,6 @@ void b3SolveSphericalJoint( b3JointSim* base, b3StepContext* context, bool useBi impulseScale = base->constraintSoftness.impulseScale; } - //// K = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)] b3Vec3 b = b3SolvePointConstraint( mA, mB, base->invIA, base->invIB, rA, rB, b3Add( cdot, bias ) ); b3Vec3 impulse = b3MulSub( b3MulSV( -massScale, b ), impulseScale, joint->linearImpulse ); diff --git a/src/weld_joint.c b/src/weld_joint.c index 075bbdf..5a379a7 100644 --- a/src/weld_joint.c +++ b/src/weld_joint.c @@ -269,7 +269,6 @@ void b3SolveWeldJoint( b3JointSim* base, b3StepContext* context, bool useBias ) impulseScale = joint->linearSpring.impulseScale; } - //// K = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)] b3Vec3 b = b3SolvePointConstraint( mA, mB, base->invIA, base->invIB, rA, rB, b3Add( cdot, bias ) ); b3Vec3 impulse = b3MulSub( b3MulSV( -massScale, b ), impulseScale, joint->linearImpulse );