C# Class ShineEngine.MathUtils

数学方法
Mostrar archivo Open project: shineTeam7/home3 Class Usage Examples

Public Methods

Method Description
absMod ( int a, int b ) : int

循环取模运算 (区别于%运算,例:absMode(-1,3) = 2)

absMode ( float a, float b ) : float

循环取模运算 (区别于%运算,例:absMode(-1,3) = 2)

clamp ( double value, double min, double max ) : double
clamp ( float value, float min, float max ) : float
clamp ( int value, int min, int max ) : int
copyVec3 ( Vector3 &vec ) : void
cutRadian ( float value ) : float
floatEquals ( float a, float b ) : bool
getIntBitNum ( int n ) : int
getPowerOf2 ( int n ) : int
isPowerOf2 ( int n ) : bool
log2 ( int i ) : int
numberOfLeadingZeros ( uint i ) : uint
random ( ) : double

产生一个(0-1)的double

randomBoolean ( ) : bool

ran一bool值

randomDirection ( ) : float
randomFloat ( ) : float
randomInt ( ) : int
randomInt ( int len ) : int

产生一个整形(0<=value

randomLong ( ) : long
randomOffSet ( int value, int offset ) : int
randomOffSetF ( float value, float offset ) : float
randomOffSetPercent ( int value, int offset ) : int
randomProb ( int prob ) : bool
randomProb ( int prob, int max ) : bool
randomRange ( int start, int end ) : int
randomRange2 ( int start, int end ) : int

Method Details

absMod() public static method

循环取模运算 (区别于%运算,例:absMode(-1,3) = 2)
public static absMod ( int a, int b ) : int
a int
b int
return int

absMode() public static method

循环取模运算 (区别于%运算,例:absMode(-1,3) = 2)
public static absMode ( float a, float b ) : float
a float
b float
return float

clamp() public static method

public static clamp ( double value, double min, double max ) : double
value double
min double
max double
return double

clamp() public static method

public static clamp ( float value, float min, float max ) : float
value float
min float
max float
return float

clamp() public static method

public static clamp ( int value, int min, int max ) : int
value int
min int
max int
return int

copyVec3() public static method

public static copyVec3 ( Vector3 &vec ) : void
vec Vector3
return void

cutRadian() public static method

public static cutRadian ( float value ) : float
value float
return float

floatEquals() public static method

public static floatEquals ( float a, float b ) : bool
a float
b float
return bool

getIntBitNum() public static method

public static getIntBitNum ( int n ) : int
n int
return int

getPowerOf2() public static method

public static getPowerOf2 ( int n ) : int
n int
return int

isPowerOf2() public static method

public static isPowerOf2 ( int n ) : bool
n int
return bool

log2() public static method

public static log2 ( int i ) : int
i int
return int

numberOfLeadingZeros() public static method

public static numberOfLeadingZeros ( uint i ) : uint
i uint
return uint

random() public static method

产生一个(0-1)的double
public static random ( ) : double
return double

randomBoolean() public static method

ran一bool值
public static randomBoolean ( ) : bool
return bool

randomDirection() public static method

public static randomDirection ( ) : float
return float

randomFloat() public static method

public static randomFloat ( ) : float
return float

randomInt() public static method

public static randomInt ( ) : int
return int

randomInt() public static method

产生一个整形(0<=value
public static randomInt ( int len ) : int
len int
return int

randomLong() public static method

public static randomLong ( ) : long
return long

randomOffSet() public static method

public static randomOffSet ( int value, int offset ) : int
value int
offset int
return int

randomOffSetF() public static method

public static randomOffSetF ( float value, float offset ) : float
value float
offset float
return float

randomOffSetPercent() public static method

public static randomOffSetPercent ( int value, int offset ) : int
value int
offset int
return int

randomProb() public static method

public static randomProb ( int prob ) : bool
prob int
return bool

randomProb() public static method

public static randomProb ( int prob, int max ) : bool
prob int
max int
return bool

randomRange() public static method

public static randomRange ( int start, int end ) : int
start int
end int
return int

randomRange2() public static method

public static randomRange2 ( int start, int end ) : int
start int
end int
return int