Easy3D 2.5.3
|
Implementation of picking mechanism for set of models. More...
#include <easy3d/gui/picker_model.h>
Public Member Functions | |
ModelPicker (const Camera *cam) | |
Model * | pick (const std::vector< Model * > &models, int x, int y) |
Pick a model from a set of models given the cursor position in the screen coordinate system. More... | |
Public Member Functions inherited from Picker | |
Picker (const Camera *cam) | |
const Camera * | camera () const |
Returns the pointer of the camera. | |
Line3 | picking_line (int x, int y) const |
Construct a picking line. More... | |
vec3 | picking_dir (int x, int y) const |
The picking direction, pointing inside the screen. More... | |
vec3 | project (const vec3 &p) const |
Project a 3D point in the world coordinate system onto the 2D screen coordinate system. More... | |
vec3 | unproject (int x, int y, float depth) const |
Compute the world coordinates of a point defined in the screen coordinate system. More... | |
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) into the OpenGL coordinate system (with an origin in the lower left corner). The high DPI scaling is also taken into consideration, so the result always corresponds to its image pixel. More... | |
Implementation of picking mechanism for set of models.
Pick a model from a set of models given the cursor position in the screen coordinate system.
models | The models |
x | The cursor x-coordinate, relative to the left edge of the content area. |
y | The cursor y-coordinate, relative to the top edge of the content area. |