|
UFO: Alien Invasion
|
obj model loading More...

Go to the source code of this file.
Data Structures | |
| struct | mobjvert_t |
| struct | mobjtri_t |
| struct | mobj_t |
Macros | |
| #define | MAX_OBJ_FACE_VERTS 128 |
Functions | |
| static void | R_LoadObjModelVertexArrays (mobj_t *obj, model_t *mod) |
| static void | R_LoadObjModelTris (mobj_t *obj, const mobjvert_t *verts, int count) |
| Assembles count tris on the model from the specified array of verts. | |
| static int | R_LoadObjModelFace (const model_t *mod, mobj_t *obj, const char *line) |
| Each line consists of 3 or more vertex definitions, e.g. | |
| static void | R_LoadObjModelLine (model_t *mod, mobj_t *obj, char *line) |
| Parse the object file line. If the structures have been allocated, populate them. Otherwise simply accumulate counts. | |
| static void | R_LoadObjSkin (model_t *mod) |
| static void | R_LoadObjModel_ (model_t *mod, mobj_t *obj, const byte *buffer, int bufSize) |
| Drives the actual parsing of the object file. The file is read twice: once to acquire primitive counts, and a second time to load them. | |
| void | R_LoadObjModel (model_t *mod, byte *buffer, int bufSize) |
obj model loading
Definition in file r_model_obj.cpp.
| #define MAX_OBJ_FACE_VERTS 128 |
Definition at line 98 of file r_model_obj.cpp.
Referenced by R_LoadObjModelFace(), and R_LoadObjModelTris().
Definition at line 353 of file r_model_obj.cpp.
References AABB::add(), model_t::alias, bufSize, Com_Error(), ERR_DROP, i, Mem_Free, Mem_PoolAllocType, Mem_PoolAllocTypeN, mAliasModel_t::meshes, mod_obj, model_t::modBox, model_t::name, mobj_t::normals, mAliasModel_t::num_frames, mAliasModel_t::num_meshes, mobj_t::num_normals, mobj_t::num_texcoords, mobj_t::num_tris, mobj_t::num_verts, OBJZERO, R_LoadObjModel_(), R_LoadObjModelVertexArrays(), R_LoadObjSkin(), mobj_t::texcoords, mobj_t::tris, model_t::type, v, mobj_t::verts, and vid_modelPool.
Referenced by LoadModel(), and R_LoadModelAsync().
Drives the actual parsing of the object file. The file is read twice: once to acquire primitive counts, and a second time to load them.
Definition at line 323 of file r_model_obj.cpp.
References bufSize, Com_Trim(), i, MAX_STRING_CHARS, and R_LoadObjModelLine().
Referenced by R_LoadObjModel().
Each line consists of 3 or more vertex definitions, e.g.
Tokenize the line with Com_Parse, and parse each vertex definition. Faces with more than 3 vertices must be broken down into triangles.
Definition at line 134 of file r_model_obj.cpp.
References Com_Error(), Com_Parse(), ERR_DROP, i, MAX_OBJ_FACE_VERTS, model_t::name, OBJZERO, R_LoadObjModelTris(), mobj_t::tris, and v.
Referenced by R_LoadObjModelLine().
Parse the object file line. If the structures have been allocated, populate them. Otherwise simply accumulate counts.
Definition at line 217 of file r_model_obj.cpp.
References Com_DPrintf(), Com_Error(), DEBUG_RENDERER, ERR_DROP, f, model_t::name, mobj_t::normals, mobj_t::num_normals, mobj_t::num_normals_parsed, mobj_t::num_texcoords, mobj_t::num_texcoords_parsed, mobj_t::num_tris, mobj_t::num_tris_parsed, mobj_t::num_verts, mobj_t::num_verts_parsed, Q_strnull(), R_LoadObjModelFace(), mobj_t::texcoords, mobj_t::tris, and mobj_t::verts.
Referenced by R_LoadObjModel_().
|
static |
Assembles count tris on the model from the specified array of verts.
Definition at line 103 of file r_model_obj.cpp.
References count, i, MAX_OBJ_FACE_VERTS, mobj_t::num_tris_parsed, mobj_t::tris, and mobjtri_t::verts.
Referenced by R_LoadObjModelFace().
Definition at line 58 of file r_model_obj.cpp.
References model_t::alias, i, Mem_PoolAllocTypeN, mAliasModel_t::meshes, mAliasMesh_t::normals, mobj_t::normals, mAliasMesh_t::num_tris, mobj_t::num_tris, mAliasMesh_t::num_verts, mobj_t::num_verts, mAliasMesh_t::texcoords, mobj_t::texcoords, mobj_t::tris, v, VectorCopy, mAliasMesh_t::verts, mobj_t::verts, mobjtri_t::verts, and vid_modelPool.
Referenced by R_LoadObjModel().
Definition at line 267 of file r_model_obj.cpp.
References model_t::alias, Com_Parse(), Com_sprintf(), Com_StripExtension(), FS_CheckFile(), FS_FreeFile(), FS_LoadFile(), i, MAX_QPATH, Mem_PoolAllocType, Mem_PoolAllocTypeN, mAliasModel_t::meshes, image_t::name, mAliasSkin_t::name, model_t::name, mAliasMesh_t::num_skins, Q_streq, Q_strncpyz(), R_AliasModelGetSkin(), mAliasSkin_t::skin, mAliasMesh_t::skins, va(), and vid_modelPool.
Referenced by R_LoadObjModel().