PointShape.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. class PointShape {
  13. public:
  14. PointShape(const osg::ref_ptr<osg::Group> renderRoot, const ActiveTrackingSystem activeTrackingSystem, osg::Vec3f point, osg::Vec3f normal, osg::Vec3f normalModifier);
  15. ~PointShape();
  16. void moveTo(osg::Vec3f position);
  17. void setNormalModifier(osg::Vec3f normalModifier);
  18. void rotateToNormalVector(osg::Vec3f normal);
  19. void setVisibility(bool mode);
  20. void setColor(osg::Vec4 color);
  21. void setupOptiTrack(OptiTrackSettings optiTrackSettings);
  22. void setupSteamVRTrack(SteamVRTrackSettings steamVrTrackSettings);
  23. void setupActionPoints();
  24. osg::ref_ptr<osg::Geode> getMesh();
  25. private:
  26. osg::ref_ptr<osg::Switch> _selectionSwitch;
  27. osg::ref_ptr<osg::MatrixTransform> _selectionTranslateGroup;
  28. osg::ref_ptr<osg::MatrixTransform> _selectionRotateGroup;
  29. osg::ref_ptr<osg::MatrixTransform> _selectionMoveToEndGroup;
  30. osg::ref_ptr<osg::MatrixTransform> _screwMove;
  31. osg::ref_ptr<osg::Group> _renderRoot;
  32. osg::ref_ptr<osg::ShapeDrawable> _shape;
  33. osg::ref_ptr<osg::Geode> _geode;
  34. osg::Vec3f _normalModifier;
  35. double _optiTrackSteamVRLength;
  36. ActiveTrackingSystem _activeTrackingSystem;
  37. };