27#ifndef EASY3D_GUI_PICKER_H
28#define EASY3D_GUI_PICKER_H
30#include <easy3d/core/types.h>
31#include <easy3d/renderer/camera.h>
128 void screen_to_opengl(
int x,
int y,
int &gl_x,
int &gl_y,
int width,
int height)
const;
136 void setup_framebuffer(
int width,
int height);
141 bool use_gpu_if_supported_;
A perspective or orthographic camera.
Definition camera.h:113
vec3 projectedCoordinatesOf(const vec3 &src, const Frame *frame=nullptr) const
Returns the screen projected coordinates of a 3D point defined in the frame coordinate system....
vec3 unprojectedCoordinatesOf(const vec3 &src, const Frame *frame=nullptr) const
Returns the world unprojected coordinates of a point defined in the screen coordinate system....
An implementation of framebuffer object (FBO).
Definition framebuffer_object.h:122
static GenericLine from_two_points(const Point &p, const Point &q)
Definition line.h:65
const Vector & direction() const
Returns the direction of the line.
Definition line.h:86
Picker(const Camera *cam)
Constructor.
Definition picker.cpp:39
void screen_to_opengl(int x, int y, int &gl_x, int &gl_y, int width, int height) const
Convert a point expressed in the screen coordinate system (with an origin in the upper left corner) i...
Definition picker.cpp:71
const Camera * camera() const
Returns the pointer of the camera.
Definition picker.h:59
Line3 picking_line(int x, int y) const
Construct a picking line.
Definition picker.h:70
vec3 project(const vec3 &p) const
Project a 3D point in the world coordinate system onto the 2D screen coordinate system.
Definition picker.h:99
virtual ~Picker()
Destructor.
Definition picker.cpp:44
vec3 picking_dir(int x, int y) const
The picking direction, pointing inside the screen.
Definition picker.h:85
vec3 unproject(int x, int y, float depth) const
Compute the world coordinates of a point defined in the screen coordinate system.
Definition picker.h:113
Definition collider.cpp:182
Vec< 3, float > vec3
A 3D point/vector of float type.
Definition types.h:44
GenericLine< 3, float > Line3
A 3D line of float type.
Definition types.h:92