Units of mass

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
jbosch
Posts: 43
Joined: Sat May 29, 2010 4:42 pm
Contact:

Units of mass

Post by jbosch »

Hi,

How does work the units of mass? I mean, 1 unit applied to an entity could be considered a Newton, or how does it works?

Thanks!

JB
Jesús Bosch
XNA BLOG: http://geeks.ms/blogs/jbosch
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Units of mass

Post by Norbo »

It's arbitrary; you can choose whatever meaning you'd like for each dimension, so long as it's consistent. I typically think of it as meters for length, something like kilograms for mass, seconds for time, and so on.

Using these choices, for example, units of force would be a regular 'newton:' kg*m / s^2.

I wrote up a pretty in-depth description of this a while back and I'll try to find it to post here in a minute.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Units of mass

Post by Norbo »

Found it:

The physics engine in general is unitless. You can arbitrarily choose meanings for length or mass units to get to whatever unit you'd like to use. Usually, I like to consider units to be 'meters' or something close, since most objects in the demos have pretty normal sizes when measured in meters (like 3.5-4.5 units for a car's length).

As an aside, there is also an extra size design constraint imposed by single precision floating point numbers which makes it beneficial to choose 'normal' numbers that aren't too small or too big. More information can be found in this thread: http://www.bepu-games.com/forums/viewto ... ?f=4&t=853.

Masses are more more forgiving to floating point precision issues, but it's a good idea to avoid measuring your car's weight in micrograms or petagrams.

The best way to think about the units is abstractly. Impulses and forces are transformed by inertia to become velocity and vice versa. Linear velocity's units are just 'length units' per 'time unit.' A wheel's angular velocity should be in radians/'time unit.'

As another example, one newton is just one kilogram-meter per second per second. This can be generalized to 'mass unit'-'length unit' per 'time unit' per 'time unit.'

Basically, as long as you choose values and units that fit with your simulation, the engine won't care.
jbosch
Posts: 43
Joined: Sat May 29, 2010 4:42 pm
Contact:

Re: Units of mass

Post by jbosch »

great! thanks!
Jesús Bosch
XNA BLOG: http://geeks.ms/blogs/jbosch
Post Reply