Skip to main content

AnimationBlend

Enum AnimationBlend 

Source
pub enum AnimationBlend {
    Blend1d {
        parameter: String,
        points: Vec<AnimationBlendPoint>,
        sync: bool,
    },
    Blend2d {
        parameter_x: String,
        parameter_y: String,
        x_values: Vec<f32>,
        y_values: Vec<f32>,
        rows: Vec<Vec<AssetId>>,
        sync: bool,
    },
}
Expand description

A blendspace: several clips mixed continuously by parameter value instead of one clip per state. kind selects the shape.

With sync true the members share one normalized phase clock – a walk and a run cycle stay foot-aligned while the blend moves between them, so speed changes do not slide the feet. Leave it false for members that are not cyclic gaits.

Variants§

§

Blend1d

Clips along one parameter. The parameter picks the two neighbouring points (by ascending value) and blends them; outside the range the nearest end clip plays alone.

Fields

§parameter: String

Name of the declared graph parameter driving the blend.

§points: Vec<AnimationBlendPoint>

Members in ascending value order.

§sync: bool

Phase-sync the members (see above).

§

Blend2d

Clips on a regular grid over two parameters, blended bilinearly between the four grid neighbours of the parameter point (clamped at the grid edges).

Fields

§parameter_x: String

Name of the parameter along the grid’s x axis.

§parameter_y: String

Name of the parameter along the grid’s y axis.

§x_values: Vec<f32>

Ascending x-axis sample positions, one per grid column.

§y_values: Vec<f32>

Ascending y-axis sample positions, one per grid row.

§rows: Vec<Vec<AssetId>>

One row of Animation clip names per y_values entry, each row holding one clip per x_values entry.

§sync: bool

Phase-sync the members (see above).

Trait Implementations§

Source§

impl Clone for AnimationBlend

Source§

fn clone(&self) -> AnimationBlend

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AnimationBlend

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AnimationBlend

Source§

fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for AnimationBlend

Source§

fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.