mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 02:15:55 +08:00
Tech ENABLE_RAYCAST_PICKING - Raytraced picking of Cut Gizmo
This commit is contained in:
parent
0cedf331b1
commit
0a7dae6df6
@ -269,13 +269,24 @@ void GLGizmoCut::on_render()
|
|||||||
#endif // !ENABLE_GL_CORE_PROFILE
|
#endif // !ENABLE_GL_CORE_PROFILE
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !ENABLE_RAYCAST_PICKING
|
#if ENABLE_RAYCAST_PICKING
|
||||||
void GLGizmoCut::on_render_for_picking()
|
void GLGizmoCut::on_register_raycasters_for_picking()
|
||||||
|
{
|
||||||
|
// the gizmo grabbers are rendered on top of the scene, so the raytraced picker should take it into account
|
||||||
|
m_parent.set_raycaster_gizmos_on_top(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GLGizmoCut::on_unregister_raycasters_for_picking()
|
||||||
|
{
|
||||||
|
m_parent.set_raycaster_gizmos_on_top(false);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void GLGizmoCut::on_render_for_picking()
|
||||||
{
|
{
|
||||||
glsafe(::glDisable(GL_DEPTH_TEST));
|
glsafe(::glDisable(GL_DEPTH_TEST));
|
||||||
render_grabbers_for_picking(m_parent.get_selection().get_bounding_box());
|
render_grabbers_for_picking(m_parent.get_selection().get_bounding_box());
|
||||||
}
|
}
|
||||||
#endif // !ENABLE_RAYCAST_PICKING
|
#endif // ENABLE_RAYCAST_PICKING
|
||||||
|
|
||||||
void GLGizmoCut::on_render_input_window(float x, float y, float bottom_limit)
|
void GLGizmoCut::on_render_input_window(float x, float y, float bottom_limit)
|
||||||
{
|
{
|
||||||
|
@ -68,9 +68,12 @@ protected:
|
|||||||
virtual void on_start_dragging() override;
|
virtual void on_start_dragging() override;
|
||||||
virtual void on_dragging(const UpdateData& data) override;
|
virtual void on_dragging(const UpdateData& data) override;
|
||||||
virtual void on_render() override;
|
virtual void on_render() override;
|
||||||
#if !ENABLE_RAYCAST_PICKING
|
#if ENABLE_RAYCAST_PICKING
|
||||||
|
virtual void on_register_raycasters_for_picking() override;
|
||||||
|
virtual void on_unregister_raycasters_for_picking() override;
|
||||||
|
#else
|
||||||
virtual void on_render_for_picking() override;
|
virtual void on_render_for_picking() override;
|
||||||
#endif // !ENABLE_RAYCAST_PICKING
|
#endif // ENABLE_RAYCAST_PICKING
|
||||||
virtual void on_render_input_window(float x, float y, float bottom_limit) override;
|
virtual void on_render_input_window(float x, float y, float bottom_limit) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -654,9 +654,7 @@ void GLGizmoScale3D::on_unregister_raycasters_for_picking()
|
|||||||
{
|
{
|
||||||
m_parent.set_raycaster_gizmos_on_top(false);
|
m_parent.set_raycaster_gizmos_on_top(false);
|
||||||
}
|
}
|
||||||
#endif // ENABLE_RAYCAST_PICKING
|
#else
|
||||||
|
|
||||||
#if !ENABLE_RAYCAST_PICKING
|
|
||||||
void GLGizmoScale3D::on_render_for_picking()
|
void GLGizmoScale3D::on_render_for_picking()
|
||||||
{
|
{
|
||||||
glsafe(::glDisable(GL_DEPTH_TEST));
|
glsafe(::glDisable(GL_DEPTH_TEST));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user