Well you should probably be scaling your points down to a tiny scale, with a really tiny planet mesh. There's no reason you need to do the collision detection at a huge scale. Once you get your result, you can transform the result back into your big world scale.
Yeah, that's what I'm moving towards. For what I need this for (information readout, very rough raycasts, etc), I don't really need
any decimal places of precision, so it should be just fine.
(It also is already scaling the points down for display to the player rather than trying to render things 1:1, so I can just work with it at that scale)
In general, the double precision stuff is kept to a minimum - storing planet orbital parameters, positions, rotations, and velocities, as well as the player's viewing position. I know I could
probably get away with reworking everything to float, but this is just what I've found most agreeable for myself.
Yeah, that's a shame... I still appreciate the reference a lot, though. Thank you again
Anyways, if you ever find a solution I'd be curious what you come up with
I'll definitely post about it, either here or on the devlog thread I plan to make at some point!
My intuition says you may have to adjust your game design to use spheres instead of ellipses though
It was spheres at first, then I started working toward ellipsoidal planets for the extra variety and realism, since it's not something often depicted... and, well, we all make decisions we have to live with I guess
Edit:
Hmmmmm.
Hmmmmmmmmmmmmmmmmmm.
So, I think I'm independently arriving at a solution that was described elsewhere? In a weird way, of course.
Basically, I'm taking a mesh asset reference - in this case an icosphere exported from Blender - and copying its triangle and vertex list. I iterate through all the triangles and use each one's vertices to make a plane.
Then, I take the dot product of the normal of that plane and the direction from the triangle's center to the check position, and compare it with previous ones, eventually finding the largest, thus finding which triangle is aimed at the test position the best.
With that triangle, I use its plane to produce the closest point on said plane to the check position, and hey presto, I have my distance.
But...
It's weird. As you can see in the gif, the final closest point jumps around and is rarely confined to the triangle. At the same time, it
somehow doesn't seem to be affecting the result. The distance readout isn't really making any obvious jumps, even when I veeeery slowly nudge it along. Hell, maybe I can try graphing the value over time to visually check if that's the case.
It's so close to working. I can almost
lick it.
Edit 2: I honestly think it IS working. I made a slider thingy to serve as a visual indicator of what's going on, as well as mapping out the number, and watched the thing go at 1/100th timestep to spot any shenanigans but there were none to be found. The oddest thing is something I expected, the actual rate of change is a bit "pulsed" - just a side effect of it checking against a rotating plane.
It seems to be working, but it's bugging me. It's very unsettling that it's somehow not resulting in any error.