mirror of
https://github.com/wassname/phaser.git
synced 2026-07-14 01:10:16 +08:00
Fixed issue where loadTexture would sometimes incorrectly try to apply the texture update twice. Also fixed bug in Math.angleBetween.
This commit is contained in:
+12
-1
@@ -336,7 +336,18 @@ Phaser.Math = {
|
||||
* @return {number}
|
||||
*/
|
||||
angleBetween: function (x1, y1, x2, y2) {
|
||||
return Math.atan2(y2 - y1, x2 - x1);
|
||||
return Math.atan2(x2 - x1, y2 - y1);
|
||||
},
|
||||
|
||||
/**
|
||||
* Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).
|
||||
* @method Phaser.Math#angleBetweenPoints
|
||||
* @param {Phaser.Point} point1
|
||||
* @param {Phaser.Point} point2
|
||||
* @return {number}
|
||||
*/
|
||||
angleBetweenPoints: function (point1, point2) {
|
||||
return Math.atan2(point2.x - point1.x, point2.y - point1.y);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user