C# 클래스 ShineEngine.MathUtils

数学方法
파일 보기 프로젝트 열기: shineTeam7/home3 1 사용 예제들

공개 메소드들

메소드 설명
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

메소드 상세

absMod() 공개 정적인 메소드

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

absMode() 공개 정적인 메소드

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

clamp() 공개 정적인 메소드

public static clamp ( double value, double min, double max ) : double
value double
min double
max double
리턴 double

clamp() 공개 정적인 메소드

public static clamp ( float value, float min, float max ) : float
value float
min float
max float
리턴 float

clamp() 공개 정적인 메소드

public static clamp ( int value, int min, int max ) : int
value int
min int
max int
리턴 int

copyVec3() 공개 정적인 메소드

public static copyVec3 ( Vector3 &vec ) : void
vec Vector3
리턴 void

cutRadian() 공개 정적인 메소드

public static cutRadian ( float value ) : float
value float
리턴 float

floatEquals() 공개 정적인 메소드

public static floatEquals ( float a, float b ) : bool
a float
b float
리턴 bool

getIntBitNum() 공개 정적인 메소드

public static getIntBitNum ( int n ) : int
n int
리턴 int

getPowerOf2() 공개 정적인 메소드

public static getPowerOf2 ( int n ) : int
n int
리턴 int

isPowerOf2() 공개 정적인 메소드

public static isPowerOf2 ( int n ) : bool
n int
리턴 bool

log2() 공개 정적인 메소드

public static log2 ( int i ) : int
i int
리턴 int

numberOfLeadingZeros() 공개 정적인 메소드

public static numberOfLeadingZeros ( uint i ) : uint
i uint
리턴 uint

random() 공개 정적인 메소드

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

randomBoolean() 공개 정적인 메소드

ran一bool值
public static randomBoolean ( ) : bool
리턴 bool

randomDirection() 공개 정적인 메소드

public static randomDirection ( ) : float
리턴 float

randomFloat() 공개 정적인 메소드

public static randomFloat ( ) : float
리턴 float

randomInt() 공개 정적인 메소드

public static randomInt ( ) : int
리턴 int

randomInt() 공개 정적인 메소드

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

randomLong() 공개 정적인 메소드

public static randomLong ( ) : long
리턴 long

randomOffSet() 공개 정적인 메소드

public static randomOffSet ( int value, int offset ) : int
value int
offset int
리턴 int

randomOffSetF() 공개 정적인 메소드

public static randomOffSetF ( float value, float offset ) : float
value float
offset float
리턴 float

randomOffSetPercent() 공개 정적인 메소드

public static randomOffSetPercent ( int value, int offset ) : int
value int
offset int
리턴 int

randomProb() 공개 정적인 메소드

public static randomProb ( int prob ) : bool
prob int
리턴 bool

randomProb() 공개 정적인 메소드

public static randomProb ( int prob, int max ) : bool
prob int
max int
리턴 bool

randomRange() 공개 정적인 메소드

public static randomRange ( int start, int end ) : int
start int
end int
리턴 int

randomRange2() 공개 정적인 메소드

public static randomRange2 ( int start, int end ) : int
start int
end int
리턴 int