Subversion Repositories gelsvn

Rev

Rev 89 | Rev 306 | 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_VEC3F_H__
2
#define __CGLA_VEC3F_H__
3
 
4
#include "ArithVec3Float.h"
5
#include "Vec3i.h"
6
#include "Vec3usi.h"
7
 
8
namespace CGLA {
9
	class Vec3d;
206 jrf 10
	class Vec4f;
2 bj 11
	class Quaternion;
12
 
89 jab 13
	/** \brief 3D float vector.
14
 
2 bj 15
			Class Vec3f is the vector typically used in 3D computer graphics. 
16
			The class has many constructors since we may need to convert from
17
			other vector types. Most of these are explicit to avoid automatic
18
			conversion. 
19
	*/
20
	class Vec3f: public ArithVec3Float<float,Vec3f>
21
	{
22
	public:
23
 
24
		/// Construct 0 vector.
25
		Vec3f(){}
26
 
27
		/// Construct a 3D float vector.
28
		Vec3f(float a, float b, float c): 
29
			ArithVec3Float<float,Vec3f>(a,b,c) {}
30
 
31
		/// Construct a vector with 3 identical coordinates.
32
		explicit Vec3f(float a): 
33
			ArithVec3Float<float,Vec3f>(a,a,a) {}
34
 
35
		/// Construct from a 3D int vector
36
		explicit Vec3f(const Vec3i& v): 
37
			ArithVec3Float<float,Vec3f>(v[0],v[1],v[2]) {}
38
 
39
		/// Construct from a 3D unsigned int vector.
40
		explicit Vec3f(const Vec3usi& v): 
41
			ArithVec3Float<float,Vec3f>(v[0],v[1],v[2]) {}
42
 
43
		/// Construct from a 3D double vector.
44
		explicit Vec3f(const Vec3d&);
45
 
46
		/// Construct from a Quaternion. ((NOTE: more explanation needed))
47
		explicit Vec3f(const Quaternion&);
48
 
206 jrf 49
		/// Construct from a 4D float vector (skipping the last value)
50
		explicit Vec3f(const Vec4f&);
2 bj 51
	};
52
 
53
}
54
#endif