Gyro tolerance (#191)

This commit is contained in:
Erin Catto 2026-10-15 23:30:56 -07:00 • committed by GitHub
commit efca0c184d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 420 additions and 63 deletions

View file

@ -214,6 +214,13 @@ B3_API void b3World_SetMaximumLinearSpeed( b3WorldId worldId, float maximumLinea
/// Get the maximum linear speed. Usually in m/s.
B3_API float b3World_GetMaximumLinearSpeed( b3WorldId worldId );
/// Set the tolerance for gyroscopic torque. [0, 1]
/// @note modifying this only affects new bodies or bodies that get their mass updated.
B3_API void b3World_SetIsotropicInertiaTolerance( b3WorldId worldId, float tolerance );
/// Get the tolerance for gyroscopic torque. [0, 1]
B3_API float b3World_GetIsotropicInertiaTolerance( b3WorldId worldId );
/// Enable/disable constraint warm starting. Advanced feature for testing. Disabling
/// warm starting greatly reduces stability and provides no performance gain.
B3_API void b3World_EnableWarmStarting( b3WorldId worldId, bool flag );

View file

@ -173,6 +173,10 @@ typedef struct b3WorldDef
/// Maximum linear speed. Usually meters per second.
float maximumLinearSpeed;
/// Use this to disable gyroscopic torque on sphere-like objects automatically.
/// Range is [0, 1]. A sphere is 0 and a 1x1x2 box is 0.5.
float isotropicInertiaTolerance;
/// Optional mixing callback for friction. The default uses sqrt(frictionA * frictionB).
b3FrictionCallback* frictionCallback;