qvek 0.1.0

convenient GLSL-style casts for vek
Documentation
  • Coverage
  • 10.64%
    5 out of 47 items documented2 out of 11 items with examples
  • Size
  • Source code size: 44.4 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.9 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 47s Average build duration of successful builds.
  • all releases: 47s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • platonvin/qvek
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • platonvin

Rust License: MIT

qvek

Convenient vector creation macros for the vek crate.

qvek simplifies the construction of vek vectors by allowing you to combine scalars and smaller vectors directly in macros, with automatic type conversions. It is syntax sugar library with zero runtime overhead

To enable potentially unsafe conversions (e.g. f32 into i8), enable feature unsafe_conversions

use qvek::*;
use vek::*;

// Create a Vec2<f32> from i16 and u8 and combine it with i8 to create Vec3<f64>:
let a = dvec3!(vec2!(1i16, 2 as u8), 3i8);
assert_eq!(a, Vec3::<f64>::new(1.0, 2.0, 3.0));

// Create a Vec2<i32> from two integers:
let b = ivec2!(1, 2);
assert_eq!(b, Vec2::<i32>::new(1, 2));

// Create a Vec4<f64>:
let c = dvec4!(vec3!(1, 2.0, 3 as i8), 4 as f64);
assert_eq!(c, Vec4::<f64>::new(1.0, 2.0, 3.0, 4.0));

License

This project is licensed under the MIT license. See LICENSE for details.