[ create a new paste ] login | about

Link: http://codepad.org/kQYjzV5s    [ raw code | output | fork ]

C, pasted on Jul 10:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
bool check_diff(int n1, int n2, int fat) {
	return ( ( (n2>n1) & (n2-fat<n1) ) | ( (n2<n1) & (n2+fat>n1) ) );
}

bool check_collision( int x1, int y1, int z1, int x2, int y2, int z2, 
						int fx1, int fy1, int fz1, int fx2, int fy2, int fz2 ) {
	
	//do_draw_box( x2,y2,z2, 0, 0xCAA95F44, fx2, fy2, fz2 ); //show x2 bounding box
	//do_draw_box( x1,y1,z1, 0, 0xCAA95F44, fx1, fy1, fz1 ); //show x1 bounding box		
	
	return ( (
			check_diff(x1, x2, fx1) & check_diff(y1, y2, fy1) & check_diff(z1, z2, fz1) //check 1st
		 ) | (
			check_diff(x2, x1, fx2) & check_diff(y2, y1, fy2) & check_diff(z2, z1, fz2) //check 2nd		 
		 )	);
	
}


Output:
1
2
Line 1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'check_diff'
Line 5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'check_collision'


Create a new paste based on this one


Comments: