Adding Vector3 for all the [f32; 3]#88
Conversation
This should resolve AryanpurTech#71 as all of the function that set a position taks `impl Into<Position3D>` as input and you can trivially cast a Position3D to a nalgebra_glm::Vec3 with `.into()` when needed
The Position3D already got replaced by a more general purposes Vector3. A lot of implementation got done so the Vector3 supports all of the basic operations: + - * / & += -= *= /= and also you can do all the base matrix operations on them.
Also modified the ./primitive_shapes codes to use directly Vector3 & Vector2 directly instead of casting arrays to their respectives Vector.
|
Examples don't work if you use |
All of the *most used* functions are implemented for both Vector3 & Vector2. Examples have been updated, tho it makes the import of blue_engine in `Cargo.toml` be a path instead of a version. Cube has been fixed, there might need more test to ensure everything is working correctly
|
|
||
| /// The uint type used for indices and more | ||
| #[cfg(feature = "u16")] | ||
| pub type UnsignedIntType = u16; |
Check failure
Code scanning / clippy
the name `UnsignedIntType` is defined multiple times
| #[cfg(feature = "u16")] | ||
| pub type UnsignedIntType = u16; | ||
| #[cfg(feature = "u32")] | ||
| pub type UnsignedIntType = u32; |
Check failure
Code scanning / clippy
the name `UnsignedIntType` is defined multiple times
ElhamAryanpur
left a comment
There was a problem hiding this comment.
Absolutely the most amazing commit of this project
There was a problem hiding this comment.
doesn't this auto cast?
There was a problem hiding this comment.
Most statically typed language doesn't allow implicit casting as the end users wouldn't be able to know the cost of that casting. By making it explicit, the compiler can be sure that the user actively want to pay that cost. So no, sadly no auto cast. Tho [f32; 3].into() works fine, I just changed it so it is a better example for other users
This should resolve #71 as all the function that set a position takes
impl Into<Position3D>as input, and you can trivially cast aPosition3Dto a nalgebra_glm::Vec3 with.into()when needed.Tho, all the examples have to be updated accordingly in the next update