mint-std140 0.1.1

Convert mint types to std140 types.
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented1 out of 3 items with examples
  • Size
  • Source code size: 8.52 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.41 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • chubei/mint-std140
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • chubei

This library contains a single trait [AsStd140] which is implemented for [mint] types that can be converted to [std140] types.

Examples

use mint_std140::AsStd140;

let mint_vector = mint::Vector2 { x: 0.0f32, y: 0.0f32 };
let std140_vector = mint_vector.as_std140();
assert_eq!(mint_vector.x, std140_vector[0]);
assert_eq!(mint_vector.y, std140_vector[1]);

let mint_matrix = mint::ColumnMatrix2 {
    x: mint::Vector2 { x: 0.0f32, y: 1.0f32 },
    y: mint::Vector2 { x: 2.0f32, y: 3.0f32 },
};
let std140_matrix = mint_matrix.as_std140();