a rigiddbody and its mass unity

Hello guys,

I am kinda playing with the “mass” field of the rigidbody component and I was wondering if there is a kind of table which assigns mass value to the objects.

I modelled a displaycase (let’s say a kind of wardrobe) and I am feeling uncertain on the value of the mass to assign. This would affect the physical interaction with the objects.

Many thanks.
GC.

Mass is relative. Assign whatever value you like, as long as you’re consistent.

–Eric

I hear this advice a lot but I think people should really get out of thinking this way.

Personally I use Kg for mass. If you design your objects so that 1 unit = 1 m and you leave gravity at 9.81m/s you end up with realistic physics.
If you are going for realism don’t start inventing your own scale.

That doesn’t make much sense (not to me at least).

Setting aside other practical issues, if you run a simulation, then scale everything up by a factor of 10 and run it again (with everything adjusted accordingly, including camera parameters and so on), there should be no observable difference in behavior, correct? In other words, in the context of a computer simulation there’s no direct correlation between realism and scale (which your statement implies that there is).

Consider, for example, a physics-based game in which the actors are mile-long space vessels, and for which the environment includes moons and asteroids and so forth. Using SI units is going to give you very large values for size, mass, and applied forces, which isn’t so great from a numerical standpoint. What you’re more likely to do in a case like this is scale everything down by at least a couple of orders of magnitude. In other words, ‘inventing your own scale’ is exactly what you should do in this case.

Consider also that SI units are somewhat arbitrary already. This is sort of a fanciful example, but consider the case of an alien civilization in some other galaxy that, like us, has developed equations describing Newtonian physics. What are the chances of them using the same units we do? Pretty small, probably. Maybe for them, length is measured in units that would be 4.78 meters for us, and time is measured in units that would be .32 seconds for us. In other words, relative to us at least, they’ve ‘invented their own scale’. And yet, their description of Newtonian physics would be no less ‘realistic’ than ours.

(Actually, now that I think about it, that example isn’t really even necessary, given that humans themselves have used a variety of different units and measuring systems over the course of their collective history.)

When working with computer-simulated physics (especially in games), the primary concerns are going to be numerical rather than using ‘realistic units’, IMO; that is, staying in the numerical ‘sweet spot’ as far as the simulator is concerned, and avoiding overflow, precision loss, and other pitfalls of floating-point representations.

Now, I’m not an expert on physics simulations or on the internal workings of PhysX, so I’m certainly open to being proven wrong. But at this point at least, it’s not clear to me why ‘inventing your own scale’ in the context of computer-simulated physics would necessarily have any impact on realism.

I believe that if you created a simulation with everything multiplied by 10 yes, however, if you do not change gravity to match that factor then your simulation will be slow (gravity wise)

The core belief is that 1 unit=1 meter and gravity is setup that way to reflect that. If you said, who cares I will just make things as big as I want them, then that would open a whole other ball of wax that you don’t really want to get into.

If you haven’t changed gravity to match, then you haven’t multiplied everything by 10.

What ball of wax? Assuming you choose values that allow your simulation to be numerically well-behaved, why would it matter if 1 unit equals something other than 1 meter?

Well of course if you ensure that everything is scaled appropriately it will work. Basically my point was that you shouldn’t go about arbitrarily setting variables, even if you are “consistent” because you will then need to multiply all sorts of constants by your weird ratio. Most of the time metres and kg are easy enough to handle and actually measure yourself.

On the off chance you are making a game about bacteria or planets then you will find that you might want to use another system. :slight_smile:

I ran into a small problem when I was writing a buoyancy script. I stupidly forgot that the density of water 1.0 g/ml. So I went on my merry way, assuming I could leave it out because why bother multiplying by 1 right? Well 1.0g/ml = 1000kg/m^3. So I actually should have been multiplying my bouyant force by 1000. After I did everything worked swimmingly.

The important thing is to use some REAL unit (whether it’s km,m,cm,mm) as your basis and it will be easier to know when you need to convert physical constants.

Here’s my fanciful example:

The femur of a small dinosaur might be 20cm long, while the femur of a brontosaurus might be 200cm long. However look at the diameter of the cross section of the bone, the brontosaurus bone will be much thicker, much much more than the “expected” 10x thicker.

You can’t just scale things up/down willy-nilly!

The ‘multiply by 10’ was just an example. Clearly, the relationships between measurements and other measurements derived from them will not always be linear.

In any case, in your example of a dinosaur bone, it’s unlikely that you’d specify both the length and the diameter of the cross section manually. Rather, you would specify one of these values (most likely the length) and derive the other using some appropriate algorithm or equation (or so I’d imagine). As such, multiplying the length by 10 would be perfectly fine (the diameter would automatically adjust to match).

Also, the example was not about scaling values, but rather about scaling units. The length and diameter of a dinosaur bone will both most likely be measured using the same units. (Sure, you could give the length in meters and the diameter in centimeters, but that’s just a technicality.) The point is, changing the meaning of 1 unit affects both the length and diameter in exactly the same way; no one is talking about ‘scaling both the length and diameter by 10’.

Also, the important thing about the length vs. diameter question is the proportion or ratio between the two, which has nothing to do with what units are used to measure them.

Anyway, in short, the ‘dinosaur bone’ example doesn’t seem particularly relevant to me.

Can’t agree with that…unless you’re doing some kind of very realistic simulator, which most people aren’t, the feel of the game always trumps “realism”. You should be playing around with variables until it feels right, and that’s harder to do when you get in the mental state of worrying exactly how many Kgs, say, your car is vs. this rock you just put in the game. It’s easier to think in relative terms, where your main actor is 1.0, and therefore anything with half that mass is .5, and anything with twice that mass is 2.0.

–Eric

Antitheory, here’s the tl;dr version of my previous post:

With your dinosaur bone example, you’re talking about scaling values. However, what we’re talking about is scaling units. These are two different things, and as such, the dinosaur bone example doesn’t really have any bearing on the discussion at hand (IMO).

My preference, based on years of working with simulations to produce artistic effects, is to pick a real world scale, derive values based on that scale as a starting point then adjust them as necessary to get the ‘feel’ you want.

It’s important to note that simulations, especially ones running at realtime speeds, are horribly inaccurate. So expecting to get super-realistic behavior with ‘real’ values is naive. But real world values are a good place to start.

As far as choosing which scale to use - the one that keeps your most important objects at a reasonable size - somewhere between 1 and 100 units long, though exact bounds depend on the simulator.

The dinosaur bone example was kind-of a joke. :stuck_out_tongue:

It seems I have awoken a sleeping bear here with this discussion. I just dont understand why you would ever bother to chose something arbitrary like 1 unit = the length of my hand.

Of course you’ll want to change some numbers after-the-fact to improve gameplay or appearance, but the real figures are a great starting point. If you were making a game where a player could push big boulders into the water you would either need to make the rocks have a very low mass or you would need to make your character super strong

I prefer to mess with the “strength” of my character because it’s a lot more arbitrary. If we are saying this guy can push boulders, that’s fine, he’s obviously very strong. However if you say that the boulders can be pushed really easily (because you made their mass really low) then you’ve entered into make-believe world where boulders only weigh 1kg and float on water.

I guess it just depends on the type of game you are making. In this case the op said he/she needed to know the mass of a display-case. Well if you had been using meters for your unit, you would just need to make your mass whatever your display-case would weigh in kg and you are done. No messing around. You could fairly easily estimate/measure the mass of all the objects inside too, so if you knock it over they all react nicely.

I really cant see any advantage to not doing this, unless you are working on a very huge or very small scale.

Oh :slight_smile:

Well, I already gave an example. If you were making a game that took place around a moon with mile-long ships, you probably wouldn’t want to let 1 unit = 1 meter, as that would result in very high values for size, mass, and applied forces, which in turn wouldn’t be good for precision. (Note that this is somewhat speculative - I haven’t actually worked on a project like that myself - but most of the physics engines I’m familiar with recommend keeping things more or less in a numerical ‘sweet spot’, which in some cases at least would likely preclude the ‘1 unit = 1 meter’ approach.)

Assuming the boulders are too massive to be moved by any normal person, then you’ve entered into the world of make-believe whether you make the person super-strong or the boulders super-light. Given that it’s more or less arbitrary either way, better to choose a scale that’s numerically well-behaved, IMO.

Anyway, all that really matters is whether your game works and behaves the way you want it to. If using SI units works for you, great. But, just because you personally can’t understand why someone else might want to do it differently doesn’t mean there’s no reason to do it differently :slight_smile:

Fair enough. Maybe I am just going a little crazy here anyways. I just spent the last couple of hours writing a script to get the cross-sectional area of a complex model from “every” different angle, store them in a lookup-table, and use them to calculate the drag on vehicles (airplanes, boats). To me it seems easier to script with this realistic approach. It might not be for everybody… and who knows, it could turn into a disaster.

I may have forgot that not everyone is as interested in making something very real, and are more focused on gameplay (something which I will have to get around to one day).

Sure, it’s probably mostly a question of context and personal preference. (That is, the approach that works well for one developer and/or type of project might not work as well for another, and vice versa.)