Writing a Basic PHYSICS ENGINE (Part 1) | C++ Engine Devlog #11

Поделиться
HTML-код
  • Опубликовано: 6 окт 2024

Комментарии • 3

  • @satibel
    @satibel 2 месяца назад +4

    You kinda want to convert-ish to a physics struct regardless because AVX2 is basically a 2x speed increase including the time it takes to convert naively.
    If you do square collisions (what your AABB is) you can store a packed left and a packed right compare and do collision in a single quad less than instruction.
    (If you can support avx 512, that's an extra 2x speed, though you basically need 2 engines/2 versions of quite a few functions if you wanna keep speed as there's still quite a few processors without avx512)
    Also you may want to have grid segmentation so objects that definitely won't collide won't do collision checks, if you have a lot of collisions that's a good speed increase.
    density field based collision is also a great way to speed up physics on huge amounts of similar objects, basically the objects on the inside the field don't have true physics and are just placed, only the outside of the field interacts (something that can speed up stuff like the physics2d planet if you make each planet have collisions with other planets. Basically imagine instead of individual planets, the group of planets behaves as a fluid with vectors going from high density to low density areas moving the objects, to that you can also add force vectors.
    Imo a good example of that is the rats in a plague tale.

  • @emomaxd2462
    @emomaxd2462 2 месяца назад +1

    you kinda idk your last videos are exactly about what i am currently thinking to make as project loool like you read my mind

  • @JayGames-n5t
    @JayGames-n5t 2 месяца назад

    ❤❤❤