phaser/src/geom/intersects/CircleToCircle.js

26 lines
718 B
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var DistanceBetween = require('../../math/distance/DistanceBetween');
2017-10-13 13:11:54 +00:00
/**
* [description]
*
* @function Phaser.Geom.Intersects.CircleToCircle
* @since 3.0.0
*
* @param {Phaser.Geom.Circle} circleA - [description]
* @param {Phaser.Geom.Circle} circleB - [description]
*
* @return {boolean} [description]
*/
2017-01-04 00:21:26 +00:00
var CircleToCircle = function (circleA, circleB)
{
return (DistanceBetween(circleA.x, circleA.y, circleB.x, circleB.y) <= (circleA.radius + circleB.radius));
};
2017-01-04 00:21:26 +00:00
module.exports = CircleToCircle;