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

vec.normalize() is incorrect if values have changed #20

Closed
brianpeiris opened this issue Dec 31, 2023 · 2 comments
Closed

vec.normalize() is incorrect if values have changed #20

brianpeiris opened this issue Dec 31, 2023 · 2 comments

Comments

@brianpeiris
Copy link

Looks like q5's optimizations don't account for changes to a vector's components.

var vec = new p5.Vector();

vec.x = 2; 
vec.normalize();
console.log(vec.x); // gives 1

vec.y = 1;
vec.normalize();
console.log(vec.x) // gives 0.707 in p5, but still 1 in q5
@quinton-ashley
Copy link
Collaborator

thanks for reporting! Fixed in v1.9.1

@brianpeiris
Copy link
Author

Thanks!

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

No branches or pull requests

2 participants