Ignition Rendering

API Reference

6.3.1
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 IGNITION_RENDERING_OGRE_OGRECAMERA_HH_
18 #define IGNITION_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 void SetHFOV(const math::Angle &_hfov) override;
50 
51  // Documentation inherited.
52  public: virtual double AspectRatio() const override;
53 
54  // Documentation inherited.
55  public: virtual void SetAspectRatio(const double _ratio) override;
56 
57  // Documentation inherited.
58  public: virtual unsigned int AntiAliasing() const override;
59 
60  // Documentation inherited.
61  public: virtual void SetAntiAliasing(const unsigned int _aa) override;
62 
63  // Documentation inherited.
64  public: virtual void SetFarClipPlane(const double _far) override;
65 
66  // Documentation inherited.
67  public: virtual void SetNearClipPlane(const double _near) override;
68 
69  public: virtual math::Color BackgroundColor() const;
70 
71  public: virtual void SetBackgroundColor(const math::Color &_color);
72 
73  // Documentation inherited.
74  public: virtual void Render() override;
75 
76  // Documentation inherited.
77  public: virtual RenderWindowPtr CreateRenderWindow() override;
78 
79  // Documentation inherited.
80  public: virtual math::Matrix4d ProjectionMatrix() const override;
81 
82  // Documentation inherited.
83  public: virtual void SetProjectionMatrix(
84  const math::Matrix4d &_matrix) override;
85 
86  // Documentation inherited.
87  public: virtual math::Matrix4d ViewMatrix() const override;
88 
89  // Documentation inherited.
90  public: virtual void SetProjectionType(CameraProjectionType _type)
91  override;
92 
93  public: void SetVFOV(double cameraVFOV) const;
94 
97  public: double NearClip() const;
98 
101  public: double FarClip() const;
102 
103  // Documentation inherited
104  public: virtual VisualPtr VisualAt(const ignition::math::Vector2i
105  &_mousePos) override;
106 
107  // Documentation Inherited.
108  // \sa Camera::SetMaterial(const MaterialPtr &)
109  public: virtual void SetMaterial(
110  const MaterialPtr &_material) override;
111 
112  // Documentation inherited.
113  public: virtual unsigned int RenderTextureGLId() const override;
114 
115  // Documentation inherited.
116  public: virtual void Destroy() override;
117 
118  // Documentation inherited.
119  public: virtual void SetVisibilityMask(uint32_t _mask) override;
120 
122  public: Ogre::Camera *Camera() const;
123 
124  // Documentation inherited.
125  // public: virtual uint32_t VisibilityMask() const override;
126 
127  protected: virtual RenderTargetPtr RenderTarget() const override;
128 
129  protected: virtual void Init() override;
130 
131  protected: virtual void SetSelectionBuffer();
132 
133  private: void CreateCamera();
134 
135  protected: virtual void CreateRenderTexture();
136 
137  protected: Ogre::Camera *ogreCamera = nullptr;
138 
139  protected: OgreSelectionBuffer *selectionBuffer = nullptr;
140 
142 
144 
145  private: friend class OgreScene;
146  private: friend class OgreRayQuery;
147  };
148  }
149  }
150 }
151 #endif
OgreRenderTargetPtr renderTexture
Definition: OgreCamera.hh:141
Definition: BaseCamera.hh:44
CameraProjectionType
Enum for projection types.
Definition: Camera.hh:39
math::Color backgroundColor
Definition: OgreCamera.hh:143
Represents a render-target to which cameras can render images.
Definition: RenderTarget.hh:37
A Ray Query class used for computing ray object intersections.
Definition: OgreRayQuery.hh:39
Generates a selection buffer object for a given camera. The selection buffer is used of entity select...
Definition: OgreSelectionBuffer.hh:47
Posable camera used for rendering the scene graph.
Definition: Camera.hh:49
Definition: OgreCamera.hh:27
Definition: OgreScene.hh:39
Definition: OgreCamera.hh:41