@@ -66,8 +66,6 @@ public class AppTracker : INotifyPropertyChanged
6666 // OnPropertyChanged listener for containers
6767 [ JsonIgnore ] public EventHandler PropertyChangedEvent ;
6868
69- [ JsonIgnore ] public Vector3 PositionOffsetRound => PositionOffset * 100 ;
70-
7169 [ JsonIgnore ] public Vector3 PoseVelocity { get ; set ; } = new ( 0 , 0 , 0 ) ;
7270 [ JsonIgnore ] public Vector3 PoseAcceleration { get ; set ; } = new ( 0 , 0 , 0 ) ;
7371 [ JsonIgnore ] public Vector3 PoseAngularAcceleration { get ; set ; } = new ( 0 , 0 , 0 ) ;
@@ -228,26 +226,18 @@ Role is TrackerType.TrackerWaist or TrackerType.TrackerLeftFoot or TrackerType.T
228226 // Note: "used" can also mean that the action is shown & disabled by the user
229227 [ JsonIgnore ]
230228 public Dictionary < InputActionEndpoint , bool > AvailableInputActions =>
231- AppPlugins . CurrentServiceEndpoint ? . SupportedInputActions ? . TryGetValue ( Role , out var actions ) ?? false
232- ? actions . ToDictionary ( x => new InputActionEndpoint { Tracker = Role , Guid = x . Guid } ,
233- x => InputActionsMap . Keys . Any ( y => y . Tracker == Role && y . Guid == x . Guid && y . IsValid ) )
234- : [ ] ;
229+ AppPlugins . CurrentServiceEndpoint ? . SupportedInputActions ? . TryGetValue ( Role , out var actions ) ?? false ?
230+ actions . ToDictionary ( x => new InputActionEndpoint { Tracker = Role , Guid = x . Guid } ,
231+ x => InputActionsMap . Keys . Any ( y => y . Tracker == Role && y . Guid == x . Guid && y . IsValid ) ) :
232+ [ ] ;
235233
236234 [ JsonIgnore ]
237235 public IEnumerable < InputActionEntry > InputActionEntries =>
238- AvailableInputActions . Select ( x => new InputActionEntry
239- {
240- Action = x . Key ,
241- IsEnabled = x . Value
242- } ) . OrderBy ( x => x . Name ) ;
236+ AvailableInputActions . Select ( x => new InputActionEntry { Action = x . Key , IsEnabled = x . Value } ) . OrderBy ( x => x . Name ) ;
243237
244238 [ JsonIgnore ]
245239 public IEnumerable < InputActionBindingEntry > InputActionBindingEntries =>
246- InputActionsMap . Select ( x => new InputActionBindingEntry
247- {
248- Action = x . Key ,
249- Source = x . Value
250- } ) . OrderBy ( x => x . ActionName ) ;
240+ InputActionsMap . Select ( x => new InputActionBindingEntry { Action = x . Key , Source = x . Value } ) . OrderBy ( x => x . ActionName ) ;
251241
252242 [ JsonIgnore ] public bool OverridePhysics { get ; set ; }
253243
@@ -363,11 +353,10 @@ public int SelectedOverrideJointIdForSelectedDevice
363353 // '+ 1' and '- 1' cause '0' is 'No Override' in this case
364354 // Note: use OverrideJointId for the "normal" (non-ui) one
365355 // Note: -1 replaced with 0 cuz disabled joints are hidden
366- get => IsActive
367- ? IsManagedBy ( AppData . Settings . SelectedTrackingDeviceGuid )
368- ? ( int ) _overrideJointId + 1
369- : 0 // Not overridden by this device
370- : 0 ; // -1; // Disabled or not supported
356+ get => IsActive ?
357+ IsManagedBy ( AppData . Settings . SelectedTrackingDeviceGuid ) ? ( int ) _overrideJointId + 1 : 0 // Not overridden by this device
358+ :
359+ 0 ; // -1; // Disabled or not supported
371360 set
372361 {
373362 // Don't parse any invalid changed
@@ -521,8 +510,9 @@ public Vector3 GetFilteredPosition(JointPositionTrackingOption? filter = null)
521510 {
522511 var computedFilter =
523512 NoPositionFilteringRequested // If filtering is force-disabled
524- ? JointPositionTrackingOption . NoPositionTrackingFilter
525- : filter ?? _positionTrackingFilterOption ;
513+ ?
514+ JointPositionTrackingOption . NoPositionTrackingFilter :
515+ filter ?? _positionTrackingFilterOption ;
526516
527517 return computedFilter switch
528518 {
@@ -542,8 +532,9 @@ public Quaternion GetFilteredOrientation(RotationTrackingFilterOption? filter =
542532 {
543533 var computedFilter =
544534 NoPositionFilteringRequested // If filtering is force-disabled
545- ? RotationTrackingFilterOption . NoOrientationTrackingFilter
546- : filter ?? _orientationTrackingFilterOption ;
535+ ?
536+ RotationTrackingFilterOption . NoOrientationTrackingFilter :
537+ filter ?? _orientationTrackingFilterOption ;
547538
548539 return computedFilter switch
549540 {
@@ -661,20 +652,8 @@ public TrackerBase GetTrackerBase(
661652 TrackingState = TrackingState ,
662653 Role = Role ,
663654 Serial = Serial ,
664-
665- Position = new Vector3
666- {
667- X = fullPosition . X ,
668- Y = fullPosition . Y ,
669- Z = fullPosition . Z
670- } ,
671- Orientation = new Quaternion
672- {
673- W = fullOrientation . W ,
674- X = fullOrientation . X ,
675- Y = fullOrientation . Y ,
676- Z = fullOrientation . Z
677- }
655+ Position = new Vector3 { X = fullPosition . X , Y = fullPosition . Y , Z = fullPosition . Z } ,
656+ Orientation = new Quaternion { W = fullOrientation . W , X = fullOrientation . X , Y = fullOrientation . Y , Z = fullOrientation . Z }
678657 } ;
679658
680659 if ( ! OverridePhysics ) return trackerBase ;
@@ -684,30 +663,10 @@ public TrackerBase GetTrackerBase(
684663 var fullAngularVelocity = GetCalibratedVector ( PoseAngularVelocity ) ;
685664 var fullAngularAcceleration = GetCalibratedVector ( PoseAngularAcceleration ) ;
686665
687- trackerBase . Velocity = new Vector3
688- {
689- X = fullVelocity . X ,
690- Y = fullVelocity . Y ,
691- Z = fullVelocity . Z
692- } ;
693- trackerBase . Acceleration = new Vector3
694- {
695- X = fullAcceleration . X ,
696- Y = fullAcceleration . Y ,
697- Z = fullAcceleration . Z
698- } ;
699- trackerBase . AngularVelocity = new Vector3
700- {
701- X = fullAngularVelocity . X ,
702- Y = fullAngularVelocity . Y ,
703- Z = fullAngularVelocity . Z
704- } ;
705- trackerBase . AngularAcceleration = new Vector3
706- {
707- X = fullAngularAcceleration . X ,
708- Y = fullAngularAcceleration . Y ,
709- Z = fullAngularAcceleration . Z
710- } ;
666+ trackerBase . Velocity = new Vector3 { X = fullVelocity . X , Y = fullVelocity . Y , Z = fullVelocity . Z } ;
667+ trackerBase . Acceleration = new Vector3 { X = fullAcceleration . X , Y = fullAcceleration . Y , Z = fullAcceleration . Z } ;
668+ trackerBase . AngularVelocity = new Vector3 { X = fullAngularVelocity . X , Y = fullAngularVelocity . Y , Z = fullAngularVelocity . Z } ;
669+ trackerBase . AngularAcceleration = new Vector3 { X = fullAngularAcceleration . X , Y = fullAngularAcceleration . Y , Z = fullAngularAcceleration . Z } ;
711670
712671 return trackerBase ;
713672 }
@@ -747,9 +706,7 @@ public TrackedJoint GetTrackedJoint()
747706 Orientation = Orientation ,
748707 Position = Position ,
749708 Velocity = PoseVelocity ,
750- TrackingState = IsActive
751- ? TrackedJointState . StateTracked
752- : TrackedJointState . StateNotTracked
709+ TrackingState = IsActive ? TrackedJointState . StateTracked : TrackedJointState . StateNotTracked
753710 } ;
754711 }
755712
@@ -774,6 +731,15 @@ public bool IsManagedBy(string guid)
774731 }
775732
776733 public double IsOverriddenOpacity => BoolToOpacity ( IsOverridden ) ;
734+
735+ // For bindings
736+ public float OrientationOffsetZ { get => OrientationOffset . Z ; set => OrientationOffset . Z = value ; }
737+ public float OrientationOffsetY { get => OrientationOffset . Y ; set => OrientationOffset . Y = value ; }
738+ public float OrientationOffsetX { get => OrientationOffset . X ; set => OrientationOffset . X = value ; }
739+
740+ public float PositionOffsetX { get => PositionOffset . X ; set => PositionOffset . X = value ; }
741+ public float PositionOffsetY { get => PositionOffset . Y ; set => PositionOffset . Y = value ; }
742+ public float PositionOffsetZ { get => PositionOffset . Z ; set => PositionOffset . Z = value ; }
777743}
778744
779745[ JsonArray ]
0 commit comments