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

КОМЕНТАРІ • 19

  • @crix_h3eadshotgg992
    @crix_h3eadshotgg992 Рік тому +10

    Here, have some motivation :D

  • @AlexHicks_Tutorials
    @AlexHicks_Tutorials Рік тому +4

    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. 👍

  • @manasjoshi2939
    @manasjoshi2939 9 місяців тому

    really great video! keep it up🙌

  • @stillww
    @stillww Рік тому +2

    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

  • @bricksnbuttons2000
    @bricksnbuttons2000 16 днів тому

    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??

  • @ashrasmun1
    @ashrasmun1 Рік тому

    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?

  • @m.hosseinmahmoodi
    @m.hosseinmahmoodi Рік тому +4

    Can you push this part's code to Git? Thanks!

  • @mr.treefrog8641
    @mr.treefrog8641 Рік тому

    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?

    • @DylanFalconer
      @DylanFalconer  Рік тому

      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.

    • @theunbearables
      @theunbearables 9 днів тому

      Can you publish your rust version?

  • @sphinxturner3520
    @sphinxturner3520 Рік тому

    Which ide are you using?

    • @DylanFalconer
      @DylanFalconer  Рік тому +2

      Neovim, with a few plugins - most notably Telescope, nvim-cmp, and the clangd language server

    • @sphinxturner3520
      @sphinxturner3520 Рік тому

      Thank you

  • @nobodyinparticular968
    @nobodyinparticular968 Рік тому

    beautiful, now consider rotated ellipses 😈

  • @ameera999
    @ameera999 26 днів тому

    please convert that to javascript