1 #include <msp/strings/format.h>
6 #include "programdata.h"
11 ClipPlane::ClipPlane():
15 ClipPlane::ClipPlane(const Vector4 &e):
19 ClipPlane::ClipPlane(const Vector3 &p, const Vector3 &d):
20 eq(compose(d, -dot(p, d)))
23 void ClipPlane::set_equation(const Vector4 &e)
28 void ClipPlane::set_plane(const Vector3 &p, const Vector3 &d)
30 Vector3 nd = normalize(d);
31 set_equation(compose(nd, -dot(p, nd)));
34 void ClipPlane::update_shader_data(ProgramData &shdata, const Matrix &view_inverse, unsigned i) const
36 shdata.uniform(format("clip_planes[%d].equation", i), eq*view_inverse);