Skip to content

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
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