Ignition Rendering

API Reference

6.0.1
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 
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 void SetHFOV(const math::Angle &_hfov) override;
54 
55  // Documentation inherited.
56  public: virtual double AspectRatio() const override;
57 
58  // Documentation inherited.
59  public: virtual void SetAspectRatio(const double _ratio) override;
60 
61  // Documentation inherited.
62  public: virtual unsigned int AntiAliasing() const override;
63 
64  // Documentation inherited.
65  public: virtual void SetAntiAliasing(const unsigned int _aa) override;
66 
67  // Documentation inherited.
68  public: virtual void SetFarClipPlane(const double _far) override;
69 
70  // Documentation inherited.
71  public: virtual void SetNearClipPlane(const double _near) override;
72 
73  public: virtual math::Color BackgroundColor() const;
74 
75  public: virtual void SetBackgroundColor(const math::Color &_color);
76 
79  public: virtual MaterialPtr BackgroundMaterial() const;
80 
83  public: virtual void SetBackgroundMaterial(MaterialPtr _material);
84 
85  // Documentation inherited.
86  public: virtual void Render() override;
87 
88  // Documentation inherited.
89  public: virtual RenderWindowPtr CreateRenderWindow() override;
90 
91  // Documentation inherited.
92  public: virtual math::Matrix4d ProjectionMatrix() const override;
93 
94  // Documentation inherited.
95  public: virtual void SetProjectionMatrix(
96  const math::Matrix4d &_matrix) override;
97 
98  // Documentation inherited.
99  public: virtual math::Matrix4d ViewMatrix() const override;
100 
101  // Documentation inherited.
102  public: virtual void SetProjectionType(CameraProjectionType _type)
103  override;
104 
105  // Documentation inherited
106  public: virtual VisualPtr VisualAt(const ignition::math::Vector2i
107  &_mousePos) override;
108 
109  // Documentation Inherited.
110  // \sa Camera::SetMaterial(const MaterialPtr &)
111  public: virtual void SetMaterial(
112  const MaterialPtr &_material) override;
113 
114  // Documentation inherited.
115  public: virtual unsigned int RenderTextureGLId() const override;
116 
117  // Documentation inherited.
118  public: void SetShadowsDirty() override;
119 
120  // Documentation inherited.
121  public: virtual void Destroy() override;
122 
123  public: Ogre::Camera *OgreCamera() const;
124 
125  // Documentation inherited.
126  public: virtual void SetVisibilityMask(uint32_t _mask) override;
127 
130  public: Ogre2SelectionBuffer *SelectionBuffer() const;
131 
132  // Documentation inherited.
133  protected: virtual RenderTargetPtr RenderTarget() const override;
134 
135  // Documentation inherited.
136  protected: virtual void Init() override;
137 
139  protected: virtual void CreateRenderTexture();
140 
143  protected: virtual void SetSelectionBuffer();
144 
146  private: void CreateCamera();
147 
153  private: void SetShadowsNodeDefDirty();
154 
156  protected: Ogre::Camera *ogreCamera = nullptr;
157 
159  protected: Ogre2SelectionBuffer *selectionBuffer = nullptr;
160 
163 
166 
168  private: std::unique_ptr<Ogre2CameraPrivate> dataPtr;
169 
171  private: friend class Ogre2Scene;
172 
175  private: friend class Ogre2RayQuery;
176  };
177  }
178  }
179 }
180 #endif
Definition: BaseCamera.hh:44
Generates a selection buffer object for a given camera. The selection buffer is used of entity select...
Definition: Ogre2SelectionBuffer.hh:47
CameraProjectionType
Enum for projection types.
Definition: Camera.hh:39
Ogre2.x implementation of the scene class.
Definition: Ogre2Scene.hh:57
Represents a render-target to which cameras can render images.
Definition: RenderTarget.hh:37
math::Color backgroundColor
Color of background.
Definition: Ogre2Camera.hh:165
Ogre2.x implementation of the camera class.
Definition: Ogre2Camera.hh:43
A Ray Query class used for computing ray object intersections.
Definition: Ogre2RayQuery.hh:38
Definition: OgreCamera.hh:27
Definition: OgreCamera.hh:41
Ogre2RenderTargetPtr renderTexture
Pointer to render texture.
Definition: Ogre2Camera.hh:162