This is a general Unity related question, but not tied directly into any of the Gamedev.tv courses. It’s sortof a tangent off of Project Boost that I’m working on.
For this project, I need to simulate wind resistance based on the shape of an object. It doesn’t need to be accurate to realistic physics models, just evenly applied in the game so there’s a benefit to aerodynamic shapes vs cubes. I’m thinking of ways to approximate it via code. I know I can apply drag via rigidbody.drag. I’m just trying to determine how I should come up with what number to apply.
I don’t really need to calculate anything other than the object’s forward direction for what I’m doing, so maybe I somehow find a cross section that is exposed to the wind in that direction. (Not certain the best way to go about this. Maybe using information from a collider I provide to test it?)
Alternatively I could fire a whole bunch of rays at the front of the object from some fixed position ahead of it. Then if the distances before the rays hit something was close to the same, I could assume it was blocky, if the distances were far apart then assume it was slanted, and probably more aerodynamic?
I’m kinda leaning towards the ray solution unless anyone has a better idea. Thanks for any input you might have.
If there’s already an easy way to determine drag of an object built in to Unity somewhere, that would be great too.