physics.setMKS()

类型 函数
physics.*
返回值
修订 2024.3703 版
关键词 MKS 单位,物理
另请参见 physics.getMKS()

概述

针对特定键设置物理模拟的 MKS(米、千克和秒)值。此方法仅用于高级目的 — 一般开发者和项目不需要使用此函数。

语法

physics.setMKS( key, value )
key (必填)

String. 设置 MKS 单位的键。可以是下列任意值

  • "velocityThreshold" — 对应于 b2_velocityThreshold
  • "timeToSleep" — 对应于 b2_timeToSleep
  • "linearSleepTolerance" — 对应于 b2_linearSleepTolerance
  • "angularSleepTolerance" — 对应于 b2_angularSleepTolerance
value (必填)

Number. 已选 MKS 键所对应的值。

示例

physics.setMKS( "timeToSleep", 10 )