TnuaBasisWithHeadroom

Trait TnuaBasisWithHeadroom 

Source
pub trait TnuaBasisWithHeadroom: TnuaBasis {
    // Required methods
    fn headroom_intrusion<'a>(
        access: &TnuaBasisAccess<'_, Self>,
        sensors: &Self::Sensors<'a>,
    ) -> Option<Range<Float>>;
    fn set_extra_headroom(memory: &mut Self::Memory, extra_headroom: Float);
}
Expand description

The basis can keeps track of the space above the character.

Note that it’s possible to opt out of this in the configuration.

Required Methods§

Source

fn headroom_intrusion<'a>( access: &TnuaBasisAccess<'_, Self>, sensors: &Self::Sensors<'a>, ) -> Option<Range<Float>>

The headroom sensor has detected a ceiling above the character’s head.

This returns None when either no ceiling is deteceted in the sensor’s range - or when the headroom sensor is not configured.

The start of the returned range is the distance from the center of the character’s collider to top of the collider. The end of the range is the distance from the center of the character’s colldier to the detected ceiling.

Source

fn set_extra_headroom(memory: &mut Self::Memory, extra_headroom: Float)

Increase the range of the headroom sensor.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§