Do not invert (physics) shape size data for circle, rectangle, capsuel & line #445

This commit is contained in:
photonstorm
2014-02-19 15:21:03 +00:00
parent 812de7d994
commit 1d3616f52c
4 changed files with 78 additions and 26 deletions
+31 -1
View File
@@ -1299,7 +1299,9 @@ Phaser.Math = {
* @return {number} The scaled value.
*/
p2px: function (v) {
return v *= -20;
return v *= 20;
},
/**
@@ -1310,7 +1312,35 @@ Phaser.Math = {
* @return {number} The scaled value.
*/
px2p: function (v) {
return v * 0.05;
},
/**
* Convert p2 physics value (meters) to pixel scale and inverses it.
*
* @method Phaser.Math#p2pxi
* @param {number} v - The value to convert.
* @return {number} The scaled value.
*/
p2pxi: function (v) {
return v *= -20;
},
/**
* Convert pixel value to p2 physics scale (meters) and inverses it.
*
* @method Phaser.Math#px2pi
* @param {number} v - The value to convert.
* @return {number} The scaled value.
*/
px2pi: function (v) {
return v * -0.05;
},
/**