Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/triangle.h')
-rw-r--r--src/model/triangle.h56
1 files changed, 16 insertions, 40 deletions
diff --git a/src/model/triangle.h b/src/model/triangle.h
index a3fb643..f2a741a 100644
--- a/src/model/triangle.h
+++ b/src/model/triangle.h
@@ -7,7 +7,6 @@
#ifndef __INCLUDED_MODEL_TRIANGLE_H__
#define __INCLUDED_MODEL_TRIANGLE_H__
-#include "math/color.h"
#include "math/vector2f.h"
#include "math/vector3f.h"
@@ -19,54 +18,20 @@ class Triangle
{
public:
/**
- * @brief default constructor
- */
- Triangle();
-
- /**
- * @brief copy constructor
+ * @brief a new triangle with 3 vertices
+ * this constructor is used by the ASE reader sets the detail flag to false
*/
- Triangle(const Triangle &other);
+ Triangle(const math::Vector3f &v0, const math::Vector3f &v1, const math::Vector3f &v2);
/**
* @brief a new triangle with 3 vertices
- * this constructor sets the detail flag to false
+ * this constructor is used by the MAP reader and assigns the face normal to every vertex 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);
+ Triangle(const math::Vector3f &v0,const math::Vector3f &v1, const math::Vector3f &v2, const math::Vector3f &normal, const bool detail = false);
/// 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 & normal()
- {
- return triangle_normal;
- }
-
- /// indidcates if this triangle was generated from a detail brush
- inline bool detail() const
- {
- return triangle_detail;
- }
-
/// triangle vertex 0
inline math::Vector3f & v0()
{
@@ -120,6 +85,17 @@ public:
{
return triangle_t2;
}
+
+ /// indidcates if this triangle was generated from a detail brush
+ inline bool detail() const
+ {
+ return triangle_detail;
+ }
+
+ /// face normal
+ inline math::Vector3f &normal() {
+ return triangle_normal;
+ }
private: