![]() ![]() Most of the time, debris are going to be nowhere near SoI boundaries, and you'll be able to reject it really early. The great thing about all of the above is that while the verification steps get progressively more complex, they also get progressively less common. If you found a potential intersect, the final step is an iterative algorithm that finds the exact time you've entered new SoI. First step is to break trajectories into segments, inflate the SoI a bit to correct for curvature, and see if there's an intersection there. For any SoI that are still feasible, we have to start doing real work. ![]() Feasibility of each AABB collision can be evaluated with just two SIMD instructions, but even if you have to do it with managed C# code, it's done in a few CPU cycles. Next, it's very easy to construct an AABB for each SoI you need to check. So if you're orbiting star, only check planets, and if you're orbiting a planet, only check moons. You don't need to consider very SoI in the game - just children of current SoI. While that can cost a few thousand cycles, it's going to be a rare occasion in practice.Įntering SoI is more interesting, but there are a lot of simplifications here too. If you are out, you need to do a bit of extra work to find the exact time you've left the previous SoI, and then simulate forward from there. You update the position for new frame, and simply check against SoI radius. Well, exiting SoI isn't really a problem. I also don't know exactly what KSP calculates, but I not only believe the orbits of the current time, but also in the future to calculate when, for example, one leaves / enters the sphere of influence of a planet / moon.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |