Triangle.cpp 316 B

123456789101112
  1. #include "client/rendering/Triangle.h"
  2. Triangle::Triangle() {
  3. }
  4. Triangle::Triangle(const Vertex& a, const Vertex& b, const Vertex& c) : a(a), b(b), c(c) {
  5. Vector3 ac = c.position - a.position;
  6. Vector3 ab = b.position - a.position;
  7. normalA = ab.cross(ac);
  8. normalB = normalA;
  9. normalC = normalA;
  10. }