return new OpenVRCombiner(*this, v);
}
+void OpenVRSystem::tick()
+{
+ vr::IVRSystem *vr_sys = vr::VRSystem();
+
+ vr::VREvent_t event;
+ while(vr_sys->PollNextEvent(&event, sizeof(event)))
+ {
+ if(event.eventType==vr::VREvent_TrackedDeviceActivated)
+ if(event.trackedDeviceIndex>=n_tracked_devices)
+ {
+ n_tracked_devices = event.trackedDeviceIndex+1;
+ tracking_matrices.resize(n_tracked_devices);
+ }
+ }
+}
+
void OpenVRSystem::update_pose_matrices()
{
vector<vr::TrackedDevicePose_t> poses;
virtual OpenVRCamera *create_camera(const GL::Camera &);
virtual OpenVRCombiner *create_combiner(GL::View &);
+ virtual void tick();
+
void update_pose_matrices();
const GL::Matrix &get_tracking_matrix(unsigned) const;
const GL::Matrix &get_hmd_matrix() const;
virtual bool get_absolute_tracking() const { return false; }
virtual HeadTrackingCamera *create_camera(const GL::Camera &) = 0;
virtual StereoCombiner *create_combiner(GL::View &) = 0;
+
+ virtual void tick() { }
};
} // namespace VR