PointShape.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. // Include modules
  3. #include "TrackSystemSettingsStructs.hpp"
  4. #include "enums.hpp"
  5. // Include dependencies
  6. #include <osg/Vec3>
  7. #include <osg/Group>
  8. #include <osg/MatrixTransform>
  9. #include <osg/ShapeDrawable>
  10. #include <osg/Switch>
  11. #include <osg/Geode>
  12. #include "lib3mf_implicit.hpp"
  13. class PointShape {
  14. public:
  15. static void loadSteamvrThread();
  16. PointShape(const osg::ref_ptr<osg::Group> renderRoot, const ActiveTrackingSystem activeTrackingSystem, osg::Vec3f point, osg::Vec3f normal, osg::Vec3f normalModifier, float normalRotation);
  17. ~PointShape();
  18. void moveTo(osg::Vec3f position);
  19. void setNormalModifier(osg::Vec3f normalModifier);
  20. void rotateToNormalVector(osg::Vec3f normal, float normalRotation);
  21. void setVisibility(bool mode);
  22. void setColor(osg::Vec4 color);
  23. void setupOptiTrack(OptiTrackSettings optiTrackSettings);
  24. void setupEMFTrack(EMFTrackSettings emfTrackSettings);
  25. void setupSteamVRTrack(SteamVRTrackSettings steamVrTrackSettings);
  26. void setupActionPoints();
  27. void setCompensation(bool compensation, float compensationLength);
  28. osg::ref_ptr<osg::Geode> getMesh();
  29. private:
  30. osg::Matrix emfYFix(osg::Vec3 normal);
  31. osg::ref_ptr<osg::Switch> _selectionSwitch;
  32. osg::ref_ptr<osg::MatrixTransform> _selectionTranslateGroup;
  33. osg::ref_ptr<osg::MatrixTransform> _selectionRotateGroup;
  34. osg::ref_ptr<osg::MatrixTransform> _screwMove;
  35. osg::ref_ptr<osg::Group> _renderRoot;
  36. osg::ref_ptr<osg::ShapeDrawable> _shape;
  37. osg::ref_ptr<osg::ShapeDrawable> _optiConnector;
  38. osg::ref_ptr<osg::Geode> _thread;
  39. osg::ref_ptr<osg::Geode> _geode;
  40. osg::Vec3f _normalModifier;
  41. OptiTrackSettings _optiTrackSettings;
  42. EMFTrackSettings _emfTrackSettings;
  43. SteamVRTrackSettings _steamVrTrackSettings;
  44. ActiveTrackingSystem _activeTrackingSystem;
  45. bool _compensation = true;
  46. float _compensationLength = 0.0f;
  47. };