Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unused automatic mass #819

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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