00001 #pragma once 00002 #define NOMINMAX 00003 #include <windows.h> 00004 #include "glew.h" 00005 #include <vector> 00006 #include "GVec4f.h" 00007 #define GLFW_DLL 00008 #include "glfw.h" 00009 00010 using namespace std; 00011 00012 enum ParticleType 00013 { 00014 glow 00015 }; 00016 00017 enum Gamestate 00018 { 00019 KILLING = 0, 00020 KILLED_ALL = 1, 00021 VICTORY = 2, 00022 DEFEAT = 3 00023 }; 00024 00025 enum Gametoggle 00026 { 00027 NONE = 0x0, 00028 SHOWHELP = 0x1, // F1 00029 DRAWFPS = 0x2, // F2 00030 WIREFRAME = 0x4, // F3 00031 USEVBA = 0x8, // F6 00032 FRUSTUMCULLING = 0x10, // F8 00033 TRANSPARENCY = 0x20 // F9 00034 }; 00035 00038 struct plane 00039 { 00040 float a; 00041 float b; 00042 float c; 00043 float d; 00044 00045 void normalize() 00046 { 00047 float length = 1.0f / sqrt(a*a + b*b + c*c); 00048 a *= length; 00049 b *= length; 00050 c *= length; 00051 d *= length; 00052 } 00053 float dot(const GVec4f &v) 00054 { 00055 float result; 00056 result = a * v.x + b * v.y + c * v.z + d * v.w; 00057 return result; 00058 } 00059 }; 00060 00061 struct keyframe_t 00062 { 00063 int index; 00064 char name[25]; 00065 GVec4f roottranslation; 00066 vector<int> boneindex; 00067 vector<GVec4f> bonerotation; 00068 float totaltime; 00069 }; 00070 00071 struct animationedge_t 00072 { 00073 int index; 00074 int keyframe1; 00075 int keyframe2; 00076 float duration; 00077 char name[25]; 00078 }; 00079 00080 struct animation_t 00081 { 00082 int index; 00083 char name[25]; 00084 vector<animationedge_t> edges; 00085 }; 00086 00087 struct facelist_t 00088 { 00089 char v[25]; 00090 char t[25]; 00091 char n[25]; 00092 facelist_t *nxt; 00093 }; 00094 00095 struct facenode_t 00096 { 00097 int vertex; 00098 int normal; 00099 int texcoord; 00100 }; 00101 00102 struct material_t 00103 { 00104 char name[50]; 00105 float ar; 00106 float ag; 00107 float ab; 00108 float dr; 00109 float dg; 00110 float db; 00111 float sr; 00112 float sg; 00113 float sb; 00114 float alpha; 00115 float ns; // specular exponent 00116 char map_Ka[50]; // Ka texture map 00117 char map_Kd[50]; // Kd texture map 00118 char map_refl[50]; // refl texture map 00119 char bump[50]; // bump texture map 00120 }; 00121 00122 struct texcoord2_t 00123 { 00124 float u; // u component 00125 float v; // v component 00126 }; 00127 00128 struct face_t 00129 { 00130 vector<facenode_t> node; 00131 int materialindex; 00132 }; 00133 00134 struct animationlibrary_t 00135 { 00136 vector<animation_t> animations; 00137 }; 00138 00139 struct keyframelibrary_t 00140 { 00141 vector<keyframe_t> keyframes; 00142 }; 00143 00144 struct vertexmapper_t 00145 { 00146 int vertexindex; 00147 vector<int> boneindex; 00148 vector<float> weight; 00149 }; 00150 00151 struct rotor_t 00152 { 00153 GVec4f axis; 00154 float speed; 00155 float angle; 00156 }; 00157 00158 struct motor_t 00159 { 00160 GVec4f speed; 00161 GVec4f position; 00162 GVec4f distance; 00163 int type; 00164 int direction; 00165 }; 00166 00167 struct force_t 00168 { 00169 GVec4f Pos0; 00170 GVec4f forcevector; 00171 00172 float starttime; 00173 float duration; 00174 float dt; 00175 00176 char name[25]; 00177 int FLAGS; 00178 };