I have been trying to better understand how parts of the Unreal Physics system works so that I can more accurately implement them in my projects. I have lots of questions about them but for now I thought I would start with Damping.
I understand what damping is doing on basic level adding “Drag” to an objects linear motion, but I was trying to understand what math is used to create this drag. I am no programmer, so I did a bunch of googling and found that often people seem to use object Velocity * DampingAmount * Mass to get linear damping force. (Some people also talked about getting an objects cross section area that is facing in the direction of travel and air pressure and including this in the calculation)
Anyway to try to figure out what was used in the Linear Damping “Force” Calculation I created this basic setup…
Its a pretty simple setup, the blueprint cylinder on the left takes the objects velocity and multiply’s it by the linear damping value (I make this negative so the force is applied against the object) then add this result to the add force node. The other cylinder uses unreals linear damping setting in the physics properties. I set both Mass to 1KG to help remove the need to multiply by mass. When you run the simulation, gravity pulls both object to the ground and I see if they hit at the same time. Then change both linear damping values and run it again.
The results below…
As you can see the blueprint always hits the ground first (but obviously the difference is bigger as the value grows) I figured this might be to do with unreal doing a calculation based on object size to mimic surface area resistance. but I tried the tests again with different sized objects but the results were the same.
Basically, I am just trying to understand what is likely to be causing the difference? Is it something I am missing in the math? or is it something to do with the blueprint update tick?
I also did a similar setup for the angular damping…
Its much more difficult to test angular as “Spinning” motion is more difficult to tell if they are matching, but I found that the results where very similar between the blueprint and the “Standard” unreal physics.
One thing that was really odd was I had to tick Accel Change in the add torque node, if I did not the results would not match. I was under the impression that “Accel Change” ignores mass but since the mass is 1 I figured this would already be the case, making the “Accel Change” negligible.
Sorry for the very long post, I hope that its easy to follow. If anyone has time to explain how this works I would greatly appreciate it.