Transfer planetary geometry into GameCult.Geometry

This commit is contained in:
Meta Vens 2026-07-22 03:47:57 +01:00
commit 756f5a3337
70 changed files with 4105 additions and 31 deletions

View file

@ -1,8 +1,8 @@
# GameCult.Geometry
`GameCult.Geometry` defines shared geometry values plus CultCache-native
documents for procedural geometry domains, LOD build requests, selected-cut
manifests, and mesh chunk artifacts.
`GameCult.Geometry` owns spatial values, planetary fields and topology,
residual-page residency, map projections and tiles, geometry queries, and the
CultCache-native documents that coordinate geometry production.
The package is deliberately substrate-shaped:
@ -20,8 +20,8 @@ The package is deliberately substrate-shaped:
The small value layer is for cross-runtime query contracts, physics probes,
native slices, and UI surfaces:
- `CultMath.float2` and `CultMath.float3`: whole-vector values for positions, velocities,
accelerations, and query inputs. SoA layouts may store them efficiently, but
- `CultMath.float2` and `CultMath.float3`: whole-vector values for positions,
velocities, accelerations, and query inputs. SoA layouts may store them efficiently, but
the semantic API does not force callers to split x/y/z into unrelated fields.
- `CultRect`: canonical XY viewport/query rectangle stored as min/max corners.
- `CultCircle`: 2D influence/query brush with rect intersection helpers.
@ -33,10 +33,10 @@ runtime equivalents instead of bespoke `{ minX, minY, maxX, maxY }` payloads.
## Runtime Path
`vg-csg` emits domain documents, selected-cut manifests, and chunk artifacts as
MessagePack CultCache documents. A Unity runtime, local worker, or remote
geometry process should receive the same records through CultMesh/CultNet and
read them back as `CultGeometry*` types.
Geometry workers emit domain documents, selected-cut manifests, and chunk
artifacts as MessagePack CultCache documents. A Unity runtime, local worker, or
remote geometry process receives the same records through CultMesh/CultNet and
reads them back as `CultGeometry*` types.
```csharp
using GameCult.Caching;
@ -66,18 +66,27 @@ using var chunks = node.Database
The record key is part of the contract. Rust and C# must compute the same key
for the same geometry record, so stable fingerprints use the Rust canonical
field order and invariant float text. If this drifts, the same chunk becomes two
field order and exact IEEE-754 component bits. If this drifts, the same chunk becomes two
different chunks depending on which runtime touched it first. That is not a
cache miss; that is split-brain geometry.
## Documents
- `CultMath.float2`, `CultMath.float3`, `CultRect`, `CultCircle`, `CultSphere`: shared value
primitives for query and view contracts.
- `CultMath.float2`, `CultMath.float3`, `CultRect`, `CultCircle`, and
`CultSphere`: shared value primitives for query and view contracts.
- `CultGeometryDomainDocument`: one hierarchical domain tree, suitable for
Ragnarok/Fensalir-style feature DSL output.
hierarchical feature DSL output.
- `CultGeometryBuildRequest`: one LOD/frustum/budget request for workers.
- `CultGeometrySelectedCutManifest`: the selected domain cut, deferred children,
fallback rows, and diagnostic contribution rows.
- `CultGeometryChunkArtifact`: render mesh, optional collider mesh, source
domain/claim identities, build counters, and transition clipping seed.
## Planetary geometry
The planetary field, cube-sphere topology, pages, residency, projections,
queries, and versioned `CMPT` map tiles are described in
[`docs/planetary.md`](docs/planetary.md). Shader consumers include
`Shaders/GameCult.Geometry.hlsl`; Unity consumers use the
`org.gamecult.geometry` package, and browser tile consumers use
`packages/gamecult-geometry-ts`.