The script that I posted will allow it to.
Although, you have to pre-calculate the properties, and then apply them to the object.
Hmmm, it suppose it is possible to make a more BGE friendly script for this - but it would be a bit more cumbersome.
The script that I made relied on the bpy module, which very effectively exposes various properties of a mesh - for instance the area and orientation of a face. In the pby module, “face.area” gives the surface area of a specified polygon. In the BGE it is not so easy.
First we must go through a mesh proxy, then a poly proxy, then query whether the given face has 3 or 4 vertices. Once that is known we, store the x,y,z, coordinates for the individual vertices. Then we may calculate the area of the face directly, by means of a formula which I do not remember off the top of my head.
Then we access the vertex normals of the given face and average them to find the face normal. If I remember correctly, it is necessary to have the mesh in “shade flat” mode. Then finally we may partition the surface area directly, by multiplying it with the face normal, which in the end yields a cubic representation of an object no matter how complex.
… but it can be done xD
The downside to this method is that it grossly over-simplifies a model, the upside is that once the calculations are done the simulation is extremely fast.
But there are other more precise ways as well; one could for example evenly rayscan the entire object from a specific direction, then depending on the area of the faces hit, and their size - apply a force proportional to these factors, and have the object be pushed away.
Alas, but I’m getting way ahead of myself. I shall go find an old drawing, here:
Edit:
You’re welcome! Hmmm, this is true angular drag is difficult, perhaps because it cannot be adequately simplified? With linear drag, the forces are, well, linear - with angular drag, the forces are not aligned at all - hmmm, hmmm how can one simplify this mechanic?
This is interesting : D I’m looking forward to the update! I’ll try to create a BGE version of my script, that way your aerodynamics may become easier for people to implement, instead of adding so many variables for surface area, the script could start with an init section containing something like this:
if(x,y,z,-x,-y,-z not in own.getPropertyNames()):
calculateAreaVector()
This way, once the game starts the shape of the object will directly correlate with the area values : D
Attachments