@@ -114,16 +114,16 @@ public static bool b2DistanceJoint_IsSpringEnabled(B2JointId jointId)
114
114
/// Set the force range for the spring.
115
115
public static void b2DistanceJoint_SetSpringForceRange ( B2JointId jointId , float lowerForce , float upperForce )
116
116
{
117
- B2_ASSERT ( lowerForce <= upperForce ) ;
118
- B2JointSim @base = b2GetJointSimCheckType ( jointId , B2JointType . b2_distanceJoint ) ;
117
+ B2_ASSERT ( lowerForce <= upperForce ) ;
118
+ B2JointSim @base = b2GetJointSimCheckType ( jointId , B2JointType . b2_distanceJoint ) ;
119
119
@base . uj . distanceJoint . lowerSpringForce = lowerForce ;
120
120
@base . uj . distanceJoint . upperSpringForce = upperForce ;
121
121
}
122
122
123
123
/// Get the force range for the spring.
124
124
public static void b2DistanceJoint_GetSpringForceRange ( B2JointId jointId , out float lowerForce , out float upperForce )
125
125
{
126
- B2JointSim @base = b2GetJointSimCheckType ( jointId , B2JointType . b2_distanceJoint ) ;
126
+ B2JointSim @base = b2GetJointSimCheckType ( jointId , B2JointType . b2_distanceJoint ) ;
127
127
lowerForce = @base . uj . distanceJoint . lowerSpringForce ;
128
128
upperForce = @base . uj . distanceJoint . upperSpringForce ;
129
129
}
@@ -377,10 +377,10 @@ public static void b2SolveDistanceJoint(B2JointSim @base, B2StepContext context,
377
377
378
378
float m = joint . distanceSoftness . massScale * joint . axialMass ;
379
379
float oldImpulse = joint . impulse ;
380
- float impulse = - m * ( Cdot + bias ) - joint . distanceSoftness . impulseScale * oldImpulse ;
380
+ float impulse = - m * ( Cdot + bias ) - joint . distanceSoftness . impulseScale * oldImpulse ;
381
381
382
382
float h = context . h ;
383
- joint . impulse = b2ClampFloat ( joint . impulse + impulse , joint . lowerSpringForce * h , joint . upperSpringForce * h ) ;
383
+ joint . impulse = b2ClampFloat ( joint . impulse + impulse , joint . lowerSpringForce * h , joint . upperSpringForce * h ) ;
384
384
impulse = joint . impulse - oldImpulse ;
385
385
386
386
B2Vec2 P = b2MulSV ( impulse , axis ) ;
0 commit comments