SLA gizmo clipping plane logic moved to fragment shader

This means the clipping now works again with both legacy and modern OpenGL
This commit is contained in:
Lukas Matena 2019-03-25 12:01:02 +01:00
parent 273fcf68a1
commit 9b7857aaab
7 changed files with 41 additions and 38 deletions

View file

@ -427,6 +427,9 @@ private:
// z range for clipping in shaders
float z_range[2];
// plane coeffs for clipping in shaders
float clipping_plane[4];
public:
GLVolumePtrs volumes;
@ -485,6 +488,7 @@ public:
}
void set_z_range(float min_z, float max_z) { z_range[0] = min_z; z_range[1] = max_z; }
void set_clipping_plane(const double* coeffs) { clipping_plane[0] = coeffs[0]; clipping_plane[1] = coeffs[1]; clipping_plane[2] = coeffs[2]; clipping_plane[3] = coeffs[3]; }
// returns true if all the volumes are completely contained in the print volume
// returns the containment state in the given out_state, if non-null