We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 928b883 + 97a838e commit 511b2f0Copy full SHA for 511b2f0
1 file changed
src/math/Math.js
@@ -774,11 +774,12 @@ Phaser.Math = {
774
*
775
* @method Phaser.Math#wrapAngle
776
* @param {number} angle - The angle value to check
777
+ * @param {boolean} radians - True if angle sizes are expressed in radians.
778
* @return {number} The new angle value, returns the same as the input angle if it was within bounds.
779
*/
- wrapAngle: function (angle) {
780
-
781
- return this.wrap(angle, -180, 180);
+ wrapAngle: function (angle, radians) {
+ var radianFactor = (radians) ? Math.PI / 180 : 1;
782
+ return this.wrap(angle, -180 * radianFactor, 180 * radianFactor);
783
784
},
785
0 commit comments