Building a Physics Engine with C++ and Simulating Machines

preview_player
Показать описание
I talk about the basics of physics engine design and the theory behind rigid body constraint solvers. Here are all the resources you'll need to build a physics engine that is similar to the one I show in the video:

Source code of my physics engine:

Euler method for solving differential equations:

Runge-Kutta method for solving differential equations:

Physically Based Modeling: Principles and Practice

Source code of my real-time video encoder:

Source code of my game engine:

#physics #simulation #programming

Check out my GitHub profile!

Join my Discord!

Follow me on Instagram!

If you like my work and would like to support me, consider donating!

Thanks for watching!
Рекомендации по теме
Комментарии
Автор

No sleeping here, there is a huge lack of technical content on youtube at this level, these videos are killer. Keep it up. Would love to see the deep-dive on your fluid sims for your engine project.

theDemongd
Автор

"i wrote this advanced physics simulator"
"oh and then i ran into some problems with making the video"
"thus i quickly built my own screen capturing software which works better than this giant open source program that's been around since 2012"

okay

itskittyme
Автор

"OBS was making me nuts, so I made my own screen recorder" this guy is a legend haha

JubaProductionsStudios
Автор

Useful or pointless video? You tell me :D Thanks for watching 💪

AngeTheGreat
Автор

Your videos should seriously get more attention then they do. Awesome work!

lukewellcash
Автор

I've studied physics for 2 years and computer science for another 3 years. I'm already thought of doing something like that, but it's very impressive to see how well you've done it. There are so many layers of complexity to what you're showing

thierrybeaulieu
Автор

This is incredible. Constraint solving is stuff you do early on in an engineering degree but I never cared for it because I was always into the more computational stuff. Seeing you come at this from the computational side first has given me a whole new perspective.

Cathal
Автор

Awesome stuff! Highly recommend you look into iterative techniques (Gauss-Seidel, or more complex Conjugate Gradient). They are probably in fact easier to implement than the Gaussian Elimination, and you can terminate iterative approaches when the error is low enough. Convergence rates are almost always related to conditioning of the system being solved, which will depend on what combination of constraints you have in your simulation. Note that isn't worse than the elimination case: poor conditioning also causes numerical instability in that algorithm as well.

jojodi
Автор

A note on implementation: your RK solver is very tightly coupled with the design of the system you're integrating. Usually it's best to try to decouple the integrator from the system itself and implement it more generically. For ordinary ODE's you just need a function that calculates a vector of derivatives from a vector of coordinates, and that's all your integrator needs.

And your physics engine can _index_ into those arrays to access coordinates of any given rigid body.

Alexander_Sannikov
Автор

You're my new favorite YouTube content creator. WOW! This level of knowledge and expertise is something I rarely see on YouTube. KEEP UP THE GOOD WORK!!! <3

Ahsan_Fazal
Автор

Just discovered your channel, and i see a lot of advanced, neat projects that really sparks my interest. This physics engine is very cool ! Im impressed to see that you make all that in C++, it genuinely makes me want to make similar stuff on a low level. That's really inspiring (even the nerdy mathematical details ! Along with the sources in the descriptions, those are the crunchy bit for me). Keeps up the awesome work !

basile
Автор

Interesting to see someone reviving the (at least my) experience of writing a physics engine. It was really a brain crushing journey for me to do this in the 90' with less accuracy, much less computing power, my very immature knowledge of math, let alone internet resources on this topic. But I have strong memories indeed from my eureka moment after real-time simulating a cloth, and a few weeks later seeing the same idea rendered on a Silicon Graphics cluster on a computer fair in Brussels.

IONYVDFC
Автор

All this goes far over my head but it's so impressive to see someone make things like this and to share it online, even creating a screenrecorder in the meantime. Crazy!

opti
Автор

YouTube algorithm please! Your content is an absolute gold mine of well explained experience in technical topics!

davidmc
Автор

You got a new subscriber. I arrived to your channel by a reddit post with a link to your engine simulation video, and I guess now I'm binge watching all your videos. Amazing work man.

grevel
Автор

every vid you make is just such a joy to watch, from the content to the editing it's just sublime. sincerely, good job.

actuallydaneel
Автор

These simulations look awesome! Can't wait to hear about the project you're making this for.

Skeffles
Автор

One of the most underrated channels on youtube. Subscribed immediately with notifications on. Best wishes.

physicist
Автор

Holy hell this is one of the greatest videos I have seen, especially for your sub count. These are better than my uni degree!

tampo
Автор

I can’t believe how you just glossed over some of the incredible work you did just to make this, easy sub man you’re killing it

TheGiantHog
join shbcf.ru