Skip to content
Snippets Groups Projects
Commit f7e71730 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Merge branch 'bug/191/guicampose' into 'master'

Resolves #191 gui camera pose bug

Closes #191

See merge request nicolas.pope/ftl!239
parents 853b0a5b 14031615
No related branches found
No related tags found
1 merge request!239Resolves #191 gui camera pose bug
Pipeline #19943 passed
......@@ -576,6 +576,16 @@ bool ftl::gui::Camera::thumbnail(cv::Mat &thumb) {
return true;
}
void ftl::gui::Camera::active(bool a) {
if (a) {
} else {
neye_[0] = eye_[0];
neye_[1] = eye_[1];
neye_[2] = eye_[2];
}
}
const GLTexture &ftl::gui::Camera::captureFrame() {
float now = (float)glfwGetTime();
delta_ = now - ftime_;
......
......@@ -66,6 +66,11 @@ class Camera {
void draw(std::vector<ftl::rgbd::FrameSet*> &fss);
/**
* @internal. Used to inform the camera if it is the active camera or not.
*/
void active(bool);
const GLTexture &captureFrame();
const GLTexture &getLeft() const { return texture1_; }
const GLTexture &getRight() const { return texture2_; }
......
......@@ -360,6 +360,7 @@ ftl::gui::Screen::~Screen() {
}
void ftl::gui::Screen::setActiveCamera(ftl::gui::Camera *cam) {
if (camera_) camera_->active(false);
camera_ = cam;
if (cam) {
......@@ -367,6 +368,7 @@ void ftl::gui::Screen::setActiveCamera(ftl::gui::Camera *cam) {
mwindow_->setVisible(true);
mwindow_->cameraChanged();
swindow_->setVisible(false);
cam->active(true);
} else {
mwindow_->setVisible(false);
swindow_->setVisible(true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment