]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Graphic/Models.hpp
Replaced Model::possible with a vector
[lugaru.git] / Source / Graphic / Models.hpp
index 5d5e5ec5e90c006be40d3650a89a219fce20a85b..6b907f22a913c5feb059eb929a0a188cf47e4910 100644 (file)
@@ -49,6 +49,7 @@ class TexturedTriangle
 public:
     short vertex[3];
     float gx[3], gy[3];
+    XYZ facenormal;
 };
 
 #define max_model_decals 300
@@ -62,56 +63,36 @@ public:
 class Model
 {
 public:
-    short vertexNum, TriangleNum;
+    short vertexNum;
     bool hastexture;
 
     int type, oldtype;
 
-    int* possible;
     int* owner;
     XYZ* vertex;
     XYZ* normals;
-    XYZ* facenormals;
-    TexturedTriangle* Triangles;
+    std::vector<TexturedTriangle> Triangles;
     GLfloat* vArray;
 
-    /*int possible[max_model_vertex];
+    /*
     int owner[max_textured_triangle];
     XYZ vertex[max_model_vertex];
     XYZ normals[max_model_vertex];
-    XYZ facenormals[max_textured_triangle];
-    TexturedTriangle Triangles[max_textured_triangle];
     GLfloat vArray[max_textured_triangle*24];*/
 
     Texture textureptr;
     ModelTexture modelTexture;
-    int numpossible;
     bool color;
 
     XYZ boundingspherecenter;
     float boundingsphereradius;
 
-    //~ float*** decaltexcoords;
-    //~ XYZ** decalvertex;
-    //~ int* decaltype;
-    //~ float* decalopacity;
-    //~ float* decalrotation;
-    //~ float* decalalivetime;
-    //~ XYZ* decalposition;
     std::vector<Decal> decals;
 
-    /*float decaltexcoords[max_model_decals][3][2];
-    XYZ decalvertex[max_model_decals][3];
-    int decaltype[max_model_decals];
-    float decalopacity[max_model_decals];
-    float decalrotation[max_model_decals];
-    float decalalivetime[max_model_decals];
-    XYZ decalposition[max_model_decals];*/
-
-    int numdecals;
-
     bool flat;
 
+    Model();
+    ~Model();
     void DeleteDecal(int which);
     void MakeDecal(decal_type atype, XYZ *where, float *size, float *opacity, float *rotation);
     void MakeDecal(decal_type atype, XYZ where, float size, float opacity, float rotation);
@@ -141,9 +122,11 @@ public:
     void drawimmediate();
     void Rotate(float xang, float yang, float zang);
     void deleteDeadDecals();
-    ~Model();
+
+private:
     void deallocate();
-    Model();
+    /* indices of triangles that might collide */
+    std::vector<unsigned int> possible;
 };
 
 #endif