1 /* This file is part of Dilay 2 * Copyright © 2015-2018 Alexander Bau 3 * Use and redistribute under the terms of the GNU General Public License 4 */ 5 #ifndef DILAY_PRIMITIVE_TRIANGLE 6 #define DILAY_PRIMITIVE_TRIANGLE 7 8 #include <glm/glm.hpp> 9 10 class PrimTriangle 11 { 12 public: 13 PrimTriangle (const glm::vec3&, const glm::vec3&, const glm::vec3&); 14 vertex1() const15 const glm::vec3& vertex1 () const { return this->_vertex1; } vertex2() const16 const glm::vec3& vertex2 () const { return this->_vertex2; } vertex3() const17 const glm::vec3& vertex3 () const { return this->_vertex3; } 18 19 glm::vec3 cross () const; 20 glm::vec3 normal () const; 21 glm::vec3 center () const; 22 glm::vec3 minimum () const; 23 glm::vec3 maximum () const; 24 float maxExtent () const; 25 float maxDimExtent () const; 26 float incircleRadiusSqr () const; 27 float longestEdgeSqr () const; 28 29 private: 30 const glm::vec3& _vertex1; 31 const glm::vec3& _vertex2; 32 const glm::vec3& _vertex3; 33 }; 34 35 #endif 36