Ignition Rendering

API Reference

7.0.0~pre1
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 
27 
28 namespace Ogre
29 {
30  class Camera;
31 }
32 
33 namespace ignition
34 {
35  namespace rendering
36  {
37  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
38  //
39  // forward declaration
40  class Ogre2CameraPrivate;
41  class Ogre2SelectionBuffer;
42 
44  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2Camera :
45  public virtual BaseCamera<Ogre2Sensor>,
46  public virtual Ogre2ObjectInterface
47  {
49  protected: Ogre2Camera();
50 
52  public: virtual ~Ogre2Camera();
53 
54  // Documentation inherited.
55  public: virtual void SetHFOV(const math::Angle &_hfov) override;
56 
57  // Documentation inherited.
58  public: virtual double AspectRatio() const override;
59 
60  // Documentation inherited.
61  public: virtual void SetAspectRatio(const double _ratio) override;
62 
63  // Documentation inherited.
64  public: virtual unsigned int AntiAliasing() const override;
65 
66  // Documentation inherited.
67  public: virtual void SetAntiAliasing(const unsigned int _aa) override;
68 
69  // Documentation inherited.
70  public: virtual void SetFarClipPlane(const double _far) override;
71 
72  // Documentation inherited.
73  public: virtual void SetNearClipPlane(const double _near) override;
74 
75  public: virtual math::Color BackgroundColor() const;
76 
77  public: virtual void SetBackgroundColor(const math::Color &_color);
78 
81  public: virtual MaterialPtr BackgroundMaterial() const;
82 
85  public: virtual void SetBackgroundMaterial(MaterialPtr _material);
86 
87  // Documentation inherited.
88  public: virtual void Render() override;
89 
90  // Documentation inherited.
91  public: virtual RenderWindowPtr CreateRenderWindow() override;
92 
93  // Documentation inherited.
94  public: virtual math::Matrix4d ProjectionMatrix() const override;
95 
96  // Documentation inherited.
97  public: virtual void SetProjectionMatrix(
98  const math::Matrix4d &_matrix) override;
99 
100  // Documentation inherited.
101  public: virtual math::Matrix4d ViewMatrix() const override;
102 
103  // Documentation inherited.
104  public: virtual void SetProjectionType(CameraProjectionType _type)
105  override;
106 
107  // Documentation inherited
108  public: virtual VisualPtr VisualAt(const ignition::math::Vector2i
109  &_mousePos) override;
110 
111  // Documentation Inherited.
112  // \sa Camera::SetMaterial(const MaterialPtr &)
113  public: virtual void SetMaterial(
114  const MaterialPtr &_material) override;
115 
116  // Documentation inherited.
117  public: virtual unsigned int RenderTextureGLId() const override;
118 
119  // Documentation inherited.
120  public: virtual void RenderTextureMetalId(void *_textureIdPtr)
121  const override;
122 
123  // Documentation inherited.
124  public: void SetShadowsDirty() override;
125 
126  // Documentation inherited.
127  public: virtual void Destroy() override;
128 
129  // Documentation inherited.
130  public: virtual void SetVisibilityMask(uint32_t _mask) override;
131 
134  public: Ogre2SelectionBuffer *SelectionBuffer() const;
135 
136  // Documentation inherited.
137  public: virtual Ogre::Camera *OgreCamera() const override;
138 
139  // Documentation inherited.
140  protected: virtual RenderTargetPtr RenderTarget() const override;
141 
142  // Documentation inherited.
143  protected: virtual void Init() override;
144 
146  protected: virtual void CreateRenderTexture();
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: 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:172
Ogre2.x implementation of the camera class.
Definition: Ogre2Camera.hh:44
A Ray Query class used for computing ray object intersections.
Definition: Ogre2RayQuery.hh:38
Definition: OgreCamera.hh:28
Definition: OgreCamera.hh:42
Mixin class to provide direct access to Ogre objects.
Definition: Ogre2ObjectInterface.hh:31
Ogre2RenderTargetPtr renderTexture
Pointer to render texture.
Definition: Ogre2Camera.hh:169