Releases: labelle-toolkit/zig-utils
Releases · labelle-toolkit/zig-utils
v0.6.1
v0.6.0
What's New
New Data Structures
- SparseSet - O(1) key-value mapping with cache-friendly iteration, ideal for ECS
- ZIndexBuckets - Ordered storage by z-index for render ordering
New Algorithms
- A Pathfinding* - Single-source shortest path with pluggable heuristics (Euclidean, Manhattan, Chebyshev, Octile)
- Floyd-Warshall - All-pairs shortest path algorithm
- FloydWarshallOptimized - SIMD-accelerated and multi-threaded parallel implementation (5-16x faster)
New Utilities
- Heuristics Module - Distance calculation functions for pathfinding
- Hook Dispatcher - Comptime event dispatch system
- ZON Coercion - Comptime struct/union coercion from .zon files
Improvements
- QuadTree - Refactored with comptime configuration
- Vector - Additional operations and integer position support
- Tests moved to dedicated
tests/folder using zspec
Breaking Changes
- Minimum Zig version updated to 0.15.2
- QuadTree now uses
QuadTree(T, config)signature
Full Changelog
v0.5.0
What's New
QuadTree Improvements
- Added
clear()method - clears all points while keeping the original boundary frominit() - Added
resize(boundary)method - clears all points and sets a new boundary - Fixed
init()to properly initialize boundary tracking fields
Full Changelog
v0.4.0
What's New
Breaking Changes
QuadTreeis now generic over ID type:QuadTree(T)instead of fixedu32QuadTreeusesEntityPoint(T)withPositionfield instead of separatex/ycoordinates- Removed
QuadTreeNodeexport (now internal type)
New Features
-
Sweep and Prune: O(n log n) broad-phase collision detection
SweepAndPrune(T)- generic over ID typefindCollisions()- find all overlapping AABB pairsqueryRect()andqueryRadius()- spatial queriesAABBandCollisionPairhelper types
-
QuadTree enhancements:
queryRadius(center, radius, buffer)- circular queriesremove(id)- remove entities by IDupdate(id, new_pos)- update entity positionshasPointInRect(range)- existence check without collecting resultsresetWithBoundaries(positions)- reset with auto-computed bounds
-
Rectangle improvements:
fromPosition(pos, w, h)- create from Positioncentered(pos, w, h)- create centered on Positioncenter()- get center Positionposition()- get top-left PositioncontainsPosition(pos)- Position-based containment
Improvements
- QuadTree uses flat array storage for better cache efficiency
- All spatial queries now use
Positiontype consistently - Both QuadTree and SweepAndPrune support generic ID types
- 45 tests covering all functionality
v0.3.0
What's New
Breaking Changes
- Renamed
Vector2toPositionfor clearer intent (#3)
New Features
- Added
PositionIstruct for integer pixel-perfect positioning - Added
mul,lengthSquared,distanceSquaredmethods toPositionI
Documentation
- Added README.md with usage examples and API reference
- Added claude.md for AI assistant context
Improvements
PositionI.fromPositionnow rounds instead of truncating
Backwards Compatibility
Vector2is still available as a deprecated alias forPosition
v0.2.0
What's New
QuadTree Spatial Partitioning
- Added
QuadTreedata structure for efficient 2D spatial queries - Added
Rectanglestruct withcontains()andintersects()methods - Added
QuadTreeNodestruct for entity storage - Operations:
insert,query,queryNearest,clear,count - Optimized
findNearestwith quadrant pruning
Testing Infrastructure
- Added zspec testing framework
- BDD-style test organization with nested structs
- 21 tests covering Vector2, Rectangle, and QuadTree
CI/CD
- Added GitHub Actions workflow for automated testing
- Runs on push/PR to main branch
Usage
const zig_utils = @import("zig_utils");
const QuadTree = zig_utils.QuadTree;
const Rectangle = zig_utils.Rectangle;
var qt = QuadTree.init(allocator, .{ .x = 0, .y = 0, .width = 100, .height = 100 });
defer qt.deinit();
try qt.insert(.{ .entity = 1, .x = 10, .y = 10 });
var result: std.ArrayListUnmanaged(zig_utils.QuadTreeNode) = .empty;
defer result.deinit(allocator);
try qt.query(.{ .x = 0, .y = 0, .width = 50, .height = 50 }, &result, allocator);v0.1.0
Initial Release
First release of zig-utils - standalone vector math utilities for Zig with no external dependencies.
Features
Vector2math utilities for 2D game development- Zero external dependencies
- Compatible with Zig 0.15.x
🤖 Generated with Claude Code