home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 July & August / PCWorld_2006-07-08_cd.bin / temacd / planearcade / planearcade.exe / Tank3.bmp / occlass.h < prev    next >
C/C++ Source or Header  |  2004-05-31  |  2KB  |  120 lines

  1.  
  2. //------------------------------------------------------------------
  3. // Name: OCTree CLASS
  4. // Desc: ************
  5. //------------------------------------------------------------------
  6. class OCTREE
  7. {
  8. private:
  9.  
  10.     //vertex buffer
  11.     LPDIRECT3DVERTEXBUFFER9 g_pVB ;
  12.  
  13.     //subor
  14.     FILE *FileGeo;
  15.     FILE *FileScn;
  16.     FILE *FileOct;
  17.  
  18.     //////////////
  19.     //MATERIALY //   
  20.     //////////////
  21.     void SetMaterial(int MaterialType);
  22.     void SetBlendMode(int BlendType);
  23.  
  24.  
  25.     /////////////
  26.     //NODE     //   
  27.     /////////////
  28.     OCTNODE *Node;
  29.     int MinNodeSize;
  30.  
  31.     void LoadNode(OCTNODE *N);
  32.     void SaveNode(OCTNODE *N);
  33.     
  34.     void CreateNode(OCTNODE *N);
  35.  
  36.     void RenderDebugNode(OCTNODE *N);
  37.  
  38.     bool ColliseNodeFace(OCTNODE *N,OCTFACE F);
  39.     bool ColliseNodeLine(OCTNODE *N,VECTOR3D P1,VECTOR3D P2);
  40.  
  41.     void ColliseNode(OCTNODE *N, VECTOR3D P1, VECTOR3D P2);
  42.     void ColliseNodeDistance(OCTNODE *N, VECTOR3D P1, VECTOR3D P2);
  43.  
  44.     bool ColliseFace(OCTFACE F, VECTOR3D P1, VECTOR3D P2);
  45.     bool ColliseFaceDistance(OCTFACE F, VECTOR3D P1, VECTOR3D P2);
  46.  
  47.     /////////////////
  48.     //OPTIMALIZACIA//
  49.     /////////////////
  50.     void Optimalize();
  51.     void FrustrumNode(OCTNODE *N);
  52.     void BackFaceCulling();
  53.  
  54.     //////////////
  55.     //GROUP FACE//   
  56.     //////////////
  57.     void InitializeGroupTextures(int Index);
  58.     void ClearGroupTextures(int Index);
  59.     void ReadGroup();
  60.     void ReadFace();
  61.     void RenderGroup(int Index);
  62.  
  63.     void CalcSmoothShading(int Index);
  64.     
  65.     /////////////////
  66.     //VERTEX BUFFER//  
  67.     /////////////////
  68.     void CreateVertexBuffer();
  69.     void FillVertexBuffer();
  70.     
  71.  
  72. public:
  73.  
  74.     //skupina
  75.     int NumGroups;
  76.     OCTGROUP *Group;
  77.  
  78.     //plosky
  79.     int NumFaces;
  80.     OCTFACE *Face;
  81.  
  82.     //mod textur
  83.     int Mode;
  84.  
  85.     //info
  86.     int NumVisibleFaces;
  87.     int NumEndNodes;
  88.  
  89.     /////////////
  90.     //UNIVERZAL//   
  91.     /////////////
  92.  
  93.     OCTREE();
  94.  
  95.     void Load(char *FileName);
  96.     void SaveScene(char *FileName);
  97.     void LoadScene(char *FileNameGeo,char *FileNameScn);
  98.  
  99.     void CreateOctTree();    
  100.     void SaveOctTree(char *FileName);
  101.     void LoadOctTree(char *FileName);
  102.     
  103.     void Render();
  104.     void CleanUp();
  105.     bool Collise(VECTOR3D P1, VECTOR3D P2);
  106.     bool ColliseDistance(VECTOR3D P1, VECTOR3D P2);
  107.         bool ColliseStatus;
  108.         VECTOR3D IntPos;
  109.         VECTOR3D IntNormal;
  110.         int IntMaterialType;
  111.         int IntBlendType;
  112.         int IntGroupType;
  113.  
  114.     void SetTexture(int ToGroup,int ToFrame,LPDIRECT3DTEXTURE9 Tex);
  115.  
  116.     
  117.  
  118.  
  119.  
  120. };