Xastir note: This file is intended to point you at the original sources of the rtree implementation used in xastir.]
Here are a few useful bits of free source code. You're completely free to use them for any purpose whatsoever. All I ask is that if you find one to be particularly valuable, then consider sending a brief thank you note to the email address in the code comments. Enjoy.
R-Trees
Straight "C" implementation of Tony Gutman's R-Tree method, R-Trees provide Log(n) speed rectangular indexing into multi-dimensional data. Based on his original implementation, I've brought it up to date with ANCI specifications and added a nice improvment based on sphere volumes.
Skiplists
Skiplists are fast associative collections invented by William Pugh. Key/Value pairs are added to skiplist containers and can then values looked up extremely quickly by key. The implementation is based on a fairly generic one originally in "C" by Bruno Grossniklaus which I converted into a C++ class library.
Quaternions
Implementation of a simple C++ quaternion class called "Squat". Popularized by a seminal paper by Ken Shoemake, a quaternion represents a rotation about an axis. Squats can be concatenated together via the * and *= operators and converted back and forth between transformation matrices. Implementation also includes a wonderful 3D vector macro library by Don Hatch.
Polygon-Cube Intersection Testing
"C" implementation of an extremely fast and robust polygon-cube intersection test by Don Hatch and myself as published in Graphics Gems V. Very useful for collision detection and view frustum visibility checking.
View the readme file
Download PCube code