arcade-physics
Version:
Use Arcade Physics without Phaser.
27 lines • 1.04 kB
JavaScript
;
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Contains_1 = __importDefault(require("./Contains"));
/**
* Checks the given Point again the Polygon to see if the Point lays within its vertices.
*
* @function Phaser.Geom.Polygon.ContainsPoint
* @since 3.0.0
*
* @param {Phaser.Geom.Polygon} polygon - The Polygon to check.
* @param {Phaser.Geom.Point} point - The Point to check if it's within the Polygon.
*
* @return {boolean} `true` if the Point is within the Polygon, otherwise `false`.
*/
const ContainsPoint = (polygon, point) => {
return (0, Contains_1.default)(polygon, point.x, point.y);
};
exports.default = ContainsPoint;
//# sourceMappingURL=ContainsPoint.js.map