00001 #pragma once 00002 00003 //#include <windows.h> 00004 #include <vector> 00005 00006 using namespace std; 00007 00008 struct vec3f 00009 { 00010 float x; 00011 float y; 00012 float z; 00013 float w; 00014 }; 00015 00016 struct boundingbox_t 00017 { 00018 vec3f minvalues; 00019 vec3f maxvalues; 00020 vec3f transformedminvalues; 00021 vec3f transformedmaxvalues; 00022 vec3f bounds[8]; 00023 }; 00024 00025 struct bone_t 00026 { 00027 int index; 00028 int parent; 00029 char name[125]; 00030 vec3f position; 00031 vec3f transformed_position; 00032 float transformationmatrix[16]; 00033 00034 // PERFORMANCE-CRITICAL ADDITIONAL MATRICES: 00035 float TRANSLATION[16]; 00036 float XROTATION[16]; 00037 float YROTATION[16]; 00038 float ZROTATION[16]; 00039 float INVERSE_TRANSLATION[16]; 00040 float ACCUMULATION_MATRIX[16]; 00041 00042 boundingbox_t *boundingbox; 00043 00044 vector<bone_t*> children; 00045 vec3f rotations; 00046 }; 00047 00048 struct keyframe_t 00049 { 00050 int index; 00051 char name[25]; 00052 vec3f roottranslation; 00053 vector<int> boneindex; 00054 vector<vec3f> bonerotation; 00055 float totaltime; 00056 }; 00057 00058 struct animationedge_t 00059 { 00060 int index; 00061 int keyframe1; 00062 int keyframe2; 00063 float duration; 00064 char name[25]; 00065 }; 00066 00067 struct animation_t 00068 { 00069 int index; 00070 char name[25]; 00071 vector<animationedge_t> edges; 00072 }; 00073 00074 struct animationlibrary_t 00075 { 00076 vector<animation_t> animations; 00077 }; 00078 00079 struct keyframelibrary_t 00080 { 00081 vector<keyframe_t> keyframes; 00082 }; 00083 00084 struct animationmanager_t 00085 { 00086 animation_t *animation; 00087 animationlibrary_t *animationlibrary; 00088 keyframelibrary_t *keyframelibrary; 00089 float starttime; 00090 float dt; 00091 int currentedge; 00092 }; 00093 00094 struct facelist_t 00095 { 00096 char v[25]; 00097 char t[25]; 00098 char n[25]; 00099 facelist_t *nxt; 00100 }; 00101 00102 struct facenode_t 00103 { 00104 int vertex; 00105 int normal; 00106 int texcoord; 00107 }; 00108 00109 struct material_t 00110 { 00111 char name[30]; 00112 float ar; 00113 float ag; 00114 float ab; 00115 float dr; 00116 float dg; 00117 float db; 00118 float sr; 00119 float sg; 00120 float sb; 00121 float alpha; 00122 }; 00123 00124 struct face_t 00125 { 00126 vector<facenode_t> node; 00127 int materialindex; 00128 }; 00129 00130 struct vertexmapper_t 00131 { 00132 int vertexindex; 00133 vector<int> boneindex; 00134 vector<float> weight; 00135 }; 00136 00137 struct skeleton_t 00138 { 00139 bone_t *root; 00140 char type[25]; 00141 animationmanager_t *animationmanager; 00142 }; 00143 00144 struct model_t 00145 { 00146 vector<vec3f> vertices; 00147 vector<vec3f> transvertices; 00148 00149 vector<vec3f> normals; 00150 vector<vec3f> transnormals; 00151 00152 vector<face_t> faces; 00153 vector<material_t> materials; 00154 00155 skeleton_t *skeleton; 00156 vector<vertexmapper_t> vertexmapper; 00157 }; 00158