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

Methods to clamp vector length #101

Closed
wants to merge 2 commits into from

Conversation

CleanCut
Copy link
Contributor

@CleanCut CleanCut commented Nov 30, 2020

An implementation of clamp_length* methods for Vec2, Vec3, Vec3A, and Vec4.

This PR is based off of 0.11.0, but I can see that there is a pretty heavy refactor going on in the refactor branch to produce the Vec* implementations through macros. I'm willing to reimplement this PR off of refactor if that's helpful. (probably after it's in a stable state?)

Resolves #100

@bitshifter
Copy link
Owner

Hi! Yeah there is a big refactor going on. I might be working on that for some time. It's probably easier if I apply changes to that branch myself since it's still a work in progress.

src/f32/vec2.rs Outdated Show resolved Hide resolved
@bitshifter
Copy link
Owner

@CleanCut I've merged the big refactor back to master. If you want to update this PR, you can add the methods once to the impl_vecn_float_methods macro in src/vec.rs. Each test will have a macro for implementing float methods as well, e.g. impl_vec2_float_tests. These methods and tests will be added for for f32 types and f64 types.

CleanCut added a commit to CleanCut/glam-rs that referenced this pull request Jan 17, 2021
@CleanCut
Copy link
Contributor Author

Closing in favor of #121

@CleanCut CleanCut closed this Jan 17, 2021
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.

Would clamp methods be welcome?
2 participants