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
25namespace 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
rendering
Definition RenderEngine.hh:31
Basic camera sensor.
Definition Camera.hh:86
A camera used for user visualization of a scene.
Definition OculusCamera.hh:37
virtual bool TrackVisualImpl(VisualPtr _visual)
Set the camera to track a scene node.
void ResetSensor()
Reset the Oculus Rift sensor orientation.
virtual void RenderImpl()
Implementation of the render call.
void AdjustAspect(double _v)
Change screen aspect ratio.
virtual ~OculusCamera()
Destructor.
OculusCamera(const std::string &_name, ScenePtr _scene)
Constructor.
virtual bool AttachToVisualImpl(VisualPtr _visual, bool _inheritOrientation, double _minDist=0, double _maxDist=0)
Set the camera to be attached to a visual.
virtual void SetRenderTarget(Ogre::RenderTarget *_target)
Set to true to enable rendering.
void MoveToVisual(VisualPtr _visual)
Move the camera to focus on a visual.
void MoveToVisual(const std::string &_visualName)
Move the camera to focus on a visual.
void Load(sdf::ElementPtr _sdf)
Load the user camera.
void Load()
Generic load function.
bool Ready()
Used to check if Oculus is plugged in and can be used.
virtual void PostRender()
Post render.
void Resize(unsigned int _w, unsigned int _h)
Resize the camera.
virtual void Update()
Render the camera.
virtual unsigned int GetImageHeight() const
virtual unsigned int GetImageWidth() const
std::shared_ptr< Visual > VisualPtr
Definition RenderTypes.hh:114
boost::shared_ptr< Scene > ScenePtr
Definition RenderTypes.hh:82
Forward declarations for the common classes.
Definition Animation.hh:27