UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
camera.h
Go to the documentation of this file.
1 
2 #ifndef UGDK_ACTION_3D_CAMERA_H_
3 #define UGDK_ACTION_3D_CAMERA_H_
4 
6 #include <OgreVector3.h>
7 
8 namespace Ogre {
9 class Camera;
10 class Quaternion;
11 }
12 
13 namespace ugdk {
14 namespace action {
15 namespace mode3d {
16 
17 class Scene3D;
18 
19 class Camera : public Element {
20 public:
21  Camera(Scene3D* scene, const std::string& camName = "MainCam");
22  ~Camera();
23 
24  void SetParameters(const Ogre::Vector3& parent_origin_offset = Ogre::Vector3::ZERO, double max_dist=7.5);
25 
26  void SetDistance(double dist);
27  double GetDistance() { return dist_; }
28  void Rotate(double yaw, double pitch);
29 
30  Ogre::Camera* camera() { return camera_; }
31  Ogre::Quaternion orientation(); //local camera orientation
32  Ogre::Quaternion actual_orientation(); //world camera orientation
33 
34 protected:
35  Ogre::Camera* camera_;
36 
37  Ogre::Vector3 offset_; // offset to parent origin
38  double dist_; // distance to origin (parent origin+offset)
39  double max_dist_;
41 
42  virtual void OnAttach() override;
43  virtual void OnParentDestroyed() override;
44  void setupTransform();
45 };
46 
47 } // namespace 3D
48 } // namespace action
49 } // namespace ugdk
50 #endif
virtual void OnAttach() override
void SetParameters(const Ogre::Vector3 &parent_origin_offset=Ogre::Vector3::ZERO, double max_dist=7.5)
Ogre::Camera * camera()
Definition: camera.h:30
Ogre::Camera * camera_
Definition: camera.h:35
A 3D Element.
Definition: element.h:26
double cumulative_pitch_
Definition: camera.h:40
Ogre::Quaternion orientation()
Definition: animation.h:11
Scene3D & scene()
Definition: element.h:45
void Rotate(double yaw, double pitch)
double GetDistance()
Definition: camera.h:27
virtual void OnParentDestroyed() override
void SetDistance(double dist)
Definition: camera.h:19
Camera(Scene3D *scene, const std::string &camName="MainCam")
double dist_
Definition: camera.h:38
Ogre::Vector3 offset_
Definition: camera.h:37
double max_dist_
Definition: camera.h:39
Definition: camera.h:8
Ogre::Quaternion actual_orientation()
A 3D game scene, or screen.
Definition: scene3d.h:32