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); }
  • 相关阅读:
    idea 找不到包或找不到符号
    JOISC部分题解
    欧拉数学习笔记
    [清华集训2017]生成树计数
    [ZJOI2019]开关
    【题解】CF817E Choosing The Commander
    CSP-S 2020游记
    【学习笔记】线段树合并
    【题解】[IOI2005]Riv 河流
    【题解】哈希冲突
  • 原文地址:https://www.cnblogs.com/imxh/p/878065.html
Copyright © 2011-2022 走看看