Simulate in cenitmeters

Hi everybody! I have a problem with scaling. I’ve serialized scene from Unreal into PhysX serialization format. Then I imported it into PhysX project based on Tank Snippet.

Units in Unreal are measured in centimeters, and I’ve got very huge objects in my PhysX scene 100 times larger than my tank. I set tanks size 100 times larger and set PxTolerancesScale like this:

PxTolerancesScale scale;
scale.length = 100;
scale.speed = 981;
scale.mass = 100000;

Now my tank moves differently than it was when it was small.

And I want the exact moving as it was when it was small.

How can I achieve this goal?


You will need to rescale the tank parameters to work with centimetres scale. For example, the moment of inertia has SI units kilograms metres squared but this needs to be expresed as kilograms centimetres squared if you are working in centimetres. Many other parameters are affected.

If you take a look at SnippetVehicleScale this should show you the parameters that need to be scaled and how to do the scaling. It takes a vehicle expressed in metres and converts it to centimetres. Look out for the function customizeVehicleToLengthScale. Customizing that to a tank should be very simple.

Also take a look at the Vehicles section in the Guide documentation. There is a sub-section called SI Units, which discusses this exact problem and lists all affected data fields and functions.



Thank you for the answer. Yesterday after posting I’ve found in vehicles documentation Scale Snippet and everything became clear to me.

Wow, Thank you very much for Si Units section. That is what I really needed.