diff --git a/app/dofs/stretch-cursor/og/StretchCursor.cs b/app/dofs/stretch-cursor/og/StretchCursor.cs index 62bccc5..44f0c8e 100644 --- a/app/dofs/stretch-cursor/og/StretchCursor.cs +++ b/app/dofs/stretch-cursor/og/StretchCursor.cs @@ -5,23 +5,25 @@ class StretchCursor : dof { public Pose to, from; // data - public Pose cursor; + public Vec3 cursor; - public void Init() {} + public void Init() { + cursor = to.position; + } public void Frame() { Vec3 vec = to.position - from.position; float len = vec.Length; float stretch = Math.Max(len - deadzone, 0f); - Vec3 dir = backhand ? vec / len : to.orientation * Vec3.Forward; + Vec3 dir = pointer ? vec / len : to.orientation * Vec3.Forward; - cursor.position = to.position + dir * stretch * strength; // * Mono.inst.stretchStr; + cursor = to.position + dir * stretch * strength; - Mesh.Cube.Draw(Material.Default, Matrix.TS(cursor.position, 0.01f)); + Mesh.Cube.Draw(Material.Default, Matrix.TS(cursor, 0.01f)); } // design - public bool backhand = true; + public bool pointer = false; public float deadzone = 0.1f; public float strength = 3f; } diff --git a/app/dofs/stretch-cursor/og/⧉ b/app/dofs/stretch-cursor/og/⧉ index 5bd8cab..4cacb15 100644 --- a/app/dofs/stretch-cursor/og/⧉ +++ b/app/dofs/stretch-cursor/og/⧉ @@ -6,13 +6,13 @@ data cursor init - cursor = to.pos + # fade in if needed frame - vec = to.pos - from.pos - len = vec.len + vec = to.pos - from.pos + len = vec.length stretch = max(len - deadzone, 0) - dir = pointer ? to.ori * v3.fwd : vec / len + dir = pointer ? to.ori * v3.fwd : vec / len cursor = to.pos + dir * stretch * strength diff --git a/app/dofs/stretch-cursor/wave/WaveCursor.cs b/app/dofs/stretch-cursor/wave/WaveCursor.cs index fd082e3..286e825 100644 --- a/app/dofs/stretch-cursor/wave/WaveCursor.cs +++ b/app/dofs/stretch-cursor/wave/WaveCursor.cs @@ -86,6 +86,8 @@ class WaveCursor : dof { // new Color(1, 1, 1), 0.004f // ); + // show that you are about to boolean in and out + oldLocalPad = localPad;