mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-28 21:06:31 -08:00
Fix Skeleton preview and other fixup
This commit is contained in:
1 parent
2fc6810043
commit
1dc9127fa6
4 files changed
+8
-7
No files matched your search
@@ -439,7 +439,8 @@ export function TrackerSettingsPage() {
|
||||
</div>
|
||||
{(tracker?.tracker.info?.isImu ||
|
||||
(tracker?.tracker.origin == DeviceOrigin.DRIVER &&
|
||||
tracker?.tracker.info?.intendedBodyPart != BodyPart.HEAD)) && (
|
||||
tracker?.tracker.info?.intendedBodyPart !=
|
||||
tracker?.tracker.info?.bodyPart)) && (
|
||||
<div className="flex flex-col gap-2 w-full mt-3">
|
||||
<Typography variant="section-title">
|
||||
{l10n.getString('tracker-settings-mounting_section')}
|
||||
|
||||
@@ -206,7 +206,7 @@ function initializePreview(
|
||||
const root =
|
||||
bones.get(BodyPart.HEAD) ??
|
||||
bones.get(BodyPart.HIP) ??
|
||||
bones.get(BodyPart.LOWER_WAIST);
|
||||
bones.get(BodyPart.UPPER_CHEST);
|
||||
if (!root) return out.copy(followOffset);
|
||||
out.copy(Vector3FromVec3fT(root.headPosition));
|
||||
skeletonGroup.updateWorldMatrix(true, false);
|
||||
@@ -226,8 +226,8 @@ function initializePreview(
|
||||
}
|
||||
skeletonGroup.add(skeletonHelper);
|
||||
|
||||
const hmd = bones.get(BodyPart.HEAD);
|
||||
const quat = QuaternionFromQuatT(hmd?.orientation).normalize().invert();
|
||||
const head = bones.get(BodyPart.HEAD);
|
||||
const quat = QuaternionFromQuatT(head?.orientation).normalize().invert();
|
||||
|
||||
// Project quat to (0x, 1y, 0z)
|
||||
const VEC_Y = new Vector3(0, 1, 0);
|
||||
|
||||
@@ -122,7 +122,7 @@ export class BasedSkeletonMeshHelper extends Object3D {
|
||||
if (partName && modelUrl) {
|
||||
modelUrlsToFetch.add(modelUrl);
|
||||
const addr = addrObject(modelUrl, partName);
|
||||
partsByAddr[addr].push([part, attached]);
|
||||
(partsByAddr[addr] ??= []).push([part, attached]);
|
||||
}
|
||||
|
||||
part.shapes.push(attached);
|
||||
|
||||
@@ -168,13 +168,13 @@ fun reduce(
|
||||
}
|
||||
|
||||
is TrackerActions.PoseMountingReset -> {
|
||||
val referenceRotation = action.referenceRotation ?: state.rotation
|
||||
|
||||
// Positional trackers' heading is aligned on full reset, not on mounting reset, except for a reference.
|
||||
val alignHeading = state.position == null || action.referenceRotation == null
|
||||
// A positional reference tracker needs to correct its heading on mounting reset.
|
||||
val correctHeading = state.position != null && action.referenceRotation == null
|
||||
|
||||
val referenceRotation = action.referenceRotation ?: state.rotation
|
||||
|
||||
val headingAlignment = if (alignHeading) {
|
||||
estimateHeadingAlign(
|
||||
state.rawRotation,
|
||||
|
||||
Reference in new issue
Block a user