You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the motivation here must be to avoid unnecessary allocations. This makes sense as allocating on each tween would be crippling for performance.
Perhaps instead of returning an owned type, the caller to ease() could pass an output: &mut Self? That would allow for tweening types that are non-copy, by writing into the output.
I believe the reason for ease() working with values rather than references is that the former is better for primitive types. An f32 is smaller than a pointer on 64-bit processors, and it should be slightly faster since no dereferencing is needed.
Tweening primitive values or small structures seemed like the most common use case to me at the time, but the current design obviously has some downsides for larger structures or structures that can't be copied.
Why must T be Copy? How can one access a value in a keyframe with non-copy types?
The text was updated successfully, but these errors were encountered: