Skip to main content

ThrowableProjectile

Trait ThrowableProjectile 

Source
pub trait ThrowableProjectile: Projectile {
    // Provided methods
    fn get_air_drag(&self) -> f32 { ... }
    fn throwable_default_gravity(&self) -> f64 { ... }
    fn apply_inertia(&self) { ... }
    fn throwable_projectile_tick(self: Arc<Self>) { ... }
    fn handle_first_tick_bubble_column(&self) { ... }
}
Expand description

Vanilla-shaped behavior shared by entities that extend ThrowableProjectile.

Provided Methods§

Source

fn get_air_drag(&self) -> f32

Air drag multiplier applied to velocity each tick while airborne (0.99, i.e. 1% loss).

Source

fn throwable_default_gravity(&self) -> f64

Downward acceleration applied each tick while this projectile is airborne.

Source

fn apply_inertia(&self)

Vanilla ThrowableProjectile.applyInertia (water vs air drag).

Source

fn throwable_projectile_tick(self: Arc<Self>)

Reached from a subclass’s tick as super.tick(). Applies gravity and drag, raycasts the move vector, moves to the hit (or full move), updates rotation, runs the Projectile/Entity base tick, then resolves the hit.

Source

fn handle_first_tick_bubble_column(&self)

Applies bubble-column effects to this projectile on its first tick.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§