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} |
---|
5 | /*! |
---|
6 | * \file SimuCameraGL.h |
---|
7 | * \brief Class for a simulation camera |
---|
8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253 |
---|
9 | * \date 2014/03/07 |
---|
10 | * \version 3.4 |
---|
11 | */ |
---|
12 | |
---|
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 { |
---|
43 | /*! \class SimuCameraGL |
---|
44 | * \brief Class for a simulation camera |
---|
45 | * |
---|
46 | */ |
---|
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, int dev_id); |
---|
54 | ~SimuCameraGL(); |
---|
55 | //! Sets the value of the near clipping plane. (default: 1.0f) |
---|
56 | /** \param zn: New z near value. */ |
---|
57 | void setNearValue(float zn); |
---|
58 | |
---|
59 | //! Sets the value of the far clipping plane (default: 2000.0f) |
---|
60 | /** \param zf: New z far value. */ |
---|
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); |
---|
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 |
---|