00001 #ifndef __HEMI__MD5_H__ 00002 #define __HEMI__MD5_H__ 00003 00004 #include "hemi.h" 00005 00006 typedef struct hemi_md5_vert 00007 { 00008 int index; 00009 int offset_weight; 00010 int num_weights; 00011 float s; 00012 float t; 00013 } hemi_md5_vert_t; 00014 00015 typedef struct hemi_md5_tri 00016 { 00017 int index; 00018 int v[3]; 00019 } hemi_md5_tri_t; 00020 00021 typedef struct hemi_md5_weight 00022 { 00023 int index; 00024 int joint; 00025 float bias; 00026 vec3 pos; 00027 } hemi_md5_weight_t; 00028 00029 typedef struct hemi_md5_mesh 00030 { 00031 char* name; 00032 char* shader; 00033 hemi_byte visible; 00034 00035 hemi_md5_vert_t* verts; 00036 hemi_uint num_verts; 00037 00038 hemi_md5_tri_t* tris; 00039 hemi_uint num_tris; 00040 00041 hemi_md5_weight_t* weights; 00042 hemi_uint num_weights; 00043 } hemi_md5_mesh_t; 00044 00045 typedef struct hemi_md5_frame 00046 { 00047 vec3 bbox[2]; 00048 float* vals; 00049 int index; 00050 } hemi_md5_frame_t; 00051 00052 typedef struct hemi_md5_joint 00053 { 00054 char* name; 00055 struct hemi_md5_joint* parent; 00056 00057 vec3 pos; 00058 quat rot; 00059 mat44 trans; 00060 mat44 atrans; 00061 00062 int flags; 00063 int index; 00064 00065 } hemi_md5_joint_t; 00066 00067 typedef struct hemi_md5_anim 00068 { 00069 hemi_md5_joint_t* joints; 00070 hemi_uint num_joints; 00071 00072 hemi_md5_frame_t* frames; 00073 hemi_uint num_frames; 00074 00075 float framerate; 00076 hemi_uint num_components; 00077 00078 } hemi_md5_anim_t; 00079 00080 typedef struct hemi_md5 00081 { 00082 hemi_md5_joint_t* joints; 00083 hemi_uint num_joints; 00084 00085 hemi_md5_mesh_t* meshes; 00086 hemi_uint num_meshes; 00087 00088 hemi_md5_anim_t* anims; 00089 hemi_uint num_anims; 00090 } hemi_md5_t; 00091 00092 HEXTERN int hemi_load_md5mesh(const char*, hemi_md5_t*); 00093 HEXTERN int hemi_load_md5anim(const char*, hemi_md5_t*); 00094 00095 #endif