algebrix 0.1.0

Vectors, matrices, quaternions, and geometry for game engines; column vectors, optional SIMD.
Documentation
  • Coverage
  • 58.25%
    406 out of 697 items documented32 out of 546 items with examples
  • Size
  • Source code size: 269.82 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 20.99 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • SkuldNorniern

Algebrix

Math for game engines: vectors, matrices, quaternions, and geometry. Uses SIMD on x86_64 and aarch64 when the simd feature is on; otherwise scalar. Originally split out from a larger codebase and kept as a separate crate.

What's in it

  • Vectors: Vec2, Vec3, Vec4 (float); IVec2/3/4, UVec2/3/4, BVec2/3/4; DVec3 for double. Swizzles supported. Float vectors also have normalize_fast() and length_fast() (rsqrt-based) when you care more about speed than precision.
  • Matrices: Mat2, Mat3, Mat4, and DMat4 for double 4x4.
  • Quaternions: Quat and DQuat for rotations.
  • Transforms: Affine2 and Affine3 for combined rotation, scale, and translation.
  • Geometry: Plane, Ray, Aabb2, Aabb3, Frustum for culling and raycasting.
  • Angles: Rad, Deg, and EulerRot for type-safe radians/degrees.

Usage

use algebrix::{Vec3, Mat4, Quat, Rad, Deg};

let v = Vec3::new(1.0, 2.0, 3.0);
let normalized = v.normalize();
let angle = Rad::from(Deg::new(90.0));

Feature flags

  • std – standard library (default).
  • simd – SIMD on; backend chosen from target (default).
  • simd-x86 – force x86_64 (SSE/AVX).
  • simd-arm – force ARM (NEON).
  • scalar-math – no SIMD.
  • glam-compatibilityFrom/Into between algebrix and glam for Vec2/Vec3/Vec4, Mat2/Mat3/Mat4, Quat.
  • nalgebra-compatibilityFrom/Into between algebrix and nalgebra for Vector2/3/4, Matrix2/3/4, Quaternion.

Default features: ["std", "simd"]. Use default-features = false and opt in to what you need if you want a smaller dependency set or a specific SIMD backend.