Skip to content

Fix center of mass not being used correctly for forces applied at points#487

Merged
Ughuuu merged 1 commit intoappsinacup:mainfrom
Ardot66:fix_center_of_mass
Feb 23, 2026
Merged

Fix center of mass not being used correctly for forces applied at points#487
Ughuuu merged 1 commit intoappsinacup:mainfrom
Ardot66:fix_center_of_mass

Conversation

@Ardot66
Copy link
Copy Markdown
Contributor

@Ardot66 Ardot66 commented Feb 23, 2026

Resolves #358

The center of mass position was being added to the point the force was being applied to, which caused objects to always behave as if their center of mass was their position. This has been changed to instead use the object's position, which now yields the expected result.

I have only tested this in 2D, but I expect that this fix should also work in 3D (being as simple as it is).

@Ughuuu
Copy link
Copy Markdown
Contributor

Ughuuu commented Feb 23, 2026

Great catch! And thanks for contributing!

@Ughuuu Ughuuu merged commit a6c8c7c into appsinacup:main Feb 23, 2026
76 checks passed
@Ardot66 Ardot66 deleted the fix_center_of_mass branch February 23, 2026 21:28
dog-molecule pushed a commit to dog-molecule/godot-rapier-physics that referenced this pull request Mar 26, 2026
…nts (appsinacup#487)

Resolves appsinacup#358

The center of mass position was being added to the point the force was
being applied to, which caused objects to always behave as if their
center of mass was their position. This has been changed to instead use
the object's position, which now yields the expected result.

I have only tested this in 2D, but I expect that this fix should also
work in 3D (being as simple as it is).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rapier ignores the Center of Mass setting when using the 'Custom' Center of Mass Mode for RigidBody2D Mass Distribution

2 participants