Skip to main content

PhysicsSensor

Trait PhysicsSensor 

Source
pub trait PhysicsSensor {
    // Required methods
    fn is_triggered(&self) -> bool;
    fn overlapping_bodies(&self) -> Vec<u64>;
    fn update(&mut self, body_positions: &[(u64, [Real; 3])]);
}
Expand description

Trait for physics sensors (trigger volumes, proximity detectors, etc.).

Required Methods§

Source

fn is_triggered(&self) -> bool

Return true if the sensor is currently triggered by any body.

Source

fn overlapping_bodies(&self) -> Vec<u64>

Return the IDs of all bodies currently overlapping this sensor.

Source

fn update(&mut self, body_positions: &[(u64, [Real; 3])])

Called each frame to update the sensor’s overlap state.

Implementors§