Gazebo Rendering

API Reference

6.6.4
gz/rendering/ogre/OgreCamera.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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_OGRE_OGRECAMERA_HH_
18 #define GZ_RENDERING_OGRE_OGRECAMERA_HH_
19 
20 #include <string>
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 OgreSelectionBuffer;
40 
41  class IGNITION_RENDERING_OGRE_VISIBLE OgreCamera :
42  public BaseCamera<OgreSensor>
43  {
44  protected: OgreCamera();
45 
46  public: virtual ~OgreCamera();
47 
48  // Documentation inherited.
49  public: virtual math::Angle HFOV() const override;
50 
51  // Documentation inherited.
52  public: virtual void SetHFOV(const math::Angle &_hfov) 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 void SetProjectionMatrix(
87  const math::Matrix4d &_matrix) override;
88 
89  // Documentation inherited.
90  public: virtual math::Matrix4d ViewMatrix() const override;
91 
92  // Documentation inherited.
93  public: virtual void SetProjectionType(CameraProjectionType _type)
94  override;
95 
96  public: void SetVFOV(double cameraVFOV) const;
97 
100  public: double NearClip() const;
101 
104  public: double FarClip() const;
105 
106  // Documentation inherited
107  public: virtual VisualPtr VisualAt(const gz::math::Vector2i
108  &_mousePos) override;
109 
110  // Documentation Inherited.
111  // \sa Camera::SetMaterial(const MaterialPtr &)
112  public: virtual void SetMaterial(
113  const MaterialPtr &_material) override;
114 
115  // Documentation inherited.
116  public: virtual unsigned int RenderTextureGLId() const override;
117 
118  // Documentation inherited.
119  public: virtual void Destroy() override;
120 
121  // Documentation inherited.
122  public: virtual void SetVisibilityMask(uint32_t _mask) override;
123 
125  public: Ogre::Camera *Camera() const;
126 
127  // Documentation inherited.
128  // public: virtual uint32_t VisibilityMask() const override;
129 
130  protected: virtual RenderTargetPtr RenderTarget() const override;
131 
132  protected: virtual void Init() override;
133 
134  protected: virtual void SetSelectionBuffer();
135 
136  private: void CreateCamera();
137 
138  protected: virtual void CreateRenderTexture();
139 
142  protected: void DestroyRenderTexture();
143 
144  protected: Ogre::Camera *ogreCamera = nullptr;
145 
146  protected: OgreSelectionBuffer *selectionBuffer = nullptr;
147 
149 
151 
152  private: friend class OgreScene;
153  private: friend class OgreRayQuery;
154  };
155  }
156  }
157 }
158 #endif
Definition: gz/rendering/base/BaseCamera.hh:47
Definition: gz/rendering/ogre/OgreCamera.hh:43
double FarClip() const
Get the far clip distance.
virtual unsigned int AntiAliasing() const override
Get the level of anti-aliasing used during rendering.
virtual void SetVisibilityMask(uint32_t _mask) override
Set visibility mask.
void DestroyRenderTexture()
Destroy render texture created by CreateRenderTexture() Note: It's not virtual.
virtual VisualPtr VisualAt(const gz::math::Vector2i &_mousePos) override
Get the visual for a given mouse position param[in] _mousePos mouse position.
virtual void SetBackgroundColor(const math::Color &_color)
virtual RenderTargetPtr RenderTarget() const override
virtual RenderWindowPtr CreateRenderWindow() override
Create a render window.
virtual math::Angle HFOV() const override
Get the camera's horizontal field-of-view.
virtual double AspectRatio() const override
Get the camera's aspect ratio.
virtual void SetFarClipPlane(const double _far) override
Set the camera's far clipping plane distance.
double NearClip() const
Get the near clip distance.
virtual math::Color BackgroundColor() const
virtual math::Matrix4d ViewMatrix() const override
Get the view matrix for this camera.
virtual void Destroy() override
Destroy any resources associated with this object. Invoking any other functions after destroying an o...
virtual unsigned int RenderTextureGLId() const override
Get the OpenGL texture id associated with the render texture used by this camera. A valid id is retur...
math::Color backgroundColor
Definition: gz/rendering/ogre/OgreCamera.hh:150
void SetVFOV(double cameraVFOV) const
virtual void SetMaterial(const MaterialPtr &_material) override
Set a material that the camera should see on all objects.
virtual void SetAspectRatio(const double _ratio) override
Set the camera's aspect ratio. This value determines the cameras vertical field-of-view....
virtual void SetProjectionType(CameraProjectionType _type) override
Set the projection type for this camera This changes the projection matrix of the camera based on the...
virtual void SetHFOV(const math::Angle &_hfov) override
Set the camera's horizontal field-of-view.
Ogre::Camera * Camera() const
Get underlying Ogre camera.
virtual void SetProjectionMatrix(const math::Matrix4d &_matrix) override
Set the projection matrix for this camera. This overrides the standard projection matrix computed bas...
virtual void Init() override
virtual void SetAntiAliasing(const unsigned int _aa) override
Set the level of anti-aliasing used during rendering. If a value of 0 is given, no anti-aliasing will...
virtual void SetNearClipPlane(const double _near) override
Set the camera's near clipping plane distance.
virtual void Render() override
Renders the current scene using this camera. This function assumes PreRender() has already been calle...
OgreRenderTargetPtr renderTexture
Definition: gz/rendering/ogre/OgreCamera.hh:148
virtual math::Matrix4d ProjectionMatrix() const override
Get the projection matrix for this camera.
A Ray Query class used for computing ray object intersections.
Definition: gz/rendering/ogre/OgreRayQuery.hh:41
Definition: gz/rendering/ogre/OgreScene.hh:41
Generates a selection buffer object for a given camera. The selection buffer is used of entity select...
Definition: gz/rendering/ogre/OgreSelectionBuffer.hh:48
Definition: gz/rendering/ogre/OgreCamera.hh:28
CameraProjectionType
Enum for projection types.
Definition: gz/rendering/Camera.hh:40