/* render/face.cc This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2 */ #include "render/face.h" #include "render/gl.h" namespace render { Face::Face(math::Vector3f const & normal) : face_normal(normal) { face_normal.normalize(); } Face::~Face() { for (std::vector::iterator it = face_vertex.begin(); it != face_vertex.end(); it++) { delete (*it); } face_vertex.clear(); } void Face::add_vertex(math::Vector3f const & vertex) { math::Vector3f *v = new math::Vector3f(vertex); face_vertex.push_back(v); } void Face::draw() { gl::begin(gl::LineLoop); for (std::vector::iterator it = face_vertex.begin(); it != face_vertex.end(); it++) { gl::vertex(*(*it)); } gl::end(); } }