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