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 >
Wrap
C/C++ Source or Header
|
2004-05-31
|
2KB
|
120 lines
//------------------------------------------------------------------
// Name: OCTree CLASS
// Desc: ************
//------------------------------------------------------------------
class OCTREE
{
private:
//vertex buffer
LPDIRECT3DVERTEXBUFFER9 g_pVB ;
//subor
FILE *FileGeo;
FILE *FileScn;
FILE *FileOct;
//////////////
//MATERIALY //
//////////////
void SetMaterial(int MaterialType);
void SetBlendMode(int BlendType);
/////////////
//NODE //
/////////////
OCTNODE *Node;
int MinNodeSize;
void LoadNode(OCTNODE *N);
void SaveNode(OCTNODE *N);
void CreateNode(OCTNODE *N);
void RenderDebugNode(OCTNODE *N);
bool ColliseNodeFace(OCTNODE *N,OCTFACE F);
bool ColliseNodeLine(OCTNODE *N,VECTOR3D P1,VECTOR3D P2);
void ColliseNode(OCTNODE *N, VECTOR3D P1, VECTOR3D P2);
void ColliseNodeDistance(OCTNODE *N, VECTOR3D P1, VECTOR3D P2);
bool ColliseFace(OCTFACE F, VECTOR3D P1, VECTOR3D P2);
bool ColliseFaceDistance(OCTFACE F, VECTOR3D P1, VECTOR3D P2);
/////////////////
//OPTIMALIZACIA//
/////////////////
void Optimalize();
void FrustrumNode(OCTNODE *N);
void BackFaceCulling();
//////////////
//GROUP FACE//
//////////////
void InitializeGroupTextures(int Index);
void ClearGroupTextures(int Index);
void ReadGroup();
void ReadFace();
void RenderGroup(int Index);
void CalcSmoothShading(int Index);
/////////////////
//VERTEX BUFFER//
/////////////////
void CreateVertexBuffer();
void FillVertexBuffer();
public:
//skupina
int NumGroups;
OCTGROUP *Group;
//plosky
int NumFaces;
OCTFACE *Face;
//mod textur
int Mode;
//info
int NumVisibleFaces;
int NumEndNodes;
/////////////
//UNIVERZAL//
/////////////
OCTREE();
void Load(char *FileName);
void SaveScene(char *FileName);
void LoadScene(char *FileNameGeo,char *FileNameScn);
void CreateOctTree();
void SaveOctTree(char *FileName);
void LoadOctTree(char *FileName);
void Render();
void CleanUp();
bool Collise(VECTOR3D P1, VECTOR3D P2);
bool ColliseDistance(VECTOR3D P1, VECTOR3D P2);
bool ColliseStatus;
VECTOR3D IntPos;
VECTOR3D IntNormal;
int IntMaterialType;
int IntBlendType;
int IntGroupType;
void SetTexture(int ToGroup,int ToFrame,LPDIRECT3DTEXTURE9 Tex);
};