Camera.cpp 552 B

123456789101112131415161718192021222324252627282930
  1. #include "Camera.h"
  2. #include <igl/canonical_quaternions.h>
  3. #include <algorithm>
  4. igl::Camera::Camera()
  5. {
  6. using namespace igl;
  7. using namespace std;
  8. // Defaults
  9. // canonical (X,Y) view
  10. copy(XY_PLANE_QUAT_D,XY_PLANE_QUAT_D+4,rotation);
  11. zoom = 1.0;
  12. angle = 45;
  13. pan[0] = 0.0;
  14. pan[1] = 0.0;
  15. pan[2] = 0.0;
  16. }
  17. igl::Camera::Camera(const Camera & that)
  18. {
  19. pan[0] = that.pan[0];
  20. pan[1] = that.pan[1];
  21. pan[2] = that.pan[2];
  22. for(int i = 0; i<4; i++)
  23. {
  24. rotation[i] = that.rotation[i];
  25. }
  26. zoom = that.zoom;
  27. angle = that.angle;
  28. }