physics.setMKS()

Type Function
Library physics.*
Return value none
Revision 2017.3178
Keywords MKS units, physics
See also physics.getMKS()

Overview

Sets the MKS (meters, kilograms, and seconds) value of the physics simulation for specific keys. This is strictly for advanced purposes — the average developer and project will not require this function.

Syntax

physics.setMKS( key, value )
key (required)

String. The key to set MKS units for. Can be any one of the following values:

  • "velocityThreshold" — corresponds to b2_velocityThreshold.
  • "timeToSleep" — corresponds to b2_timeToSleep.
  • "linearSleepTolerance" — corresponds to b2_linearSleepTolerance.
  • "angularSleepTolerance" — corresponds to b2_angularSleepTolerance.
value (required)

Number. The value of for the chosen MKS key.

Example

physics.setMKS( "timeToSleep", 10 )