28#include <osgViewer/Viewer>
29#include <osgViewer/ViewerEventHandlers>
31#include <util/common.h>
49class coVRStatsDisplay;
52class COVEREXPORT
VRViewer :
public osgViewer::Viewer,
public ui::Owner
92 char stereoCommand[500];
93 char monoCommand[500];
96 virtual void renderingTraversals();
99 osg::Vec3 viewPos, viewDir;
100 osg::Vec3 initialViewPos;
102 osgViewer::StatsHandler *statsHandler =
nullptr;
106 void readConfigFile();
108 void setStereoMode();
110 void createChannels(
int i);
111 void destroyChannels(
int i);
115 osg::Vec4 backgroundColor;
120 bool reEnableCulling;
122 osg::Geometry *distortionMesh(
const char *fileName);
123 void createViewportCameras(
int i);
124 void destroyViewportCameras(
int i);
125 void createBlendingCameras(
int i);
126 void destroyBlendingCameras(
int i);
127 float requestedSeparation, separation;
128 int animateSeparation;
131 std::list<osg::ref_ptr<osg::Camera> > myCameras;
168 virtual void getCameras(Cameras &cameras,
bool onlyActive =
true);
169 virtual void getContexts(Contexts &contexts,
bool onlyValid =
true);
170 virtual void getScenes(Scenes &scenes,
bool onlyValid =
true);
187 return initialViewPos;
194 void culling(
bool enable, osg::CullSettings::CullingModeValues mode = osg::CullSettings::ENABLE_ALL_CULLING,
bool once =
false);
209 return backgroundColor;
212 bool clearWindow =
true;
217 overwritePAndV = state;
221 return overwritePAndV;
233 bool m_fullscreen =
false;
238 bool m_requireGlFinish =
true;
241std::pair<osg::Matrix, osg::Matrix> COVEREXPORT
computeViewProjFixedScreen(
const osg::Matrix &viewerMat, osg::Vec3 eye,
const osg::Vec3 &xyz,
const osg::Vec3 &hpr,
const osg::Vec2 &size,
double near,
double far,
bool ortho=
false,
double worldAngle=0.f);
Definition: ARToolKit.h:33
std::pair< osg::Matrix, osg::Matrix > COVEREXPORT computeViewProjFixedScreen(const osg::Matrix &viewerMat, osg::Vec3 eye, const osg::Vec3 &xyz, const osg::Vec3 &hpr, const osg::Vec2 &size, double near, double far, bool ortho=false, double worldAngle=0.f)
Definition: coClusterStat.h:29
Definition: ARToolKit.h:168
Definition: coVRConfig.h:127
Definition: coVRStatsDisplay.h:24
Definition: InitGLOperation.h:39
Definition: MSEventHandler.h:10
Definition: OpenCOVER.h:61
Definition: VRViewer.h:53
bool isFullscreen() const
angleStruct * getAngleStruct()
Definition: VRViewer.h:198
virtual void getCameras(Cameras &cameras, bool onlyActive=true)
osg::Vec3 & getViewerPos()
Definition: VRViewer.h:181
void setFrustumAndView(int i)
void setInitialViewerPos(osg::Vec3 &po)
Definition: VRViewer.h:189
FrustaAndViews computeFrustumAndView(int i)
static VRViewer * instance()
void setClearColor(const osg::Vec4 &color)
void overwriteViewAndProjectionMatrix(bool state)
Definition: VRViewer.h:215
void redrawHUD(double interval)
std::vector< osg::ref_ptr< osg::Camera > > viewportCamera
Definition: VRViewer.h:230
osg::Node::NodeMask getCullMaskRight()
virtual void getScenes(Scenes &scenes, bool onlyValid=true)
void glContextOperation(osg::GraphicsContext *ctx)
osg::Vec3 & getInitialViewerPos()
Definition: VRViewer.h:185
osg::Vec3 eyeOffset(Eye eye) const
std::vector< osg::ref_ptr< osg::Camera > > blendingCamera
Definition: VRViewer.h:231
osg::Node::NodeMask getCullMask()
osg::Vec4 getBackgroundColor()
Definition: VRViewer.h:207
void updateViewerMat(const osg::Matrix &mat)
void setRenderToTexture(bool)
virtual void getContexts(Contexts &contexts, bool onlyValid=true)
osg::Node::NodeMask getCullMaskLeft()
void addCamera(osg::Camera *camera)
osg::Matrix & getViewerMat()
Definition: VRViewer.h:177
virtual void startThreading()
bool isMatrixOverwriteOn()
Definition: VRViewer.h:219
void setFullscreen(bool state)
float getSeparation()
Definition: VRViewer.h:202
void removeCamera(osg::Camera *camera)
void setViewerMat(osg::Matrix &mat)
Definition: VRViewer.h:173
void setSeparation(float stereoSep)
void culling(bool enable, osg::CullSettings::CullingModeValues mode=osg::CullSettings::ENABLE_ALL_CULLING, bool once=false)
Eye
Definition: VRViewer.h:151
@ EyeRight
Definition: VRViewer.h:154
@ EyeLeft
Definition: VRViewer.h:153
@ EyeMiddle
Definition: VRViewer.h:152
static int unsyncedFrames
Definition: VRViewer.h:69
Definition: VRViewer.h:136
osg::Matrix view
Definition: VRViewer.h:137
osg::Matrix proj
Definition: VRViewer.h:138
Definition: VRViewer.h:141
FrustumAndView right
Definition: VRViewer.h:143
FrustumAndView middle
Definition: VRViewer.h:144
FrustumAndView left
Definition: VRViewer.h:142