2017-01-01 14:33:41 +00:00
|
|
|
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)
|
2017-01-01 14:33:41 +00:00
|
|
|
{
|
|
|
|
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;
|