performance improvements in culling
Merge pull request #5441 from ricardoquesada/api_fixed_for_3d

little performance improvements in culling