SteamVRTrackPoint.cpp 849 B

12345678910111213141516171819202122232425
  1. // Include own headers
  2. #include "SteamVRTrackPoint.hpp"
  3. SteamVRTrackPoint::SteamVRTrackPoint(const osg::Vec3 point, const osg::Vec3 normal, const osg::Vec3 normalModifier, const float normalRotation, const bool compensation, const double length): TrackPoint(point, normal, normalModifier, normalRotation, compensation) {
  4. _length = length;
  5. updateShift();
  6. }
  7. double SteamVRTrackPoint::getLength() {
  8. return _length;
  9. }
  10. SteamVRTrackSettings SteamVRTrackPoint::getSteamVRTrackSettings() {
  11. return SteamVRTrackSettings {_length};
  12. }
  13. void SteamVRTrackPoint::updateSteamVRTrackSettings(SteamVRTrackSettings settings) {
  14. _length = settings.length;
  15. updateShift();
  16. }
  17. void SteamVRTrackPoint::updateShift() {
  18. osg::Vec3 shift = _normal.operator*(_length + STEAMVR_THREAD_LENGTH + STEAMVR_ORIGIN_OFFSET);
  19. _trackOrigin = shift.operator+(_origin);
  20. }