Help divide camera data and camera functions This utility work with camera data by static funtions. More...
#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/CameraUtils.hpp>
Public Member Functions | |
| CameraUtils ()=delete | |
Static Public Member Functions | |
| static Points | project (const Camera &camera, const std::vector< Vec3d > &points) |
| Project point throw camera to 2d coordinate into imgui window. | |
| static Slic3r::Point | project (const Camera &camera, const Vec3d &point) |
| static Polygon | create_hull2d (const Camera &camera, const GLVolume &volume) |
| Create hull around GLVolume in 2d space of camera. | |
| static void | ray_from_screen_pos (const Camera &camera, const Vec2d &position, Vec3d &point, Vec3d &direction) |
| Create ray(point and direction) for screen coordinate. | |
| static void | ray_from_ortho_screen_pos (const Camera &camera, const Vec2d &position, Vec3d &point, Vec3d &direction) |
| static void | ray_from_persp_screen_pos (const Camera &camera, const Vec2d &position, Vec3d &point, Vec3d &direction) |
| static Vec2d | get_z0_position (const Camera &camera, const Vec2d &coor) |
| Unproject mouse coordinate to get position in space where z coor is zero Platter surface should be in z == 0. | |
| static Vec3d | screen_point (const Camera &camera, const Vec2d &position) |
| Create 3d screen point from 2d position. | |
Help divide camera data and camera functions This utility work with camera data by static funtions.
|
delete |
|
static |
Create hull around GLVolume in 2d space of camera.
| camera | Projection params |
| volume | Outline by 3d object |
References Slic3r::GLVolume::bounding_box(), Slic3r::Geometry::convex_hull(), Slic3r::GLVolume::convex_hull(), Slic3r::GLVolume::get_instance_transformation(), Slic3r::Geometry::Transformation::get_matrix(), Slic3r::GLVolume::get_volume_transformation(), Slic3r::TriangleMesh::its, and project().
Referenced by anonymous_namespace{GLGizmoEmboss.cpp}::calc_fine_position(), and anonymous_namespace{EmbossJob.cpp}::find_closest().
Unproject mouse coordinate to get position in space where z coor is zero Platter surface should be in z == 0.
| camera | Projection params |
| coor | Mouse position |
References ray_from_screen_pos().
Referenced by anonymous_namespace{EmbossJob.cpp}::CreateObjectJob::process().
Project point throw camera to 2d coordinate into imgui window.
| camera | Projection params |
| points | Point to project. |
References Slic3r::GUI::Camera::get_projection_matrix(), Slic3r::GUI::Camera::get_view_matrix(), and Slic3r::GUI::Camera::get_viewport().
Referenced by Slic3r::GUI::GLSelectionRectangle::contains(), create_hull2d(), Slic3r::GUI::GLCanvas3D::CenterOfMass::on_left_down(), Slic3r::GUI::GLGizmoTextureDisplacement::on_mouse_adjust_texture(), project(), Slic3r::GUI::GLCanvas3D::CenterOfMass::render_details(), and anonymous_namespace{SurfaceDrag.cpp}::start_dragging().
|
static |
|
static |
References Slic3r::GUI::Camera::get_dir_forward(), Slic3r::GUI::Camera::get_projection_matrix(), Slic3r::GUI::Camera::get_type(), Slic3r::GUI::Camera::get_view_matrix(), Slic3r::GUI::Camera::get_viewport(), Slic3r::GUI::Camera::Ortho, and screen_point().
Referenced by ray_from_screen_pos().
|
static |
References Slic3r::GUI::Camera::get_position(), Slic3r::GUI::Camera::get_projection_matrix(), Slic3r::GUI::Camera::get_type(), Slic3r::GUI::Camera::get_view_matrix(), Slic3r::GUI::Camera::get_viewport(), Slic3r::GUI::Camera::Perspective, and screen_point().
Referenced by ray_from_screen_pos().
|
static |
Create ray(point and direction) for screen coordinate.
| camera | Definition of camera |
| position | Position on screen(aka mouse position) |
| point | OUT start of ray |
| direction | OUT direction of ray |
References Slic3r::GUI::Camera::get_type(), Slic3r::GUI::Camera::Ortho, Slic3r::GUI::Camera::Perspective, ray_from_ortho_screen_pos(), and ray_from_persp_screen_pos().
Referenced by Slic3r::GUI::GLCanvas3D::get_camera_pan_anchor(), get_z0_position(), Slic3r::GUI::MeshRaycaster::line_from_mouse_pos(), Slic3r::GUI::ray_from_camera(), Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::ray_plane_hit(), and Slic3r::GUI::MeshRaycaster::unproject_on_mesh().
Create 3d screen point from 2d position.
| camera | Define camera viewport |
| position | Position on screen(aka mouse position) |
References Slic3r::GUI::Camera::get_viewport().
Referenced by ray_from_ortho_screen_pos(), and ray_from_persp_screen_pos().