Skip intersects check by argument

This commit is contained in:
samme 2020-05-04 22:06:24 -07:00
parent 992af0b15e
commit d80e4f5824

View file

@ -1341,12 +1341,14 @@ var World = new Class({
* @param {ArcadePhysicsCallback} [processCallback] - The process callback.
* @param {*} [callbackContext] - The context in which to invoke the callback.
* @param {boolean} [overlapOnly] - If this a collide or overlap check?
* @param {boolean} [intersects] - Assert that the bodies intersect and should not be tested before separation.
*
* @return {boolean} True if separation occurred, otherwise false.
*/
separate: function (body1, body2, processCallback, callbackContext, overlapOnly)
separate: function (body1, body2, processCallback, callbackContext, overlapOnly, intersects)
{
if (
!intersects &&
!body1.enable ||
!body2.enable ||
body1.checkCollision.none ||
@ -1983,7 +1985,7 @@ var World = new Class({
continue;
}
if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly))
if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly, true))
{
if (collideCallback)
{