@smokng_mirror: Yup, it’s a solar sail. Congratulations, thread title unlocked.
Yes, I could have gone with a simplified approach such as using a single raycast per sail area. Or I could have just gone with the simple formulae on wikipedia that just deal with sail area and angle with respect to the sun. But then you’re locked to providing metadata about the vehicle, rather than just it’s shape. Considering that rasterizers are very very fast at extracting projections of geometry, to me it made sense to use it to do the heavy lifting.
Even if I have to go down to an 8x8 texture (which you can do in BGE), that’s the equivalent of 64 raycasts. Admittedly, more of those would be wasted than if I specifically placed raycast locations, but by the time you’re at even 32x32 texture, you’re doing 1024 raycasts with far less processor load than the equivalent raycasting (there’s a reason game engines aren’t raytracers). And if you need to process the results of those raycasts it’s always going to take time regardless of raycasts vs rasterization. There isn’t too much math involved (a vector projection and a cross product), but from working with trails, I know that the mathutils module struggles to do more than a couple hundred operations per frame - and the math is simple enough for me to implement in plain C. I was aware when I started that the bandwidth requirements would be high, and decided I needed the challenge.
Actually, this BGMC is just an excuse to implement this simulator. I’ve been wanting to play around with solar sail design for a while - and anything that would provide experimental control should do a little more simulation than a game would.
So anyway, force calculation is done (vector projection). Now I need to calculate the applied torque from the sail (cross product).
You’re going to be flying that umbrella and the challenge is simply going to be to get to various locations (eg change orbits, exit a lagrange point, earth/moon transit, etc). I think that will be quite hard enough - particularly if I decide to do it in 3d…