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) { ... }
}
Expand description

Vanilla-shaped behavior shared by entities that extend ThrowableProjectile.

Provided Methods§

Source

fn get_air_drag(&self) -> f32

Vanilla ThrowableProjectile.getAirDrag.

Source

fn throwable_default_gravity(&self) -> f64

Vanilla ThrowableProjectile.getDefaultGravity (0.03).

Source

fn apply_inertia(&self)

Vanilla ThrowableProjectile.applyInertia (water vs air drag).

Source

fn throwable_projectile_tick(&self)

Vanilla ThrowableProjectile.tick.

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.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§