pattern of behaviour
This commit is contained in:
parent
54d72a1fa7
commit
e2d928eaee
17 changed files with 138 additions and 1 deletions
27
app/dofs/cubic-flow/pattern.txt
Normal file
27
app/dofs/cubic-flow/pattern.txt
Normal file
|
@ -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
|
5
app/dofs/fullstick/pattern.txt
Normal file
5
app/dofs/fullstick/pattern.txt
Normal file
|
@ -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
|
24
app/dofs/offset-cursor/pattern.txt
Normal file
24
app/dofs/offset-cursor/pattern.txt
Normal file
|
@ -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
|
8
app/dofs/orbital-view/pattern.txt
Normal file
8
app/dofs/orbital-view/pattern.txt
Normal file
|
@ -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)
|
8
app/dofs/quadraticizer/pattern.txt
Normal file
8
app/dofs/quadraticizer/pattern.txt
Normal file
|
@ -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)
|
30
app/dofs/touch-xr/pattern.txt
Normal file
30
app/dofs/touch-xr/pattern.txt
Normal file
|
@ -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
|
29
app/dofs/trackballer/pattern.txt
Normal file
29
app/dofs/trackballer/pattern.txt
Normal file
|
@ -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
|
6
app/dofs/twist-cursor/pattern.txt
Normal file
6
app/dofs/twist-cursor/pattern.txt
Normal file
|
@ -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
|
0
app/dofs/wave-cursor/pattern.txt
Normal file
0
app/dofs/wave-cursor/pattern.txt
Normal file
Loading…
Add table
Reference in a new issue