Skip to content

Commit

Permalink
stub
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Sep 15, 2024
1 parent 6369959 commit 0dcbc7b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions examples/3d-audio.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
(in-package #:org.shirakumo.fraf.trial.examples)

(defmethod trial-harmony:server-initargs append ((main main))
(list :mixers '((:effect mixed:space-mixer))))

(define-example 3d-audio
:title "3D-Audio"
(enter (make-instance 'vertex-entity :vertex-array (// 'trial 'unit-grid)) scene)
(enter (make-instance 'audio-source) scene)
(enter (make-instance 'audio-camera) scene)
(enter (make-instance 'render-pass) scene))

(defclass audio-camera (fps-camera)
())

(define-handler (audio-camera tick :after) ()
(setf (harmony:location :effect) (location audio-camera))
(setf (harmony:direction :effect) ()))

(defclass audio-source (listener located-entity)
())

(defmethod stage :after ((source audio-source) (area staging-areaf))
(stage (assets:// :step-rocks) area))

(define-handler (audio-source tick) (dt)
(let ((loc (location audio-source)))
(debug-sphere loc 0.5)
(play (assets:// :step-rocks) :location loc)))

0 comments on commit 0dcbc7b

Please sign in to comment.