下载Cocos Creator
来源:Cocos
浏览 586
扫码
分享
2019-04-11 20:47:04
- Editor.Math
- Properties
- Methods
- Editor.Math.deg2rad (degree)
- Editor.Math.rad2deg (radius)
- Editor.Math.rad180 (radius)
- Editor.Math.rad360 (radius)
- Editor.Math.deg180 (degree)
- Editor.Math.deg360 (degree)
- Editor.Math.randomRange (min, max)
- Editor.Math.randomRangeInt (min, max)
- Editor.Math.clamp (val, min, max)
- Editor.Math.clamp01 (val)
- Editor.Math.calculateMaxRect (out, p0, p1, p2, p3)
- Editor.Math.lerp (from, to, ratio)
- Editor.Math.numOfDecimals (val)
- Editor.Math.numOfDecimalsF (val)
- Editor.Math.toPrecision (val, precision)
- Editor.Math.bezier (c0, c1, c2, c3, t)
- Editor.Math.solveCubicBezier (c0, c1, c2, c3, x)
Editor.Math
Properties
Editor.Math.EPSILON
Editor.Math.MACHINE_EPSILON
Editor.Math.TWO_PI
Editor.Math.HALF_PI
Editor.Math.D2R
Editor.Math.R2D
Methods
Editor.Math.deg2rad (degree)
degree
number
Degree to radius.
Editor.Math.rad2deg (radius)
radius
number
Radius to degree.
Editor.Math.rad180 (radius)
radius
number
Let radius in -pi to pi.
Editor.Math.rad360 (radius)
radius
number
Let radius in 0 to 2pi.
Editor.Math.deg180 (degree)
degree
number
Let degree in -180 to 180.
Editor.Math.deg360 (degree)
degree
number
Let degree in 0 to 360.
Editor.Math.randomRange (min, max)
min
numbermax
number
Returns a random floating-point number between min (inclusive) and max (exclusive).
Editor.Math.randomRangeInt (min, max)
min
numbermax
number
Returns a random integer between min (inclusive) and max (exclusive).
Editor.Math.clamp (val, min, max)
val
numbermin
numbermax
number
Clamps a value between a minimum float and maximum float value.
Editor.Math.clamp01 (val)
val
number
Clamps a value between 0 and 1.
Editor.Math.calculateMaxRect (out, p0, p1, p2, p3)
out
rectp0
vec2p1
vec2p2
vec2p3
vec2
Editor.Math.lerp (from, to, ratio)
from
numberto
numberratio
number
Editor.Math.numOfDecimals (val)
val
number
Get number of decimals for decimal part.
Editor.Math.numOfDecimalsF (val)
val
number
Get number of decimals for fractional part.
Editor.Math.toPrecision (val, precision)
val
numberprecision
number
Editor.Math.bezier (c0, c1, c2, c3, t)
c0
numberc1
numberc2
numberc3
numbert
number
Editor.Math.solveCubicBezier (c0, c1, c2, c3, x)
c0
numberc1
numberc2
numberc3
numberx
number
当前内容版权归
Cocos 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问
Cocos .