Replies: 2 comments 3 replies
-
Be aware that you can already set the |
Beta Was this translation helpful? Give feedback.
1 reply
-
Thank you for opening, consolidating there |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Motivation
I want to develop a space simulation game (something like KSP) in which you could create rockets, spaceships by assembling different parts (engine, tank, cockpit). Each part has its own mass that might change over time (mostly for tanks).
In Godot, I use a RigidBody3D for the spaceship and for the parts a pair of (MeshInstance3D,CollisionShape3D) that you can choose from a list of parts.
As far as I can tell (I gather these information by browsing the source code) the CollisionShape3D is used to detect collisions (obviously) and to compute the mass_properties (i.e. the center of mass and the inertia tensor of the body).
The issue I face, is that the computation of the mass properties assumes that the mass is uniformly distributed over the CollisionShape3D in the RigidBody3D (the effect of a CollisionShape3D during the computation is based on its volume only).
I would like to be able to define a non uniformly distributed mass over the CollisionShape3D in a given RigidBody3D.
Implications
This implies a modification on how the mass of a RigidBody3D is defined and how the mass properties are computed.
Add a Mass Mode with 2 choices for the RigidBody3D
Uniform
(the default choice)Non Uniform
In
Uniform
mode, we have the current behavior of Godot and the field Mass is visible and editable for the RigidBody3D in the editor. InNon Uniform
mode the Mass is not editable (and "not visible" or "visible and filled automatically with the computed mass" ? )On each collision shape, add a field Mass only visible and editable if the mass mode is
Non Uniform
.On the core engine, the computation of the mass_properties must be updated in the case of the
Non Uniform
mode.Although, the starting point is a specific need for my game, I feel like this a more general request to improve the 3D physic in Godot with not that much effort.
If this discussion is successful and requires development, I am ready to ensure it.
Beta Was this translation helpful? Give feedback.
All reactions