From bbd04914749b2e3918796fe331daf649b06163ea Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 9 Aug 2009 21:11:55 +0000 Subject: adds r_normals cvar, read normals from .ase models --- src/model/triangle.h | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'src/model/triangle.h') diff --git a/src/model/triangle.h b/src/model/triangle.h index 27abeed..fe1c720 100644 --- a/src/model/triangle.h +++ b/src/model/triangle.h @@ -17,24 +17,45 @@ namespace model class Triangle { public: - /// a new triangle with 3 vertices, a normal and detail flag - Triangle(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2, - math::Vector3f const &normal, bool detail); + /** + * @brief default constructor + */ + Triangle(); /** - * @brief a new triangle with 3 vertices with normals and a face normal + * @brief copy constructor + */ + Triangle(const Triangle &other); + + /** + * @brief a new triangle with 3 vertices * this constructor sets the detail flag to false */ - Triangle( math::Vector3f const &v0, math::Vector3f const &n0, - math::Vector3f const &v1, math::Vector3f const &n1, - math::Vector3f const &v2, math::Vector3f const &n2, - math::Vector3f const &normal); + Triangle(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2); + + /// a new triangle with 3 vertices, a normal and detail flag + Triangle(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2, + math::Vector3f const &normal, bool detail); /// delete triangle ~Triangle(); + /** + * @brief assignment + */ + void assign(const Triangle &other); + + /** + * @brief assignment oeprator + */ + inline const Triangle & operator=(const Triangle &other) + { + assign(other); + return (*this); + } + /// normal of the triangle - inline math::Vector3f const & normal() const + inline math::Vector3f & normal() { return triangle_normal; } -- cgit v1.2.3