Skip to content

Commit

Permalink
Removed unused automatic mass (#819)
Browse files Browse the repository at this point in the history
  • Loading branch information
erincatto authored Oct 7, 2024
1 parent a7123be commit 2dbb681
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
7 changes: 0 additions & 7 deletions include/box2d/box2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,6 @@ B2_API b2MassData b2Body_GetMassData( b2BodyId bodyId );
/// You should call this regardless of body type.
B2_API void b2Body_ApplyMassFromShapes( b2BodyId bodyId );

/// Set the automatic mass setting. Normally this is set in b2BodyDef before creation.
/// @see b2BodyDef::automaticMass
B2_API void b2Body_SetAutomaticMass( b2BodyId bodyId, bool automaticMass );

/// Get the automatic mass setting
B2_API bool b2Body_GetAutomaticMass( b2BodyId bodyId );

/// Adjust the linear damping. Normally this is set in b2BodyDef before creation.
B2_API void b2Body_SetLinearDamping( b2BodyId bodyId, float linearDamping );

Expand Down
19 changes: 0 additions & 19 deletions src/body.c
Original file line number Diff line number Diff line change
Expand Up @@ -1260,25 +1260,6 @@ void b2Body_ApplyMassFromShapes( b2BodyId bodyId )
b2UpdateBodyMassData( world, body );
}

void b2Body_SetAutomaticMass( b2BodyId bodyId, bool automaticMass )
{
b2World* world = b2GetWorldLocked( bodyId.world0 );
if ( world == NULL )
{
return;
}

b2Body* body = b2GetBodyFullId( world, bodyId );
body->automaticMass = automaticMass;
}

bool b2Body_GetAutomaticMass( b2BodyId bodyId )
{
b2World* world = b2GetWorld( bodyId.world0 );
b2Body* body = b2GetBodyFullId( world, bodyId );
return body->automaticMass;
}

void b2Body_SetLinearDamping( b2BodyId bodyId, float linearDamping )
{
B2_ASSERT( b2IsValid( linearDamping ) && linearDamping >= 0.0f );
Expand Down
1 change: 0 additions & 1 deletion src/body.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ typedef struct b2Body
bool fixedRotation;
bool isSpeedCapped;
bool isMarked;
bool automaticMass;
} b2Body;

// The body state is designed for fast conversion to and from SIMD via scatter-gather.
Expand Down

0 comments on commit 2dbb681

Please sign in to comment.