Static assert RELAX_ITERATIONS == 1 beside stepNormalImpulse

stepNormalImpulse sums the impulse applied after each relax pass, which is
the step impulse only with one relax iteration. Also indents two stray
column-0 lines of the previous commit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-20 02:48:16 +01:00
commit 6cfeeff232
2 changed files with 6 additions and 2 deletions

View file

@ -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;

View file

@ -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 )
{