+++ /dev/null
-#include <msp/strings/format.h>
-#include "clipplane.h"
-#include "gl.h"
-#include "matrix.h"
-#include "misc.h"
-#include "programdata.h"
-
-namespace Msp {
-namespace GL {
-
-ClipPlane::ClipPlane():
- eq(0, 0, 0, 1),
- generation(0)
-{ }
-
-ClipPlane::ClipPlane(const Vector4 &e):
- eq(e),
- generation(0)
-{ }
-
-ClipPlane::ClipPlane(const Vector3 &p, const Vector3 &d):
- eq(compose(d, -dot(p, d))),
- generation(0)
-{ }
-
-void ClipPlane::set_equation(const Vector4 &e)
-{
- eq = e;
- ++generation;
-}
-
-void ClipPlane::set_plane(const Vector3 &p, const Vector3 &d)
-{
- Vector3 nd = normalize(d);
- set_equation(compose(nd, -dot(p, nd)));
-}
-
-void ClipPlane::update_shader_data(ProgramData &shdata, unsigned i) const
-{
- shdata.uniform(format("clip_planes[%d].equation", i), eq);
-}
-
-} // namespace GL
-} // namespace Msp