Merge pull request #5391 from samme/fix/overlapR

Set Arcade.Body#overlapR in separateCircle()
This commit is contained in:
Richard Davey 2020-11-09 17:10:18 +00:00 committed by GitHub
commit d397551b3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1521,6 +1521,9 @@ var World = new Class({
overlap = (body1.halfWidth + body2.halfWidth) - DistanceBetween(body1.center.x, body1.center.y, body2.center.x, body2.center.y);
}
body1.overlapR = overlap;
body2.overlapR = overlap;
// Can't separate two immovable bodies, or a body with its own custom separation logic
if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateX || body2.customSeparateX)
{