diff --git a/src/contact_solver.c b/src/contact_solver.c index 3b43cac..c0f58e0 100644 --- a/src/contact_solver.c +++ b/src/contact_solver.c @@ -1810,7 +1810,7 @@ void b3PrepareContacts_Convex( b3SolverBlock block, b3StepContext* context ) ( (float*)&cp->normalImpulses )[lane] = warmStartScale * mp->normalImpulse; ( (float*)&cp->totalNormalImpulses )[lane] = 0.0f; -( (float*)&cp->stepNormalImpulses )[lane] = 0.0f; + ( (float*)&cp->stepNormalImpulses )[lane] = 0.0f; b3Vec3 rnA = b3Cross( rA, normal ); b3Vec3 rnB = b3Cross( rB, normal ); @@ -1898,7 +1898,7 @@ void b3PrepareContacts_Convex( b3SolverBlock block, b3StepContext* context ) ( (float*)&cp->baseSeparations )[lane] = 0.0f; ( (float*)&cp->normalImpulses )[lane] = 0.0f; ( (float*)&cp->totalNormalImpulses )[lane] = 0.0f; -( (float*)&cp->stepNormalImpulses )[lane] = 0.0f; + ( (float*)&cp->stepNormalImpulses )[lane] = 0.0f; ( (float*)&cp->normalMasses )[lane] = 0.0f; ( (float*)&cp->relativeVelocities )[lane] = 0.0f; ( (float*)&cp->leverArms )[lane] = 0.0f; diff --git a/src/solver.c b/src/solver.c index 4c5c114..5e208b6 100644 --- a/src/solver.c +++ b/src/solver.c @@ -28,6 +28,10 @@ #define ITERATIONS 1 #define RELAX_ITERATIONS 1 +// stepNormalImpulse (contact_solver.c) sums the impulse applied after each relax pass; it is the step +// impulse only with one relax pass per sub-step +_Static_assert( RELAX_ITERATIONS == 1, "stepNormalImpulse is exact only with one relax iteration" ); + #if ( defined( __GNUC__ ) || defined( __clang__ ) ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) static void b3Pause( void ) {