Download link:
http://www.mediafire.com/?5ijr4e73j4diidc
Basically, create an entity at any position - make sure it is static.
Go into the code, find the line that read:
const float[] _ORIGIN = { 0.0f,0.0f ,0.0f };
Put the coords of the entity into that array {X,Y,Z}.
Then call whenever you want to track the player's position the trackingBegin routine. An example of this is included w/ the test map.
//Create an Array with the position of the player {X,Y,Z}
float[] position = { 10.0f, 0.9f, 13.25f };
//Pass this into trackingBegin along with the origin object name.
trackingBegin(position,"object_origin");
Then, whenever you want to get the player location, do something like:
float[] p = trackingGetPosition();
Where:
p[0] = <x coord>
p[1] = <y coord>
p[2] = <z coord>
Note that all positions will be down to the accuracy of the const "_PADDING" - i have set this to "1" in the code as this is what i feel to be a reasonable value (good trade-off of accuracy and not creating a tonne of objects).
Please note, try to use this only when necessary (e.g at the start of where you want position tracking). Adding lots of collide callbacks & attach objects will eventually crash the game (about 10k ish), so don't go overboard with precision and amount of tracking. You can stop tracking by either hitting the object limit "_TRACKMAXNO" or calling: