zoukankan      html  css  js  c++  java
  • NewtonGetGlobalScale

    dFloat NewtonGetGlobalScale(const NewtonWorld* newtonWorld)
    Get the global scale factor.
    设计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

     

    See also

    NewtonCreate dFloat NewtonGetGlobalScale(const NewtonWorld* newtonWorld) { Newton *world; world = (Newton *) newtonWorld; return world->GetGlobalScale(); return dgFloat32(1.0f); }
  • 相关阅读:
    acdream 1017: Fast Transportation 网络流层次图
    centos5的kernel source
    Linux内核源代码的阅读及相关工具介绍(转)
    gcc生成静态库和动态库(转)
    写一篇大家一看就会的教程《JNI初步》(转)
    jni.h
    5分钟学用Lucene
    (VC2005) picture 控件显示16*16的Icon
    (VC/MFC)通过结构体传递参数给线程
    (VC2005)MFC中添加控件的成员变量.
  • 原文地址:https://www.cnblogs.com/imxh/p/878065.html
Copyright © 2011-2022 走看看