Simulating Physics in my C++ Engine

https://www.youtube.com/watc...
To try everything Brilliant has to offer—free—for a full 30 days, visit https://brilliant.org/Zyger/ . You’ll also get 20% off an annual premium subscription In this video I will be simulating physics in my C++ engine. I have been working on a graphics engine for the last month or so. Today I finally decided to take a little break from adding further graphics into the project and opted to try and simulate physics instead. So in this video I will start by creating a rigidbody class to give my entities physics component such as gravity, drag, friction, velocity, acceleration and forces. I will also be creating a custom collider class that is capable of creating a collider for any given entity. Beyond this I will create a collision resolution class that will handle what happens when a collision occurs such as bouncing, pushing and pulling etc. Previous Video: https://youtu.be/-3qMMHBsUJ8 ➤My Links: Discord: https://discord.gg/tYDXGja55Y Instagram: https://www.instagram.com/gabzxd/ Twitch: https://www.twitch.tv/officialzyger Twitter: https://twitter.com/ZygerDesigns Patreon: https://www.patreon.com/Zyger ➤Music: funky jammings - Mothense | offbeat game composer! Night - Tomodachi Life Balatro OST - Main Theme Bozz - William Benckert A Lil BIT - Rocket Jr ➤Ignore: I made a custom physics simulation system in my C++ engine, starting with a Rigidbody class that handles mass, velocity, acceleration, gravity, drag, and applied forces. I implemented AABB-based Collider components for simple but efficient collision detection. To resolve collisions, I created a CollisionResolver that applies impulses for bounce (restitution), friction, and positional correction to prevent overlap. Forces like gravity and user input are accumulated and integrated each frame for realistic motion, while drag and friction help simulate real-world behavior. The system supports both dynamic and kinematic bodies, allowing for flexible and responsive 2D physics interactions. #coding #physics #cplusplus #c #zyger #gameengine
Home
/
Indie Game Developers
/
Zyger
/
Simulating Physics in my C++ Engine