Crate vecmate

Crate vecmate 

Source
Expand description

GitHub last commit crates.io docs.rs License

§Lightweight, zero-dependency, type-agnostic library for vector math.

let mut position = consts::f32::ZERO;
let target = vec2(10.0, 5.0);
let speed = 2.0;

let direction = (target - position).normalize();
position += direction * speed;

println!("Moving towards {target}");
println!("New position: {position}");

Modules§

vec2
Module for working with two-dimensional vectors

Traits§

Float
Trait that specifies that the root of a number can be calculated
Number
Trait that defines that the type is a number