Subversion Repositories gelsvn

Rev

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

Rev 178 Rev 392
Line 9... Line 9...
9
		float FOV_DEG;
9
		float FOV_DEG;
10
		float FOV_RAD;
10
		float FOV_RAD;
11
		int WINX, WINY;
11
		int WINX, WINY;
12
		float znear, zfar;
12
		float znear, zfar;
13
		float aspect;
13
		float aspect;
14
		CGLA::Vec3f centre;
-
 
15
		float rad;
-
 
16
		bool button_down;
14
		bool button_down;
17
		TrackBallAction last_action;
15
		TrackBallAction last_action;
18
		CGLA::Vec2i old_pos;
-
 
19
		bool spin;
16
		bool spin;
20
 
17
 
21
		QuatTrackBall *ball;
18
		QuatTrackBall ball;
22
	public:
19
	public:
23
 
20
 
24
		GLViewController(int _WINX, int _WINY,
21
		GLViewController(int _WINX, int _WINY,
25
										 const CGLA::Vec3f& _centre, float _rad);
22
										 const CGLA::Vec3f& _centre, float _rad);
26
		void grab_ball(TrackBallAction action, const CGLA::Vec2i& pos);
23
		void grab_ball(TrackBallAction action, const CGLA::Vec2i& pos);
Line 29... Line 26...
29
		bool try_spin();
26
		bool try_spin();
30
		void reset_projection();
27
		void reset_projection();
31
		void set_gl_modelview();
28
		void set_gl_modelview();
32
		void reshape(int W, int H);
29
		void reshape(int W, int H);
33
		void set_near_and_far();
30
		void set_near_and_far();
-
 
31
		
-
 
32
		void set_centre(const CGLA::Vec3f& c)
-
 
33
		{
-
 
34
			ball.set_centre(c);
-
 
35
		}
-
 
36
		
-
 
37
		void set_eye_dist(float rad)
-
 
38
		{
-
 
39
			ball.set_eye_dist(rad);
-
 
40
			set_near_and_far();
-
 
41
		}
34
 
42
 
35
		float get_fovy_rad() const {return FOV_RAD;}
43
		float get_fovy_rad() const {return FOV_RAD;}
36
 
44
 
37
		float get_eye_dist() const
45
		float get_eye_dist() const
38
		{
46
		{
39
			return ball->get_eye_dist();
47
			return ball.get_eye_dist();
40
		}
48
		}
41
 
49
 
42
		void get_view_param(CGLA::Vec3f& e, 
-
 
43
												CGLA::Vec3f& c, CGLA::Vec3f& u) const
50
		void get_view_param(CGLA::Vec3f& e, CGLA::Vec3f& c, CGLA::Vec3f& u) const
44
		{
51
		{
45
			ball->get_view_param(e,c,u);
52
			ball.get_view_param(e,c,u);
46
		}
53
		}
47
 
54
 
48
		bool load(std::ifstream&);
55
		bool load(std::ifstream&);
49
		bool save(std::ofstream&) const;
56
		bool save(std::ofstream&) const;
50
	};
57
	};