phaser/src/math/const.js

87 lines
1.8 KiB
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
2020-01-15 12:07:09 +00:00
* @copyright 2020 Photon Storm Ltd.
2019-05-10 15:15:04 +00:00
* @license {@link https://opensource.org/licenses/MIT|MIT License}
2018-02-12 16:01:20 +00:00
*/
var MATH_CONST = {
2018-01-26 06:19:27 +00:00
/**
2018-02-07 21:58:23 +00:00
* The value of PI * 2.
*
* @name Phaser.Math.PI2
* @type {number}
* @since 3.0.0
*/
PI2: Math.PI * 2,
2018-01-26 06:19:27 +00:00
/**
2018-02-07 21:58:23 +00:00
* The value of PI * 0.5.
*
* @name Phaser.Math.TAU
* @type {number}
* @since 3.0.0
*/
TAU: Math.PI * 0.5,
2018-01-26 06:19:27 +00:00
/**
2018-02-07 21:58:23 +00:00
* An epsilon value (1.0e-6)
*
* @name Phaser.Math.EPSILON
* @type {number}
* @since 3.0.0
*/
EPSILON: 1.0e-6,
2018-01-26 06:19:27 +00:00
/**
2018-02-07 21:58:23 +00:00
* For converting degrees to radians (PI / 180)
*
* @name Phaser.Math.DEG_TO_RAD
* @type {number}
* @since 3.0.0
*/
DEG_TO_RAD: Math.PI / 180,
2018-01-26 06:19:27 +00:00
/**
2018-02-07 21:58:23 +00:00
* For converting radians to degrees (180 / PI)
*
* @name Phaser.Math.RAD_TO_DEG
* @type {number}
* @since 3.0.0
*/
RAD_TO_DEG: 180 / Math.PI,
2018-01-26 06:19:27 +00:00
/**
2018-02-07 21:58:23 +00:00
* An instance of the Random Number Generator.
2018-12-13 13:09:14 +00:00
* This is not set until the Game boots.
2018-02-07 21:58:23 +00:00
*
* @name Phaser.Math.RND
* @type {Phaser.Math.RandomDataGenerator}
* @since 3.0.0
*/
RND: null,
/**
* The minimum safe integer this browser supports.
* We use a const for backward compatibility with Internet Explorer.
*
* @name Phaser.Math.MIN_SAFE_INTEGER
* @type {number}
* @since 3.21.0
*/
MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER || -9007199254740991,
/**
* The maximum safe integer this browser supports.
* We use a const for backward compatibility with Internet Explorer.
*
* @name Phaser.Math.MAX_SAFE_INTEGER
* @type {number}
* @since 3.21.0
*/
MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991
};
module.exports = MATH_CONST;