Gyro tolerance (#191)
This commit is contained in:
parent
0cfc475b88
commit
efca0c184d
23 changed files with 420 additions and 63 deletions
|
|
@ -332,6 +332,7 @@ b3WorldId b3CreateWorld( const b3WorldDef* def )
|
|||
world->restitutionIterations = b3ClampInt( def->restitutionIterations, 0, B3_MAX_RESTITUTION_ITERATIONS );
|
||||
world->enableRestitutionPropagation = def->enableRestitutionPropagation;
|
||||
world->maxLinearSpeed = def->maximumLinearSpeed;
|
||||
world->isotropicInertiaTolerance = b3ClampFloat( def->isotropicInertiaTolerance, 0.0f, 1.0f );
|
||||
world->contactSpeed = def->contactSpeed;
|
||||
world->contactHertz = def->contactHertz;
|
||||
world->contactDampingRatio = def->contactDampingRatio;
|
||||
|
|
@ -2215,6 +2216,27 @@ float b3World_GetMaximumLinearSpeed( b3WorldId worldId )
|
|||
return world->maxLinearSpeed;
|
||||
}
|
||||
|
||||
void b3World_SetIsotropicInertiaTolerance( b3WorldId worldId, float tolerance )
|
||||
{
|
||||
B3_ASSERT( b3IsValidFloat( tolerance ) );
|
||||
|
||||
b3World* world = b3GetUnlockedWorldFromId( worldId );
|
||||
if ( world == NULL )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
B3_REC( world, WorldSetIsotropicInertiaTolerance, worldId, tolerance );
|
||||
|
||||
world->isotropicInertiaTolerance = b3ClampFloat( tolerance, 0.0f, 1.0f );
|
||||
}
|
||||
|
||||
float b3World_GetIsotropicInertiaTolerance( b3WorldId worldId )
|
||||
{
|
||||
b3World* world = b3GetWorldFromId( worldId );
|
||||
return world->isotropicInertiaTolerance;
|
||||
}
|
||||
|
||||
b3Profile b3World_GetProfile( b3WorldId worldId )
|
||||
{
|
||||
b3World* world = b3GetUnlockedWorldFromId( worldId );
|
||||
|
|
|
|||
Loading…
Reference in a new issue