phaser/src/geom/intersects/CircleToCircle.js

20 lines
516 B
JavaScript
Raw Normal View History

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;