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 (DEF-3940) #3120

Closed
britzl opened this issue May 23, 2019 · 2 comments · Fixed by #8712
Closed

Center of mass (DEF-3940) #3120

britzl opened this issue May 23, 2019 · 2 comments · Fixed by #8712
Labels
engine Issues related to the Defold engine feature request A suggestion for a new feature physics Issues related to physics (2D and/or 3D)

Comments

@britzl
Copy link
Contributor

britzl commented May 23, 2019

Would be great to have methods for working with the center of mass of the object.
Requests:
(LINK REMOVED)(LINK REMOVED)
2019-05-13 15:58:12 (alexey.gulev)
Box2d has next methods (b2body.h):
/// Get the mass data of the body.
/// @return a struct containing the mass, inertia and center of the body.
void GetMassData(b2MassData* data) const;

/// Set the mass properties to override the mass properties of the fixtures.
/// Note that this changes the center of mass position.
/// Note that creating or destroying fixtures can also alter the mass.
/// This function has no effect if the body isn't dynamic.
/// @param massData the mass properties.
void SetMassData(const b2MassData* data);

/// This resets the mass properties to the sum of the mass properties of the fixtures.
/// This normally does not need to be called unless you called SetMassData to override
/// the mass and you later want to reset the mass.
void ResetMassData();

2019-05-20 16:58:35 (alexey.gulev)
It seems like something related to Bullet3d center of mass:
(LINK REMOVED)If not, Could we implement those methods only for 2d physics?

@britzl britzl added bug Something is not working as expected engine Issues related to the Defold engine feature request A suggestion for a new feature and removed bug Something is not working as expected feature request A suggestion for a new feature labels May 23, 2019
@britzl britzl added the physics Issues related to physics (2D and/or 3D) label Oct 29, 2019
@britzl britzl added this to Discuss in Issue Review via automation Sep 1, 2022
@zarkua
Copy link

zarkua commented Jan 25, 2024

In my game, I am forced to create six collision objects in a single game object (GO) due to the absence of a method to manipulate the center of mass for physics objects.

Having the ability to work with the center of mass as described in this issue would greatly enhance the efficiency and functionality of my game development process. Implementing methods for manipulating the center of mass, as in Box2D (GetMassData, SetMassData, and ResetMassData), would be incredibly beneficial.

This feature is crucial for the specific mechanics of my game, and its absence complicates the development process significantly. I hope this feature can be prioritized as it will not only aid in my current project but will also be a valuable addition for many other developers working with physics in Defold.

image

@britzl
Copy link
Contributor Author

britzl commented Jan 28, 2024

@AGulev AGulev mentioned this issue Mar 29, 2024
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine Issues related to the Defold engine feature request A suggestion for a new feature physics Issues related to physics (2D and/or 3D)
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants