类型 函数 库 physics.* 返回值 无 修订 2024.3703 版 关键词 MKS 单位,物理 另请参见 physics.getMKS()
针对特定键设置物理模拟的 MKS(米、千克和秒)值。此方法仅用于高级目的 — 一般开发者和项目不需要使用此函数。
physics.setMKS( key, value )
String. 设置 MKS 单位的键。可以是下列任意值
"velocityThreshold"
— 对应于 b2_velocityThreshold
。"timeToSleep"
— 对应于 b2_timeToSleep
。"linearSleepTolerance"
— 对应于 b2_linearSleepTolerance
。"angularSleepTolerance"
— 对应于 b2_angularSleepTolerance
。Number. 已选 MKS 键所对应的值。
physics.setMKS( "timeToSleep", 10 )