diff options
Diffstat (limited to 'src/model/triangle.h')
-rw-r--r-- | src/model/triangle.h | 39 |
1 files changed, 30 insertions, 9 deletions
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; } |