🚧 Warning: Experimental Crate! 🚧
This crate is currently in beta and experimental. It is subject to breaking changes in future releases. Use it at your own risk, and keep in mind that the API may change in future versions.
HexGa Math
Check the documentation to find some examples in the doc.
A Math library that contains :
N Dimension stuff
This crate define N dimensionnal math stuff (2d, 3d, 4d, ... nd) like vector/point of any type (float, int, uint, or even user defined):
Useful type like
use *;
assert_eq!;
assert_eq!;
Generic Casting trait
The crate also provide generic traits for casting with the same behavior as the as keyword :
use *;
assert_eq!;
assert_eq!;
let vec_f32 = new;
let vec_f64 = new;
let vec_f32_to_f64 = cast_into_composite;
assert_eq!;
Generic Remapping trait
Similar traits for casting remapping the range of an primitive to another primitive range also exist :
use *;
assert_eq!;
assert_eq!;
assert_eq!;
Quick start with the prelude
There are some quick typedef in the prelude :
int,uintandfloat: The default primitive precision used in the typedef. (can be change with the feature flags)Point2,Point3,Point4for Vector ofint,Vec2,Vec3,Vec4for Vector offloat,Rect2,Rect3,Rect4for Rectangle offloat,Rect2P,Rect3P,Rect4Pfor Rectangle ofint(Pfor point),Mat2,Mat3,Mat4for Matrix offloat, andMat2P,Mat3P,Mat4Puseint,Grid2,Grid3,Grid3can only be indexed byPointby default.
More advanced type
If you need more control about the precision, each type have another more generic base type:
Gridtype uses aPointfor the indexing precision, but that can be changed by using with theGridBasetype.AngleandTimeuse afloatprecision that can be changed usingAngleOfandTimeOf
Main Hexga crate
Check hexga : https://crates.io/crates/hexga if you are interested in a quick start, it regroup multiple hexga crates.