Crates.io | na |
lib.rs | na |
version | 0.32.2 |
source | src |
created_at | 2017-08-01 10:52:12.70031 |
updated_at | 2023-07-18 13:53:12.459955 |
description | na is a wrapper around nalgebra to make it easier and mostly less verbose to work with the most used types in vector math for graphics. |
homepage | http://github.com/arturoc/na |
repository | http://github.com/arturoc/na |
max_upload_size | |
id | 25967 |
size | 49,895 |
na is a wrapper around nalgebra to make it easier and mostly less verbose to work with the most used types in vector math for graphics.
na shortens the most common types Vector*, Point*, Quaternion... to Vec*, Pnt*, Quat... and defaults the generic parameters to f32 so you can write:
struct Pos(Vec3);
It also inlcudes some other functionalities not yet present in nalgebra:
let m4: Mat4 = ...;
let v4: Vec4 = ...;
let v4_2 = m4.fast_mul(&v4);
Fast versions of inversion for matrices
GLSL style swizzles:
let xy = v3.xy()
let xz = v3.xz()
....
let one = vec3!(1.); //sets all components to 1
let composed = vec3!(v2, z); // creates a Vector3 from a Vector2 and a float
...
Easy to use traits for the most common types: