{"id":51468420,"url":"https://github.com/trentsterling/spatialhash","last_synced_at":"2026-07-06T14:01:06.483Z","repository":{"id":338418361,"uuid":"1157816923","full_name":"TrentSterling/spatialhash","owner":"TrentSterling","description":"🚀 High-performance, generic Spatial Hash for Unity. Architected for O(1) performance, zero allocations, and data-oriented simplicity. Includes multi-part masterclass tutorial.","archived":false,"fork":false,"pushed_at":"2026-02-14T12:42:50.000Z","size":207,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-14T19:39:18.003Z","etag":null,"topics":["aoi","csharp","gamedev","high-performance","masterclass","netcode","optimization","spatial-hash","spatial-partitioning","unity"],"latest_commit_sha":null,"homepage":"http://tront.xyz/spatialhash/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TrentSterling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-14T10:47:00.000Z","updated_at":"2026-02-14T13:04:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/TrentSterling/spatialhash","commit_stats":null,"previous_names":["trentsterling/spatialhash"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/TrentSterling/spatialhash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrentSterling%2Fspatialhash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrentSterling%2Fspatialhash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrentSterling%2Fspatialhash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrentSterling%2Fspatialhash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TrentSterling","download_url":"https://codeload.github.com/TrentSterling/spatialhash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrentSterling%2Fspatialhash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35193679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aoi","csharp","gamedev","high-performance","masterclass","netcode","optimization","spatial-hash","spatial-partitioning","unity"],"created_at":"2026-07-06T14:01:05.533Z","updated_at":"2026-07-06T14:01:06.445Z","avatar_url":"https://github.com/TrentSterling.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚡ SpatialHash Masterclass\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Live Tutorial](https://img.shields.io/badge/Live-Tutorial-blue.svg)](http://tront.xyz/spatialhash/)\n[![Unity 2021.3+](https://img.shields.io/badge/Unity-2021.3%2B-blue.svg)](#)\n\nA high-performance, generic **Spatial Hash** for Unity. Architected for O(1) performance, zero allocations, and data-oriented simplicity.\n\n## 🚀 Live Masterclass \u0026 Interactive Demos\nExplore the 5-part technical deep-dive, interactive visualizers, and the **Pixel Pickup** stress-test arena at:\n**[http://tront.xyz/spatialhash/](http://tront.xyz/spatialhash/)**\n\n---\n\n## 📦 The Toolkit\n\nThis repository contains a production-ready spatial partitioning suite:\n\n### 1. [SpatialHash.cs](spatialhash/SpatialHash.cs) (Core API)\nThe generic, non-allocating 3D hash engine. \n- **Generic**: Works with any component or class.\n- **Bucket Pooling**: Zero-allocation internal memory recycling.\n- **Query Types**: High-speed Sphere and AABB checks.\n\n### 2. [NetworkAOI.cs](spatialhash/NetworkAOIManager.cs) (Networking)\nPlug-and-play Interest Management for **PurrNet**, FishNet, and Mirror.\n- Sync only what matters to each player.\n- Save 90% of your network bandwidth.\n\n### 3. [RoomManager.cs](spatialhash/RoomManager.cs) (World State)\nPortal-based visibility and room synchronization logic (Inspired by **CellGen**).\n\n### 4. [Samples Gallery](spatialhash/Examples/)\nComplete implementations for:\n- **CollisionBroadphase**: 10x faster trigger systems.\n- **PathfindingLookup**: Fast nearest-node search.\n- **WorldStreamer**: Dynamic level/chunk loading.\n- **FrustumCulling**: Broad-phase visibility filtering.\n\n---\n\n## 🛠️ Quick Start\n\n```csharp\nusing SpatialHash;\n\n// 1. Initialize (Cell size should be ~2x your query radius)\nvar hash = new SpatialHash\u003cTransform\u003e(cellSize: 10f);\n\n// 2. Register/Update (O(1))\nhash.Update(myEntity, myEntity.position);\n\n// 3. Query (Zero-Allocation)\nList\u003cTransform\u003e results = new List\u003cTransform\u003e();\nhash.QueryRadius(playerPosition, 20f, results);\n```\n\n---\n\n## 📜 License\nMIT - Created for the community by **Trent Sterling**. \nCome say hi on [Discord](https://discord.gg/0hyoWZyM6y7kkFCN)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrentsterling%2Fspatialhash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrentsterling%2Fspatialhash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrentsterling%2Fspatialhash/lists"}