TnuaBasisWithGround

Trait TnuaBasisWithGround 

Source
pub trait TnuaBasisWithGround: TnuaBasis {
    // Required methods
    fn is_airborne(access: &TnuaBasisAccess<'_, Self>) -> bool;
    fn violate_coyote_time(memory: &mut Self::Memory);
    fn ground_sensor<'a>(sensors: &Self::Sensors<'a>) -> &'a TnuaProximitySensor;
}
Expand description

The basis keeps track on the entity the chracter stands on - and whether or not it stands on something.

Required Methods§

Source

fn is_airborne(access: &TnuaBasisAccess<'_, Self>) -> bool

Can be queried by an action to determine if the character should be considered “in the air”.

This is a query method, used by the action to determine what the basis thinks.

Source

fn violate_coyote_time(memory: &mut Self::Memory)

If the basis is at coyote time - finish the coyote time.

This is typically called by air actions so that a long coyote time will not allow, for example, unaccounted air jumps. These actions should invoke this method inside their influence_basis method.

If the character is fully grounded, this method must not change that.

Source

fn ground_sensor<'a>(sensors: &Self::Sensors<'a>) -> &'a TnuaProximitySensor

The sensor used to detect the ground.

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§