OculusCamera.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 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 
18 #ifndef GAZEBO_OCULUS_CAMERA_HH_
19 #define GAZEBO_OCULUS_CAMERA_HH_
20 
21 #include <string>
22 
24 
25 namespace gazebo
26 {
27  namespace rendering
28  {
29  class OculusCameraPrivate;
30 
33 
36  class GZ_RENDERING_VISIBLE OculusCamera : public Camera
37  {
41  public: OculusCamera(const std::string &_name, ScenePtr _scene);
42 
44  public: virtual ~OculusCamera();
45 
48  public: void Load(sdf::ElementPtr _sdf);
49 
51  public: void Load();
52 
54  public: void Init();
55 
57  public: virtual void Update();
58 
60  public: virtual void PostRender();
61 
63  public: void Fini();
64 
68  public: void Resize(unsigned int _w, unsigned int _h);
69 
72  public: void MoveToVisual(VisualPtr _visual);
73 
76  public: void MoveToVisual(const std::string &_visualName);
77 
82  public: virtual void SetRenderTarget(Ogre::RenderTarget *_target);
83 
86  public: void AdjustAspect(double _v);
87 
88  // Documentation inherited
89  public: virtual unsigned int GetImageWidth() const;
90 
91  // Documentation inherited
92  public: virtual unsigned int GetImageHeight() const;
93 
95  public: void ResetSensor();
96 
99  public: bool Ready();
100 
101  // Documentation inherited
102  protected: virtual void RenderImpl();
103 
115  protected: virtual bool AttachToVisualImpl(VisualPtr _visual,
116  bool _inheritOrientation, double _minDist = 0,
117  double _maxDist = 0);
118 
124  protected: virtual bool TrackVisualImpl(VisualPtr _visual);
125 
128  private: void OnControl(ConstWorldControlPtr &_data);
129 
131  private: void Oculus();
132 
135  private: OculusCameraPrivate *dataPtr;
136  };
138  }
139 }
140 #endif
Basic camera sensor.
Definition: Camera.hh:81
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:82
A camera used for user visualization of a scene.
Definition: OculusCamera.hh:36
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.