diff --git a/src/Arts.cs b/src/Arts.cs index dbb83d4..2955e29 100644 --- a/src/Arts.cs +++ b/src/Arts.cs @@ -117,7 +117,7 @@ static class Arts // color_cube { - meshes["color_cube"].Draw( + meshes[ColorCube.toggle ? "color_cube_toggle" : "color_cube"].Draw( mat_colorcube, ColorCube.grab.pose.ToMatrix(ColorCube.scl) ); diff --git a/src/Dofs.cs b/src/Dofs.cs index 0f3606e..5c70c2c 100644 --- a/src/Dofs.cs +++ b/src/Dofs.cs @@ -34,7 +34,7 @@ static class Stretch Vec3 delta = to_grab.pose.position - from_grab.pose.position; stretch = Maths.max(delta.Magnitude - deadzone, 0); - Vec3 dir = delta.Normalized; + Vec3 dir = toggle ? delta.Normalized : to_grab.pose.orientation * Vec3.Forward; cursor.position = to_grab.pose.position + dir * stretch * strength; if (Vec3.Distance(cursor.position, last_particle_pos) > trail_dist) @@ -62,7 +62,8 @@ static class Stretch } // design - static float deadzone = 0.1f; + public static bool toggle = true; + static float deadzone = 0.06f; static float strength = 3; } @@ -109,5 +110,8 @@ static class ColorCube return x / 12.92f; } + + // design + public static bool toggle = true; } diff --git a/src/Mono.cs b/src/Mono.cs index 8ea5701..52338c0 100644 --- a/src/Mono.cs +++ b/src/Mono.cs @@ -39,6 +39,8 @@ static class Mono ColorCube.Init(); } + public static Pose windowPoseButton = new Pose(0, -0.4f, -0.4f, Quat.FromAngles(45, 180, 0)); + public static void Frame() { if (Rig.btn_back.delta == +1) @@ -58,6 +60,13 @@ static class Mono } } + UI.WindowBegin("test toggles", ref windowPoseButton); + if (UI.Button(ColorCube.toggle ? "color frame" : "color face")) + ColorCube.toggle = !ColorCube.toggle; + if (UI.Button(Stretch.toggle ? "con dir" : "stretch dir")) + Stretch.toggle = !Stretch.toggle; + UI.WindowEnd(); + // flatscreen dev controls if (Device.Name == "Simulator") {