Floating point accuracy and large game worlds

Started by
0 comments, last by SpaceRogue 21 years, 1 month ago
I''m looking for a good way to handle LARGE areas of space for my game, but I''m worried about floating point accuracy. I was thinking of using a pair of long integers together to represent distance along a single axis, effectively dividing space up into cubes, each representing the range of a single long integer. Is this a decent way to approach this or is there a simpler more effective way? Will I incurr some kind of performance penalty passing integers to D3D''s matrix structures that are designed for float values?
Advertisement
1) int -> float... not sure bout the performance loss. but do it the other way around and u''re definitely talking bout performance issues. how bad? get a profiler

2) if floats dont cut it, doubles are still viable. if precision issues still crop up, the long data type may still compensate. however, using long also limits u to discrete steps in coordinate specifications. as long as ur world space does not span too much, it shouldnt be a problem. but a simpler solution if that occurs.. use MORE longs
- To learn, we share... Give some to take some -

This topic is closed to new replies.

Advertisement