Re:Show HN: 3D Raycasting Engine in JavaScript
by ahuth on Tuesday March 31, 2020 @03:33PM
(#22741531)
Definitely a misuse of React! And for whatever reason, naming is always an issue for me. Need a better name than "utils" for sure.
One thing that surprised me about this is how fast the browser renders 320 absolutely positioned divs that are constantly updating.
But then I thought about it some more, and realized that many websites these days probably have way more DOM and DOM manipulation than that going on!
Re:Show HN: 3D Raycasting Engine in JavaScript
by adamredwoods on Tuesday March 31, 2020 @09:57PM
(#22744861)
I applaud the misuse of React!
We've seen a lot of raycasters, so one made with React and hooks isn't a bad thing.
Interesting code of using useRef with your state, and then useEffect to update it every render. A simple/better Redux?
Though my "negative nancy" comment would be that this is the wrong tool for the job (or at least, it could use a little renaming?) because after jumping from Scene to App to useCastRays hook... I finally found all the actual logic in "utils": which I'm always suspicious of ;)
Anyhoo - really cool, I'd like to see how the 2D sprites are integrated!