API reference

aster_blueprint::fluid_nodes

Pre-1.0: signatures are not frozen. Generated from rustdoc JSON of the compiled crate; rustdoc JSON format version 60. Only public items are listed.

Graph nodes over the fluid kernel: core.fluid.*.v1.

  • core.fluid.sim.v1 (Motion / Temporal): the simulation. Its time input (normally a core.clock.v1) drives it: each evaluation advances the sim from the time it last saw to the new time in fixed 1/60 s steps (at most 8 per evaluation; a longer gap skips ahead). Its previous value is its state: the runtime keeps it in the node's slot, so a [crate::runtime::Candidate] that is dropped leaves the state untouched and a committed one adopts it. A time that goes backwards restarts the sim. Inputs add a splat and an emitter. Output: a Fluid value (ValueType::Fluid).
  • core.fluid.dye.v1 (Visual / Pure): Fluid -> Surface (a one-image recording, width x height).
  • core.fluid.velocity.v1, core.fluid.speed.v1, core.fluid.density.v1 (Motion / Pure): sample the flow at a point 0..1 so other nodes can be driven by it.

Positions are 0..1 across the domain, lengths and velocities in domain widths (see [crate::fluid]).

Structs

structaster_blueprint::fluid_nodes::Port

pub struct Port { /* see fields */ }

One declared input.

Public fields

fieldtype
name&'static str
value_typemodel::ValueType
defaultDflt

Trait implementations: Clone, Copy, Debug

Enums

enumaster_blueprint::fluid_nodes::Dflt

pub enum Dflt { Required, Scalar, Length, Bool, Color }

Default of an optional input.

Variants

  • Required
  • Scalar
  • Length
  • Bool
  • Color

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::fluid_nodes::FluidKind

pub enum FluidKind { Sim, Dye, Velocity, Speed, Density }

The fluid node kinds.

Methods

  • const ALL: [FluidKind; 5]
  • fn name(self) -> &'static str
  • fn from_name(name: &str) -> Option<Self>
  • fn inputs(self) -> &'static [Port]
  • fn output(self) -> ValueType
  • fn domain(self) -> Domain
  • fn effect(self) -> Effect

Variants

  • Sim
  • Dye
  • Velocity
  • Speed
  • Density

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

Functions

fnaster_blueprint::fluid_nodes::evaluate

pub fn evaluate(kind: FluidKind, inputs: &[prepared::RuntimeValue], prev: Option<&prepared::RuntimeValue>) -> Result<prepared::RuntimeValue, aster_ui::Error>

Evaluate one fluid node. prev is the node's previous output (its state), when it has one.

Constants

constaster_blueprint::fluid_nodes::DENSITY

pub const DENSITY: &str

constaster_blueprint::fluid_nodes::DYE

pub const DYE: &str

constaster_blueprint::fluid_nodes::MAX_STEPS_PER_EVAL

pub const MAX_STEPS_PER_EVAL: usize

Largest number of fixed steps one evaluation advances.

constaster_blueprint::fluid_nodes::SIM

pub const SIM: &str

constaster_blueprint::fluid_nodes::SPEED

pub const SPEED: &str

constaster_blueprint::fluid_nodes::VELOCITY

pub const VELOCITY: &str