Newer
Older
cg / include / vec.h
@glproj03 glproj03 on 29 Jan 2006 729 bytes Did a lot off stuff :-)
  1. #ifndef _VEC_H
  2. #define _VEC_H
  3.  
  4. #include "spoly.h"
  5.  
  6. #include <string>
  7. #include <vector>
  8. class Vec {
  9. private:
  10. public:
  11. std::vector<SPoly*> faces;
  12. float c[3];
  13.  
  14. Vec();
  15. Vec(float vx, float vy, float vz);
  16. Vec(Vec* v);
  17. float x();
  18. float y();
  19. float z();
  20. float* getCoords();
  21. Vec operator+(Vec* v);
  22. Vec operator+(Vec c);
  23. void add(Vec a);
  24. void sub(Vec a);
  25. void add(Vec& a);
  26. void sub(Vec& a);
  27. Vec operator-(Vec& v);
  28. Vec operator*(float s);
  29. Vec operator*(Vec& s);
  30. Vec operator/(float s);
  31. float angle(Vec& v);
  32. float dotP(Vec& v);
  33. Vec cross(Vec& v);
  34. Vec normalize();
  35. float length();
  36. void print();
  37. Vec* clone();
  38. void vardump(std::string whitespace);
  39. void registerFace(SPoly* p);
  40. };
  41. #endif