Struct ModParticle
pub struct ModParticle {
pub position: [f64; 3],
pub previous: [f64; 3],
pub velocity: [f64; 3],
pub age: i32,
pub lifetime: i32,
pub size: f32,
pub rgba: [f32; 4],
pub frame: u32,
pub removed: bool,
pub state: [f64; 4],
}Expand description
One particle of a provider’s type, as its tick reads and writes it: the fields of vanilla’s
Particle a tick moves. Plain numbers, so a tick allocates nothing, and one value for
native and wasm mods alike.
Fields§
§position: [f64; 3]Particle.x/y/z: the position now. A tick moves the particle by writing it.
previous: [f64; 3]Particle.xo/yo/zo: where it was a tick ago, which a frame interpolates from. The game
sets it to position before each tick; a tick that teleports the particle sets it too.
velocity: [f64; 3]Particle.xd/yd/zd: the velocity the spawn gave it (the declared one, or the spawn
call’s). The game applies no vanilla motion to a provider’s particle, so a tick moves
position by it, or not.
age: i32Particle.age, the ticks this particle has run: 1 on its first tick. The game advances it
before each tick.
lifetime: i32Particle.lifetime: the particle expires on the tick after age reaches it. A tick may
change it.
size: f32SingleQuadParticle.quadSize: the billboard’s half-width in blocks.
rgba: [f32; 4]Particle.rCol/gCol/bCol/alpha, each 0 to 1.
frame: u32The sprite drawn, an index in the sprite set particles/<path>.json lists (the last one
when it is past the list).
removed: boolParticle.remove(): set it to expire the particle before its lifetime is up.
state: [f64; 4]Four numbers that stay with this particle from one tick to the next, zero when it spawns.
Trait Implementations§
§impl Clone for ModParticle
impl Clone for ModParticle
§fn clone(&self) -> ModParticle
fn clone(&self) -> ModParticle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more