From bf66637bced7f3b36566b410cea553f4a68cd158 Mon Sep 17 00:00:00 2001 From: spatialfree Date: Sat, 9 Nov 2024 19:52:02 -0500 Subject: [PATCH] step box mode deltabools --- src/Mono.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Mono.cs b/src/Mono.cs index b0f8ad6..982a655 100644 --- a/src/Mono.cs +++ b/src/Mono.cs @@ -68,10 +68,13 @@ static class Mono } } else - { - bool in_dist = Vec3.Distance(Rig.r_con_stick.position, box_pose.position) < 6 * U.cm; - held.Step(in_dist && Rig.btn_grip.state); - if (held.state) + { + in_dist.Step(Vec3.Distance(Rig.r_con_stick.position, box_pose.position) < 6 * U.cm); + bool pickup = in_dist.state && Rig.btn_grip.delta == +1; + in_cone.Step(Vec3.AngleBetween( + Rig.head.orientation * Vec3.Forward, + Vec3.Direction(box_pose.position, Rig.head.position) + ) < 15.0f); { box_pose.position = Rig.r_con_stick.position; }