UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

27 lines (24 loc) 587 B
import { aabb2_distance_sqr_to_point } from "./aabb2_distance_sqr_to_point.js"; /** * * @param {number} x0 * @param {number} y0 * @param {number} x1 * @param {number} y1 * @param {number} center_x * @param {number} center_y * @param {number} radius * @return {boolean} */ export function aabb2_intersects_circle( x0, y0, x1, y1, center_x, center_y, radius ) { const distance_to_center = aabb2_distance_sqr_to_point( x0, y0, x1, y1, center_x, center_y ); return distance_to_center < radius * radius; }