added 3dengfx into the repo, probably not the correct version for this
[summerhack] / src / 3dengfx / src / 3dengfx / camera.hpp
1 /*
2 This file is part of the 3dengfx, realtime visualization system.
3
4 Copyright (c) 2004, 2005 John Tsiombikas <nuclear@siggraph.org>
5
6 3dengfx is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 3dengfx is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with 3dengfx; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20 #ifndef _CAMERA_HPP_
21 #define _CAMERA_HPP_
22
23 #include <string>
24 #include "gfx/base_cam.hpp"
25
26 class Camera : public BaseCamera {
27 public:
28         Camera(const Vector3 &trans = Vector3(0,0,0), const Quaternion &rot = Quaternion());
29
30         virtual Matrix4x4 get_camera_matrix(unsigned long msec = XFORM_LOCAL_PRS) const;
31         
32         //virtual void activate(unsigned long msec = XFORM_LOCAL_PRS) const;
33 };
34
35
36 class TargetCamera : public Camera {
37 public:
38         XFormNode target;
39
40         TargetCamera(const Vector3 &trans = Vector3(0,0,-10), const Vector3 &target = Vector3(0,0,0));
41         virtual ~TargetCamera();
42
43         virtual void set_target(const Vector3 &target);
44         virtual Vector3 get_target(unsigned long msec = XFORM_LOCAL_PRS) const;
45
46         virtual Matrix4x4 get_camera_matrix(unsigned long msec = XFORM_LOCAL_PRS) const;
47         
48         //virtual void activate(unsigned long msec = XFORM_LOCAL_PRS) const;
49
50         virtual void zoom(scalar_t factor, unsigned long msec = XFORM_LOCAL_PRS);
51         virtual void roll(scalar_t angle, unsigned long msec = XFORM_LOCAL_PRS);
52 };
53
54 #endif  // _CAMERA_HPP_