Closed nbogie closed 1 day ago
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!
I'd like to contribute a fix and regression tests, if it turns out that that's wanted!
Looks like the code has been this way since addition of the functions in v1.0.0
It seems like on this line the surface normal is multiplied by two using the instance method which modifies the vector where it probably should use a static method that does not modify the original instead.
@nbogie You can go ahead with a fix. Thanks!
Most appropriate sub-area of p5.js?
p5.js version
1.9.4
Web browser and version
all
Operating system
all
Steps to reproduce this
Snippet:
Expected behaviour:
I'd expect the surface normal argument to be unchanged by the calculation, in both instance and static cases.
Actual behaviour:
The surface normal argument is mutated during the calculation, in both instance and static cases.
Misc:
Here's a (simplification of a) real usage where the bug caught me out: https://openprocessing.org/sketch/2295422