Subversion Repositories gelsvn

Rev

Rev 306 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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