mirror of
https://github.com/liabru/matter-js.git
synced 2025-03-08 23:03:36 -05:00
Allow for negative force to bring a body out of sleeping state.
This commit is contained in:
parent
f4f3bf7c48
commit
d585e80b5b
3 changed files with 7 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* matter.js 0.8.0-edge 2015-01-21
|
* matter.js 0.8.0-edge 2015-03-03
|
||||||
* http://brm.io/matter-js/
|
* http://brm.io/matter-js/
|
||||||
* License: MIT
|
* License: MIT
|
||||||
*/
|
*/
|
||||||
|
@ -5115,7 +5115,7 @@ var Sleeping = {};
|
||||||
motion = body.speed * body.speed + body.angularSpeed * body.angularSpeed;
|
motion = body.speed * body.speed + body.angularSpeed * body.angularSpeed;
|
||||||
|
|
||||||
// wake up bodies if they have a force applied
|
// wake up bodies if they have a force applied
|
||||||
if (body.force.x > 0 || body.force.y > 0) {
|
if (body.force.x != 0 || body.force.y != 0) {
|
||||||
Sleeping.set(body, false);
|
Sleeping.set(body, false);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -5172,7 +5172,7 @@ var Sleeping = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description
|
* Description
|
||||||
* @method set
|
* @method set
|
||||||
|
|
4
build/matter.min.js
vendored
4
build/matter.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -27,7 +27,7 @@ var Sleeping = {};
|
||||||
motion = body.speed * body.speed + body.angularSpeed * body.angularSpeed;
|
motion = body.speed * body.speed + body.angularSpeed * body.angularSpeed;
|
||||||
|
|
||||||
// wake up bodies if they have a force applied
|
// wake up bodies if they have a force applied
|
||||||
if (body.force.x > 0 || body.force.y > 0) {
|
if (body.force.x != 0 || body.force.y != 0) {
|
||||||
Sleeping.set(body, false);
|
Sleeping.set(body, false);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ var Sleeping = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description
|
* Description
|
||||||
* @method set
|
* @method set
|
||||||
|
|
Loading…
Add table
Reference in a new issue