drawcall / Proton

Javascript particle animation library
https://drawcall.github.io/Proton/
MIT License
2.41k stars 275 forks source link

Rotate behavior: unexpected result #71

Closed kavandos closed 4 years ago

kavandos commented 4 years ago

I've tried to use particle rotation behaviour, and suddenly found unexpected results. After digging in code I've found a Rotate method "applyBehaviour" that has

if (this.style === 'to' || this.style === 'TO' || this.style === '_') { particle.rotation += particle.data.rotationB + (particle.data.rotationA - particle.data.rotationB) * this.energy }...

It has "+=" operator, but "=" expected here

So it's probably a bug.

drawcall commented 4 years ago

This is the interpolation formula. I don't know what effect you want

kavandos commented 4 years ago

I suggest particle.rotation = [interpolation]

but here I see particle.rotation += [interpolation]

Am I wrong to suggest this behaviour?

kavandos commented 4 years ago

Probably I misunderstood, and Rotate means only "rotation speed". In this case everything is fine. I just wanted a particle to start with one angle and die with another one...