1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 02:15:33 +00:00
openmw-tes3mp/apps/openmw/mwvr/openxrworldview.hpp

43 lines
1.3 KiB
C++

#ifndef OPENXRWORLDVIEW_HPP
#define OPENXRWORLDVIEW_HPP
#include "openxrview.hpp"
#include "openxrsession.hpp"
namespace MWVR
{
class OpenXRWorldView : public OpenXRView
{
public:
class UpdateSlaveCallback : public osg::View::Slave::UpdateSlaveCallback
{
public:
UpdateSlaveCallback(osg::ref_ptr<OpenXRManager> XR, OpenXRSession* session, osg::ref_ptr<OpenXRWorldView> view, osg::GraphicsContext* gc)
: mXR(XR), mSession(session), mView(view), mGC(gc)
{}
void updateSlave(osg::View& view, osg::View::Slave& slave) override;
private:
osg::ref_ptr<OpenXRManager> mXR;
OpenXRSession* mSession;
osg::ref_ptr<OpenXRWorldView> mView;
osg::ref_ptr<osg::GraphicsContext> mGC;
};
public:
OpenXRWorldView(osg::ref_ptr<OpenXRManager> XR, std::string name, osg::ref_ptr<osg::State> state, OpenXRSwapchain::Config config, float metersPerUnit);
~OpenXRWorldView();
//! Prepare for render (update matrices)
void prerenderCallback(osg::RenderInfo& renderInfo) override;
//! Projection offset for this view
osg::Matrix projectionMatrix();
//! View offset for this view
osg::Matrix viewMatrix();
float mMetersPerUnit = 1.f;
};
}
#endif