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

Possible to move carousel in constant speed? #38

Open
coco175 opened this issue Jan 31, 2020 · 1 comment
Open

Possible to move carousel in constant speed? #38

coco175 opened this issue Jan 31, 2020 · 1 comment

Comments

@coco175
Copy link

coco175 commented Jan 31, 2020

What has to be done in order to move the carousel in a constant motion? Not jumping from one item to the next... I am looking for a constant, smooth turning of the items,. I s that possible?
Thanks

@specious
Copy link
Owner

That would be possible by adjusting the formula that calculates by how much the carousel will rotate between two animation frames:

// Asymptotically approach the destination
self.rotation = self.destRotation - rem / (1 + (self.speed * dt));
self.scheduleNextFrame();

A pull request for a feature that would enable selecting, for example, among multiple easing functions that govern the motion would be quite appreciated.

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

No branches or pull requests

2 participants