Subversion Repositories gelsvn

Rev

Rev 43 | Rev 125 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 43 Rev 45
Line 3... Line 3...
3
 
3
 
4
#include "ArithVec.h"
4
#include "ArithVec.h"
5
 
5
 
6
namespace CGLA {
6
namespace CGLA {
7
 
7
 
8
  template<class T, class V, int N>
8
  template<class T, class V, unsigned int N>
9
    class ArithVecFloat: public ArithVec<T,V,N>
9
    class ArithVecFloat: public ArithVec<T,V,N>
10
    {
10
    {
11
    public:
11
    public:
12
	  
12
	  
13
      ArithVecFloat() 
13
      ArithVecFloat() 
Line 42... Line 42...
42
	}
42
	}
43
		
43
		
44
    };
44
    };
45
 
45
 
46
  /// Returns normalized vector
46
  /// Returns normalized vector
47
  template<class T, class V, int N>
47
  template<class T, class V, unsigned int N>
48
    inline T length(const ArithVecFloat<T,V,N>& v) 
48
    inline T length(const ArithVecFloat<T,V,N>& v) 
49
    {
49
    {
50
      return v.length();
50
      return v.length();
51
    }
51
    }
52
	
52
	
53
	
53
	
54
  /// Returns normalized vector
54
  /// Returns normalized vector
55
  template<class T, class V, int N>
55
  template<class T, class V, unsigned int N>
56
    inline V normalize(const ArithVecFloat<T,V,N>& v) 
56
    inline V normalize(const ArithVecFloat<T,V,N>& v) 
57
    {
57
    {
58
      return v/v.length();
58
      return v/v.length();
59
    }
59
    }
60
}
60
}