64bit integer vectors?
64bit integer vectors?
Did anyone ever try to use 64bit integer vectors with irrlicht? I tryto simulate a solar system, and 32bit integers don't cut it. floats/doubles are too unprecise...
32 bit integers gives you a range of 4294967296 numbers.
i think this should be more than enough to describe a world of any size. you merely need to plan your scale.
instead of letting a space ship's world coordinates be 200x300x100 or something, make it 2x3x1. similarly, scale down everything else, and you'll have plenty of room in your 4294967296 for a whole solar system.
if you want more than a solar system, merely consider chopping your space into sectors, each with a range of 4294967296x4294967296x4294967296.
if something is at 5000000000, merely change it to sector A02 at 705032704
then when drawing, take the current center of camera as the 'origin' and shift everything into a sector's range from that origin. so, if your camera was on the border between A00 and A02, the point A00 250000000 would be passed to the renderer as -250000000 and the point A02 705032704 would be passed as 705032704.
otherwise, if you dont want to deal with drawing from multiple sectors at the same time, you can simply say that one sector holds all of the interesting things in that area of space-- and to get to the next interesting sector, you'll have to "warp" to it. thus, you are bound within a sector, and "warping" will simply load a different sector-- but you will only ever be rendering one sector of space. if the player's ship goes too close to the edge, simply ingage autopilot to turn it around.
i think this should be more than enough to describe a world of any size. you merely need to plan your scale.
instead of letting a space ship's world coordinates be 200x300x100 or something, make it 2x3x1. similarly, scale down everything else, and you'll have plenty of room in your 4294967296 for a whole solar system.
if you want more than a solar system, merely consider chopping your space into sectors, each with a range of 4294967296x4294967296x4294967296.
if something is at 5000000000, merely change it to sector A02 at 705032704
then when drawing, take the current center of camera as the 'origin' and shift everything into a sector's range from that origin. so, if your camera was on the border between A00 and A02, the point A00 250000000 would be passed to the renderer as -250000000 and the point A02 705032704 would be passed as 705032704.
otherwise, if you dont want to deal with drawing from multiple sectors at the same time, you can simply say that one sector holds all of the interesting things in that area of space-- and to get to the next interesting sector, you'll have to "warp" to it. thus, you are bound within a sector, and "warping" will simply load a different sector-- but you will only ever be rendering one sector of space. if the player's ship goes too close to the edge, simply ingage autopilot to turn it around.
a screen cap is worth 0x100000 DWORDS
for reference: just saw that pluto is about 5 bilion km away from the sun, that means(if I'm right) a scale of +/- 2km per number ( (sun_dist*2)/4294967296)= +/- 2) in case youre not planning to land on anything, there sould be no problem. only your minimal speed would be something like 100km/sec to keep the flying smooth. but then it would take 994 days to fly acros the solar system in real time at 50fps