arcade-physics
Version:
Use Arcade Physics without Phaser.
30 lines • 1.22 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 RotateAroundXY_1 = __importDefault(require("./RotateAroundXY"));
/**
* Rotates a Triangle at a certain angle about a given Point or object with public `x` and `y` properties.
*
* @function Phaser.Geom.Triangle.RotateAroundPoint
* @since 3.0.0
*
* @generic {Phaser.Geom.Triangle} O - [triangle,$return]
*
* @param {Phaser.Geom.Triangle} triangle - The Triangle to rotate.
* @param {Phaser.Geom.Point} point - The Point to rotate the Triangle about.
* @param {number} angle - The angle by which to rotate the Triangle, in radians.
*
* @return {Phaser.Geom.Triangle} The rotated Triangle.
*/
const RotateAroundPoint = (triangle, point, angle) => {
return (0, RotateAroundXY_1.default)(triangle, point.x, point.y, angle);
};
exports.default = RotateAroundPoint;
//# sourceMappingURL=RotateAroundPoint.js.map