Ignition Rendering

API Reference

5.0.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 
78  public: virtual MaterialPtr BackgroundMaterial() const;
79 
82  public: virtual void SetBackgroundMaterial(MaterialPtr _material);
83 
84  // Documentation inherited.
85  public: virtual void Render() override;
86 
87  // Documentation inherited.
88  public: virtual RenderWindowPtr CreateRenderWindow() override;
89 
90  // Documentation inherited.
91  public: virtual math::Matrix4d ProjectionMatrix() const override;
92 
93  // Documentation inherited.
94  public: virtual math::Matrix4d ViewMatrix() const override;
95 
96  // Documentation inherited
97  public: virtual VisualPtr VisualAt(const ignition::math::Vector2i
98  &_mousePos) override;
99 
100  // Documentation Inherited.
101  // \sa Camera::SetMaterial(const MaterialPtr &)
102  public: virtual void SetMaterial(
103  const MaterialPtr &_material) override;
104 
105  // Documentation inherited.
106  public: virtual unsigned int RenderTextureGLId() const override;
107 
108  // Documentation inherited.
109  // TODO(anyone): this function should be virtual, declared in 'Camera'
110  // and 'BaseCamera'. We didn't do it to preserve ABI.
111  // Looks in commit history for '#SetShadowsNodeDefDirtyABI' to
112  // see changes made and revert
113  public: void SetShadowsNodeDefDirty();
114 
115  // Documentation inherited.
116  public: virtual void Destroy() override;
117 
118  public: Ogre::Camera *OgreCamera() const;
119 
120  // Documentation inherited.
121  public: virtual void SetVisibilityMask(uint32_t _mask) override;
122 
123  // Documentation inherited.
124  protected: virtual RenderTargetPtr RenderTarget() const override;
125 
126  // Documentation inherited.
127  protected: virtual void Init() override;
128 
130  protected: virtual void CreateRenderTexture();
131 
134  protected: virtual void SetSelectionBuffer();
135 
137  private: void CreateCamera();
138 
140  protected: Ogre::Camera *ogreCamera = nullptr;
141 
143  protected: Ogre2SelectionBuffer *selectionBuffer = nullptr;
144 
147 
150 
152  private: std::unique_ptr<Ogre2CameraPrivate> dataPtr;
153 
155  private: friend class Ogre2Scene;
156 
159  private: friend class Ogre2RayQuery;
160  };
161  }
162  }
163 }
164 #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
Ogre2.x implementation of the scene class.
Definition: Ogre2Scene.hh:56
Represents a render-target to which cameras can render images.
Definition: RenderTarget.hh:37
math::Color backgroundColor
Color of background.
Definition: Ogre2Camera.hh:149
Ogre2.x implementation of the camera class.
Definition: Ogre2Camera.hh:42
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:146