Crates.io | gfx-maths |
lib.rs | gfx-maths |
version | 0.2.9 |
source | src |
created_at | 2021-08-17 08:06:07.933927 |
updated_at | 2023-03-12 20:18:02.587944 |
description | Implementations for the most essential Graphics Math operations |
homepage | |
repository | https://github.com/rob2309/gfx-maths-rs |
max_upload_size | |
id | 438342 |
size | 55,392 |
This crate implements all the basic mathematical structures and operations that are needed for almost any graphical program, namely:
The usual operations are implemented via member functions and operator overloads. Operators should handle almost exactly as they would in GLSL, e.g.
use gfx_maths_rs::*;
let v = Vec3::new(5.0, 6.0, 7.0);
let s = 1.0 / v;
let t = Mat4::translate(Vec3::new(1.0, 0.0, 0.0)) * s;
Vectors are always treated as column vectors, which is why only Mat4 * Vec4 is implemented and not Vec4 * Mat4.