-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Increase precision of RigidBody mass
property
#89468
Increase precision of RigidBody mass
property
#89468
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is a band-aid on a wider editor issue, but this fix is fine for now.
I'm making this comment like the one that started post #89465 Perhaps increasing the precision of the mass property from 0.01 kg to 0.001 kg can be an improvement. But there is a more fundamental problem that it does not solve. You may want to work on a milligram scale or smaller. And then again you won't have the precision you need. This problem can be repeated with other units such as length (or position) if you want to work with bodies that have a size of few centimeters (or even millimeters). Additionally, the minimum ZOOM value (20cm) and the minimum navigation speed (20cm/s) can be very large (and uncomfortable) working at that scale. I think the underlying problem is that certain units are the ones that have been kept in mind for use with the editor tools, or for the Physics engine. I haven't seen the GODOT source code (maybe I wouldn't even understand it) but I suspect that I wouldn't get good results with the Physics engine if I work with objects whose mass and size are an arbitrary fraction of the reference units, probably because precision will be lost (due to rounding). I perfectly understand that you can work with the units in an abstract way, you can consider that each unit of length or mass is on the scale you want, you would only have to adjust some physical constants taken into account in the simulation. There are magnitudes such as the acceleration of gravity that is set to 9.81 by default. This value forces to interpretate that the unit of length is equal to one meter (1m). You could always replace this value with 981 and then reinterpret the unit of length to be equal to one centimeter (1cm). But the editor will still show the "m" symbol which represents meters. That can be confusing. I like properties's boxes, like position and mass, showing explicitly stated units. BUT THAT SYMBOL OF UNIT SHOULD BE CONFIGURABLE. At least one prefix should be configurable such as deci-, centi-, milli-,... Each could represent a multiplicative factor that would be replaced everywhere at the same time, including where constants such as the acceleration of gravity or in internal variables of the Physics engine. |
mass
property
Thanks! And congrats for your first merged Godot contribution 🎉 @L30n4rd0-4rg3nt1n0 For more context on additional flexibility for inputting arbitrary precision, see godotengine/godot-proposals#3524 For your suggestion to make units configurable, this would warrant a new proposal or discussion on https://github.com/godotengine/godot-proposals/discussions. I think this would add significant complexity for a relatively niche scenario - if using a non-standard unit scaling, it would probably make more sense to outright disable displaying SI units which no longer match the used scale. |
@akien-mga , I understand what you're saying about increasing complexity. The truth is that at this moment I would not know how to estimate the work that this type of change represents. When I mentioned modifying "prefixes" globally everywhere I was thinking it would be more aesthetic to be able to define the symbol for new units instead of just deleting them. After all the units appear in various places, for example when adjusting the zoom or navigation speed, as well as in multiple properties in the inspector. At this point, it would be strange to see them disappear completely. I was also thinking about physics constants like the acceleration of gravity (and perhaps some internal parameter of the physics engine), and perhaps a user starts working on one scale and then discovers it's better to move to another. Modifying a prefix would rescale all those magnitudes at the same time, it would be more comfortable for the user. But you're right, I guess the best thing would be I think carefully about what I'm saying in order to express it in a new proposal post. |
Increase precision of mass property in RigidBody2D and RigidBody3D from 0.01 kg to 0.001 kg for more precise simulations.
Fixes #89465