Comments (1)
For the most part I only support behaviour that is supported in Rust itself. Rust will not let you multiple a f32 or i32 by a bool.
1.0_f32 * true // compile error
1.0_f32 * f32::from(true) // ok
What it does support is a from conversion from bool to float or bool to integer.
1.0_f32 * f32::from(true) // ok
glam also has from impls for creating a Vec3 or IVec3 from a BVec3 or BVec3A, so while what you are proposing won't work the following will
Vec3A::from(BVec3A) * Vec3A, Vec3::from(BVec3) * Vec3, IVec3::from(BVec3) * IVec3, I16Vec3::from(BVec3) * I16Vec3
Possibly .into()
will work in these cases as well if the compiler can work out what type conversion you are after.
As for supporting arithmetic operations on vector masks for other vector types, I don't intend to add that for the reasons given above, that is rust itself doesn't support it.
from glam-rs.
Related Issues (20)
- Needs to reach version 1 HOT 5
- `Mat4::inverse()` has different result with SSE and scalar version HOT 5
- Feature request: Support for the `float_eq` crate
- Supporting simpler BVecN operations HOT 1
- Usage of `mul_add` HOT 1
- impl `Div<f32>`/`Div<f64>` for [`D`]`MatX`
- Feature request: add `towards` for vectors HOT 1
- Implement missing `From<Quat>` for matrices (get basis from quaternion) HOT 3
- From array for boolean vectors HOT 1
- Threshold for `is_normalized` seems wrong HOT 3
- Add `with_x `, `with_y`, to vector types HOT 1
- Add matrix transpose multiplication
- Vec2::fract() with negative numbers is inconsistent with f32::fract() HOT 5
- Quat::to_euler outputs bigger than PI * 2 at certain angles HOT 13
- Possible Incompleteness HOT 1
- Quat::from_euler truncates rotations to a single rotation HOT 2
- Quat / Euler tests fail on Apple Silicon HOT 11
- IVec2 and similar types should be Ord. HOT 1
- Extend `.normalize()` etc. to work for more values HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glam-rs.