nalgebra_glm's Functions Don't Account for Unsigned Integer Types.
- Dominant language
- Rust
- Stars
- 4.8k
- Forks
- 565
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I am using `nalgebra_glm` for my ray tracing project.
In my code, I define generic wrapper types (for example: `TBounds3` defined by two `TVec3`s)
I realize that many functions in `nalgebra_glm` are bounded by the `Number` trait, which is bounded by `Signed`. Therefore, I cannot use `nalgebra_glm`'s built-in functions on unsigned types.
The code below does not compile:
```rust
let v = UVec2::new(2, 2);
let v2 = UVec2::new(1, 4);
nalgebra_glm::min2(&v, &v2);
```
Despite making complete sense in this case.
I think a possible solution is to replace the `Signed` trait bound with `Num` in the `Number` trait definition and add a `Signed` bound where necessary. (sign and abs functions)
I can start a PR process if you are interested.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.