2D Collision Response | C Game + Engine From Scratch 09
Вставка
- Опубліковано 7 сер 2022
- If you would like to know more, here are the sources I used in no particular order:
* noonat.github.io/intersect
* blog.hamaluik.ca/posts/simple...
* github.com/pgkelley4/line-seg...
* • Handmade Hero Day 050 ... - Handmade Hero 50
* tavianator.com/2011/ray_box.html
* tavianator.com/2015/ray_box_n...
* www.deengames.com/blog/2020/a...
* Real-Time Collision Detection by Christer Ericson
Code used in recording: github.com/Falconerd/engine-f...
Pixel art for this series is custom made by Presley Carvalho. Check out his website here: perigic.com/
Background pixel art for this series is Kings and Pigs by Pixel Frog. Check it out here: pixelfrog-assets.itch.io/king...
Music for this series is from Breezy's Mega Quest by RyanAvx. Check it out here: ryanavx.itch.io/breezys-mega-...
➤ Website: dylanfalconer.com
➤ GitHub: github.com/Falconerd
➤ Twitch: / falconerd
➤ Discord: / discord
Here, have some motivation :D
Thanks :)
Was doing this part this weekend on my engine, was nice to see we came around very closely to the same solution. I do like the exact step for when the collision time is equal and you solve the higher velocity axis first. 👍
Nice one!
really great video! keep it up🙌
2:38 C does have a sign function in the form of copysign(1, x) which compiles to just 2 instructions (andps with -0.0, orps with 1.0). In the case of x=0 it behaves differently than the method in the video (it returns 1 instead of 0) but that should be ok for the case in the video
Oh good to know, thanks!
If we're calling sweep_response and static_response `iterations` times per physics_update() and and physics_update() is called once per frame isn't the true tick rate fps * iterations??
2:58 would it be reasonable to get rid of the if-statement and write
hit.normal[(px < py)] = (px < py)((dx > 0) - (dx < 0)) + (px >= py)((dy > 0) - (dy < 0))
to make it branchless?
Can you push this part's code to Git? Thanks!
Yes I can, cheers for the reminder.
Are you sure you need stationary response? I remade this in Rust and I commented out my stationery response and I don’t have any issues with tunneling or glitchyness it’s as smooth as can be. Perhaps i am missing something or I am not hitting some edge case?
I have found that without the stationary response there is glitching through corners. Perhaps there's some difference in the way our code is running that prevents this? Keen to understand why.
Can you publish your rust version?
Which ide are you using?
Neovim, with a few plugins - most notably Telescope, nvim-cmp, and the clangd language server
Thank you
beautiful, now consider rotated ellipses 😈
please convert that to javascript