This commit is contained in:
Erin Catto 2026-10-19 23:06:20 -07:00
commit 1ad7cba87f
4 changed files with 11 additions and 1 deletions

View file

@ -12,7 +12,7 @@ BraceWrapping:
AfterUnion: true
BeforeWhile: true
ColumnLimit: 130
ColumnLimit: 100
PointerAlignment: Left
UseTab: Always
BreakConstructorInitializers: BeforeComma

5
.editorconfig Normal file
View file

@ -0,0 +1,5 @@
root = true
[*.{c,h,cpp,inl}]
guidelines = 100
guidelines_style = 1px dotted gray

View file

@ -892,6 +892,9 @@ b3BodyTOIResult b3Body_TimeOfImpactMover( b3BodyId bodyId, b3Pos origin, const b
return result;
}
// This computes the deviation of the principal inertia values without computing eigenvalues.
// It computes:
// ((I1 - I2)^2 + (I1 - I3)^2 + (I2 - I3)^2) / (I1^2 + I2^2 + I3^2)
// https://en.wikipedia.org/wiki/Cauchy_stress_tensor#Stress_deviator_tensor
static void b3UpdateIsotropicInertia( b3World* world, b3Body* body, b3BodySim* bodySim )
{

View file

@ -106,6 +106,8 @@ static void b3IntegrateVelocitiesTask( b3SolverBlock block, b3StepContext* conte
// I * (w2 - w1) + h * cross(w2, I * w2) = 0
// This is all done in local coordinates where the Jacobian is easier to compute.
// This improves the simulation of long skinny bodies.
// If the principal inertia values of I are roughly equal (isotropic) then
// cross(w2, I * w2) ~= 0, so this can be skipped.
if ( sim->flags & b3_enableGyroscopicTorque )
{
// Get current rotation.