Vertex.cpp 858 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "Vertex.h"
  2. Vertex::Vertex(float x, float y, float z, float nx, float ny, float nz, float tx, float ty)
  3. {
  4. this->x = x;
  5. this->y = y;
  6. this->z = z;
  7. this->normalX = nx;
  8. this->normalY = ny;
  9. this->normalZ = nz;
  10. this->texX = tx;
  11. this->texY = ty;
  12. }
  13. Vertex::~Vertex()
  14. {
  15. }
  16. Vertex Vertex::operator/(const float &other) const
  17. {
  18. return Vertex(x / other, y / other, z / other, normalX, normalY, normalZ, texX, texY);
  19. }
  20. Vertex Vertex::operator*(const Vertex & other) const
  21. {
  22. return Vertex(x*other.x, y*other.y, z*other.z, normalX, normalY, normalZ, texX, texY);
  23. }
  24. Vertex Vertex::operator*(const float & other) const
  25. {
  26. return Vertex(x*other, y*other, z*other, normalX, normalY, normalZ, texX, texY);
  27. }
  28. Vertex Vertex::operator+(const Vertex & other) const
  29. {
  30. return Vertex(x+other.x, y+other.y, z+other.z, normalX, normalY, normalZ, texX, texY);
  31. }