foxostro / GutsyStormPython_Abandoned

Python game with boxy voxel terrain. (similar to Minecraft's terrain)
GNU General Public License v3.0
1 stars 0 forks source link

Box-Frustum testing is expensive in Python. Move code to Objective-C. #16

Open foxostro opened 12 years ago

foxostro commented 12 years ago

Box-Frustum testing is expensive due to high function call overhead of Python. Doing pure computation work like vector dot products is too expensive to do in Python. Especially, if these calculations are done on every camera update.

Move vector math and Box-Frustum testing into Objective-C code. The Frustum should be able to check a list of cubes quickly in one call to non-Python code. Something like: Frustum.filterVisibleCubes(chunks) will call out to Objective-C to perform the checks. Pass it the list of active chunks and get back the list of visible chunks.