From e2d928eaee0b704bf9165e9e9fbd24cb8538009d Mon Sep 17 00:00:00 2001 From: spatialfree Date: Thu, 16 Feb 2023 04:26:59 -0500 Subject: [PATCH] pattern of behaviour --- app/dofs/color-cube/{⧉.txt => pattern.txt} | 0 app/dofs/cubic-flow/pattern.txt | 27 +++++++++++++++++ app/dofs/fullstick/pattern.txt | 5 ++++ app/dofs/offset-cursor/pattern.txt | 24 +++++++++++++++ app/dofs/orbital-view/pattern.txt | 8 +++++ app/dofs/oriel/{⧉.txt => pattern.txt} | 2 +- app/dofs/quadraticizer/pattern.txt | 8 +++++ .../reach => reach-cursor}/ReachCursor.cs | 0 .../reach/⧉.txt => reach-cursor/pattern.txt} | 0 .../wave/⧉.txt => rolls-cursor/pattern.txt} | 0 .../stretch-cursor/{og => }/StretchCursor.cs | 0 .../stretch-cursor/{og/⧉.txt => pattern.txt} | 0 app/dofs/touch-xr/pattern.txt | 30 +++++++++++++++++++ app/dofs/trackballer/pattern.txt | 29 ++++++++++++++++++ app/dofs/twist-cursor/pattern.txt | 6 ++++ .../wave => wave-cursor}/WaveCursor.cs | 0 app/dofs/wave-cursor/pattern.txt | 0 17 files changed, 138 insertions(+), 1 deletion(-) rename app/dofs/color-cube/{⧉.txt => pattern.txt} (100%) create mode 100644 app/dofs/cubic-flow/pattern.txt create mode 100644 app/dofs/fullstick/pattern.txt create mode 100644 app/dofs/offset-cursor/pattern.txt create mode 100644 app/dofs/orbital-view/pattern.txt rename app/dofs/oriel/{⧉.txt => pattern.txt} (99%) create mode 100644 app/dofs/quadraticizer/pattern.txt rename app/dofs/{stretch-cursor/reach => reach-cursor}/ReachCursor.cs (100%) rename app/dofs/{stretch-cursor/reach/⧉.txt => reach-cursor/pattern.txt} (100%) rename app/dofs/{stretch-cursor/wave/⧉.txt => rolls-cursor/pattern.txt} (100%) rename app/dofs/stretch-cursor/{og => }/StretchCursor.cs (100%) rename app/dofs/stretch-cursor/{og/⧉.txt => pattern.txt} (100%) create mode 100644 app/dofs/touch-xr/pattern.txt create mode 100644 app/dofs/trackballer/pattern.txt create mode 100644 app/dofs/twist-cursor/pattern.txt rename app/dofs/{stretch-cursor/wave => wave-cursor}/WaveCursor.cs (100%) create mode 100644 app/dofs/wave-cursor/pattern.txt diff --git a/app/dofs/color-cube/⧉.txt b/app/dofs/color-cube/pattern.txt similarity index 100% rename from app/dofs/color-cube/⧉.txt rename to app/dofs/color-cube/pattern.txt diff --git a/app/dofs/cubic-flow/pattern.txt b/app/dofs/cubic-flow/pattern.txt new file mode 100644 index 0000000..41f0707 --- /dev/null +++ b/app/dofs/cubic-flow/pattern.txt @@ -0,0 +1,27 @@ +# 2021.10.18 -> 2023.02.16 -> + +// 4 independent spatial cursors +p0 = leftHand.pos +p1 = leftTwistCursor.pos +p2 = rightTwistCursor.pos +p3 = rightHand.pos + +if toggle + if !leftTwistCursor.outty + pp = p0 + p0 = p1 + p1 = pp + if !rightTwistCursor.outty + pp = p2 + p2 = p3 + p3 = pp + +pastPos = p0 +for i = 0, i < 64, i++ + t = i / 63.0f + a = Lerp(p0, p1, t) + b = Lerp(p1, p2, t) + c = Lerp(p2, p3, t) + pos = Lerp(Lerp(a, b, t), Lerp(b, c, t), t) + Draw.Line(pastPos, pos, color) + pastPos = pos diff --git a/app/dofs/fullstick/pattern.txt b/app/dofs/fullstick/pattern.txt new file mode 100644 index 0000000..bb5eda2 --- /dev/null +++ b/app/dofs/fullstick/pattern.txt @@ -0,0 +1,5 @@ +# 2019.11.03 -> 2023.02.16 -> + +rot = (stick.y * 90, 0, stick.x * 90) +dir = stick.pressed ? down : up +output = hand.rotation * rot * dir \ No newline at end of file diff --git a/app/dofs/offset-cursor/pattern.txt b/app/dofs/offset-cursor/pattern.txt new file mode 100644 index 0000000..0aafb5b --- /dev/null +++ b/app/dofs/offset-cursor/pattern.txt @@ -0,0 +1,24 @@ +# 2019.10.28 -> 2023.02.16 -> + +dragPos = mainHand.pos +if (mainHand.button.down) + lastPos = dragPos + +if (mainHand.button.held) + cursor += (dragPos - lastPos) * 12 + +lastPos = dragPos + +// x orbital-view +dragPos = mainHand.pos // * head.rot +newRot = orielRot * head.rot + +if (mainHand.button.down) + lastPos = dragPos + +if (mainHand.button.held) + cursor += newRot * ((dragPos - lastPos) * 12) + cursor = newRot * rot.inverse(oldRot) * cursor + +lastPos = dragPos +oldRot = newRot \ No newline at end of file diff --git a/app/dofs/orbital-view/pattern.txt b/app/dofs/orbital-view/pattern.txt new file mode 100644 index 0000000..657f45a --- /dev/null +++ b/app/dofs/orbital-view/pattern.txt @@ -0,0 +1,8 @@ +# 2019.10.17 -> 2023.02.16 -> + +oriel.pos = head.rot * fwd + +// amplified +oriel.pos = head.rot * fwd +strength = ~4 +oriel.rot = rot.euler(0, head.euler.y * -strength, 0) \ No newline at end of file diff --git a/app/dofs/oriel/⧉.txt b/app/dofs/oriel/pattern.txt similarity index 99% rename from app/dofs/oriel/⧉.txt rename to app/dofs/oriel/pattern.txt index 20fe19d..e4a48ed 100644 --- a/app/dofs/oriel/⧉.txt +++ b/app/dofs/oriel/pattern.txt @@ -41,4 +41,4 @@ data frame -design +design \ No newline at end of file diff --git a/app/dofs/quadraticizer/pattern.txt b/app/dofs/quadraticizer/pattern.txt new file mode 100644 index 0000000..9769cd0 --- /dev/null +++ b/app/dofs/quadraticizer/pattern.txt @@ -0,0 +1,8 @@ +# 2021.10.15 -> 2023.02.16 -> + +a = offHand.pos +hit = raycast(offHand.fwd, midPlane) +dist = distance(hit, midPlane) +b = mainHand.pos + mainHand.rot * fwd * dist +c = backhanded stretch-cursor +pos = lerp(lerp(a, b, t), lerp(b, c, t), t) \ No newline at end of file diff --git a/app/dofs/stretch-cursor/reach/ReachCursor.cs b/app/dofs/reach-cursor/ReachCursor.cs similarity index 100% rename from app/dofs/stretch-cursor/reach/ReachCursor.cs rename to app/dofs/reach-cursor/ReachCursor.cs diff --git a/app/dofs/stretch-cursor/reach/⧉.txt b/app/dofs/reach-cursor/pattern.txt similarity index 100% rename from app/dofs/stretch-cursor/reach/⧉.txt rename to app/dofs/reach-cursor/pattern.txt diff --git a/app/dofs/stretch-cursor/wave/⧉.txt b/app/dofs/rolls-cursor/pattern.txt similarity index 100% rename from app/dofs/stretch-cursor/wave/⧉.txt rename to app/dofs/rolls-cursor/pattern.txt diff --git a/app/dofs/stretch-cursor/og/StretchCursor.cs b/app/dofs/stretch-cursor/StretchCursor.cs similarity index 100% rename from app/dofs/stretch-cursor/og/StretchCursor.cs rename to app/dofs/stretch-cursor/StretchCursor.cs diff --git a/app/dofs/stretch-cursor/og/⧉.txt b/app/dofs/stretch-cursor/pattern.txt similarity index 100% rename from app/dofs/stretch-cursor/og/⧉.txt rename to app/dofs/stretch-cursor/pattern.txt diff --git a/app/dofs/touch-xr/pattern.txt b/app/dofs/touch-xr/pattern.txt new file mode 100644 index 0000000..7c9f6d7 --- /dev/null +++ b/app/dofs/touch-xr/pattern.txt @@ -0,0 +1,30 @@ +# 2021.10.29 -> 2023.02.16 -> + +# gyro-keyboard +# tilt through the layers as you type, reducing travel and mistaps +keyLayers[3] +tilt = device.rotation.y +index = int(tilt * 10) +layer = keyLayers[index] + +if tap + layer.sample(touch.pos) + +# swipe-cursor +# extend cursor out of phone with swipe +if absolute + offset = touch.y + +offset += touch.delta.y +cursor = phone.pos + phone.up * offset * 3 + +# touch-stretch-cursor +# using the distance between your thumbs extend a cursor out +stretch = dist(touch[0], touch[1]) +dir = calibration +origin = phone.pos + phone.rot * touch[0].xy +cursor = origin + phone.rot * dir * stretch * 3 + +# tilt-touch +# tilt your phone to move the touch points in 3d space +touch.xyz = phone.rot * touch.xy \ No newline at end of file diff --git a/app/dofs/trackballer/pattern.txt b/app/dofs/trackballer/pattern.txt new file mode 100644 index 0000000..a129264 --- /dev/null +++ b/app/dofs/trackballer/pattern.txt @@ -0,0 +1,29 @@ +# 2020.04.21 -> 2023.02.16 -> + +newRot = hand.rot * heldRot * spinRot +if (offCon.triggerBtn.held && held != null) + newDelta = Inverse(newRot) * offHand.rotDelta + newDelta *= newRot + spinDelta = Slerp( + spinDelta, + newDelta, + Time.deltaTime / 0.1f + ) + +spinRot *= spinDelta + +// lower the speed the higher the friction +friction = 1 - Clamp01( + Angular(spinDelta).magnitude / deltaTime / 15 +) +friction = friction * friction * friction; +spinDelta = Slerp( + Quaternion.identity, + spinDelta, + 1 - (friction * Time.deltaTime) +) +heldRotDelta = newRot * Inverse(oldRot) + +held.rot = hand.rot * heldRot * spinRot +// or +held.angularVel = Angular(heldRotDelta) / deltaTime \ No newline at end of file diff --git a/app/dofs/twist-cursor/pattern.txt b/app/dofs/twist-cursor/pattern.txt new file mode 100644 index 0000000..81fbdee --- /dev/null +++ b/app/dofs/twist-cursor/pattern.txt @@ -0,0 +1,6 @@ +# 2021.10.15 -> 2023.02.16 -> + +rel = LookRotation(mainHand.rot * forward) +twist = Angle(rel * up, hand.rot * up) / 180 +twist = Max(twist - 0.05, 0) +cursor = hand.pos + hand.rot * forward * twist \ No newline at end of file diff --git a/app/dofs/stretch-cursor/wave/WaveCursor.cs b/app/dofs/wave-cursor/WaveCursor.cs similarity index 100% rename from app/dofs/stretch-cursor/wave/WaveCursor.cs rename to app/dofs/wave-cursor/WaveCursor.cs diff --git a/app/dofs/wave-cursor/pattern.txt b/app/dofs/wave-cursor/pattern.txt new file mode 100644 index 0000000..e69de29