My Project
GeoChunk.h
1 #ifndef __GEOCHUNCK_H__
2 #define __GEOCHUNCK_H__
3 
4 #include "utils.h"
5 #include "ModelUtils.h"
6 
7 namespace ParaEngine
8 {
9 struct AnimExtent{
10  D3DXVECTOR3 MinimumExtent;
11  D3DXVECTOR3 MaximumExtent;
12  float BoundsRadius;
13 };
14 
15 class CMDXModel;
16 class CGeoset;
17 struct ParaXGeoChunk;
18 class ShadowVolume;
19 struct LightParams;
26 class CGeoChunk
27 {
28 public:
29  CGeoChunk(void);
30  ~CGeoChunk(void);
31 
32  void Read(TypePointer inP,int inSize);
33  void Render(CMDXModel *model,const AnimInfo& animInfo);
34  D3DXVECTOR3* GetMaximumExtent();
35  D3DXVECTOR3* GetMinimumExtent();
36 
37 private:
38  void CalcGroupMatrix(CMDXModel *model);
39  void BuildShadowVolume(CMDXModel *model,const AnimInfo& animInfo,ShadowVolume * pShadowVolume, LightParams* pLight, D3DXMATRIX* mxWorld);
40 
41 private:
42  int numVertices;
43  D3DXVECTOR3* vertices;
44  D3DXVECTOR3* normals;
45 
46  int numTriangles;
47  short* triangles;
48 
49  char* vertexGroups;
50 
51  D3DXVECTOR2* uvs;
52 
53  int numGroups;
54  int* groups;
55  int numMatrixGroups;
56  int* matrixGroups;
57 
58  D3DXMATRIX* matrixes;
59  float* AnimAlphas;
60 
61  int materialID;
62 
63  float boundsRadius;
64  D3DXVECTOR3 mins;
65  D3DXVECTOR3 maxs;
66 
67  int numAnimExtent;
68  AnimExtent* animExtents;
69 friend CMDXModel;
70 friend CGeoset;
71 };
72 }
73 #endif//__GEOCHUNCK_H__
An X file model must contain only one geoset which is a collection of geochunks.
Definition: Geoset.h:25
ShadowVolume is a structure for storing shadow volume geometries.
Definition: ShadowVolume.h:39
different physics engine has different winding order.
Definition: EventBinding.h:32
Definition: utils.h:13
Definition: GeoChunk.h:9
LightParams is a structure for which a shadow volume is built.
Definition: ShadowVolume.h:8
This is a mesh object.
Definition: GeoChunk.h:26
Definition: ParaEngineXFileDef.h:150
Definition: ModelUtils.h:7
This is the ParaX mesh and animation file format model.
Definition: MDXModel.h:61