Ignition Rendering

API Reference

7.0.0~pre1
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 
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 OgreSelectionBuffer;
41 
42  class IGNITION_RENDERING_OGRE_VISIBLE OgreCamera :
43  public virtual BaseCamera<OgreSensor>,
44  public virtual OgreObjectInterface
45  {
46  protected: OgreCamera();
47 
48  public: virtual ~OgreCamera();
49 
50  // Documentation inherited.
51  public: virtual void SetHFOV(const math::Angle &_hfov) override;
52 
53  // Documentation inherited.
54  public: virtual double AspectRatio() const override;
55 
56  // Documentation inherited.
57  public: virtual void SetAspectRatio(const double _ratio) override;
58 
59  // Documentation inherited.
60  public: virtual unsigned int AntiAliasing() const override;
61 
62  // Documentation inherited.
63  public: virtual void SetAntiAliasing(const unsigned int _aa) override;
64 
65  // Documentation inherited.
66  public: virtual void SetFarClipPlane(const double _far) override;
67 
68  // Documentation inherited.
69  public: virtual void SetNearClipPlane(const double _near) override;
70 
71  public: virtual math::Color BackgroundColor() const;
72 
73  public: virtual void SetBackgroundColor(const math::Color &_color);
74 
75  // Documentation inherited.
76  public: virtual void Render() override;
77 
78  // Documentation inherited.
79  public: virtual RenderWindowPtr CreateRenderWindow() override;
80 
81  // Documentation inherited.
82  public: virtual math::Matrix4d ProjectionMatrix() const override;
83 
84  // Documentation inherited.
85  public: virtual void SetProjectionMatrix(
86  const math::Matrix4d &_matrix) override;
87 
88  // Documentation inherited.
89  public: virtual math::Matrix4d ViewMatrix() const override;
90 
91  // Documentation inherited.
92  public: virtual void SetProjectionType(CameraProjectionType _type)
93  override;
94 
95  public: void SetVFOV(double cameraVFOV) const;
96 
99  public: double NearClip() const;
100 
103  public: double FarClip() const;
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: virtual void Destroy() override;
119 
120  // Documentation inherited.
121  public: virtual void SetVisibilityMask(uint32_t _mask) override;
122 
123  // Documentation inherited.
124  public: virtual Ogre::Camera *Camera() const override;
125 
126  // Documentation inherited.
127  // public: virtual uint32_t VisibilityMask() const override;
128 
129  protected: virtual RenderTargetPtr RenderTarget() const override;
130 
131  protected: virtual void Init() override;
132 
133  protected: virtual void SetSelectionBuffer();
134 
135  private: void CreateCamera();
136 
137  protected: virtual void CreateRenderTexture();
138 
139  protected: Ogre::Camera *ogreCamera = nullptr;
140 
141  protected: OgreSelectionBuffer *selectionBuffer = nullptr;
142 
144 
146 
147  private: friend class OgreScene;
148  private: friend class OgreRayQuery;
149  };
150  }
151  }
152 }
153 #endif
OgreRenderTargetPtr renderTexture
Definition: OgreCamera.hh:143
Definition: BaseCamera.hh:44
CameraProjectionType
Enum for projection types.
Definition: Camera.hh:39
math::Color backgroundColor
Definition: OgreCamera.hh:145
Mixin class to provide direct access to Ogre objects.
Definition: OgreObjectInterface.hh:31
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:28
Definition: OgreScene.hh:39
Definition: OgreCamera.hh:42