Gazebo Rendering

API Reference

6.6.3
gz/rendering/ogre2/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 GZ_RENDERING_OGRE2_OGRE2CAMERA_HH_
18 #define GZ_RENDERING_OGRE2_OGRE2CAMERA_HH_
19 
20 #include <memory>
21 
26 
27 namespace Ogre
28 {
29  class Camera;
30 }
31 
32 namespace ignition
33 {
34  namespace rendering
35  {
36  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
37  //
38  // forward declaration
39  class Ogre2CameraPrivate;
40  class Ogre2SelectionBuffer;
41 
43  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2Camera :
44  public BaseCamera<Ogre2Sensor>
45  {
47  protected: Ogre2Camera();
48 
50  public: virtual ~Ogre2Camera();
51 
52  // Documentation inherited.
53  public: virtual math::Angle HFOV() const override;
54 
55  // Documentation inherited.
56  public: virtual void SetHFOV(const math::Angle &_hfov) override;
57 
58  // Documentation inherited.
59  public: virtual double AspectRatio() const override;
60 
61  // Documentation inherited.
62  public: virtual void SetAspectRatio(const double _ratio) override;
63 
64  // Documentation inherited.
65  public: virtual unsigned int AntiAliasing() const override;
66 
67  // Documentation inherited.
68  public: virtual void SetAntiAliasing(const unsigned int _aa) override;
69 
70  // Documentation inherited.
71  public: virtual void SetFarClipPlane(const double _far) override;
72 
73  // Documentation inherited.
74  public: virtual void SetNearClipPlane(const double _near) override;
75 
76  public: virtual math::Color BackgroundColor() const;
77 
78  public: virtual void SetBackgroundColor(const math::Color &_color);
79 
82  public: virtual MaterialPtr BackgroundMaterial() const;
83 
86  public: virtual void SetBackgroundMaterial(MaterialPtr _material);
87 
88  // Documentation inherited.
89  public: virtual void Render() override;
90 
91  // Documentation inherited.
92  public: virtual RenderWindowPtr CreateRenderWindow() override;
93 
94  // Documentation inherited.
95  public: virtual math::Matrix4d ProjectionMatrix() const override;
96 
97  // Documentation inherited.
98  public: virtual void SetProjectionMatrix(
99  const math::Matrix4d &_matrix) override;
100 
101  // Documentation inherited.
102  public: virtual math::Matrix4d ViewMatrix() const override;
103 
104  // Documentation inherited.
105  public: virtual void SetProjectionType(CameraProjectionType _type)
106  override;
107 
108  // Documentation inherited
109  public: virtual VisualPtr VisualAt(const ignition::math::Vector2i
110  &_mousePos) override;
111 
112  // Documentation Inherited.
113  // \sa Camera::SetMaterial(const MaterialPtr &)
114  public: virtual void SetMaterial(
115  const MaterialPtr &_material) override;
116 
117  // Documentation inherited.
118  public: virtual unsigned int RenderTextureGLId() const override;
119 
120  // Documentation inherited.
121  public: void SetShadowsDirty() override;
122 
123  // Documentation inherited.
124  public: virtual void Destroy() override;
125 
126  public: Ogre::Camera *OgreCamera() const;
127 
128  // Documentation inherited.
129  public: virtual void SetVisibilityMask(uint32_t _mask) override;
130 
133  public: Ogre2SelectionBuffer *SelectionBuffer() const;
134 
135  // Documentation inherited.
136  protected: virtual RenderTargetPtr RenderTarget() const override;
137 
138  // Documentation inherited.
139  protected: virtual void Init() override;
140 
142  protected: virtual void CreateRenderTexture();
143 
146  protected: void DestroyRenderTexture();
147 
150  protected: virtual void SetSelectionBuffer();
151 
153  private: void CreateCamera();
154 
160  private: void SetShadowsNodeDefDirty();
161 
163  protected: Ogre::Camera *ogreCamera = nullptr;
164 
166  protected: Ogre2SelectionBuffer *selectionBuffer = nullptr;
167 
170 
173 
175  private: std::unique_ptr<Ogre2CameraPrivate> dataPtr;
176 
178  private: friend class Ogre2Scene;
179 
182  private: friend class Ogre2RayQuery;
183  };
184  }
185  }
186 }
187 #endif
Definition: gz/rendering/ogre/OgreCamera.hh:27
STL class.
math::Color backgroundColor
Color of background.
Definition: gz/rendering/ogre2/Ogre2Camera.hh:172
Ogre2RenderTargetPtr renderTexture
Pointer to render texture.
Definition: gz/rendering/ogre2/Ogre2Camera.hh:169
Generates a selection buffer object for a given camera. The selection buffer is used of entity select...
Definition: gz/rendering/ogre2/Ogre2SelectionBuffer.hh:47
CameraProjectionType
Enum for projection types.
Definition: gz/rendering/Camera.hh:39
A Ray Query class used for computing ray object intersections.
Definition: gz/rendering/ogre2/Ogre2RayQuery.hh:38
Ogre2.x implementation of the scene class.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:57
Represents a render-target to which cameras can render images.
Definition: gz/rendering/RenderTarget.hh:37
Definition: gz/rendering/ogre/OgreCamera.hh:41
Ogre2.x implementation of the camera class.
Definition: gz/rendering/ogre2/Ogre2Camera.hh:43
Definition: gz/rendering/base/BaseCamera.hh:44