Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lil_math

A Zig math library for games and simulations.

Contents

  • VectorsVec2/3/4 (f32), Vec2d/3d/4d (f64), Vec2i/3i/4i (i32), Vec2u/3u/4u (u32)
  • MatricesMat2/3/4 (f32), Mat2d/3d/4d (f64)
  • RotorsRot2/3 (f32/f64); geometric-algebra representation of rotations
  • VersorsVersor2/3 (f32/f64); Pin group (rotations + reflections)
  • MirrorsMirror2/3 (f32/f64); affine reflection across a plane/line
  • Geometry — rays, segments, AABBs, circles/spheres
  • Directions — discrete compass/grid direction enums and bitmask sets
  • Interpolation — animated value types with pluggable easing
  • Transforms — TRS decomposition to Mat4
  • Fixed-pointFixedPoint(I, F) with common aliases (Q16_16, etc.)
  • Noise — Value, Perlin, Simplex, White, Blue noise with fBm and domain warping
  • Half-edge mesh — connectivity structure for manifold surfaces

Usage

Add to your build.zig.zon:

zig fetch --save git+https://github.com/lilydoar/lil-math#<commit>

In build.zig:

const lil_math = b.dependency("lil_math", .{});
exe.root_module.addImport("lil_math", lil_math.module("lil_math"));

Then import:

const math = @import("lil_math");
const v = math.Vec3.init(.{ 1, 2, 3 });

Requirements

Zig 0.16.0+

About

A Zig math library for games and simulations

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages