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); }
  • 相关阅读:
    OC文件操作、获取文件属性
    【解决方法】Unexpected namespace prefix “xmlns” found for tag Layout
    hdu5301(2015多校2)--Buildings(构造)
    java_GC
    iOS开发项目之四 [ 调整自定义tabbar的位置与加号按钮的位置]
    李洪强-C语言3-数组
    李洪强-C语言2-字符串
    李洪强-C语言1-指针
    【C语言】07-基本语句和运算
    【C语言】06-基本数据类型
  • 原文地址:https://www.cnblogs.com/imxh/p/878065.html
Copyright © 2011-2022 走看看