Ignition Rendering

API Reference

4.1.0
Ogre2Camera.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 #ifndef IGNITION_RENDERING_OGRE2_OGRE2CAMERA_HH_
18 #define IGNITION_RENDERING_OGRE2_OGRE2CAMERA_HH_
19 
20 #include <memory>
21 
25 
26 namespace Ogre
27 {
28  class Camera;
29 }
30 
31 namespace ignition
32 {
33  namespace rendering
34  {
35  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
36  //
37  // forward declaration
38  class Ogre2CameraPrivate;
39  class Ogre2SelectionBuffer;
40 
42  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2Camera :
43  public BaseCamera<Ogre2Sensor>
44  {
46  protected: Ogre2Camera();
47 
49  public: virtual ~Ogre2Camera();
50 
51  // Documentation inherited.
52  public: virtual void SetHFOV(const math::Angle &_angle) override;
53 
54  // Documentation inherited.
55  public: virtual double AspectRatio() const override;
56 
57  // Documentation inherited.
58  public: virtual void SetAspectRatio(const double _ratio) override;
59 
60  // Documentation inherited.
61  public: virtual unsigned int AntiAliasing() const override;
62 
63  // Documentation inherited.
64  public: virtual void SetAntiAliasing(const unsigned int _aa) override;
65 
66  // Documentation inherited.
67  public: virtual void SetFarClipPlane(const double _far) override;
68 
69  // Documentation inherited.
70  public: virtual void SetNearClipPlane(const double _near) override;
71 
72  public: virtual math::Color BackgroundColor() const;
73 
74  public: virtual void SetBackgroundColor(const math::Color &_color);
75 
76  // Documentation inherited.
77  public: virtual void Render() override;
78 
79  // Documentation inherited.
80  public: virtual RenderWindowPtr CreateRenderWindow() override;
81 
82  // Documentation inherited.
83  public: virtual math::Matrix4d ProjectionMatrix() const override;
84 
85  // Documentation inherited.
86  public: virtual math::Matrix4d ViewMatrix() const override;
87 
88  // Documentation inherited
89  public: virtual VisualPtr VisualAt(const ignition::math::Vector2i
90  &_mousePos) override;
91 
92  // Documentation Inherited.
93  // \sa Camera::SetMaterial(const MaterialPtr &)
94  public: virtual void SetMaterial(
95  const MaterialPtr &_material) override;
96 
97  // Documentation inherited.
98  public: virtual unsigned int RenderTextureGLId() const override;
99 
100  // Documentation inherited.
101  public: virtual void Destroy() override;
102 
103  public: Ogre::Camera *OgreCamera() const;
104 
105  // Documentation inherited.
106  public: virtual void SetVisibilityMask(uint32_t _mask) override;
107 
108  // Documentation inherited.
109  protected: virtual RenderTargetPtr RenderTarget() const override;
110 
111  // Documentation inherited.
112  protected: virtual void Init() override;
113 
115  protected: virtual void CreateRenderTexture();
116 
119  protected: virtual void SetSelectionBuffer();
120 
122  private: void CreateCamera();
123 
125  protected: Ogre::Camera *ogreCamera = nullptr;
126 
128  protected: Ogre2SelectionBuffer *selectionBuffer = nullptr;
129 
132 
135 
137  private: std::unique_ptr<Ogre2CameraPrivate> dataPtr;
138 
140  private: friend class Ogre2Scene;
141 
144  private: friend class Ogre2RayQuery;
145  };
146  }
147  }
148 }
149 #endif
Definition: BaseCamera.hh:43
Generates a selection buffer object for a given camera. The selection buffer is used of entity select...
Definition: Ogre2SelectionBuffer.hh:47
Ogre2.x implementation of the scene class.
Definition: Ogre2Scene.hh:45
Represents a render-target to which cameras can render images.
Definition: RenderTarget.hh:37
math::Color backgroundColor
Color of background.
Definition: Ogre2Camera.hh:134
Ogre2.x implementation of the camera class.
Definition: Ogre2Camera.hh:42
A Ray Query class used for computing ray object intersections.
Definition: Ogre2RayQuery.hh:39
Definition: OgreCamera.hh:27
Definition: OgreCamera.hh:41
Ogre2RenderTargetPtr renderTexture
Pointer to render texture.
Definition: Ogre2Camera.hh:131