[SOLVED] OgreNewt's standard metric system

greyWiz

26-03-2006 03:14:50

Hi, everyone. I got a question about OgreNewt's standards related to units and metric system. Inside Ogre, you have the freedom to state the metric system and the scale used - one generic unit, for instance, could mean one meter, one feet, one centimenter, and so on...

Based on this, what is OgreNewt's standard? Let me try to explain the reason of my question. Suppose we have a gravity of 10m/s2; now, suppose also that we stated one generic unit meaning one meter. In this case, 0.01 unit will mean one centimeter, 1000 units will mean one kilometer, etc.

Even gravity being constant, the critical point here is the point of view of the watcher. An ant and a giant dinosaur, thrown from the same height, theoretically should reach the ground at the same time, and it's ok.

So, let's say they were thrown from a height of 10 meters. Despite the fact they reach the ground at the same time (one second), the ant will have the sensation that it fell from a huge height at a huge speed because, in relation to its size, ten meters is indeed a big space to cover. Now, our Godzilla, measuring 300 meters, will have a completely different sensation, since 10 meters will be the height of his feet's fingernails... :wink:

Now, imagine that OgreNewt's standard gravity is equal to Ogre's 10 generic units / seconds * seconds. If I'm not aware of that and create a standard where one generic unit means one kilometer, and apply this force to my camera and objects, I would have the impression that they fall ultra fast (a 2 meter object, e.g., will measure 0.002 units)! The opposite would also be true: one generic unit meaning one centimeter would give me the impression that my objects fall pretty slow, since all of them will be scaled differently from the physic's standards (here, the same 2 meters object will measure 200 units).

I hope that my absurd comparisons have made some sense... So please, if anyone colud help me about this metric issue, I'd be very thankful. :D

Thanks in advance!
Edgard

abhinavxrai

27-03-2006 09:25:45

I'm no so sure about this, but OgreNewt doesnt have a standard basic unit for any metric system. This said, we define our own scale and units. But then again, I'm not entirely sure about this.

sdragou

27-03-2006 10:26:12

In the StandardForceCallback gravity acceleration is 9.81 which means that it's units are m/s^2.
This is multiplied by the mass and the force is calculated.

So 1 unit of size has to be 1 meter and time has to be in seconds.

But if you change the forces that you apply by using custom force and torque callbacks the units are whatever you like.

greyWiz

27-03-2006 13:57:14

Ok, I guess this is what I needed to know. Thanks, folks! :D

walaber

28-03-2006 16:11:23

Newton (and OgreNewt by extension) have no inherent scale. but the most common scale with physics engines is 1 unit = 1m, so that is why the default callback uses 9.8 as the gravity constant. if you are using a different scale in your project, just create your own gravity callback using an appropriate value for your project.

greyWiz

29-03-2006 19:07:21

Well, coincidence or not, I had already stated im my project that 1 unit = 1 meter, so I guess everything will be running smoothly with the standard callback... ;)

Thanks for the answer, walaber! And, once again, thanks everyone! :)