phaser4-rex-plugins
Version:
28 lines (24 loc) • 951 B
JavaScript
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2019 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
import RotateAroundXY from './RotateAroundXY.js';
/**
* 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.
*/
var RotateAroundPoint = function (triangle, point, angle) {
return RotateAroundXY(triangle, point.x, point.y, angle);
};
export default RotateAroundPoint;