Referring to book:
Title: Game Programming Gems 4
Chapter: 2.3 - Solving Accuracy Problems in Large World Coordinates
Page: 157
ISBN: 1-58450-295-9
In this chapter, the author (Peter Freeze, NCsoft Core) uses a method to solve large world coordinate problems by implement a concept called Far Positions which is a hybrid between fixed-point (segments) and floating-point (offset) numbers. Here is an example:
Code: Select all
class FarPosition
{
private:
FarSegment m_segment;
Vector3 m_offset;
static float m_segmentSize;
};
union FarSegment
{
struct
{
int16 x, z;
};
int32 xz;
matFarSegment() {};
matFarSegment( ZeroType ) : xz(0) {};
};
Well, we attempted to implement this but the author did warn us of, and we did stumble into, the fact that the entire engine pipeline has has be use this concept or it won't work properly. When we try to convert back to a standard Ogre::Vector3 we loose precision - even if we set the Ogre::Real to a double.
It would be nice if Ogre would someday support something similar to this ( or if it does, please tell us).