C++ version using an occlusion buffer for for collision detection; twice as fast.