File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -608,10 +608,11 @@ function serializePerson(person) {
608608 const xvel = person . xVelocity || 0 ;
609609 const yvel = person . isDwelling ? 0 : ( person . speed * person . direction ) ;
610610
611- // Normalize positions to 0-1 range
611+ // Normalize positions to 0-1 range within floor plane
612612 // x = blue axis (Z in Three.js) = hallway length
613613 // y = red axis (X in Three.js) = hallway width
614- const xNormalized = Math . max ( 0 , Math . min ( 1 , ( person . z + hallway . length_m * 0.5 ) / hallway . length_m ) ) ;
614+ // Note: person.z ranges [0, length_m], person.xOffset ranges [-width_m/2, +width_m/2]
615+ const xNormalized = Math . max ( 0 , Math . min ( 1 , person . z / hallway . length_m ) ) ;
615616 const yNormalized = Math . max ( 0 , Math . min ( 1 , ( person . xOffset + hallway . width_m * 0.5 ) / hallway . width_m ) ) ;
616617
617618 return {
You can’t perform that action at this time.
0 commit comments