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"));
/**
* Tests if a triangle contains a point.
*
* @function Phaser.Geom.Triangle.ContainsPoint
* @since 3.0.0
*
* @param {Phaser.Geom.Triangle} triangle - The triangle.
* @param {(Phaser.Geom.Point|Phaser.Math.Vector2|any)} point - The point to test, or any point-like object with public `x` and `y` properties.
*
* @return {boolean} `true` if the point is within the triangle, otherwise `false`.
*/
const ContainsPoint = (triangle, point) => {
return (0, Contains_1.default)(triangle, point.x, point.y);
};
exports.default = ContainsPoint;
//# sourceMappingURL=ContainsPoint.js.map