#pragma once #include namespace cgv { namespace media { /** * A plane of arbitrary dimension stored as a homogeneous vector that defines the coefficients of the plane equation. */ template class plane { public: cgv::math::vec h; /// construct plane of give dimension allocating a homogenous vector of one dimension mor plane(int dim = 3) { h.resize(dim+1); } /// construct from normal vector and distance of plane to origin, which /// is negated before it is copied to the last component of the stored /// homogenous vector plane(const cgv::math::vec &n, const T &distance) { h.resize(n.size()+1); for (unsigned int i=0; i get_normal() const { cgv::math::vec n; n.resize(h.size()-1); for (unsigned int i=0; i