sim_cinematique_inverse/labo_ik/IKGLCanvas.h

46 lines
882 B
C
Raw Normal View History

2024-04-01 17:18:18 -04:00
#pragma once
/**
* @file IKGLCanvas.h
*
* @brief Canvas class for drawing OpenGL scenes.
*
* Nom:
* Code permanent :
* Email :
*
*/
#include <nanogui/window.h>
#include <nanogui/canvas.h>
#include <nanogui/shader.h>
class IKApplication;
// An OpenGL canvas class to draw point clouds
//
class IKGLCanvas : public nanogui::Canvas
{
public:
IKGLCanvas(IKApplication* _app);
virtual void draw_contents() override;
virtual bool mouse_drag_event(const nanogui::Vector2i& p, const nanogui::Vector2i& rel, int button, int modifiers) override;
virtual bool scroll_event(const nanogui::Vector2i& p, const nanogui::Vector2f& rel) override;
void resetCamera();
private:
nanogui::ref<nanogui::Shader> m_shader;
nanogui::ref<nanogui::Shader> m_lineShader;
IKApplication* m_app;
// Camera parameters
float phi[2];
float dist;
};