Which got me to thinking about the issue of scale with objects since 32,000 at 1 meter per unit works out to a measly 32km.
Am I wrong in this thinking?
Is the way to handle this to apply physics to only 32km away from the player in any direction but scale things differently for graphics (eg. 1 unit = 2 meters or some such)?
Or just hang it all and scale even the physics differently (eg. 1 unit in physics and gui = 1 km)?
So I’ve broken my “space” down into cubes that load depending on where the player is. So like if you’re in say zone 1, 1, 1 then zones 0,0,0 through 2,2,2 are loaded as a cube around the player. I haven’t settled on a zone size yet (I was think about 1000 so each zone is a cubic km.
I had already jumped at the issue of what I want to do is far FAR too large anyways so took inspiration from @normen 's infinite zoom class and just load stuff in nearby zones instead of all thing all the time.
My understanding of the physics engine is albeit a bit limited but I was thinking to handle physics in the same way that I handled loaded space. In chunks chunks. But in this case the area that the physics would play in covers a 3 by 3 by 3 collection of zones instead.
The reason I wanted to know the limits and should I be scaling is just so I don’t make plans that are intrinsically ridiculous.
Through the experimentation I’ve gone through so far I don’t see a way to “reset” physics locations to a certain location. So if your physics object has moved say 20km you go “Ok you. Get back to 0,0,0” and just continue the physics simulation. I’ve been able to make my graphics object stay at 0,0,0 but the physics objects move invisibly behind the scenes.
Yep. And if the size of each cube was 2n the local translation would be x << bits and vice versa. The bits represent the amount of bits it takes to represent your grid size. I.e 4 bits for 16. 5 bits for 32 (2n!). Cheap and convenient.
So. If you told me your grid size was 16 and it was the 5th box along, i could do xCoord = 5 << 4; or if you said your x coord was 2232 i could say cellNo = x >> 4;