get all objects in scene in python

im working on a lod for my game but i need the script to make every thing
but the map and the main objects to be invisible unless its infront of the camera, i tryed to do this with a radar sensor but it murderd performace, im so lost please help

Joel

There is an example LOD script in the BGE docs:

http://www.blender.org/documentation/pydoc_gameengine/PyDoc-Gameengine-2.34/KX_SCA_ReplaceMeshActuator.KX_SCA_ReplaceMeshActuator-class.html

Use that method.

o to compicated for me to understand, someone post a .blend please, i dont get what im soposed to do with all that