fork download
  1. #pragma once
  2.  
  3. #include "ED_Engine.h"
  4.  
  5. class EDE_GridSceneNode : public ISceneNode
  6. {
  7.  
  8. private:
  9. /////////////////
  10. // The Grid Cells
  11. /////////////////
  12. class Cell
  13. {
  14. private:
  15. IDynamicMeshBuffer* meshBuffer;
  16. bool visible;
  17. vector3df topLeft, topRight, bottomLeft, bottomRight, center;
  18. int id;
  19.  
  20. void setDefaultMaterial();
  21.  
  22. public:
  23. Cell();
  24. Cell(vector3df topLeft, vector3df topRight, vector3df bottomLeft, vector3df bottomRight, int id, bool visible);
  25. ~Cell();
  26.  
  27. void RenderCell(IVideoDriver* driver, SColor color);
  28. };
  29.  
  30. ///////////
  31. // The Grid
  32. ///////////
  33. private:
  34. vector3df gridPos;
  35. float cellSize;
  36. int width, height;
  37. Cell** gridCells;
  38.  
  39. public:
  40. EDE_GridSceneNode(ISceneNode* parent, ISceneManager* smgr, s32 id = -1);
  41.  
  42. void init( int width, int height, vector3df gridPos = vector3df(0.0f, 0.0f, 0.0f), float cellSize = 1.0f);
  43.  
  44. void createGridFlat(float cellSize);
  45. void createGridOnTerrain(ISceneNode* terrainSceneNode, float cellSize);
  46.  
  47. void renderGrid(IVideoDriver* driver, SColor color);
  48.  
  49. };
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty