From 84781b5ec6e0a8d864302b1c1dbc4f44c10213b6 Mon Sep 17 00:00:00 2001 From: spatialfree Date: Fri, 11 Nov 2022 12:35:17 -0500 Subject: [PATCH] exp flexion --- app/Rig/Rig.cs | 5 +++-- app/dofs/rolls-cursor/RollsCursor.cs | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Rig/Rig.cs b/app/Rig/Rig.cs index 8775dd8..272e8c4 100644 --- a/app/Rig/Rig.cs +++ b/app/Rig/Rig.cs @@ -83,7 +83,7 @@ public class Rig { lWrist = new Pose(lCon.pos + lCon.ori * new Vec3(0, 0, 0.052f), lCon.ori); } - public float Flexion(Hand hand, FingerId finger, float deadzone = 0.3f) { + public float Flexion(Hand hand, FingerId finger, float deadzone = 0.15f) { float flexion = (Vec3.Dot( PullRequest.Direction( hand.Get(finger, JointId.Tip).position, @@ -95,7 +95,8 @@ public class Rig { ) ) + 1f) / 2; - return Math.Max(flexion - deadzone, 0f) / (1 - deadzone); + flexion = Math.Max(flexion - deadzone, 0f) / (1 - deadzone); + return flexion * flexion; } public Vec3 Fullstick(bool chirality) { diff --git a/app/dofs/rolls-cursor/RollsCursor.cs b/app/dofs/rolls-cursor/RollsCursor.cs index 8ccc93c..5c19b11 100644 --- a/app/dofs/rolls-cursor/RollsCursor.cs +++ b/app/dofs/rolls-cursor/RollsCursor.cs @@ -20,7 +20,6 @@ class RollsCursor : dof { float fR = rig.Flexion(hand, FingerId.Ring); float fL = rig.Flexion(hand, FingerId.Little); - // Biased by finger length float stretch = (fI + fM + fR + fL) / 4f; Vec3 to = Roll(hand, JointId.KnuckleMid, fI, fM, fR, fL);