Advertisement
Guest User

Vector.h

a guest
Jan 16th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. class vec3{
  2. public:
  3. vec3();
  4. vec3(float X, float Y, float Z);
  5.  
  6. vec3 cross(const vec3 vec);
  7. vec3 scale(float scale);
  8. vec3 lerp(vec3 end, float time);
  9.  
  10. bool operator!=(const vec3 vec);
  11. bool operator==(const vec3 vec);
  12.  
  13. vec3 operator-(const vec3 vec);
  14. vec3 operator-(const float value);
  15. vec3 operator+(const vec3 vec);
  16. vec3 operator+(const float value);
  17. vec3 operator*(const vec3 vec);
  18. vec3 operator*(const float value);
  19. vec3 operator/(const float value);
  20. vec3 operator=(const float* value);
  21. vec3 operator+=(const vec3 vec);
  22. vec3 operator()(float x, float y, float z);
  23. vec3 operator-=(const vec3 vec);
  24. vec3 operator-=(const float value);
  25. vec3 operator*=(const vec3 vec);
  26. vec3 operator*=(const float value);
  27.  
  28. vec3 forward();
  29. vec3 right();
  30. vec3 up();
  31.  
  32. float* convert();
  33.  
  34. float getX() const;
  35. float getY() const;
  36. float getZ() const;
  37. float getLength() const;
  38. float getMagnitude() const;
  39. float distanceTo(vec3 pos);
  40.  
  41. void copy(vec3 result);
  42. void addX(float value);
  43. void addY(float value);
  44. void addZ(float value);
  45. void normalize();
  46. void zero();
  47.  
  48. float x, y, z;
  49. };
  50.  
  51. class vec4{
  52. public:
  53. vec4();
  54. vec4(float X, float Y, float Z, float W);
  55.  
  56. vec4 lerp(vec4 vec, vec4 endpos, float time);
  57.  
  58. bool operator!=(const vec4 vec);
  59. bool operator==(const vec4 vec);
  60.  
  61. vec4 operator-(const vec4 vec);
  62. vec4 operator+(const vec4 vec);
  63. vec4 operator*(const vec4 vec);
  64. vec4 operator*(const float value);
  65.  
  66. float getX() const;
  67. float getY() const;
  68. float getZ() const;
  69. float getW() const;
  70.  
  71. void addX(float value);
  72. void addY(float value);
  73. void addZ(float value);
  74. void addW(float value);
  75.  
  76. void zero();
  77.  
  78. float x, y, z, w;
  79. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement