pub enum ParamKind {
Modal,
Structural,
}Expand description
What a parameter is for (ADR-0180 rule 2): whether its value carries an integer meaning, which decides two things and nothing else — whether the engine quantizes it before the scene sees it, and which of the generated reference’s two groups it prints under.
Orthogonal to [hold]: a hold reaches any bindable parameter whatever its
kind, and a kind quantizes whether or not the binding is held.
Variants§
Modal
Continuous — every value in the range means something, and the scene reads the fraction. The default, and what every parameter was before kinds existed.
Structural
Integer meaning: a mode number, a rule index, a count, a family. The
engine rounds the post-smoothing value once, CPU-side, before
set_param, so the scene is never handed 6.4 petals.
Implementations§
Source§impl ParamKind
impl ParamKind
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The name the generated reference and the exported schema print. Two readers, one spelling.
Sourcepub fn quantize(self, value: f32) -> f32
pub fn quantize(self, value: f32) -> f32
value as the scene should receive it: rounded for a
Structural parameter, untouched for a
Modal one.
The last step before set_param, after the hold has chosen which
frame’s value stands and the smoother has eased toward it — which is
why a structural parameter that is also smoothed steps through the
intervening integers rather than landing fractionally. An author who
wants a clean jump leaves it out of [smoothing].
A non-finite value is passed through rather than rounded: f32::round
leaves NaN alone anyway, and the scenes already guard their own
inputs.
Trait Implementations§
impl Copy for ParamKind
impl Eq for ParamKind
impl StructuralPartialEq for ParamKind
Auto Trait Implementations§
impl Freeze for ParamKind
impl RefUnwindSafe for ParamKind
impl Send for ParamKind
impl Sync for ParamKind
impl Unpin for ParamKind
impl UnsafeUnpin for ParamKind
impl UnwindSafe for ParamKind
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.