From 0dcbc7bb6a35f3d8fcf818b8dc09b47db9219ce5 Mon Sep 17 00:00:00 2001 From: Yukari Hafner Date: Sun, 15 Sep 2024 22:07:56 +0200 Subject: [PATCH] stub --- examples/3d-audio.lisp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 examples/3d-audio.lisp diff --git a/examples/3d-audio.lisp b/examples/3d-audio.lisp new file mode 100644 index 00000000..5d9e9e34 --- /dev/null +++ b/examples/3d-audio.lisp @@ -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)))