I finally got the complex merging done.
Before, when an orbital was going too fast, one frame it was at the back of another orbital, and the next frame, it was in front of it. Since its velocity was so high, the radii didn’t ever collide, so it just went through other ones without merging. That was really not acceptable, so I worked a lot on making sure it works.
How I did it is actually very interesting:
- Get the starting position of the moving object and its ending position on the next frame.
- Get the coordinates of the target object you want to check for a potential merge.
- Draw a line from where the moving object started to where it ended, and check if the target object is intersecting that line (calculating what percentage along that line the checked object sits).
- If it intersects, you merge them.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.