SI units in Game engines #11871
Replies: 2 comments 2 replies
-
That said... I personally feel that using multiple units provides more benefit when built into an editor than being in the code itself, in the context of a game engine. Especially given the duplication of components and systems to support every unit and the pain of unifying those data sources at runtime. Otherwise, the different units end up remaining completely external to the engine causing duplicate components, systems, and events to handle each unit type. Thus, I suspect adding multiple units to bevy would end up as a re-export of Going beyond one unit per concept adds unnecessary complexity to the engine and would need to be a separate abstraction on top of the engine; since, all units would need to be converted to the same one to simplify the calculations within the engine to reduce the risk of errors for one unit but not another. I would recommend using the TLDR; adding multiple units per concept would add unnecessary complexity to the engine and, generally, better outside of the engine |
Beta Was this translation helpful? Give feedback.
-
Please check out this issue (radians vs degrees): #11132 I only needed dimension units once (to distinguish rpm vs rad/s) in my previous projects, so I don't think it's necessary to have in bevy, but still worth keeping in mind if more use-cases emerge. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello~
I am sorry if this doesn't belong here, i didn't know where to ask for it. Please let me know if i should remove and where i should ask instead if it was not appropriate.
I extensively use
uom
for some private projects, it saved me a lot of mistakes and made things clearer (apart from some error messages related to the generic essence of those structs) and I was wondering the place of using typed SI Units in Game engines.Yesterday i was tinkering with the physic engine bevy xpdb and wondered if there could be a way so that we could have typed units for parameters (Length, Force, ...).
I also saw this issue #11577 (comment) in bevy that mentioned using real units instead of abstract ones, in this example for Lumen (or other).
Having typed dimension units in my opinion makes it clear without documentation about what the value is suppose to be (instead of a simple number).
Does this kind of approach make sense and would it be feasible?
Beta Was this translation helpful? Give feedback.
All reactions