Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor (options?: ICreateBodyOptions) {
options = options || {};
this._name = options.name || '';
this._body = new CANNON.Body({
type: ERigidBodyType.DYNAMIC,
});
setWrap(this._body, this);
this._body.sleepSpeedLimit = 0.1; // Body will feel sleepy if speed<1 (speed == norm of velocity)
this._body.sleepTimeLimit = 1; // Body falls asleep after 1s of sleepiness
this._onCollidedListener = this._onCollided.bind(this);
}