1
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: fix edge crossing

+11 -20
+5 -6
physics_engine.vhd
··· 301 301 c_top := py - SIZE11; 302 302 c_bot := py + SIZE11; 303 303 304 - -- Swept horizontal overlap: union of prev and new extents along motion axis 304 + -- Swept overlap: edge-crossing checks (prev and new extents straddle the face) 305 305 if vx(9) = '0' then 306 - x_overlap := (c_right >= OBS_L(obs_i)) and (c_prev_left <= OBS_R(obs_i)); 306 + x_overlap := (c_right >= OBS_L(obs_i)) and (c_prev_right <= OBS_L(obs_i)); 307 307 else 308 - x_overlap := (c_prev_right >= OBS_L(obs_i)) and (c_left <= OBS_R(obs_i)); 308 + x_overlap := (c_left <= OBS_R(obs_i)) and (c_prev_left >= OBS_R(obs_i)); 309 309 end if; 310 310 311 - -- Swept vertical overlap 312 311 if vy(9) = '0' then 313 - y_overlap := (c_bot >= OBS_T(obs_i)) and (c_prev_top <= OBS_B(obs_i)); 312 + y_overlap := (c_bot >= OBS_T(obs_i)) and (c_prev_bot <= OBS_T(obs_i)); 314 313 else 315 - y_overlap := (c_prev_bot >= OBS_T(obs_i)) and (c_top <= OBS_B(obs_i)); 314 + y_overlap := (c_top <= OBS_B(obs_i)) and (c_prev_top >= OBS_B(obs_i)); 316 315 end if; 317 316 318 317 if x_overlap and y_overlap then
+2 -10
renderer.vhd
··· 26 26 char_height : in std_logic_vector(9 downto 0); 27 27 cam_x : in std_logic_vector(10 downto 0); 28 28 cam_y : in std_logic_vector(10 downto 0); 29 - vel_x_in : in std_logic_vector(9 downto 0); 30 - vel_y_in : in std_logic_vector(9 downto 0); 31 29 trail_on_in : in std_logic; 32 30 red : out std_logic; 33 31 green : out std_logic; ··· 48 46 signal wr : std_logic_vector(10 downto 0); 49 47 50 48 signal char_on, ground_on, wall_on, ceiling_on, obs_on : std_logic; 51 - signal arrow_on : std_logic := '0'; -- disabled 52 49 53 50 begin 54 51 ··· 90 87 91 88 end process render; 92 89 93 - -- Velocity vector arrow disabled — arrow_on held '0' by signal initializer 94 - 95 90 -- ---------------------------------------------------------------- 96 91 -- Color output with priority 97 92 -- ---------------------------------------------------------------- 98 - color : process(char_on, ground_on, wall_on, ceiling_on, 99 - obs_on, arrow_on, trail_on_in) 93 + color : process(char_on, ground_on, wall_on, ceiling_on, obs_on, trail_on_in) 100 94 begin 101 - if arrow_on = '1' then 102 - red <= '1'; green <= '1'; blue <= '1'; -- White 103 - elsif char_on = '1' then 95 + if char_on = '1' then 104 96 red <= '1'; green <= '0'; blue <= '0'; -- Red 105 97 elsif obs_on = '1' then 106 98 red <= '1'; green <= '1'; blue <= '0'; -- Yellow
+4 -4
visualizer.py
··· 249 249 c_top = py - SIZE; c_bot = py + SIZE 250 250 251 251 if to_signed(vx) >= 0: 252 - x_overlap = c_right >= ol and prev_left <= orr 252 + x_overlap = c_right >= ol and prev_right <= ol 253 253 else: 254 - x_overlap = prev_right >= ol and c_left <= orr 254 + x_overlap = c_left <= orr and prev_left >= orr 255 255 if to_signed(vy) >= 0: 256 - y_overlap = c_bot >= ot and prev_top <= ob 256 + y_overlap = c_bot >= ot and prev_bot <= ot 257 257 else: 258 - y_overlap = prev_bot >= ot and c_top <= ob 258 + y_overlap = c_top <= ob and prev_top >= ob 259 259 260 260 if x_overlap and y_overlap: 261 261 if prev_bot <= ot: