You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Floating-origin: rebase cloth/vehicle/navmesh/terrain-streamer + 50 km² scale validation (#429 follow-up) #613
Follow-up to the floating-origin / origin-rebasing first slice shipped in #612 (part of umbrella #429).
The first slice (Scene::RebaseOrigin / JoltScene::ShiftOrigin, opt-in WorldOriginSettings, default off) shifts root entity transforms, Jolt rigid bodies + static terrain + character controllers, and Box2D bodies back toward the origin when the primary camera travels far, keeping stored f32 coordinates small. It composes with the already-shipped camera-relative rendering.
Deferred from the first slice
Subsystems that hold world-space state outside the rebased set and so desync on a rebase (each documented as a limitation in JoltScene::ShiftOrigin):
Cloth soft-bodies — JPH soft-body particle clouds are not shifted (SetPosition semantics for soft bodies are unclear; a wrong shift is worse than none).
Vehicle / constraint anchors to a fixed world point — two-body constraints stay consistent (both endpoints translate together), but a constraint anchored to an absolute world point would not.
NavMesh — baked in world space; agents would path in a shifted frame against an unshifted mesh. Needs the navmesh + crowd query frame to rebase too.
TerrainStreamer per-tile WorldOrigin (TerrainTile.h) — set but not applied at render; the natural place to fold the rebase offset in.
Scale validation (the umbrella's acceptance bar)
End-to-end 50 km² traversal: no jitter/shadow-swim, physics stable across many rebases, streaming interoperates. The first slice proves the mechanism at a smaller distance (45 km visual evidence + Functional physics); this is the full-scale sign-off.
Auto-trigger tuning under real traversal (thresholds, rebase frequency, cost of a rebase over N thousand entities).
Notes
WorldOriginSettings.Enabled defaults off (opt-in per scene), so none of the above affects existing scenes today.
Landed in PR #663 (feature/floating-origin-rebase-613). Per-item evidence:
Cloth — JoltScene::ShiftOrigin shifts each soft body's COM (SetPosition, particles are COM-relative), and Scene::RebaseOrigin shifts the absolute m_ClothRuntime CPU render cache. Guard: WorldOriginRebaseClothTest.ClothVerticesShiftRigidlyWithRebase.
Vehicle / constraint anchors — new JoltScene::ShiftWorldAnchoredConstraints: NotifyShapeChanged(sFixedToWorld, -delta) shifts single-body-to-world anchors exactly in place (preserving rest state/motors/warm-start); pulleys are rebuilt from their shifted authored pivots. The defer-the-whole-rebase fallback was removed. Vehicles need nothing (the VehicleConstraint holds no absolute anchor; the chassis is a regular body already shifted). Guards: WorldOriginRebaseWorldJointTest, WorldOriginRebasePulleyTest.
NavMesh — Scene::RebaseNavigation regenerates the mesh at the shifted bounds (Detour has no in-place translate — m_orig is private and drives every spatial query), shifting bounds/off-mesh-links/agent-targets and rebuilding the query + crowd via a shared BakeNavMesh(). Guard: WorldOriginRebaseNavTest.AgentContinuesToTargetAcrossRebase.
TerrainStreamer per-tile WorldOrigin — folded into the per-tile draw (entityTransform × translate(WorldOrigin)) at every draw/shadow site and the non-tess cull frustum; made entity-relative via an entity-local camera feed so it's rebase-free. This also fixes the pre-existing streamed-tile stacking bug. Single-tile terrain is byte-identical (verified rendering correctly in the editor).
50 km² traversal — WorldOriginRebaseVisualEvidenceTest at 50 km + a multi-rebase traversal: no visible pop (RMSE before/after 1.635, worst consecutive 1.545, both < 5.0). WorldOriginRebaseTraversalTest fires ~10 rebases across a 10 km flight and asserts absolute-trajectory continuity.
Auto-trigger tuning / rebase cost — WorldOriginRebaseBenchmark: 68.7 ms @ 10k, 308 ms @ 50k entities (Debug/unoptimized); rebase frequency validated by the traversal test (~1 rebase / grid cell at threshold 1024).
17/17 tests pass (incl. the GL visual-evidence tests, which render rather than skip). Design notes captured in docs/agent-rules/floating-origin-rebase-subsystems.md.
Closing — the checklist is complete. Umbrella #429 closed alongside.
Activity
coderabbitai commentedon Jul 10, 2026
🔗 Related PRs
#468 - feat(physics): wire Jolt HeightFieldShape into terrain collision (
#428) [merged]#562 - Perf/DOD: flat depth-sorted hierarchy world-matrix propagation pass [merged]
#587 - Camera-relative rendering + absolute-world pattern shaders (
#429) [merged]#601 - feat(renderer2d): camera-relative CPU-bake coordinate shift for 2D sprites (
#429) [merged]#612 - feat(scene): floating-origin / origin-rebasing (
#429) [merged]#663 - Floating-origin: rebase cloth/constraints/navmesh/terrain-streamer + 50 km² scale validation (
#613) [open]🧪 Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
fix(review): missing-safe pulley entity lookup + MD018 doc reflow (#613)
drsnuggles8 commentedon Jul 18, 2026
Landed in PR #663 (
feature/floating-origin-rebase-613). Per-item evidence:JoltScene::ShiftOriginshifts each soft body's COM (SetPosition, particles are COM-relative), andScene::RebaseOriginshifts the absolutem_ClothRuntimeCPU render cache. Guard:WorldOriginRebaseClothTest.ClothVerticesShiftRigidlyWithRebase.JoltScene::ShiftWorldAnchoredConstraints:NotifyShapeChanged(sFixedToWorld, -delta)shifts single-body-to-world anchors exactly in place (preserving rest state/motors/warm-start); pulleys are rebuilt from their shifted authored pivots. The defer-the-whole-rebase fallback was removed. Vehicles need nothing (theVehicleConstraintholds no absolute anchor; the chassis is a regular body already shifted). Guards:WorldOriginRebaseWorldJointTest,WorldOriginRebasePulleyTest.Scene::RebaseNavigationregenerates the mesh at the shifted bounds (Detour has no in-place translate —m_origis private and drives every spatial query), shifting bounds/off-mesh-links/agent-targets and rebuilding the query + crowd via a sharedBakeNavMesh(). Guard:WorldOriginRebaseNavTest.AgentContinuesToTargetAcrossRebase.WorldOrigin— folded into the per-tile draw (entityTransform × translate(WorldOrigin)) at every draw/shadow site and the non-tess cull frustum; made entity-relative via an entity-local camera feed so it's rebase-free. This also fixes the pre-existing streamed-tile stacking bug. Single-tile terrain is byte-identical (verified rendering correctly in the editor).WorldOriginRebaseVisualEvidenceTestat 50 km + a multi-rebase traversal: no visible pop (RMSE before/after 1.635, worst consecutive 1.545, both < 5.0).WorldOriginRebaseTraversalTestfires ~10 rebases across a 10 km flight and asserts absolute-trajectory continuity.WorldOriginRebaseBenchmark: 68.7 ms @ 10k, 308 ms @ 50k entities (Debug/unoptimized); rebase frequency validated by the traversal test (~1 rebase / grid cell at threshold 1024).17/17 tests pass (incl. the GL visual-evidence tests, which render rather than skip). Design notes captured in
docs/agent-rules/floating-origin-rebase-subsystems.md.Closing — the checklist is complete. Umbrella #429 closed alongside.
fix(ci): exclude vendored recast from UBSan signed-overflow (#613)
docs(ci): reference upstream recast overflow issue/PR in the UBSan ex…
Merge pull request #663 from drsnuggles8/feature/floating-origin-reba…
ci(tsan): suppress Jolt's assert-build mutex-bookkeeping race (vendor…