Add recon drones and body burial; stabilize spectator camera

This commit is contained in:
2026-10-21 15:28:32 +02:00
parent f41d8ba2f9
commit ac285b5c97
80 changed files with 13545 additions and 126 deletions
+24 -1
View File
@@ -9,7 +9,7 @@ def adapt(s):
s=re.sub(r'ERR_ObserverViewSample (\w+)', r'ERR_ObserverViewSample* \1',s)
s=re.sub(r'(sample|start|end)\.', r'\1->',s)
return re.sub(r'(m_Samples\[\d+\])\.',r'\1->',s)
rules='\n'.join(adapt(body(p,k)) for k in ['static bool Sample(', 'static bool Fresh('])
rules='\n'.join(adapt(body(p,k)) for k in ['static bool Sample(', 'static bool Fresh(', 'static bool Origin(', 'static bool WorldSample(', 'static vector WorldPosition('])
methods='\n'.join(adapt(body(p,k)) for k in ['void Clear(', 'void Push(', 'bool Read(', 'float Playback(', 'void Align('])
baseline=ROOT/'docs/evidence/observer-smoothing-2026-10-09/baseline/addons/core/Scripts/Game/ERR/00_Core/ERR_ObserverPlayerView.c'
old_methods='\n'.join(adapt(body(baseline,k)) for k in ['void Clear(', 'void Push(', 'bool Read('])
@@ -75,6 +75,29 @@ int main(){
assert(!ERR_ObserverScope::Valid(22,{1,91,0}));
assert(!ERR_ObserverScope::Valid(22,{1,0,2}));
assert(!ERR_ObserverViewRules::Fresh(100,101));
// The buffer now stores complete world positions, including distant/negative maps.
assert(ERR_ObserverViewRules::WorldSample({15000,300,-16000},forward,up,60,.02));
assert(!ERR_ObserverViewRules::WorldSample({nan,0,0},forward,up,60,.02));
assert(!ERR_ObserverViewRules::WorldSample({0,std::numeric_limits<float>::infinity(),0},forward,up,60,.02));
Buffer world;
vector capturedRoot{15000,300,-16000},offset{.125,1.5,.25};
vector worldEye=ERR_ObserverViewRules::WorldPosition(capturedRoot,offset);
world.Push(1,100,100,worldEye,forward,up,60,.02,-1,{});
// Independently corrected proxy position cannot affect the buffered world pose.
for(int i=0;i<60;i++){
assert(world.Read(1,100+i,1.f/60,matrix,fov,nearPlane));
assert(close(matrix[3].x,15000.125)&&close(matrix[3].y,301.5)&&close(matrix[3].z,-15999.75));
}
// Walking advances sampled origins and offsets together on the same timeline.
world.Push(1,150,150,ERR_ObserverViewRules::WorldPosition({15002,300,-16000},offset),forward,up,60,.02,-1,{});
assert(world.Read(1,225,.016,matrix,fov,nearPlane)&&close(matrix[3].x,15001.125));
world.Push(1,160,160,{nan,0,0},forward,up,60,.02,-1,{});assert(world.m_Stamp==150);
// Expiry/reacquisition and target changes snap to the new full position.
assert(!world.Read(1,501,.016,matrix,fov,nearPlane));
world.Push(1,600,600,{-12000,50,9000},forward,up,60,.02,-1,{});
assert(world.Read(1,600,.016,matrix,fov,nearPlane)&&close(matrix[3].x,-12000));
world.Push(2,650,650,{24000,50,9000},forward,up,60,.02,-1,{});
assert(world.Read(2,650,.016,matrix,fov,nearPlane)&&close(matrix[3].x,24000));
// Real interpolation bodies, same constant-speed poses, uneven packet arrivals.
// Different client/server clock origins, dropped packets and varied render FPS.
for(float frame:{1000.f/30,1000.f/60,1000.f/144}){