added cursor keys
This commit is contained in:
parent
6569ea30f9
commit
b4eef24816
1 changed files with 8 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
|||
#lang scheme/base
|
||||
(require fluxus-016/drflux)
|
||||
;#lang scheme/base
|
||||
;(require fluxus-016/drflux)
|
||||
(require scheme/class)
|
||||
|
||||
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -1395,10 +1395,10 @@
|
|||
(set-camera-transform (mtranslate (vector 0 0 -1))))
|
||||
|
||||
(define/public (update)
|
||||
(when (key-pressed "a") (set! yaw (+ yaw 1)))
|
||||
(when (key-pressed "d") (set! yaw (- yaw 1)))
|
||||
(when (key-pressed "w") (set! tilt (+ tilt 1)))
|
||||
(when (key-pressed "s") (set! tilt (- tilt 1)))
|
||||
(when (or (key-pressed "a") (key-special-pressed 100)) (set! yaw (+ yaw 1)))
|
||||
(when (or (key-pressed "d") (key-special-pressed 102)) (set! yaw (- yaw 1)))
|
||||
(when (or (key-pressed "w") (key-special-pressed 101)) (set! tilt (+ tilt 1)))
|
||||
(when (or (key-pressed "s") (key-special-pressed 103)) (set! tilt (- tilt 1)))
|
||||
|
||||
; clamp tilt to prevent gimbal lock
|
||||
(when (> tilt 88) (set! tilt 88))
|
||||
|
|
Loading…
Reference in a new issue