This repository has been archived on 2026-07-09. You can view files and clone it, but cannot push or open issues or pull requests.
agent-knowledge-base-archived/dialog-summaries/2026-06-07-kamaz-snow-tracks-persist.md
Herschel 4302183027 Update kamaz5360 snow docs — persistent deformation map, volume conservation
Replace OldVertices transfer description with the final persistent TMap solution.
Document plow ridge widening and AddDepth cap removal for snow volume conservation.
Update project status with commit hash and next test steps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 08:37:59 +03:00

2.6 KiB
Raw Permalink Blame History

2026-06-07 KAMAZ Snow Tracks Persistence Fix

Project: garage/kamaz5360 Machine: wuu (C:\git\kamaz5360) Scene: kamNiagraSnow

User Goal

  • Tracks on snow from vehicle Kleos and plow never disappear.
  • Plow can pile snow into a heap/snowdrift (сугроб).
  • Total snow volume in the scene does not decrease.

Root Cause Found

ASnowTiledSurfaceManager::UpdateProceduralSnowSurface was called with bForceRebuild=true whenever the vehicle moved more than SnowSurfaceHalfExtentCm * 0.65 (~32 m) from the surface origin. This reset all six vertex arrays from scratch, erasing all deformations.

Fix Applied

SnowTiledSurfaceManager.h — added

TMap<FIntPoint, float> PersistentSurfaceDepths;
TMap<FIntPoint, FColor> PersistentSurfaceColors;

FORCEINLINE FIntPoint WorldToSurfaceGridKey(float WorldX, float WorldY) const
{
    const float Spacing = FMath::Max(SnowSurfaceVertexSpacingCm, 1.0f);
    return FIntPoint(FMath::RoundToInt(WorldX / Spacing), FMath::RoundToInt(WorldY / Spacing));
}

SnowTiledSurfaceManager.cpp changes

  1. UpdateProceduralSnowSurface vertex loop — restores from map before pushing vertex:

    const FIntPoint PersistKey = WorldToSurfaceGridKey(WorldX, WorldY);
    if (const float* StoredDepth = PersistentSurfaceDepths.Find(PersistKey))
        LocalPosition.Z = LocalBasePosition.Z + *StoredDepth;
    
  2. All stamp functions (StampProceduralSnowSurface, StampProceduralSnowBox, plow cut, plow deposit) — write to map after modifying vertex:

    const FIntPoint PersistKey = WorldToSurfaceGridKey(WorldBase.X, WorldBase.Y);
    PersistentSurfaceDepths.Add(PersistKey, SnowSurfaceVertices[Index].Z - SnowSurfaceBaseVertices[Index].Z);
    PersistentSurfaceColors.Add(PersistKey, SnowSurfaceColors[Index]);
    
  3. ClearAllSnowTiles — empties both maps.

  4. Volume conservation — removed GlobalSnowDepthCm * 0.75f cap on plow deposit AddDepth; widened ridge zone (RidgeHalfY 55→90 cm, factor 2.5→3.5). Full removed volume is deposited.

Commit

garage/kamaz5360 master: 4b9ff68

  • problems/2026-06-07-kamaz-snow-tracks-disappear-on-surface-rebuild.md
  • projects/kamaz5360/status.md

About git.4min.pro Access

  • Forgejo instance at 192.168.170.41 (alias forgejo in SSH config).
  • SSH key: C:/Users/post/.ssh/id_ed25519_forgejo.
  • Agent can commit/push via SSH: forgejo:infra/agent-knowledge-base and forgejo:garage/kamaz5360.git.
  • API token stored only in local memory (C:\Users\post\.claude\projects\...\memory\reference_forgejo_access.md), never in git.