1 #include <msp/strings/format.h>
3 #include "programdata.h"
8 ClipPlane::ClipPlane(const Vector4 &e):
12 ClipPlane::ClipPlane(const Vector3 &p, const Vector3 &d):
13 eq(compose(d, -dot(p, d)))
16 void ClipPlane::set_equation(const Vector4 &e)
22 void ClipPlane::set_plane(const Vector3 &p, const Vector3 &d)
24 Vector3 nd = normalize(d);
25 set_equation(compose(nd, -dot(p, nd)));
28 void ClipPlane::update_shader_data(ProgramData &shdata, unsigned i) const
30 shdata.uniform(format("clip_planes[%d].equation", i), eq);