Vector3 using Doubles Instead of Floats

I’m trying to make a really detailed Solar System simulation. I want vaguely realistic distances between planets but at the same time I want to able to reliably do maths for distances as small as 1km. I’ve already done a bunch of work on scaling things down and shortening distances but floats just don’t give me enough precision to get the distances I want whilst have the same fine control.

Is there a way to use Doubles instead of Floats?

There’s no way to use doubles in Vector3. You can make your own Vector3-like struct that uses doubles, but you won’t be able to use it for Transform.position. Generally the way you handle this isn’t by using doubles anyway, but by doings things like using two coordinate systems, one “global” and one “local”, so you can have precision with close objects using local coords.

There are a couple of tricks which seem to be necessary with floats:

Floating Origin

…and logarithmic depth buffers

It’s not perfect as Sean O’Neil says.

A better approach may be to use Floating Origin together with scaled-subspaces as per this article!?s=7717bd0c73f8b60f31bec52012314ed4