OpenGLContext.loaders.twitch | index /home/mcfletch/pylive/OpenGLContext/loaders/twitch.py |
Quake3 BSP file loading module (lowest abstraction layer)
Written directly from the following:
http://www.mralligator.com/q3/
Basically just uses numpy record declarations to parse the bsp files
into structured data-arrays...
Modules | ||||||
|
Classes | ||||||||
|
Functions | ||
|
Data | ||
BRUSHSIDE_RECORD = [('plane', '<i4'), ('texture', '<i4')] BRUSH_RECORD = [('brushside', '<i4'), ('n_brushsides', '<i4'), ('texture', '<i4')] EFFECT_RECORD = [('name', 'c', 64), ('brush', '<i4'), ('unknown', '<i4')] FACE_RECORD = [('texture', '<i4'), ('effect', '<i4'), ('type', '<i4'), ('vertex', '<i4'), ('n_vertices', '<i4'), ('meshvert', '<i4'), ('n_meshverts', '<i4'), ('lm_index', '<i4'), ('lm_start', '<i4', 2), ('lm_size', '<i4', 2), ('lm_origin', '<f4', 3), ('lm_vecs_s', '<f4', 3), ('lm_vecs_t', '<f4', 3), ('normal', '<f4', 3), ('size', '<i4', 2)] LEAF_RECORD = dtype([('cluster', '<i4'), ('area', '<i4'), ('mi... ('leafbrush', '<i4'), ('n_leafbrushes', '<i4')]) LIGHTMAP_RECORD = [('texture', 'i1', (128, 128, 3))] LIGHTVOL_RECORD = [('ambient', 'i1', 3), ('directional', 'i1', 3), ('dir', 'i1', 2)] LUMP_ORDER = [('entities', 'c'), ('textures', dtype([('filename', '|S1', (64,)), ('flags', '<i4'), ('contents', '<i4')])), ('planes', dtype([('normal', '<f4', (3,)), ('distance', '<f4')])), ('nodes', dtype([('plane', '<i4'), ('children', '<i4', (2,)), ('mins', '<i4', (3,)), ('maxs', '<i4', (3,))])), ('leafs', dtype([('cluster', '<i4'), ('area', '<i4'), ('mi... ('leafbrush', '<i4'), ('n_leafbrushes', '<i4')])), ('leaffaces', '<i4'), ('leafbrushes', '<i4'), ('models', [('mins', '<f4', 3), ('maxs', '<f4', 3), ('face', '<i4'), ('n_faces', '<i4'), ('brush', '<i4'), ('n_brushes', '<i4')]), ('brushes', [('brushside', '<i4'), ('n_brushsides', '<i4'), ('texture', '<i4')]), ('brushsides', [('plane', '<i4'), ('texture', '<i4')]), ('vertices', [('position', '<f4', 3), ('texcoord_surface', '<f4', 2), ('texcoord_lightmap', '<f4', 2), ('normal', '<f4', 3), ('color', 'B', 4)]), ('meshverts', '<i4'), ('effects', [('name', 'c', 64), ('brush', '<i4'), ('unknown', '<i4')]), ('faces', [('texture', '<i4'), ('effect', '<i4'), ('type', '<i4'), ('vertex', '<i4'), ('n_vertices', '<i4'), ('meshvert', '<i4'), ('n_meshverts', '<i4'), ('lm_index', '<i4'), ('lm_start', '<i4', 2), ('lm_size', '<i4', 2), ('lm_origin', '<f4', 3), ('lm_vecs_s', '<f4', 3), ('lm_vecs_t', '<f4', 3), ('normal', '<f4', 3), ('size', '<i4', 2)]), ('lightmaps', [('texture', 'i1', (128, 128, 3))]), ('lightvols', [('ambient', 'i1', 3), ('directional', 'i1', 3), ('dir', 'i1', 2)]), ('visdata', 'iio')] MODEL_RECORD = [('mins', '<f4', 3), ('maxs', '<f4', 3), ('face', '<i4'), ('n_faces', '<i4'), ('brush', '<i4'), ('n_brushes', '<i4')] NODE_RECORD = dtype([('plane', '<i4'), ('children', '<i4', (2,)), ('mins', '<i4', (3,)), ('maxs', '<i4', (3,))]) PLANE_RECORD = dtype([('normal', '<f4', (3,)), ('distance', '<f4')]) TEXTURE_RECORD = dtype([('filename', '|S1', (64,)), ('flags', '<i4'), ('contents', '<i4')]) VERTEX_RECORD = [('position', '<f4', 3), ('texcoord_surface', '<f4', 2), ('texcoord_lightmap', '<f4', 2), ('normal', '<f4', 3), ('color', 'B', 4)] VISDATA_RECORD_HEADER = [('n_vecs', '<i4'), ('sz_vecs', '<i4')] __file__ = '/home/mcfletch/pylive/OpenGLContext/loaders/twitch.py' __name__ = 'OpenGLContext.loaders.twitch' __package__ = 'OpenGLContext.loaders' f4 = '<f4' filename = 'maps/focal_p132.bsp' i4 = '<i4' log = <logging.Logger object> |