CCMathHelper
CCMathHelper
Cocos2DInheritance: System.Object
Fields
Pi(System.Single)
Pi_2(System.Single)
Pi_4(System.Single)
TwoPi(System.Single)
Methods
Clamp(int, int, int)
System.Int32 Clamp(int, int, int)(System.Int32 value, System.Int32 min, System.Int32 max)
Parameters:
value
(System.Int32)min
(System.Int32)max
(System.Int32)Returns:
System.Int32
Clamp(float, float, float)
System.Single Clamp(float, float, float)(System.Single value, System.Single min, System.Single max)
Parameters:
value
(System.Single)min
(System.Single)max
(System.Single)Returns:
System.Single
Cos(float)
System.Single Cos(float)(System.Single radian)
Parameters:
radian
(System.Single)Returns:
System.Single
Lerp(int, int, float)
System.Int32 Lerp(int, int, float)(System.Int32 value1, System.Int32 value2, System.Single amount)
Parameters:
value1
(System.Int32)value2
(System.Int32)amount
(System.Single)Returns:
System.Int32
Lerp(float, float, float)
System.Single Lerp(float, float, float)(System.Single value1, System.Single value2, System.Single amount)
Linearly interpolates between two values.
Parameters:
value1
(System.Single) - Source value.value2
(System.Single) - Source value.amount
(System.Single) - Value between 0 and 1 indicating the weight of value2.Returns:
System.Single
- Interpolated value.Example
Sin(float)
System.Single Sin(float)(System.Single radian)
Parameters:
radian
(System.Single)Returns:
System.Single
ToDegrees(float)
System.Single ToDegrees(float)(System.Single radians)
Parameters:
radians
(System.Single)Returns:
System.Single
ToRadians(float)
System.Single ToRadians(float)(System.Single degrees)
Parameters:
degrees
(System.Single)Returns:
System.Single