Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coroutine support #32

Open
wxjz2 opened this issue Jan 27, 2022 · 1 comment
Open

Coroutine support #32

wxjz2 opened this issue Jan 27, 2022 · 1 comment

Comments

@wxjz2
Copy link

wxjz2 commented Jan 27, 2022

hi, Coroutine is powerful and convenient feature for animation scene. just like

await tweeny::from(130).to(130).during(300);

is there a plan to implement coroutine version?

@wxjz2 wxjz2 changed the title fiber support Coroutine support Jan 27, 2022
@mobius3
Copy link
Owner

mobius3 commented Jan 30, 2022

Hello, there is no plan on supporting that. From what I gather (according to my own experience with await in other languages)

await tweeny::from(130).to(130).during(300);

is supposed to wait for the whole interpolation to finish before going on with the next statement? If that's the case, how is that desirable? I mean, it clearly sounds cool but I'm not sure how that's useful (I may be that ignorant), usually tweens are controlled elsewhere because animations tend to move forward regardless of other things happening in the code.

Moreover, at least judging by your code, who is going to step the tween? the coroutine? Tweeny itself has no notion of "frame", it has no self register for interpolations to interpolate, it does not calculate any kind of delta-time by itself, that is left for the application developer to do. If we are going to support this idiom, we'll need to keep track of time.

Maybe we can have a coroutine wrapper in an "extension" header that knows how to handle these things? Specially because that's not a core goal of tweeny, but would be a nice feature to have, if the use case is actually useful and pertinent.

I have a lot of catch-ups to do with the C++ standard so I don't see myself researching or working on this myself, so as for me, I have no plans on adding that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants