munum
is a minimalistic numerical library for high-performance 3D math. This is a pure Rust no_std compatible port of the JavaScript / AssemblyScript version of munum: https://github.com/andykswong/munum
[dependencies]
munum = "0.1.0"
Features:
std
- enabled by default.libm
- can be used instead ofstd
to enable trigonometry related functions inno_std
environmentserde
- enableserde
serialize/deserialize implementations
See Docs.rs: https://docs.rs/munum
Sample usage to build a perspective camera view-projection matrix:
use core::f32::{consts::PI, INFINITY};
use munum::{transform, vec3};
let eye = vec3(0_f32, 2., 0.);
let target = vec3(0., 0.6, 0.);
let up = vec3(0., 0., -1.);
let view = transform::look_at(eye, target, up);
let proj = transform::perspective(2., PI/2., 1., INFINITY);
let view_proj = proj * view;
This repository and the code inside it is licensed under the MIT License. Read LICENSE for more information.