arcade-physics
Version:
Use Arcade Physics without Phaser.
31 lines • 1.2 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"));
const InCenter_1 = __importDefault(require("./InCenter"));
/**
* Rotates a Triangle about its incenter, which is the point at which its three angle bisectors meet.
*
* @function Phaser.Geom.Triangle.Rotate
* @since 3.0.0
*
* @generic {Phaser.Geom.Triangle} O - [triangle,$return]
*
* @param {Phaser.Geom.Triangle} triangle - The Triangle to rotate.
* @param {number} angle - The angle by which to rotate the Triangle, in radians.
*
* @return {Phaser.Geom.Triangle} The rotated Triangle.
*/
const Rotate = (triangle, angle) => {
const point = (0, InCenter_1.default)(triangle);
return (0, RotateAroundXY_1.default)(triangle, point.x, point.y, angle);
};
exports.default = Rotate;
//# sourceMappingURL=Rotate.js.map