Skip to main content

Tornado

Struct Tornado 

Source
pub struct Tornado {
    pub target: [f32; 3],
    pub path: Vec<[f32; 3]>,
    pub index: i32,
    pub timer: i64,
    pub position: [f32; 3],
    pub emitting: bool,
    pub slot: Option<(f32, f32)>,
}
Expand description

The component’s state.

Original: FUN_1400594e0.

Fields§

§target: [f32; 3]

The point it heads for.

§path: Vec<[f32; 3]>

The line it follows.

§index: i32

The index of the point it heads for.

§timer: i64

Until the next wrecking pass.

§position: [f32; 3]

Where it is.

§emitting: bool

Whether its particle slot is on.

Original: FUN_140054080(0) fades it out.

§slot: Option<(f32, f32)>

The particle slot’s alpha (system) and its rate per second: 1 / fade from the start, −1 / fade once it stops; None once the slot is gone.

Original: FUN_140053fc0.

Implementations§

Source§

impl Tornado

Source

pub fn step_slot(&mut self, dt: i64)

The particle component’s update for the slot, which runs before the tornado’s (the template lists particle first): the alpha moves by AsSeconds(dt) × rate; above 1 it stays at 1 and stops, at 0 or below the slot goes.

Original: FUN_140053490.

Source§

impl Tornado

Source

pub fn new( t: &TornadoTemplate, size: usize, terrain: &HeightGrid<'_>, floors: &Floors, rng: &mut Random, ) -> Tornado

A new tornado on a map of size cells: its line across the map, and its event.

Original: FUN_140058f00.

Source

pub fn follow(&mut self) -> bool

Within 3 of its point, the next point at least 10 on; false past the end.

Original: FUN_1400ac6b0(state, position, 10, 3), FUN_1400ac590.

Source

pub fn throw(&self, t: &TornadoTemplate, rng: &mut Random) -> [f32; 3]

The point a wrecking pass throws: RandFloatTol × 180° about it, up to away (RandFloat).

Original: FUN_1400589a0.

Trait Implementations§

Source§

impl Clone for Tornado

Source§

fn clone(&self) -> Tornado

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Tornado

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Tornado

Source§

fn eq(&self, other: &Tornado) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Tornado

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.