I'm about to create a terrain for a mobile game which allows a huge terrain which is mostly limited by the available hardisk space.
This requires to keep the floating points limited to a "after-point-precision" of 2 numbers. What is a good approach to keep it at the precision of 2 numbers after the point?
Remember: I'm running on a mobile device, so the method should be fast and easy to use and should be applicable to any arithmetic which is needed for games.
More information
I'm not talking about space( i know how much space a float takes guys, really ), i'm talking about the issue that i loose precision when my floating point is going to have to many numbers after the decimal point.
Using a int
would cause that i've to convert the int into a float each frame. I don't know how fast the conversion is but this seems to cost a lot of performance when doing it for a lot of objects. ( Remeber i'm on a mobile device ).
Of course i'm also not talking about the terrain, i'm talking about objects in the terrain! The terrain is a specialized system which actually can hold a terrain size which extends the limits of the floats a lot ( It's even possible to save north america in this system when you have enough disk space, but actually the limits are set to -99km to +99km ).
Edit 2
As usual in games the movement is timebased, means i need to multiply the speed of the object with a modifier given to me by unity, this corrupts my numbers which are limited to 2 numbers after the decimal point.