Thanks for the feedback
The "growing sphere" idea is exactly what I had in mind :
- save emitter position and speed at the time of emission, plus position of every planetary bodies
- at each timestep, check if the distance between emitter and receiver is less than speed of light multiplied by the time since emission
- the first time it is true :
- compute the ray between emitter position when sending and current receiver position. With the speed saved at emission, you can also compute the doppler effect if wanted
- for each planet, compute the distance between the ray and the "capsule" defined by the planet position at emission and reception times ; if it's less than 0 we had an occlusion. Since we're using a linear interpolation for the planet movement, it may be possible to reduce this to a point/line distance check with regard to the planet radius with a change of frame of reference
It's also possible to save the antenna position at emission time to compute the gain when we know the direction the ray is pointed to, same at reception side.
If we need sub-timestep precision, it requires solving for the exact time the receiver/radioemission sphere collide ; with a linear interpolation between the receiver position at the last timestep and the current one, it will probably lead to a quadratic equation, I haven't checked the math yet.
All of this relies on using linar interpolation for the movement between :
- emission and reception for the planets
- during the last timestep for the receiver
The second point may be problematic for low orbiting spacecrafts at high time acceleration
Edit:
Started to do some prototyping, first with the time delay estimation. I can get some good looking numbers but it's not that easy to make sure they are actually correct ; they're in the right ballpark from mercury to neptune.
The main issue is that with this model, if you have for exemple two vessels at rest with each other, the time delay between the two should be exactly their distance over c, but here it takes into account the movement in the global frame and it introduces an error in the estimated delay. Maybe some relativity tricks are in order here, but I'm not ready to touch that yet.
If I park two vessels on the moon 200 meters from each other, the estimated delay converted back to distance is in agreement with submeter accuracy from x1 to x1000 time acceleration. It jumps to several kilometers when using x100000 (@60Hz with VSync enabled). Should be good enough for most usecases. Next step is working on planetary occultations...