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

Center of mass offset for RigidBody and RigidBody2D. #7136

Closed
CowThing opened this issue Nov 17, 2016 · 6 comments
Closed

Center of mass offset for RigidBody and RigidBody2D. #7136

CowThing opened this issue Nov 17, 2016 · 6 comments

Comments

@CowThing
Copy link
Contributor

Currently the center of mass is always at the origin point of the RigidBody. There is no way to change the center of mass without moving all of the collision shapes and visual nodes so that the origin is offset.

I would like to have a function to offset the center of mass away from the origin without having to move everything around.

@reduz
Copy link
Member

reduz commented Nov 17, 2016

This was planned for 3.0

On Nov 17, 2016 11:29 AM, "CowThing" [email protected] wrote:

Currently the center of mass is always at the origin point of the
RigidBody. There is no way to change the center of mass without moving all
of the collision shapes and visual nodes so that the origin is offset.

I would like to have a function to offset the center of mass away from the
origin without having to move everything around.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#7136, or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z23IgYQu0ncJKjkWET19gia769yl7ks5q_GTagaJpZM4K1XvT
.

@reduz
Copy link
Member

reduz commented Aug 5, 2017

this was added in 3.0

@reduz reduz closed this as completed Aug 5, 2017
@Xrayez
Copy link
Contributor

Xrayez commented Oct 22, 2017

This was potentially fixed for 3D case in #7426 but not for RigidBody2D.

@m4nu3lf Can this be done for 2D case as well? I've tried to translate your code to 2D but my knowledge of physics is pretty much basic. I've successfully recomputed the center of mass based on shapes' origin and other stuff but I can't figure out how to integrate it all. Any pointers?

@aaronfranke
Copy link
Member

aaronfranke commented Sep 20, 2018

Was this added? What's it called?

I'm on 3.1 Alpha and I can't seem to find any setting for the center of mass on RigidBody.

@SteveSmith16384
Copy link

I'm on 3.4.2 and I can't see the option? The docs at https://docs.godotengine.org/en/stable/classes/class_rigidbody2d.html still say "The center of mass is always located at the node's origin without taking into account the CollisionShape2D centroid offsets."

@Calinou
Copy link
Member

Calinou commented Feb 21, 2022

Custom center of mass was added in both 2D and 3D in 4.0 by #49610, but it won't be backported to 3.x as it involves backwards-incompatible changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants