Subversion Repositories gelsvn

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 bj 1
#ifndef __CGLA__ARITHVEC3INT_H__
2
#define __CGLA__ARITHVEC3INT_H__
3
 
4
#include "ArithVecInt.h"
5
 
6
namespace CGLA {
7
 
8
	template<class T, class V>
9
	class ArithVec3Int: public ArithVecInt<T,V,3>
10
	{
11
	public:
12
 
13
		/// Construct a 3D int vector.
14
		ArithVec3Int(T a, T b, T c): ArithVecInt<T,V,3>(a,b,c) {}
15
 
16
		/// Construct a 3D int vector.
17
		ArithVec3Int() {}
18
 
19
	};
20
 
21
	/// Returns cross product of arguments
22
	template<class T, class V>
23
	inline V cross( const ArithVec3Int<T,V>& x, 
24
									const ArithVec3Int<T,V>& y ) 
25
	{
26
		return V( x[1] * y[2] - x[2] * y[1], 
27
							x[2] * y[0] - x[0] * y[2], 
28
							x[0] * y[1] - x[1] * y[0] );
29
	}
30
 
31
}
32
 
33
#endif
34