Skip to content

Support obtaining the curve of AnimatableCurve #19313

Open
@MushineLament

Description

@MushineLament

What problem does this solve or what need does it fill?

Allow modification of known animation curves, random or targeted adjustments to animation curves.

What solution would you like?

impl<P, C> Debug for AnimatableCurve<P, C>
where
    C: Debug,
{
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
        f.debug_struct("AnimatableCurve")
            **.field("curve", &self.curve)**
            .finish()
    }
}

I have noticed that dyn AnimableCurve supports printing on debug traits that have already been implemented, so I think it is possible to allow C generics to return data when implementing a certain trait.

So only when the C generic supports a certain trait, will it return the actual data of AnimableCurve.

Meanwhile, this trait supports converting data, just like converting any trait to an actual type.

What alternative(s) have you considered?

Not.

Additional context

I haven't found any known AnimatableCurve to obtain actual curve data, please let me know if there is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AnimationMake things move and change over timeC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions