pub struct Source {
pub position: Point3D,
pub directivity: Directivity,
pub amplitude: f64,
pub crossover: CrossoverFilter,
pub name: String,
}Expand description
Sound source with position and directivity
Fields§
§position: Point3DSource position
directivity: DirectivityDirectivity pattern
amplitude: f64Source amplitude (strength)
crossover: CrossoverFilterCrossover filter
name: StringSource name (e.g., “Left Main”, “Subwoofer”)
Implementations§
Source§impl Source
impl Source
Sourcepub fn new(
position: Point3D,
directivity: Directivity,
amplitude: f64,
) -> Source
pub fn new( position: Point3D, directivity: Directivity, amplitude: f64, ) -> Source
Create a new source
Sourcepub fn omnidirectional(position: Point3D, amplitude: f64) -> Source
pub fn omnidirectional(position: Point3D, amplitude: f64) -> Source
Create a simple omnidirectional source at position
Sourcepub fn classical(
position: Point3D,
h_angle: f64,
v_angle: f64,
amplitude: f64,
) -> Source
pub fn classical( position: Point3D, h_angle: f64, v_angle: f64, amplitude: f64, ) -> Source
Create a classical directional source
Sourcepub fn with_crossover(self, crossover: CrossoverFilter) -> Source
pub fn with_crossover(self, crossover: CrossoverFilter) -> Source
Set crossover filter
Sourcepub fn amplitude_towards(&self, point: &Point3D, frequency: f64) -> f64
pub fn amplitude_towards(&self, point: &Point3D, frequency: f64) -> f64
Get directional amplitude towards a point at a specific frequency
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Source
impl<'de> Deserialize<'de> for Source
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Source, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Source, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Source
impl Serialize for Source
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more