pub struct ShatterConfig {
pub delay: f64,
pub duration: f64,
pub mode: ShatterMode,
pub pieces: u32,
pub seed: u32,
pub origin: ShatterOrigin,
pub spread: f32,
pub spin: f32,
pub depth: f32,
pub fade: bool,
}Expand description
Configuration for the shatter animation effect: the node’s own rendered
subtree — background, border, content and children, exactly as it would
have painted — is rasterised once, cut into pieces convex cells by a
deterministic Voronoi partition seeded by seed, and each cell is flown
away from origin, spun and faded independently.
seed and the sampled instant fully determine every shard’s cell,
direction, spin and depth — two renders of the same file at the same time
are byte-identical.
mode decides which end of the timeline is the intact node and which is
the fully dispersed one, and what happens once delay + duration has
elapsed:
"out"(default): assembled atdelay, fully dispersed atdelay + duration. Outside[delay, delay + duration)the effect contributes nothing at all — the node renders byte-identically to one with noshattereffect in itsanimationlist, the same hard short-circuitchromatic_aberrationandzoom_bluruse rather than a fade that only gets close to zero."in"is the mirror: dispersed atdelay, assembled atdelay + duration, and — like"out"— outside its window the node renders as if the effect were absent."hold"plays the same dispersal as"out"but freezes at the fully dispersed state oncedelay + durationis reached instead of short-circuiting back to the plain node — it legitimately never converges.
Fields§
§delay: f64Delay before the shards start moving (seconds).
duration: f64How long the dispersal (or, in "in" mode, the assembly) takes
(seconds).
mode: ShatterModeWhich end of the timeline is intact and what happens after
delay + duration. See the type-level doc comment.
pieces: u32Number of Voronoi shards (default 24, clamped 1..=64).
seed: u32Seed for the deterministic Voronoi partition and every shard’s direction/spin/depth jitter.
origin: ShatterOriginPoint shards fly away from (or, in "in" mode, converge toward), as
a fraction of the node’s own box ({ "x": 0.5, "y": 0.5 } is the
centre, the default).
spread: f32Radial travel multiplier at full dispersal, relative to the node’s
own diagonal (default 1.0). 0 pins shards in place — only spin,
depth and fade remain visible.
spin: f32Maximum rotation in degrees a shard reaches at full dispersal
(default 90); each shard’s own sign and magnitude are jittered from
seed.
depth: f32Per-shard scale modulation at full dispersal, the same “0.0 = none”
semantics as OrbitConfig::depth (default 0.4): each shard’s own
signed depth is jittered from seed, so some shards appear to come
toward the camera (scale > 1) while others recede (scale < 1).
fade: boolFade each shard’s opacity to zero as it reaches full dispersal
(default true). With mode: "in" this is a mirror: shards start
transparent and reach full opacity as they assemble.
Trait Implementations§
Source§impl Clone for ShatterConfig
impl Clone for ShatterConfig
Source§impl Debug for ShatterConfig
impl Debug for ShatterConfig
Source§impl<'de> Deserialize<'de> for ShatterConfig
impl<'de> Deserialize<'de> for ShatterConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ShatterConfig
impl JsonSchema for ShatterConfig
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for ShatterConfig
impl PartialEq for ShatterConfig
Source§impl Serialize for ShatterConfig
impl Serialize for ShatterConfig
impl StructuralPartialEq for ShatterConfig
Auto Trait Implementations§
impl Freeze for ShatterConfig
impl RefUnwindSafe for ShatterConfig
impl Send for ShatterConfig
impl Sync for ShatterConfig
impl Unpin for ShatterConfig
impl UnsafeUnpin for ShatterConfig
impl UnwindSafe for ShatterConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more