1 #include <msp/strings/format.h>
3 #include "programdata.h"
8 ClipPlane::ClipPlane():
13 ClipPlane::ClipPlane(const Vector4 &e):
18 ClipPlane::ClipPlane(const Vector3 &p, const Vector3 &d):
19 eq(compose(d, -dot(p, d))),
23 void ClipPlane::set_equation(const Vector4 &e)
29 void ClipPlane::set_plane(const Vector3 &p, const Vector3 &d)
31 Vector3 nd = normalize(d);
32 set_equation(compose(nd, -dot(p, nd)));
35 void ClipPlane::update_shader_data(ProgramData &shdata, unsigned i) const
37 shdata.uniform(format("clip_planes[%d].equation", i), eq);