BodyComponentOptions
Index
Properties
Properties
optionalconfig
Type declaration
optionalcanSleepByDefault?: boolean
optionaldefaultMass?: number
Configure default mass that bodies have
Default 10 mass units
optionalsleepBias?: number
Sleep bias - The weighted average to apply to the current frame body motion over one second
let bias = Math.pos(sleepBias, durationSeconds); let motion = bias * previousAverageMotion + (1 - bias) * currentFrameMotion;
Default 0.5
optionalsleepEpsilon?: number
Sleep epsilon - (small number) this is the amount of massless kinetic energy a body needs to be below to fall asleep
Default 0.07
optionalsleepTimeThreshold?: number
Amount of time that bodies (in contact islands) need to be below the sleepEpsilon
Default 1000ms
optionalwakeThreshold?: number
Wake Threshold - the amount of "motion" or massless kinetic energy need to wake a body from sleep
Default 0.07 * 3;
By default bodies do not sleep, this can be turned on to improve perf if you have a lot of bodies.
Default false