EMFTrackPoint.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Include own headers
  2. #include "EMFTrackPoint.hpp"
  3. // Include modules
  4. #include "MeshTools.hpp"
  5. EMFTrackPoint::EMFTrackPoint(const osg::Vec3 point, const osg::Vec3 normal, const osg::Vec3 normalModifier, const float normalRotation, const bool compensation, const double width, const double height, const double depth): TrackPoint(point, normal, normalModifier, normalRotation, compensation) {
  6. _width = width;
  7. _height = height;
  8. _depth = depth;
  9. }
  10. double EMFTrackPoint::getWidth() {
  11. return _width;
  12. }
  13. double EMFTrackPoint::getHeight() {
  14. return _height;
  15. }
  16. double EMFTrackPoint::getDepth() {
  17. return _depth;
  18. }
  19. EMFTrackSettings EMFTrackPoint::getEMFTrackSettings() {
  20. return EMFTrackSettings {_width, _height, _depth};
  21. }
  22. void EMFTrackPoint::updateEMFTrackSettings(EMFTrackSettings settings) {
  23. _width = settings.width;
  24. _height = settings.height;
  25. _depth = settings.depth;
  26. }
  27. float EMFTrackPoint::getNormalCompensation() {
  28. float compensationLength = MeshTools::compensationLength(_normal, _normalModifier, std::sqrt(std::pow(_width / 2, 2) + std::pow(_height / 2, 2)));
  29. return compensationLength > 0.0f ? compensationLength : 0.0f;
  30. }
  31. int EMFTrackPoint::getMinimumRequiredPoints() {
  32. return _minimumPointsRequired;
  33. }