added cursor keys

This commit is contained in:
Dave Griffiths 2009-07-02 14:46:07 +01:00
parent 6569ea30f9
commit b4eef24816

View file

@ -1,5 +1,5 @@
#lang scheme/base ;#lang scheme/base
(require fluxus-016/drflux) ;(require fluxus-016/drflux)
(require scheme/class) (require scheme/class)
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -685,8 +685,8 @@
(set! child-twig-ids (cons twig-id child-twig-ids))) (set! child-twig-ids (cons twig-id child-twig-ids)))
(define/pubment (grow point) (define/pubment (grow point)
(let ((growing-noise (oa-load-sample (fullpath "snd/event01.wav")))) (let ((growing-noise (oa-load-sample (fullpath "snd/event01.wav"))))
(oa-play growing-noise (vector 0 0 0) (rndf) 0.3)) (oa-play growing-noise (vector 0 0 0) (rndf) 0.3))
(inner (void) grow point)) (inner (void) grow point))
(define/public (add-ornament point-index property) (define/public (add-ornament point-index property)
@ -1395,10 +1395,10 @@
(set-camera-transform (mtranslate (vector 0 0 -1)))) (set-camera-transform (mtranslate (vector 0 0 -1))))
(define/public (update) (define/public (update)
(when (key-pressed "a") (set! yaw (+ yaw 1))) (when (or (key-pressed "a") (key-special-pressed 100)) (set! yaw (+ yaw 1)))
(when (key-pressed "d") (set! yaw (- yaw 1))) (when (or (key-pressed "d") (key-special-pressed 102)) (set! yaw (- yaw 1)))
(when (key-pressed "w") (set! tilt (+ tilt 1))) (when (or (key-pressed "w") (key-special-pressed 101)) (set! tilt (+ tilt 1)))
(when (key-pressed "s") (set! tilt (- tilt 1))) (when (or (key-pressed "s") (key-special-pressed 103)) (set! tilt (- tilt 1)))
; clamp tilt to prevent gimbal lock ; clamp tilt to prevent gimbal lock
(when (> tilt 88) (set! tilt 88)) (when (> tilt 88) (set! tilt 88))