pub struct AudioOcclusionProbe {
pub from: [f32; 3],
pub to: [f32; 3],
pub blocked: Option<bool>,
}Expand description
Runtime-only occlusion probe for a positional audio emitter.
The audio system attaches one to each emitter’s entity and refreshes
from (the listener) and to (the emitter) every frame; PhysicsSystem
(which steps earlier) raycasts the segment against scene geometry and
writes back blocked. The audio system then muffles the emitter when the
path is blocked. The exchange is one frame behind the listener, which is
inaudible. Riding the emitter’s entity, the probe despawns with it.
Not authored in world files: it has no args.
Fields§
§from: [f32; 3]Listener position in world space (the ray origin).
to: [f32; 3]Emitter position in world space (the ray target).
blocked: Option<bool>Whether scene geometry blocks the segment, or None when unanswered
(no physics in the world, or the first frame).
Trait Implementations§
Source§impl Clone for AudioOcclusionProbe
impl Clone for AudioOcclusionProbe
Source§fn clone(&self) -> AudioOcclusionProbe
fn clone(&self) -> AudioOcclusionProbe
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Component for AudioOcclusionProbe
impl Component for AudioOcclusionProbe
Source§const NAME: &'static str = "AudioOcclusionProbe"
const NAME: &'static str = "AudioOcclusionProbe"
The registry name a world authors this component under.
Source§fn from_baked(_bytes: &[u8]) -> Result<Self, CnResult>
fn from_baked(_bytes: &[u8]) -> Result<Self, CnResult>
Reconstruct this component from a blob record, whose bytes are the
serialized runtime component (cook already ran the asset -> component
translation). The default rejects: runtime-only components are never
stored in a blob, so only loadable types provide an implementation.
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Called after construction to inject the payload locator from the blob def.
Only meaningful for components with a compiled payload.
The default implementation does nothing (correct for most components).
Source§fn inject_name(&mut self, _id: AssetId)
fn inject_name(&mut self, _id: AssetId)
Called after construction to inject the asset’s identity from the blob
def. Only meaningful for components that look themselves up by id at
runtime. The default implementation does nothing.
Source§impl ComponentSlot for AudioOcclusionProbe
impl ComponentSlot for AudioOcclusionProbe
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
The component type’s stable id, used as its
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<Self>
fn slot(s: &ComponentStorage) -> &Column<Self>
Borrow this type’s column out of the storage.
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
Mutably borrow this type’s column out of the storage.
Source§impl Debug for AudioOcclusionProbe
impl Debug for AudioOcclusionProbe
Source§impl Default for AudioOcclusionProbe
impl Default for AudioOcclusionProbe
Source§fn default() -> AudioOcclusionProbe
fn default() -> AudioOcclusionProbe
Returns the “default value” for a type. Read more
Source§impl From<AudioOcclusionProbe> for ComponentAsset
impl From<AudioOcclusionProbe> for ComponentAsset
Source§fn from(c: AudioOcclusionProbe) -> Self
fn from(c: AudioOcclusionProbe) -> Self
Converts to this type from the input type.
impl RuntimeComponent for AudioOcclusionProbe
Auto Trait Implementations§
impl Freeze for AudioOcclusionProbe
impl RefUnwindSafe for AudioOcclusionProbe
impl Send for AudioOcclusionProbe
impl Sync for AudioOcclusionProbe
impl Unpin for AudioOcclusionProbe
impl UnsafeUnpin for AudioOcclusionProbe
impl UnwindSafe for AudioOcclusionProbe
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