From b55d97a8a3b11d0e94b48214c161a42c9788545f Mon Sep 17 00:00:00 2001 From: spatialfree Date: Tue, 11 Jan 2022 13:05:02 -0500 Subject: [PATCH] lift rez --- app/Glove.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/app/Glove.cs b/app/Glove.cs index 3b1dea5..524da2b 100644 --- a/app/Glove.cs +++ b/app/Glove.cs @@ -23,15 +23,26 @@ public class Glove { Vec3 twistPoint; bool twistOut; + int firstFace; + public void Step() { Pose shoulder = mono.Shoulder(chirality); Pose wrist = mono.Wrist(chirality); Con con = mono.Con(chirality), otherCon = mono.Con(!chirality); - bool reach = con.device.IsX2Pressed; bool pull = otherCon.gripBtn.frameDown; - bool lift = con.device.IsX1Pressed; - lift = false; - bool twist = con.device.IsX1Pressed; + + if (firstFace == 0) { + if (con.device.IsX1JustPressed) { firstFace = 1; } + if (con.device.IsX2JustPressed) { firstFace = 2; } + } + if (!con.device.IsX1Pressed && !con.device.IsX2Pressed) { firstFace = 0; } + + bool twist = firstFace == 1; + bool reach = firstFace == 2; + + bool lift = false; + if (firstFace == 1 && con.device.IsX2Pressed) { lift = true; } + if (firstFace == 2 && con.device.IsX1Pressed) { lift = true; } // exclusive states?