4 /**> Model Loading <**/
14 #include "Constants.h"
17 #include "Quaternions.h"
31 class TexturedTriangle{
37 #define max_model_decals 300
47 short vertexNum,TriangleNum;
57 TexturedTriangle* Triangles;
60 /*int possible[max_model_vertex];
61 int owner[max_textured_triangle];
62 XYZ vertex[max_model_vertex];
63 XYZ normals[max_model_vertex];
64 XYZ facenormals[max_textured_triangle];
65 TexturedTriangle Triangles[max_textured_triangle];
66 GLfloat vArray[max_textured_triangle*24];*/
73 XYZ boundingspherecenter;
74 float boundingsphereradius;
76 float*** decaltexcoords;
81 float* decalalivetime;
84 /*float decaltexcoords[max_model_decals][3][2];
85 XYZ decalvertex[max_model_decals][3];
86 int decaltype[max_model_decals];
87 float decalopacity[max_model_decals];
88 float decalrotation[max_model_decals];
89 float decalalivetime[max_model_decals];
90 XYZ decalposition[max_model_decals];*/
96 void DeleteDecal(int which);
97 void MakeDecal(int atype, XYZ *where, float *size, float *opacity, float *rotation);
98 void MakeDecal(int atype, XYZ where, float size, float opacity, float rotation);
99 void drawdecals(GLuint shadowtexture,GLuint bloodtexture,GLuint bloodtexture2,GLuint breaktexture);
100 int SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate);
101 int SphereCheckPossible(XYZ *p1,float radius, XYZ *move, float *rotate);
102 int LineCheck(XYZ *p1,XYZ *p2, XYZ *p, XYZ *move, float *rotate);
103 int LineCheckSlide(XYZ *p1,XYZ *p2, XYZ *p, XYZ *move, float *rotate);
104 int LineCheckPossible(XYZ *p1,XYZ *p2, XYZ *p, XYZ *move, float *rotate);
105 int LineCheckSlidePossible(XYZ *p1,XYZ *p2, XYZ *p, XYZ *move, float *rotate);
106 void UpdateVertexArray();
107 void UpdateVertexArrayNoTex();
108 void UpdateVertexArrayNoTexNoNorm();
109 bool loadnotex(char *filename);
110 bool loadraw(char *filename);
111 bool load(char *filename,bool texture);
112 bool loaddecal(char *filename,bool texture);
113 void Scale(float xscale,float yscale,float zscale);
114 void FlipTexCoords();
115 void UniformTexCoords();
116 void ScaleTexCoords(float howmuch);
117 void ScaleNormals(float xscale,float yscale,float zscale);
118 void Translate(float xtrans,float ytrans,float ztrans);
119 void CalculateNormals(bool facenormalise);
121 void drawdifftex(GLuint texture);
122 void drawimmediate();
123 void drawdiffteximmediate(GLuint texture);
124 void Rotate(float xang,float yang,float zang);