@@ -67,6 +67,8 @@ let sunShaftOverride = -1;
6767let ssgiOverride = - 1 ;
6868let ssrOverride = - 1 ;
6969let vsmMotionPath = false ;
70+ let motionYaw = 0.0 ;
71+ let motionFrames = 0 ;
7072let shadowsAlwaysFresh = false ;
7173for ( let i = 1 ; i < argv . length ; i = i + 1 ) {
7274 if ( argv [ i ] === "--capture" && i + 2 < argv . length ) {
@@ -109,6 +111,12 @@ for (let i = 1; i < argv.length; i = i + 1) {
109111 if ( argv [ i ] === "--vsm-motion-path" ) {
110112 vsmMotionPath = true ;
111113 }
114+ if ( argv [ i ] === "--motion-yaw" && i + 1 < argv . length ) {
115+ motionYaw = parseFloat ( argv [ i + 1 ] ) ;
116+ }
117+ if ( argv [ i ] === "--motion-frames" && i + 1 < argv . length ) {
118+ motionFrames = Math . max ( 0 , Math . floor ( parseFloat ( argv [ i + 1 ] ) ) ) ;
119+ }
112120 if ( argv [ i ] === "--shadows-always-fresh" ) {
113121 shadowsAlwaysFresh = true ;
114122 }
@@ -207,15 +215,25 @@ while (!windowShouldClose()) {
207215 // Bistro camera on frame 240 for a matched static/transition comparison.
208216 let renderCamX = camX ;
209217 let renderCamZ = camZ ;
218+ let renderYaw = camYaw ;
210219 if ( vsmMotionPath ) {
211220 fixtureFrame = fixtureFrame + 1 ;
212- const pathStep = Math . floor ( fixtureFrame / 30 ) % 2 ;
221+ // With --motion-frames, interpolate once from the launch pose to the
222+ // endpoint so the fixture crosses the same refit/cache boundaries as
223+ // interactive walking. The default keeps the established 30-frame
224+ // square wave used by the original translation-only oracle.
225+ const pathStep = motionFrames > 0
226+ ? Math . min ( fixtureFrame / motionFrames , 1.0 )
227+ : Math . floor ( fixtureFrame / 30 ) % 2 ;
213228 renderCamX = camX + pathStep * 3.748170285 ;
214229 renderCamZ = camZ + pathStep * 4.685212856 ;
230+ renderYaw = camYaw + pathStep * motionYaw ;
215231 }
216- const lookX = renderCamX + Math . cos ( camPitch ) * fwdX * 100 ;
232+ const renderFwdX = - Math . sin ( renderYaw ) ;
233+ const renderFwdZ = - Math . cos ( renderYaw ) ;
234+ const lookX = renderCamX + Math . cos ( camPitch ) * renderFwdX * 100 ;
217235 const lookY = camY + Math . sin ( camPitch ) * 100 ;
218- const lookZ = renderCamZ + Math . cos ( camPitch ) * fwdZ * 100 ;
236+ const lookZ = renderCamZ + Math . cos ( camPitch ) * renderFwdZ * 100 ;
219237
220238 beginDrawing ( ) ;
221239
0 commit comments