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

math: Rewrite Vec tests and fix Vec cross calculation bug #1028

Merged
merged 4 commits into from
Sep 23, 2023

Conversation

noisegul
Copy link
Contributor

@noisegul noisegul commented Sep 23, 2023

  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.

Rewrote the old commented out tests in accordance to the Mach style guide and added the listed missing basic tests.
While doing so I also caught two bugs in the cross and swizzling methods:

  • the naming of the Vec3 swizzling method was wrong, using yzw instead of yzx, and .w() instead of .x(), while cross was calling yzx
  • the cross method used e.g. .mul(b.xzy()) instead of .mul(&b.xzy())

Tests for add, sub, div, mul, addScalar, subScalar, divScalar, mulScalar
Old tests were not in accordance to the testing style guide
Copy link
Member

@slimsag slimsag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super, super helpful - thank you!

@slimsag slimsag merged commit 2615afa into hexops:main Sep 23, 2023
3 checks passed
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