Answer the question
In order to leave comments, you need to log in
Approximate calculation of air resistance in the box2d engine
I hope there are people here who know how to do it.
What is given: There is a body, which is a convex polygon. It moves at some speed and possibly rotates around the center of mass. Air resistance and/or lift must be calculated.
The calculation is needed for the box2d physics engine.
I decided to do this: we divide the surface (perimeter) of the body into segments, for each we calculate the resistance force and apply it to the body using the box2d functions.
In theory, if the partition is made small enough, then the result should be adequate.
For each segment, I calculated the instantaneous speed of its first point and the normal.
It is clear that the force will be proportional to the speed of the point (or the square of the speed), the length of the segment, and the cosine of the angle between the normal and the speed.
Actually my question is how to determine the direction of force. If anyone has experienced something similar, please help. I will be grateful for any help
Answer the question
In order to leave comments, you need to log in
My instinct tells me that it is directed along the normal to the surface (in your case, a segment). But I'm not sure.
when you find a solution, write an article :)
it will be very interesting.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question