Products of Inerta #7909
erikscott128
started this conversation in
3D
Replies: 1 comment
-
I believe you want this (or at least something closely related) #7033 - if you agree with that proposal up voting it won't hurt, you could also comment with your use cases and ideas for how it could be work or be presented to users. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As of Godot 4, it appears the rotational inertia of a RigidBody3D can be defined by the user rather than being auto-calculated from the mass and collision shapes. This is a great addition, and one that I lacked several years ago in my first attempts using Godot 3. However, it is defined as a Vector3 which likely greatly simplifies implementation (inversion is very simple) but lacks generality and flexibility for users looking to accurately simulate specific rigid bodies.
The general inertia of a rigid body is usually expressed as a symmetric second-order tensor (a 3x3 matrix in this case). This is how it's generally expressed in Euler's 2nd law of motion in a non-inertial frame. The diagonal entries are equivalent to the entries in the existing Vector3 inertia property in the RigidBody3D class. This is sufficient to define the rotational inertia of an object if the chosen axes of the body align with the inertia's principle axes. However, it is often useful to resolve the inertia tensor in an alternate basis, which introduces off-diagonal entries. The off-diagonal entries are referred to as the "products of inertia" and to be consistent, the inertia tensor must be symmetric.
I would argue against a re-implementation of the inertia property as a Godot basis. This would also break existing implementations that utilize the Vector3 inertia field, and it would not enforce symmetry. Instead, I would propose the addition an additional Vector3 property (
inertia_prod
or something along those lines) such that symmetry of the tensor can be ensured in the underlying implementation. This vector can be left zero by the user and certain underlying optimizations can be made if it is. However, giving users the option to specify the inertia in non-principle axes gives users a great deal more flexibility if attempting to accurately simulate motion of specific objects (namely vehicles).Should this proposal be considered, I would recommend the following order for the new vector3: [Iyz, Ixz, Ixy]. This is consistent with the Voigt form of symmetric tensors such that this new
inertia_prod
vector represents the second half of a Voigt form tensor.Beta Was this translation helpful? Give feedback.
All reactions