What's the big deal with units? It ocours to me that units in a simulation Dont Matter At all on the library level. Of course, in your individual program, it matters a great deal. But just assuming mks units would make everything very, very simple. Because there are no inherent scaling factors in MKS. Therefore, it it relatively easy for the user to set thier own units without even telling the engine what units it uses For example, I'm building a space game. I routinely deal with multi-megaton asteroids and spaceships that mass about 10 tons each. Ships tend to be tens of meters long.
So are my masses things like 30000000000,(30 million metric tons, the mass of an asteroid you build your base on) or 10000000(10 metric tones, the mass of my command ship)? Are my lengths things like 20 meters 1000, etc?
No. I use different conventions. I feed my physics engine things like 3000 and .1 for mass and 1 and 5 and 100 for length.
Why does this work? Because I keep my units consistent. My base unit of mass is 100 tons. My base length is 10 meters. Time is of course seconds. Keeping this consistent is not difficult, but there is a trick to it. Because acceleration is length/time^2, I get 10m/s^2 as my base unit of lenth. So when I measure acceleration, I do it in earth gravities. Force = mass * acceleration, so 10m/s^2 * 100tons = 1 million kgm/s^2, or 1 meganewton. Torque and energy are both Length * force, so the units of energy are 10Mj, and torque is 10MNm. Density is mass/length^3, so it has units of 100kg/m^3, so water has a density of ten. Using these units, Nasa's space shuttle orbiter has a fully loaded mass of 1.09, a length of 2, and a thrust per engine of 2(three engines, thrust = 6) These units are, in my opinion, much easier to work with. much easier to work with than 20 meters, 109000000kg, and 6000000 N. I don't spend so much time counting zeroes!!
So do I hear so much about what units box2d should be in?
So are my masses things like 30000000000,(30 million metric tons, the mass of an asteroid you build your base on) or 10000000(10 metric tones, the mass of my command ship)? Are my lengths things like 20 meters 1000, etc?
No. I use different conventions. I feed my physics engine things like 3000 and .1 for mass and 1 and 5 and 100 for length.
Why does this work? Because I keep my units consistent. My base unit of mass is 100 tons. My base length is 10 meters. Time is of course seconds. Keeping this consistent is not difficult, but there is a trick to it. Because acceleration is length/time^2, I get 10m/s^2 as my base unit of lenth. So when I measure acceleration, I do it in earth gravities. Force = mass * acceleration, so 10m/s^2 * 100tons = 1 million kgm/s^2, or 1 meganewton. Torque and energy are both Length * force, so the units of energy are 10Mj, and torque is 10MNm. Density is mass/length^3, so it has units of 100kg/m^3, so water has a density of ten. Using these units, Nasa's space shuttle orbiter has a fully loaded mass of 1.09, a length of 2, and a thrust per engine of 2(three engines, thrust = 6) These units are, in my opinion, much easier to work with. much easier to work with than 20 meters, 109000000kg, and 6000000 N. I don't spend so much time counting zeroes!!
So do I hear so much about what units box2d should be in?