mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-04 15:52:35 -08:00
mountingResetOrientation for tracker on skeleton
This commit is contained in:
1 parent
fe08eb103e
commit
86f04d90ac
3 files changed
+7
-4
No files matched your search
@@ -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),
|
||||
});
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-1
Submodule solarxr-protocol updated: 12c07d886d...71e2959508.
Reference in new issue
Block a user