Thank you for the kind words. The only way I can continue to make more videos is if more students find out about pikuma. Every help in spreading the word helps. 🙂👍
I bought his course on 2d physics and it is the best online course i have ever taken, he goes deep into advanced physics, all the other stuff i have read online is incorrect and incomplete, buy his course and you won't regret it.
@@pikuma nice, I just finished watching your verlet integration video. I have a question - I am implementing a 2d physics engine and I want to support multiple constraints like springs, to enable exotic features like soft bodies. Does your course go over topics such as a system of constraints, verlet integration etc? If it does, I'll buy it right now
Hello, thank you for the good explaination. I have one question and that is that the final resolve does not seem to take into account HOW MUCH overlap there was between the objects. The calculation result seems to be the same no matter if they barely touch or one object penetrates deep into the other. Can this be ignored and if so why? I would normally imagine that you would want to make sure that at the end of a discrete time simulation step the two objects are not colliding anymore and have their final velocity for the next simulation tick to then move away from each other.
Great stuff! I would have one question though. Isn't it possible that you resolve a collision, then move your objects in one time step, and they are still in contact after that? Since the game runs in discrete time steps and you need to get an overlap to detect the collision. That could cause you to resolve the same collision twice which would be nonsense I suppose.
That is a great question! You see, you are absolutely correct. In this video I focused on the "detection" part of the collision, and not on the "resolution." To resolve the collision we have many different techniques; some engines perform a position correction to first offset the bodies away from each other so they don't collide anymore, and we also have engines that apply 'impulses' to both bodies to simulate a proper collision resolution. These techniques have pros and cons. Just changing the position of two colliding bodies might be okay when we only have two bodies, but what happens when we have multiple bodies touching each other (fixing one collision and offsetting the bodies might cause other collisions with other neighboring bodies). You see, it's a tricky game. What most engines do is to work with "constraints", and solve both position and velocity constraints of the system. The engines either solve a huge system of equations to account for all the bodies, or solve one collision at a time but iterate to get closer to the best solution each pass of the iteration. I'm sorry, your question might look simple but it's the core of super complex discussions in game engines. There are many methods that engines use to solve that. As always, if you're interested to really dig deeper, check out my 2D physics course at pikuma.com. :)
@@pikuma Thanks for a great answer! I realise that it is a complex topic for sure. One idea that I had was that you could add condition to collision detection that the bodies need to be moving towards each other along the normal vector. So after you resolve the collision the first time, the bodies start moving away from each other so the next step you wouldn't detect any collision even if the overlap still exists. But I haven't thought it through entirely, it could have some issues.
Absolutely. All the forces of your system will result in an acceleration, which will change their velocities, which will then change their position. Collision check happens after the pisition was updated and the resolution proceeds from there.
No. Acceleration happens when there are forces being applied to an object. Applying an impulse, in our simplified version of things, is basically just an instantaneous change in velocity.
При столкновении объектов не происходит тангенциального вращения т.к. это нарушает закон сохранения энергии. Механика, стр. 162, Сивухин Д.В., 2005 When objects collide, tangential rotation does not occur because this violates the law of conservation of energy. Mechanics, p. 162, Sivukhin D.V., 2005
This is probably connected to the type of integration you're using for the simulation of movement. Can you kindly check my video on Verlet integration please? There, I mention some different integrations that instead of gaining energy end up losing energy over time (but a lot slower).
@@pikumaok I have shifted to verlet integration but the problem very much remains, when I put project the bodies directly at one another along the X or Y axis or 45 degrees with respect to the one another the program runs as expected but when subjected to more unusual angles extra momentum is seen among the bodies
@@prometheusli101 True! Dart is a great language, I believe Bob Nystrom works in the Dart team. Meanwhile, I'll try to keep things as language-agnostic as possible. All the best.
This video is missing a huge component: how to calculate the collision normal n. For spheres, I think this is the difference vector between the two centers of the spheres at time of collision.
No, I'll still post videos here every once in a while. But since TH-cam is not a great platform for structured learning, I'm mosrly focused on other content.
I'm unable to contact you on the messenger ;( I promise I won't inconvenience you, again. I may be tiresome to you at this point, I apologize for this state. I wish to learn C++ game engine and physics engine development more than anything else right now, and I think my request justifies by the unfair conversion rate considering our economical value, trust me most of the people are impoverished here due to the bajillion population count and other platforms offering things at reduced cost after conversion. Sir, please let me know what you consider.
I’m taking your course on 2d physics, it is just fascinating, makes me love coding and math more and more. Would love to see more of this content.
Thank you for the kind words. The only way I can continue to make more videos is if more students find out about pikuma.
Every help in spreading the word helps. 🙂👍
this is the best game physiscs video i have ever seen.
I bought his course on 2d physics and it is the best online course i have ever taken, he goes deep into advanced physics, all the other stuff i have read online is incorrect and incomplete, buy his course and you won't regret it.
Thank you for the kibd words, Vicenzo! It also helps that the topic is extremely fun. 🙂
Hello Gustavo!, are you italian too ??? cannot wait to see your next 3d physics engien programming
I'm from Brazil. 🙂
Akita brought me here! So nice to discover your content.
Grande Akita. Ajudando os canais menores. 😄 Abração e obrigado pelo follow.
Aha! Eu tinha certeza que vc é brasileiro pelo sotaque! Cheguei aqui aleatoriamente pq comecei a brincar de fazer jogo esse ano
Great content really, you should use some audio software to clear out the walkie sound
Thank you. I'll eventually learn how to do this video thing. 🙂
I'll look into it. Let me know if you have any suggestions of software that does that.
Absolutely great video, great explanations!
Very nice,
I wonder if you also made a video about collision resolution that involves angular momentum
Absolutely! 🙂 It's all included in the lectures.
🔗pikuma.com/courses/game-physics-engine-programming
@@pikuma nice, I just finished watching your verlet integration video.
I have a question -
I am implementing a 2d physics engine and I want to support multiple constraints like springs, to enable exotic features like soft bodies. Does your course go over topics such as a system of constraints, verlet integration etc?
If it does, I'll buy it right now
Hello, thank you for the good explaination. I have one question and that is that the final resolve does not seem to take into account HOW MUCH overlap there was between the objects. The calculation result seems to be the same no matter if they barely touch or one object penetrates deep into the other. Can this be ignored and if so why? I would normally imagine that you would want to make sure that at the end of a discrete time simulation step the two objects are not colliding anymore and have their final velocity for the next simulation tick to then move away from each other.
Muy bueno, me compre el de Raycasting Programming with C 👌
Great stuff! I would have one question though. Isn't it possible that you resolve a collision, then move your objects in one time step, and they are still in contact after that? Since the game runs in discrete time steps and you need to get an overlap to detect the collision. That could cause you to resolve the same collision twice which would be nonsense I suppose.
That is a great question! You see, you are absolutely correct. In this video I focused on the "detection" part of the collision, and not on the "resolution." To resolve the collision we have many different techniques; some engines perform a position correction to first offset the bodies away from each other so they don't collide anymore, and we also have engines that apply 'impulses' to both bodies to simulate a proper collision resolution.
These techniques have pros and cons. Just changing the position of two colliding bodies might be okay when we only have two bodies, but what happens when we have multiple bodies touching each other (fixing one collision and offsetting the bodies might cause other collisions with other neighboring bodies). You see, it's a tricky game.
What most engines do is to work with "constraints", and solve both position and velocity constraints of the system. The engines either solve a huge system of equations to account for all the bodies, or solve one collision at a time but iterate to get closer to the best solution each pass of the iteration.
I'm sorry, your question might look simple but it's the core of super complex discussions in game engines. There are many methods that engines use to solve that.
As always, if you're interested to really dig deeper, check out my 2D physics course at pikuma.com. :)
@@pikuma Thanks for a great answer! I realise that it is a complex topic for sure. One idea that I had was that you could add condition to collision detection that the bodies need to be moving towards each other along the normal vector. So after you resolve the collision the first time, the bodies start moving away from each other so the next step you wouldn't detect any collision even if the overlap still exists. But I haven't thought it through entirely, it could have some issues.
Really great content! Thank you!
You went so far back to the relative velocity explanation. It took a bit long cuz if this but still is nice
I know. Just need to make sure we don't leave anyone behind. 🙂
Excelent Gustavo...
Gracias Jose! All the best. 🙂
Do you have a lesson like this for polygons / with rotations?
Sure. I go over 2D polygon collision detection and resolution in the course (2D convex polygos).
if the objects in my scene are subject to acceleration will the method still work?
Absolutely. All the forces of your system will result in an acceleration, which will change their velocities, which will then change their position. Collision check happens after the pisition was updated and the resolution proceeds from there.
So the parallel component of the relative velocity is not affected, if i am right?
any new video? I love your video
How do you know which object (A or B) gets the +J and which one gets the -J?
Actually I am thinking now that it doesn't matter, because if A and B labels are swapped, the sign of the relative velocity also swaps
@@Test-iv4pm Correct. The magbitude of the impulse should be the same, just flipped.
does apply impulse change acceleration too?
No. Acceleration happens when there are forces being applied to an object. Applying an impulse, in our simplified version of things, is basically just an instantaneous change in velocity.
При столкновении объектов не происходит тангенциального вращения т.к. это нарушает закон сохранения энергии. Механика, стр. 162, Сивухин Д.В., 2005
When objects collide, tangential rotation does not occur because this violates the law of conservation of energy. Mechanics, p. 162, Sivukhin D.V., 2005
Столкновение между абсолютно упругими там расписывается, а не как в физ движке
for some reason in my implementation of this code causes the objects to get energy out of nowhere over time, do you have a solution to this
This is probably connected to the type of integration you're using for the simulation of movement. Can you kindly check my video on Verlet integration please? There, I mention some different integrations that instead of gaining energy end up losing energy over time (but a lot slower).
@@pikumaok I have shifted to verlet integration but the problem very much remains, when I put project the bodies directly at one another along the X or Y axis or 45 degrees with respect to the one another the program runs as expected but when subjected to more unusual angles extra momentum is seen among the bodies
If anyone wants the snippet of code that I used, feel free to ask here in the comments. :)
i dont use C++,just learn concept in this channel
@@prometheusli101 That's a good approach. :) This should be valuable regardless of the language you use. What's your language of choice?
@@pikuma dart, seems nobody teach this by using dart,so i can only choose this approach
@@prometheusli101 True! Dart is a great language, I believe Bob Nystrom works in the Dart team. Meanwhile, I'll try to keep things as language-agnostic as possible. All the best.
@@pikuma you needn't change any thing,good enough already,thanks for your work
This video is missing a huge component: how to calculate the collision normal n. For spheres, I think this is the difference vector between the two centers of the spheres at time of collision.
This is part of collision detection and collision information, which is shape-dependent.
@pikuma But for the spheres example in this video, it's what I said above correct?
@@GoatsOnAParachute Yes. Spheres are easy to detect and find the collision info. 🙂👍
Did you stop YT?
No, I'll still post videos here every once in a while. But since TH-cam is not a great platform for structured learning, I'm mosrly focused on other content.
@@pikuma other content ? Your website ?
@@thomasamathew4058 Well, yes. But my lectures for the university as well. 😬
@@pikuma oh okay. I checked out your course and it is everything I wanted..I'll buy it soon.
I'm unable to contact you on the messenger ;(
I promise I won't inconvenience you, again.
I may be tiresome to you at this point, I apologize for this state. I wish to learn C++ game engine and physics engine development more than anything else right now, and I think my request justifies by the unfair conversion rate considering our economical value, trust me most of the people are impoverished here due to the bajillion population count and other platforms offering things at reduced cost after conversion. Sir, please let me know what you consider.