home *** CD-ROM | disk | FTP | other *** search
/ 3D Games (Spidla) / 3dhry1.iso / carterrain / src / geometry.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-03-17  |  676 b   |  47 lines

  1. #ifndef _GEOMETRY_H_
  2. #define _GEOMETRY_H_
  3.  
  4. #include "trig.h"
  5.  
  6. class CVertex : public CVector
  7. {
  8. public:
  9.     CVector normal;
  10. };
  11.  
  12. class CTriangle
  13. {
  14. public:
  15.     unsigned int v[3];
  16.     unsigned int tv[3];
  17.     CVector normal;    
  18. };
  19.  
  20. class CTvertex
  21. {
  22. public:
  23.     double u, v;
  24. };
  25.  
  26. class CGeometry
  27. {
  28. private:
  29.     unsigned int vertices;
  30.     CVertex *vertex;
  31.     unsigned int tvertices;
  32.     CTvertex *tvertex;
  33.     unsigned int triangles;
  34.     CTriangle *triangle;
  35. public:
  36.     CGeometry(void);
  37.     CGeometry(unsigned int v, unsigned int tv, unsigned int t);
  38.     CGeometry(const char* f);
  39.     ~CGeometry(void);
  40.     
  41.     void scale(double s);
  42.     void draw(void);
  43.     void calc_normals(void);
  44. };
  45.  
  46. #endif
  47.