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

LoopRepeat executes an action once too many #13011

Closed
3 of 13 tasks
gero3 opened this issue Jan 1, 2018 · 5 comments
Closed
3 of 13 tasks

LoopRepeat executes an action once too many #13011

gero3 opened this issue Jan 1, 2018 · 5 comments

Comments

@gero3
Copy link
Contributor

gero3 commented Jan 1, 2018

Description of the problem

When I was writing the unit test of AnimationAction, I noticed something I didn't expect. When asking to LoopRepeat a action 3 times, it executes the action 4 times, I think.
Example: https://jsfiddle.net/wqoLka39/3/

Three.js version
  • Dev
  • r89
  • ...
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, ...)
@mrdoob
Copy link
Owner

mrdoob commented Jan 1, 2018

/ping @bhouston @tschw

@donmccurdy
Copy link
Collaborator

This is documented under AnimationAction.repetitions:

The number of repetitions of the performed AnimationClip over the course of this action. Can be set via setLoop. Default is Infinity.

Setting this number has no effect, if the loop mode is set to THREE.LoopOnce.

Note: The first run is not taken into account. For example: if repetition is set to 2, the total number of executed rounds will be 3.

@donmccurdy
Copy link
Collaborator

donmccurdy commented Jan 1, 2018

^I've been surprised by that as well. Not sure if there's another way to configure the action that would feel more intuitive, or if this is derived from another tool like Unity?

@bhouston
Copy link
Contributor

bhouston commented Jan 1, 2018 via email

@gero3
Copy link
Contributor Author

gero3 commented Jan 2, 2018

I agree.

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

5 participants