summaryrefslogtreecommitdiffstats
path: root/src/General.h
blob: 1dec2d54e930066f4ffefa2732ffe5527ad1a279 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21



class CGeneral
{
public:
	static float GetATanOfXY(float x, float y){
		if(y >= 0.0f) return atan2(x, y);
		return atan2(x, y) + 2*M_PI;
	}

	// not too sure about all these...
	static uint16 GetRandomNumber(void)
		{ return myrand() & 0xFFFF; }
	// Probably don't want to ever reach high
	static float GetRandomNumberInRange(float low, float high)
		{ return low + (high - low)*(GetRandomNumber()/float(MY_RAND_MAX + 1)); }
		
	static Int32 GetRandomNumberInRange(Int32 low, Int32 high)
		{ return low + (high - low)*(GetRandomNumber()/float(MY_RAND_MAX + 1)); }
};