1- //! A 3D spatial positioning node using a basic (and naive) algorithm. It does
2- //! not make use of any fancy binaural algorithms, rather it just applies basic
3- //! panning and filtering.
1+ //! A 3D spatial positioning node using a basic (and naive) algorithm. ( It can also
2+ //! be used for 2D audio.) It does not make use of any fancy binaural algorithms,
3+ //! rather it just applies basic panning and filtering.
44
55#[ cfg( not( feature = "std" ) ) ]
66use num_traits:: Float ;
@@ -27,8 +27,9 @@ use firewheel_core::{
2727 vector:: Vec3 ,
2828} ;
2929
30- /// A 3D spatial positioning node using a basic but fast algorithm. It does not make use
31- /// of any fancy binaural algorithms, rather it just applies basic panning and filtering.
30+ /// A 3D spatial positioning node using a basic but fast algorithm. (It can also be used
31+ /// for 2D audio). It does not make use of any fancy binaural algorithms, rather it just
32+ /// applies basic panning and filtering.
3233#[ derive( Diff , Patch , Debug , Clone , Copy , PartialEq ) ]
3334#[ cfg_attr( feature = "bevy" , derive( bevy_ecs:: prelude:: Component ) ) ]
3435#[ cfg_attr( feature = "bevy_reflect" , derive( bevy_reflect:: Reflect ) ) ]
@@ -40,11 +41,13 @@ pub struct SpatialBasicNode {
4041 /// A 3D vector representing the offset between the listener and the
4142 /// sound source.
4243 ///
43- /// The coordinates are `(x, y, z)`.
44+ /// The coordinates are `(x, y, z)`. (This node can also be used for 2D audio by
45+ /// setting the z value to `0.0`.)
4446 ///
45- /// * `-x` is to the left of the listener, and `+x` is the the right of the listener
46- /// * `-y` is below the listener, and `+y` is above the listener.
47- /// * `-z` is in front of the listener, and `+z` is behind the listener
47+ /// * `-x` is to the left of the listener, and `+x` is to the right of the listener
48+ /// * Larger absolute `y` and `z` values will make the signal sound farther away.
49+ /// (The algorithm used by this node makes no distinction between `-y`, `+y`, `-z`,
50+ /// and `+z`).
4851 ///
4952 /// By default this is set to `(0.0, 0.0, 0.0)`
5053 pub offset : Vec3 ,
0 commit comments