NewtonGetGlobalScale
dFloat NewtonGetGlobalScale(const NewtonWorld* newtonWorld)
Get the global scale factor.
设计Newton引擎的全局缩放参数
设计Newton引擎的全局缩放参数
Remarks
the physics system in theory should be dimensionless, however in practice the engine have to be implemented with limited precision floating numbers and is also built for real-time simulation, it is inevitable that tolerances have to be used in order to increase performance, and reduce instabilities. These tolerances make the engine dimension dependent, for example let say a rigid body is considered at rest when its velocity is less than 0.01 units per second for some frames. For a program using meters as unit this translate to 0.01 meters per second, however for a program using centimeter this translate to 0.0001 meter per second, since the precession of speed is independent of the unit system, this means that in the second system the engine has to work much harder to bring the body to rest. A solution for this is to scale all tolerances to match the unit system. The argument globalScale must be a constant to convert the unit system in the game to meters, for example if in your game you are using 39 units is a meter, the globaScale must be 39. The exact conversion factor does not have to be exact, but the closer it is to reality the better performance the application will get. Applications that are already using meters as the unit system must pass 1.0 as globalScale.
物理系统应该是无量纲的,但是在实际应用中,引擎必须限制浮点数的精度建立实时的仿真.不可避免地要忍受性参的提高和稳定性的降低.这些
例如在你的游戏中用39 units为一米, globaScale必需是39