Struct cybergrape::sphericalizer::Sphericalizer
source · pub struct Sphericalizer {
tag_settings: Vec<(f32, f32)>,
}
Expand description
Converts from raw antenna measurements into a spherical coordinate and bundles
range and gain into a BufferMetadata
struct to pass into a Binauraliser
.
Fields§
§tag_settings: Vec<(f32, f32)>
Implementations§
source§impl Sphericalizer
impl Sphericalizer
sourcepub fn new(tag_settings: Vec<(f32, f32)>) -> Self
pub fn new(tag_settings: Vec<(f32, f32)>) -> Self
Instantiates a new Sphericalizer
, storing the gains and ranges of the
tags that we will be looking for.
sourcefn scale_angle(azm: f32) -> f32
fn scale_angle(azm: f32) -> f32
From observation, azimuth and elevation are in the range of -70 to 70 degrees (-1.22173 to 1.22173 rad) This function scales them to the range -90 to 90 degrees (-PI/2 to PI/2 rad)
sourcepub fn query(
&self,
acc: &mut UpdateAccumulator<Hdm>,
) -> Option<Vec<BufferMetadata>>
pub fn query( &self, acc: &mut UpdateAccumulator<Hdm>, ) -> Option<Vec<BufferMetadata>>
Pulls updates out of the UpdateAccumulator
, sphericalizes them, bundles
the associated gain and range, generating a vec of BufferMetadata
.
Auto Trait Implementations§
impl Freeze for Sphericalizer
impl RefUnwindSafe for Sphericalizer
impl Send for Sphericalizer
impl Sync for Sphericalizer
impl Unpin for Sphericalizer
impl UnwindSafe for Sphericalizer
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> 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