Small OpenGL based c++ rendering library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rotationsmatrix.h 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* libsegl - Sebas Extended GL Library
  2. * Collection of Opengl/3D-Math helpers
  3. *
  4. * Copyright (c) 2008 by Sebastian Lohff, seba@seba-geek.de
  5. * http://www.seba-geek.de
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  20. * Boston, MA 02110-1301, USA.
  21. */
  22. #ifndef __ROTATIONSMATRIX_H
  23. #define __ROTATIONSMATRIX_H
  24. #include <cmath>
  25. #include "punkt3d.h"
  26. #include "emath.h"
  27. #include "matrix.h"
  28. namespace segl {
  29. enum axis { x_axis=0, y_axis, z_axis };
  30. class Rotationsmatrix : public Matrix {
  31. private:
  32. float deg;
  33. Punkt3D rotvec;
  34. void initRot();
  35. public:
  36. Rotationsmatrix();
  37. Rotationsmatrix(axis, float);
  38. Rotationsmatrix(Punkt3D, float);
  39. ~Rotationsmatrix();
  40. void set(float);
  41. void set(axis, float);
  42. void set(Punkt3D, float);
  43. Punkt3D operator*(const Punkt3D&);
  44. Rotationsmatrix operator*(const Rotationsmatrix&);
  45. };
  46. } // namespace segl
  47. #endif