How to correctly do world scaling?

Software: Away3D 4.x

Van Hellsing, Newbie
Posted: 21 January 2014 10:52 AM   Total Posts: 30

I’ve been doing a lot of research, and seen http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Scaling_The_World

So the question is, what exactly does physicsWorld.scaling do? What values of those listed in the bullet wiki it scales?

How do I perform a correct scaling? As the article says, bullet works fine with size values in the range of .05 to 10, which in Away3D with default scaling is 5 to 1000. I need to bring this range down to 2.5 to 5000.

What do I need to change besides physicsWorld.scaling = 200, to keep all the relative speeds and time consistent to the player?

   

Van Hellsing, Newbie
Posted: 23 January 2014 11:05 PM   Total Posts: 30   [ # 1 ]

Ok. With some experiments and a bit of luck, I have gone to a conclusion:

physicsWorld.scaling actually takes care of the following two:

* Scale collision shapes about origin by X
* Scale all positions by X

so, you DON"T HAVE TO DO THESE.

What you have to do is this:
set physicsWorld.scaling to 100 * X
* DIVIDE all linear (but not angular) velocities by X
* DIVIDE linear [Sleep Threshold] by X
* DIVIDE gravity by X
* DIVIDE all impulses you supply by X
* DIVIDE all torques by X^2
* DIVIDE all inertias by X if not computed by Bullet

I remind, that this is the case if you want to keep Away3D dimensions the same, but change physics precision limits.

Haven’t checked yet what to do with impulse thresholds.

Hope this helps someone out there at some point.

   

Mal Duffin, Newbie
Posted: 31 January 2014 12:47 PM   Total Posts: 14   [ # 2 ]

Hi Van,

Many thanks for posting the info, that is def useful to know.

Mal

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X