diff --git a/gui/app/src/components/widgets/SkeletonVisualizerWidget.tsx b/gui/app/src/components/widgets/SkeletonVisualizerWidget.tsx index 2ba3e7cc6..e3a7acbd4 100644 --- a/gui/app/src/components/widgets/SkeletonVisualizerWidget.tsx +++ b/gui/app/src/components/widgets/SkeletonVisualizerWidget.tsx @@ -26,7 +26,7 @@ import { Vector3, WebGLRenderer, } from 'three'; -import { BodyPart, BoneT } from 'solarxr-protocol'; +import { BodyPart, BoneT, MountingMethod } from 'solarxr-protocol'; import { QuaternionFromQuatT } from '@/maths/quaternion'; import classNames from 'classnames'; import { useLocalization } from '@fluent/react'; @@ -401,7 +401,9 @@ function SkeletonVisualizer({ trackers.set(bodyPart, { trackerId: tracker.trackerId, mountingOrientation: QuaternionFromQuatT( - tracker.info?.mountingOrientation + tracker.info?.lastMountingMethod == MountingMethod.MANUAL + ? tracker.info?.mountingOrientation + : tracker.info?.mountingResetOrientation ).normalize(), boneOffset: getTrackerBoneOffset(bodyPart), }); diff --git a/server/core/src/main/java/dev/slimevr/solarxr/datafeed/datafeed.kt b/server/core/src/main/java/dev/slimevr/solarxr/datafeed/datafeed.kt index 20bc9646f..674b632dc 100644 --- a/server/core/src/main/java/dev/slimevr/solarxr/datafeed/datafeed.kt +++ b/server/core/src/main/java/dev/slimevr/solarxr/datafeed/datafeed.kt @@ -65,6 +65,7 @@ private fun createTracker(device: DeviceState, tracker: TrackerState, trackerMas imuType = tracker.imuType ?: ImuType.UNKNOWN, bodyPart = tracker.bodyPart ?: BodyPart.NONE, mountingOrientation = tracker.mountingOrientation.let { Quat(it.x, it.y, it.z, it.w) }, + mountingResetOrientation = tracker.sessionCalibration.headingAlignment.let { Quat(it.x, it.y, it.z, it.w) }, displayName = tracker.name, customName = tracker.customName, lastMountingMethod = tracker.lastMountingMethod, @@ -82,7 +83,7 @@ private fun createTracker(device: DeviceState, tracker: TrackerState, trackerMas rotationIdentityAdjusted = if (trackerMask.rotationIdentityAdjusted) tracker.rotation.let { Quat(it.x, it.y, it.z, it.w) } else null, // FIXME: uses reference adjusted rawMagneticVector = if (trackerMask.rawMagneticVector && tracker.magStatus == MagnetometerStatus.ENABLED) tracker.rawMagnetometer.let { Vec3f(it.x, it.y, it.z) } else null, stayAligned = if (trackerMask.stayAligned) StayAlignedTracker(tracker.stayAlignedData.yawCorrection.toDeg(), tracker.motion == Motion.RESTING) else null, - origin = tracker.origin, + origin = if (trackerMask.origin) tracker.origin else null, ) private const val DEVICE_STATS_WINDOW_MS = 5_000L diff --git a/solarxr-protocol b/solarxr-protocol index 12c07d886..71e295950 160000 --- a/solarxr-protocol +++ b/solarxr-protocol @@ -1 +1 @@ -Subproject commit 12c07d886d5d53dd1544c382b4dec01cf125cef2 +Subproject commit 71e2959508e022f23d4a0917c34a5ad44d27c7ee