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

Fix forward and back animation issue #1218

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

Mikalai
Copy link
Contributor

@Mikalai Mikalai commented Jun 13, 2024

Description

There is an issue with this code

time = time_within_period(time, 2.0 * _maxTime);
if (time > _maxTime) time = 2.0 * _maxTime - time;

time value should run though the range of [0, 2 * maxTime] but as soon as it reaches maxTime it will stop grow and never reach 2.0 * _maxTime thus backward part won't work. I've added additional variable samplerTime which stores time for sampler while time variable will be able to move forward in the range [0, 2 * maxTime].

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Create simple forward and backward animation, start it and check incoming values to the sampler

auto animation = vsg::Animation::create();
animation->mode = vsg::Animation::FORWARD_AND_BACK;

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code

@robertosfield robertosfield merged commit d05479e into vsg-dev:master Jul 2, 2024
8 checks passed
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

Successfully merging this pull request may close these issues.

2 participants