;; returns the left hands state (i.e. HandState_*)
(bind-func kinect_get_hand_left
(lambda (id:i64)
(let ((hands:i32* (kinect_update_body.hands))
(ids:i64* (kinect_update_body.ids))
(i:i64 0) (idx:i64 -1))
(dotimes (i 6) (if (= (pref ids i) id) (set! idx i)))
(if (< idx 0)
-1
(pref hands (* 2 idx))))))