Advertisement
Guest User

tree.h - by Abhijeet

a guest
Mar 26th, 2014
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #ifndef _TREE_H_
  2. #define _TREE_H_
  3.  
  4. class Tree
  5. {
  6. public:
  7.     struct InitInfo
  8.     {
  9.         bool Use32BitIndices;
  10.         USHORT NumInstances;
  11.        
  12.         std::string ModelPath;
  13.         std::string far_ModelPath;
  14.     };
  15.  
  16.     struct TreeData
  17.     {
  18.         XMFLOAT3 pos;
  19.         bool IsFar;
  20.         bool Visible;
  21.     };
  22.  
  23. private:
  24.     XNA::AxisAlignedBox box;
  25.     Model* mModel;
  26.     Model* far_mModel;
  27.     InitInfo mInfo;
  28.  
  29.     Model::MeshData mModel_MeshData;
  30.     Model::MeshData far_mModel_MeshData;
  31.    
  32.     USHORT NumVisibleObjects;
  33.     USHORT farModel_NumVisibleObjects;
  34.  
  35.     std::vector<TreeData> treeData;
  36.  
  37.     static const unsigned short MAX_TREES = 100;
  38.  
  39. private:
  40.     void AddtreeWorld(CXMMATRIX World);
  41.     void AddtreeWorldToFarModel(CXMMATRIX World);
  42.  
  43.     void DrawNearModel(CXMMATRIX W);
  44.     void DrawFarModel(CXMMATRIX W);
  45. public:
  46.     Tree();
  47.     ~Tree();
  48.  
  49.     void Init(InitInfo& info);
  50.  
  51.  
  52.     void Update();
  53.     void Draw(CXMMATRIX W);
  54. };
  55.  
  56. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement