Subversion Repositories gelsvn

Rev

Rev 206 | 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;
306 jrf 11
 
89 jab 12
	/** \brief 3D float vector.
13
 
2 bj 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
16
			other vector types. Most of these are explicit to avoid automatic
17
			conversion. 
18
	*/
19
	class Vec3f: public ArithVec3Float<float,Vec3f>
20
	{
21
	public:
22
 
23
		/// Construct 0 vector.
24
		Vec3f(){}
25
 
26
		/// Construct a 3D float vector.
27
		Vec3f(float a, float b, float c): 
28
			ArithVec3Float<float,Vec3f>(a,b,c) {}
29
 
30
		/// Construct a vector with 3 identical coordinates.
31
		explicit Vec3f(float a): 
32
			ArithVec3Float<float,Vec3f>(a,a,a) {}
33
 
34
		/// Construct from a 3D int vector
35
		explicit Vec3f(const Vec3i& v): 
36
			ArithVec3Float<float,Vec3f>(v[0],v[1],v[2]) {}
37
 
38
		/// Construct from a 3D unsigned int vector.
39
		explicit Vec3f(const Vec3usi& v): 
40
			ArithVec3Float<float,Vec3f>(v[0],v[1],v[2]) {}
41
 
42
		/// Construct from a 3D double vector.
43
		explicit Vec3f(const Vec3d&);
44
 
206 jrf 45
		/// Construct from a 4D float vector (skipping the last value)
46
		explicit Vec3f(const Vec4f&);
2 bj 47
	};
48
 
49
}
50
#endif