1 #include <msp/strings/format.h>
6 #include "programdata.h"
11 ClipPlane::ClipPlane():
16 ClipPlane::ClipPlane(const Vector4 &e):
21 ClipPlane::ClipPlane(const Vector3 &p, const Vector3 &d):
22 eq(compose(d, -dot(p, d))),
26 void ClipPlane::set_equation(const Vector4 &e)
32 void ClipPlane::set_plane(const Vector3 &p, const Vector3 &d)
34 Vector3 nd = normalize(d);
35 set_equation(compose(nd, -dot(p, nd)));
38 void ClipPlane::update_shader_data(ProgramData &shdata, unsigned i) const
40 shdata.uniform(format("clip_planes[%d].equation", i), eq);