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

Define explicit units for all relevant properties #7

Closed
aaronfranke opened this issue Dec 16, 2022 · 1 comment
Closed

Define explicit units for all relevant properties #7

aaronfranke opened this issue Dec 16, 2022 · 1 comment

Comments

@aaronfranke
Copy link
Contributor

The current draft spec does not explicitly define what units the numbers are in. Different engines use different conventions, so I think it's important to explicitly define what units the model is in, so that they can be converted as necessary.

I propose the following properties have their units explicitly defined with SI units wherever possible:

Rigid Bodies

Type Proposed Unit
mass number Kilograms (kg)
linearVelocity number[3] Meters per second (m/s)
angularVelocity number[3] Radians per second (rad/s)

Colliders

The details of the properties of the objects representing each collider shape have not been specified yet, but I propose that all of the distance units be explicitly specified to be in meters (m).

Joints

Type Proposed Unit
min number Meters (m) or Radians (rad)
max number Meters (m) or Radians (rad)
springConstant number Kilogram per second squared (kg/s²) aka Newton per meter (N/m)

For the spring constant, see https://en.wikipedia.org/wiki/Hooke%27s_law#Units_of_measurement

Scene Properties

Type Proposed Unit
gravity number[3] Meters per second squared (m/s²)
@eoineoineoin
Copy link
Owner

Yes, 100% agree; note, the glTF spec already specifies:

The units for all linear distances are meters.

All angles are in radians.

Positive rotation is counterclockwise.

https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#coordinate-system-and-units

Certainly would be good to reinforce and explicitly specify the new units.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants