home flexion btn test

This commit is contained in:
ethan merchant 2025-05-21 23:18:08 -04:00
parent 54ba006027
commit ccfa6f9575

View file

@ -11,6 +11,8 @@ public class Rig
public Vec3 perch_pos = Vec3.Zero;
public Btn home_btn = new();
public void Init()
{
@ -26,13 +28,20 @@ public class Rig
view_pos = head_pos + V.XYZ(0, -6 * U.cm, 0);
// Position is specifically defined as the middle of the middle finger's root (metacarpal) bone.
palm_pos = hand_1.palm.position;
// For orientation, Forward is the direction the flat of the palm is facing, "Iron Man" style. X+ is to the outside of the right hand, and to the inside of the left hand.
palm_ori = hand_1.palm.orientation;
perch_pos = palm_pos + Vec3.Up * 8 * U.cm;
float index_flexion = Flexion(hand_1, FingerId.Index);
home_btn.Frame(index_flexion < 0.13f, index_flexion > 0.6);
// Text.Add(
// index_flexion.ToString("F2"),
// Matrix.TR(perch_pos, head_ori * Quat.FromAngles(0, 180, 0)),
// (home_btn.held ? Color.White : Color.Black)
// );
}
public struct Btn