na

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

15 unstable releases (7 breaking)

new 0.18.1 Apr 15, 2019
0.17.0 Feb 21, 2019
0.16.6 Nov 13, 2018
0.16.0 Jul 22, 2018
0.13.0 Aug 16, 2017

#36 in Math

Download history 1/week @ 2018-12-31 18/week @ 2019-01-07 19/week @ 2019-01-14 2/week @ 2019-01-21 14/week @ 2019-01-28 13/week @ 2019-02-04 8/week @ 2019-02-11 18/week @ 2019-02-18 21/week @ 2019-02-25 14/week @ 2019-03-04 14/week @ 2019-03-11 18/week @ 2019-03-18 56/week @ 2019-03-25 31/week @ 2019-04-01 4/week @ 2019-04-08

80 downloads per month

BSD-3-Clause

51KB
1K SLoC

na

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:

  • Fast versions of multiplication of matrices (including matrices with vectors) that can be used by calling:
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()
....
  • Macros to easily create vectors:
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:

    • BaseNum (Integers and reals)
    • BaseInt
    • BaseFloat
    • NumVec (Vector of any number type)
    • FloatVec
    • NumPnt
    • FloatPnt

Dependencies

~3MB
~54K SLoC