mirror of
https://github.com/wassname/phaser.git
synced 2026-07-16 01:20:13 +08:00
Integrating p2.js.
This commit is contained in:
@@ -1280,6 +1280,28 @@ Phaser.Math = {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Convert p2 physics value to pixel scale.
|
||||
*
|
||||
* @method Phaser.Math#p2px
|
||||
* @param {number} v - The value to convert.
|
||||
* @return {number} The scaled value.
|
||||
*/
|
||||
p2px: function (v) {
|
||||
return v *= -20;
|
||||
},
|
||||
|
||||
/**
|
||||
* Convert pixel value to p2 physics scale.
|
||||
*
|
||||
* @method Phaser.Math#px2p
|
||||
* @param {number} v - The value to convert.
|
||||
* @return {number} The scaled value.
|
||||
*/
|
||||
px2p: function (v) {
|
||||
return v * -0.05;
|
||||
},
|
||||
|
||||
/**
|
||||
* Convert degrees to radians.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user