Skip to main content

FxWorld

Struct FxWorld 

Source
pub struct FxWorld {
    pub cfg: FxCfg,
    /* private fields */
}
Expand description

Die Welt: Effektplätze und Instanz-Auslage.

Fields§

§cfg: FxCfg

Implementations§

Source§

impl FxWorld

Source

pub fn new(cfg: FxCfg) -> Self

Source

pub fn play(&mut self, chain: Vec<Module>) -> u32

Einen Effektplatz mit gegebener Modul-Kette starten. Gibt die Play-Kennung zurück. Der Initialstoß wird sofort abgearbeitet, damit Frame 1 schon Funken zeigt.

Source

pub fn play_graph(&mut self, graph: &FxGraph) -> Result<u32, GraphError>

Graph starten: kompiliert das Kantengerüst in die lineare Kette und legt sie wie play als neuen Effektplatz aus. Ein Fehler im Graph lässt den World unangetastet.

Source

pub fn stop(&mut self, id: u32)

Nachschub abschalten; das Licht geht aus, die Glut altert aus.

Source

pub fn kill(&mut self, id: u32)

Sofort auslöschen, samt Restglut.

Source

pub fn step(&mut self, dt: f32)

Ein fester Simulationsschritt über alle Effektplätze.

Source

pub fn instances(&self) -> &[FxInstance]

Die Render-Auslage des letzten Schritts.

Source

pub fn charge_bytes(&self) -> &[u8] ⓘ

Dieselbe Auslage als roher Byte-Stream (32 Byte je Teilchen) für den Upload in einen GPU-Instanz-Buffer. Die Umwandlung ist ein Null-Kopierer: FxInstance ist repr(C) mit 4-Byte-Ausrichtung, jedes Feld liegt lückenlos hintereinander.

Source

pub fn live_count(&self) -> usize

Lebende Teilchen über alle Effektplätze.

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> 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, 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.