Overte C++ Documentation
StereoDisplayPlugin.h
1 //
2 // Created by Bradley Austin Davis on 2015/05/29
3 // Copyright 2015 High Fidelity, Inc.
4 //
5 // Distributed under the Apache License, Version 2.0.
6 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
7 //
8 #pragma once
9 
10 #include "../OpenGLDisplayPlugin.h"
11 class QScreen;
12 
13 class StereoDisplayPlugin : public OpenGLDisplayPlugin {
14  Q_OBJECT
15  using Parent = OpenGLDisplayPlugin;
16 public:
17  virtual bool isStereo() const override final { return true; }
18  virtual bool isSupported() const override final;
19 
20  virtual float getRecommendedAspectRatio() const override;
21  virtual glm::mat4 getEyeProjection(Eye eye, const glm::mat4& baseProjection) const override;
22 
23  // NOTE, because Stereo displays don't include head tracking, and therefore
24  // can't include roll or pitch, the eye separation is embedded into the projection
25  // matrix. However, this eliminates the possibility of easily mainpulating
26  // the IPD at the Application level, the way we now allow with HMDs.
27  // If that becomes an issue then we'll need to break up the functionality similar
28  // to the HMD plugins.
29  //virtual glm::mat4 getEyeToHeadTransform(Eye eye) const override;
30 
31  virtual void pluginUpdate() override {};
32 
33 protected:
34  virtual bool internalActivate() override;
35  virtual void internalDeactivate() override;
36  void updateScreen(uint32_t i);
37 
38  float _ipd{ 0.064f };
39  QScreen* _screen;
40 };