finger curl mounting reset

This commit is contained in:
Erimel committed 2026-09-08 17:54:38 -04:00
1 parent 94fa3f54a3
commit 2f120cfff7
13 files changed
+59 -86

No files matched your search

-2
View File
@@ -645,8 +645,6 @@ settings-general-fk_settings-leg_tweak-foot_plant-description = Foot-plant rotat
settings-general-fk_settings-leg_fk = Leg tracking
settings-general-fk_settings-leg_fk-reset_mounting_feet-v1 = Force feet mounting calibration
settings-general-fk_settings-leg_fk-reset_mounting_feet-description-v1 = Force feet mounting calibration during body mounting calibration.
settings-general-fk_settings-leg_fk-reset_mounting_fingers = Force fingers mounting calibration
settings-general-fk_settings-leg_fk-reset_mounting_fingers-description = Force fingers mounting calibration during body mounting calibration.
settings-general-fk_settings-enforce_joint_constraints = Skeletal Limits
settings-general-fk_settings-enforce_joint_constraints-enforce_constraints = Enforce constraints
settings-general-fk_settings-enforce_joint_constraints-enforce_constraints-description = Prevents joints from rotating past their limit
@@ -37,7 +37,7 @@ export function LoaderIcon({
if (!videoRef.current) return;
if (isVisible) {
videoRef.current.play().catch(() => { });
videoRef.current.play().catch(() => {});
} else {
videoRef.current.pause();
videoRef.current.currentTime = 0;
@@ -58,14 +58,13 @@ export function LoaderIcon({
if (!lowPriority) return;
setIsPageVisible(true);
videoRef.current?.play().catch(() => { });
videoRef.current?.play().catch(() => {});
};
if (!lowPriority && videoRef.current) {
setIsPageVisible(true);
videoRef.current.play().catch(() => { });
}
else if (lowPriority && (document.hidden || !document.hasFocus())) {
videoRef.current.play().catch(() => {});
} else if (lowPriority && (document.hidden || !document.hasFocus())) {
setIsPageVisible(false);
if (videoRef.current) {
videoRef.current.pause();
@@ -84,7 +83,6 @@ export function LoaderIcon({
};
}, [lowPriority]);
return (
<video
ref={videoRef}
@@ -483,9 +483,7 @@ function EmptyTrackerListIllustration({
return (
<div className="flex flex-col items-center justify-center flex-1 h-full min-h-[220px] gap-3 text-center p-6 my-auto">
<LoaderIcon
slimeState={isError ? SlimeState.SAD : SlimeState.JUMPY}
/>
<LoaderIcon slimeState={isError ? SlimeState.SAD : SlimeState.JUMPY} />
<div className="flex flex-col gap-1 max-w-xs">
<Typography
bold
@@ -185,10 +185,7 @@ export function DriverSettings() {
</div>
</div>
<Typography
variant="section-title"
id="settings-driver-velocity"
/>
<Typography variant="section-title" id="settings-driver-velocity" />
<div className="pt-1 pb-2">
<Typography id="settings-driver-velocity-description" />
</div>
@@ -197,9 +194,7 @@ export function DriverSettings() {
outlined
control={control}
name="sendVelocity"
label={l10n.getString(
'settings-driver-velocity'
)}
label={l10n.getString('settings-driver-velocity')}
/>
</>
</SettingsPagePaneLayout>
@@ -18,7 +18,6 @@ import { selectAtom } from 'jotai/utils';
type ResetsSettingsForm = {
resetMountingFeet: boolean;
resetMountingFingers: boolean;
armsResetMode: number;
yawResetSmoothTime: number;
saveMountingReset: boolean;
@@ -27,7 +26,6 @@ type ResetsSettingsForm = {
const defaultValues: ResetsSettingsForm = {
resetMountingFeet: false,
resetMountingFingers: false,
armsResetMode: 0,
yawResetSmoothTime: 0.0,
saveMountingReset: false,
@@ -65,7 +63,6 @@ export function ResetsSettings() {
const onSubmit = (values: ResetsSettingsForm) => {
const resetsSettings = new ResetsSettingsResponseT();
resetsSettings.resetMountingFeet = values.resetMountingFeet;
resetsSettings.resetMountingFingers = values.resetMountingFingers;
resetsSettings.armsResetMode = values.armsResetMode;
resetsSettings.yawResetSmoothTime = values.yawResetSmoothTime;
resetsSettings.saveMountingReset = values.saveMountingReset;
@@ -182,54 +179,28 @@ export function ResetsSettings() {
</div>
</div>
<div className="grid md:grid-cols-2 flex-col gap-3 pt-5">
<div className="flex flex-col gap-1">
<Typography variant="section-title">
{l10n.getString(
'settings-general-fk_settings-leg_fk-reset_mounting_feet-v1'
)}
</Typography>
<div className="flex flex-col gap-1 pt-5">
<Typography variant="section-title">
{l10n.getString(
'settings-general-fk_settings-leg_fk-reset_mounting_feet-v1'
)}
</Typography>
<Typography>
{l10n.getString(
'settings-general-fk_settings-leg_fk-reset_mounting_feet-description-v1'
)}
</Typography>
<Typography>
{l10n.getString(
'settings-general-fk_settings-leg_fk-reset_mounting_feet-description-v1'
)}
</Typography>
<CheckBox
variant="toggle"
outlined
control={control}
name="resetMountingFeet"
label={l10n.getString(
'settings-general-fk_settings-leg_fk-reset_mounting_feet-v1'
)}
/>
</div>
<div className="flex flex-col gap-1">
<Typography variant="section-title">
{l10n.getString(
'settings-general-fk_settings-leg_fk-reset_mounting_fingers'
)}
</Typography>
<Typography>
{l10n.getString(
'settings-general-fk_settings-leg_fk-reset_mounting_fingers-description'
)}
</Typography>
<CheckBox
variant="toggle"
outlined
control={control}
name="resetMountingFingers"
label={l10n.getString(
'settings-general-fk_settings-leg_fk-reset_mounting_fingers'
)}
/>
</div>
<CheckBox
variant="toggle"
outlined
control={control}
name="resetMountingFeet"
label={l10n.getString(
'settings-general-fk_settings-leg_fk-reset_mounting_feet-v1'
)}
/>
</div>
<div className="flex flex-col pt-5 gap-1">
@@ -610,7 +610,8 @@ export function TrackingChecklist({
'bg-status-success': completion === 'complete',
'bg-status-critical animate-pulse animate-low-priority':
completion === 'incomplete',
'bg-status-warning animate-pulse animate-low-priority': completion === 'partial',
'bg-status-warning animate-pulse animate-low-priority':
completion === 'partial',
})}
/>
</div>
@@ -657,7 +658,7 @@ export function TrackingChecklist({
<div className="absolute bottom-0 right-0 w-20 h-20 overflow-clip pointer-events-none">
<div className="-rotate-45 translate-x-3.5 translate-y-3.5">
<LoaderIcon slimeState={slimeState} lowPriority/>
<LoaderIcon slimeState={slimeState} lowPriority />
</div>
</div>
</div>
+2 -2
View File
@@ -89,14 +89,14 @@ export function useProvideAppContext(): AppContext {
const handleBlur = () => {
document.documentElement.classList.add('freeze-animations');
};
const handleFocus = () => {
document.documentElement.classList.remove('freeze-animations');
};
window.addEventListener('blur', handleBlur);
window.addEventListener('focus', handleFocus);
return () => {
window.removeEventListener('blur', handleBlur);
window.removeEventListener('focus', handleFocus);
@@ -92,8 +92,6 @@ data class TapDetectionConfig(
data class ResetsConfig(
/** Always reset mounting for feet */
val resetMountingFeet: Boolean = false,
/** Always reset mounting for fingers */
val resetMountingFingers: Boolean = false,
/** Reset mode used for the arms */
val armsResetMode: ArmsResetMode = ArmsResetMode.BACK,
/** Yaw reset smoothing time in seconds */
@@ -101,7 +99,7 @@ data class ResetsConfig(
/** Save automatic mounting reset calibration */
val saveMountingReset: Boolean = false,
/** Reset a positional tracker's attitude full reset */
val resetPositionalHeadAttitude: Boolean = false, // TODO
val resetPositionalHeadAttitude: Boolean = false,
/** Used as preferred mounting method and tracking checklist */
val lastMountingMethod: MountingMethod = MountingMethod.POSE,
)
@@ -129,7 +127,7 @@ fun defaultKeybinds(): List<KeybindConfig> = listOf(
data class SkeletonTogglesConfig(
val floorClip: Boolean = true,
val skatingCorrection: Boolean = true,
val toeSnap: Boolean = true, // TODO this was false in main
val toeSnap: Boolean = true, // TODO this was false in main, evaluate if we want it on by default
val footPlant: Boolean = true,
val mocapMode: Boolean = false,
val useTrackerPositions: Boolean = true,
@@ -48,6 +48,13 @@ object ResetBodyParts {
BodyPart.LEFT_LITTLE_DISTAL,
)
val LEFT_FINGERS_NO_THUMB = LEFT_FINGERS -
setOf(
BodyPart.LEFT_THUMB_METACARPAL,
BodyPart.LEFT_THUMB_PROXIMAL,
BodyPart.LEFT_THUMB_DISTAL,
)
val RIGHT_FINGERS = setOf(
BodyPart.RIGHT_THUMB_METACARPAL,
BodyPart.RIGHT_THUMB_PROXIMAL,
@@ -66,19 +73,24 @@ object ResetBodyParts {
BodyPart.RIGHT_LITTLE_DISTAL,
)
val RIGHT_FINGERS_NO_THUMB = RIGHT_FINGERS -
setOf(
BodyPart.RIGHT_THUMB_METACARPAL,
BodyPart.RIGHT_THUMB_PROXIMAL,
BodyPart.RIGHT_THUMB_DISTAL,
)
val FINGERS = LEFT_FINGERS + RIGHT_FINGERS
val LEFT_LOWER_ARM = setOf(
BodyPart.LEFT_LOWER_ARM,
BodyPart.LEFT_HAND,
) +
LEFT_FINGERS
)
val RIGHT_LOWER_ARM = setOf(
BodyPart.RIGHT_LOWER_ARM,
BodyPart.RIGHT_HAND,
) +
RIGHT_FINGERS
)
val LOWER_ARMS = LEFT_LOWER_ARM + RIGHT_LOWER_ARM
@@ -141,7 +141,7 @@ class ResetsManager(val context: ResetsContext, val server: VRServer, val settin
resetType != ResetType.POSE_MOUNTING ||
(
(config.resetMountingFeet || bodyPart !in ResetBodyParts.FEET) &&
(config.resetMountingFingers || bodyPart !in ResetBodyParts.FINGERS) &&
bodyPart !in ResetBodyParts.FINGERS &&
bodyPart !in ResetBodyParts.TOES
)
}
@@ -173,12 +173,16 @@ class ResetsManager(val context: ResetsContext, val server: VRServer, val settin
in ResetBodyParts.ARMS if armsResetMode == ArmsResetMode.FORWARD -> 0f
// Going left
// Going left/
in ResetBodyParts.RIGHT_FINGERS_NO_THUMB -> -FastMath.HALF_PI
in ResetBodyParts.LEFT_ARM if armsResetMode == ArmsResetMode.T_POSE_UP -> -FastMath.HALF_PI
in ResetBodyParts.RIGHT_ARM if armsResetMode == ArmsResetMode.T_POSE_DOWN -> -FastMath.HALF_PI
// Going right
in ResetBodyParts.LEFT_FINGERS_NO_THUMB -> FastMath.HALF_PI
in ResetBodyParts.LEFT_ARM if armsResetMode == ArmsResetMode.T_POSE_DOWN -> FastMath.HALF_PI
in ResetBodyParts.RIGHT_ARM if armsResetMode == ArmsResetMode.T_POSE_UP -> FastMath.HALF_PI
@@ -19,7 +19,6 @@ class ResetsBehaviour(
receiver.sendRpc(
ResetsSettingsResponse(
resetMountingFeet = config.resetMountingFeet,
resetMountingFingers = config.resetMountingFingers,
armsResetMode = config.armsResetMode,
yawResetSmoothTime = config.yawResetSmoothTime,
saveMountingReset = config.saveMountingReset,
@@ -35,7 +34,6 @@ class ResetsBehaviour(
copy(
resetsConfig = ResetsConfig(
resetMountingFeet = req.resetMountingFeet,
resetMountingFingers = req.resetMountingFingers,
armsResetMode = req.armsResetMode,
yawResetSmoothTime = req.yawResetSmoothTime,
saveMountingReset = req.saveMountingReset,
@@ -42,8 +42,8 @@ class TrackerRestOrientationBehaviour(
private val quarterRollRight = EulerAngles(EulerOrder.YZX, 0f, 0f, FastMath.HALF_PI).toQuaternion()
private fun getRestOrientation(bodyPart: BodyPart?, armsResetMode: ArmsResetMode) = if (armsResetMode == ArmsResetMode.T_POSE_DOWN) {
when (bodyPart) {
in ResetBodyParts.LEFT_ARM -> quarterRollLeft
in ResetBodyParts.RIGHT_ARM -> quarterRollRight
in ResetBodyParts.LEFT_ARM + ResetBodyParts.LEFT_FINGERS -> quarterRollLeft
in ResetBodyParts.RIGHT_ARM + ResetBodyParts.RIGHT_FINGERS -> quarterRollRight
else -> Quaternion.IDENTITY
}
} else {