Depends on how big your region is.
Should be something like:
Code:
regionCoordinate = (int)(absoluteCoordinate / regionSize);
The result should be a floored number (if downcasting to int truncates the decimals or if it uses the known rules to ceil or floor the number).
If your regionsize is 8, you would do:
Code:
regionCoordinate = (int)(absoluteCoordinate / 8);
Or, since 8 is 2 ^ 3:
Code:
regionCoordinate = absoluteCoordinate >> 3;
If it were to be 32 (2 ^ 5):
Code:
regionCoordinate = absoluteCoordinate >> 5;
You get what I mean, in Hyperion I got this:
Code:
regionCoordinate = absoluteCoordinate >> 3) - 6;
Don't ask me what the -6's for because I have no idea. If anyone knows, please tell me.