Flair
Framework Libre Air
SimuCameraGL.h
Go to the documentation of this file.
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
13 #ifndef SIMUCAMERAGL_H
14 #define SIMUCAMERAGL_H
15 
16 #include <SimuCamera.h>
17 #include <SensorGL.h>
18 #include <ISceneNodeAnimator.h>
19 
20 // in order to get function prototypes from glext.h, define GL_GLEXT_PROTOTYPES
21 // before including glext.h
22 #define GL_GLEXT_PROTOTYPES
23 #include <GL/gl.h>
24 
25 namespace irr {
26 namespace scene {
27 class ICameraSceneNode;
28 }
29 }
30 
31 namespace flair {
32 namespace gui {
33 class DoubleSpinBox;
34 class Vector3DSpinBox;
35 }
36 namespace simulator {
37 class Model;
38 }
39 }
40 
41 namespace flair {
42 namespace sensor {
47 class SimuCameraGL : public SimuCamera,
48  public SensorGL,
49  public irr::scene::ISceneNodeAnimator {
50 public:
51  // top left origin
52  SimuCameraGL(const simulator::Model *parent, std::string name, int width,
53  int height, int x, int y, uint32_t modelId,uint32_t deviceId);
54  ~SimuCameraGL();
56 
57  void setNearValue(float zn);
58 
60 
61  void setFarValue(float zf);
62 
63 private:
64  void UpdateFrom(const core::io_data *data);
65  void animateNode(irr::scene::ISceneNode *node, irr::u32 timeMs);
66  ISceneNodeAnimator *createClone(irr::scene::ISceneNode *node,
67  irr::scene::ISceneManager *newManager = 0);
68  void getImage(void);
69  void putImage(char *pixels,core::Time imageTime);
70  irr::scene::ICameraSceneNode *camera;
71  irr::scene::ISceneManager *smgr;
72  gui::Vector3DSpinBox *position, *direction, *up;
73  gui::DoubleSpinBox *fov;
74  int width, height, x, y;
75  char *buffer;
76  bool use_pbo, invert_pixel, disable_output;
77  GLuint *pboIds;
78  int index;
79 };
80 } // end namespace simulator
81 } // end namespace flair
82 #endif // SIMUCAMERAGL_H
Abstract class for data types.
Definition: io_data.h:94
namespace of the flair Framework
Definition: Ahrs.h:19
void setNearValue(float zn)
Sets the value of the near clipping plane. (default: 1.0f)
unsigned long long Time
Time definition, in ns.
Definition: Object.h:55
Class for a simulation camera.
Definition: Blade.h:22
Class for a simulation camera.
Definition: SimuCameraGL.h:47
Definition: Model.h:55
void setFarValue(float zf)
Sets the value of the far clipping plane (default: 2000.0f)
Class displaying a QDoubleSpinBox on the ground station.
Definition: DoubleSpinBox.h:28
Definition: SensorGL.h:35
Class displaying 3 QDoubleSpinBox for x,y,z on the ground station.
Definition: Vector3DSpinBox.h:28
Class for a simulation camera.
Definition: SimuCamera.h:30