Guest User

EDE_GridSceneNode.h

a guest
Feb 19th, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.58 KB | None | 0 0
  1. #pragma once
  2. #include "ED_Engine.h"
  3.  
  4. class EDE_GridSceneNode : public ISceneNode
  5. {
  6.     private:
  7.         ///////////
  8.         // The Grid
  9.         ///////////
  10.         vector3df gridPos;
  11.        
  12.         float cellSize;
  13.         int widthInCells, heightInCells;
  14.  
  15.         u16** uIndicesVertical;
  16.         S3DVertex** verticesVertical;
  17.         u16** uIndicesHorizontal;
  18.         S3DVertex** verticesHorizontal;
  19.  
  20.         SColor color;
  21.  
  22.         aabbox3d<f32> Box;
  23.         SMaterial Material;
  24.  
  25.     private:
  26.         void createGridFlat();
  27.         void createGridOnFullTerrain(ITerrainSceneNode* terrainSceneNode);
  28.         void createGridOnPositionTerrain(ITerrainSceneNode* terrainSceneNode);
  29.        
  30.         void renderGrid(IVideoDriver* driver, SColor color);
  31.  
  32.         void setupVertexArrays();
  33.  
  34.     public:
  35.         EDE_GridSceneNode(ISceneNode* parent, ISceneManager* smgr, s32 id = -1);
  36.  
  37.         void initGridOverFullTerrain( ITerrainSceneNode* terrainSceneNode, ITexture* heightmapTexture, vector3df gridPos = vector3df(0.0f, 0.0f, 0.0f), float cellSize = 1.0f, SColor color = SColor(255, 255, 255, 255));
  38.         void initGridOverPositionTerrain( ITerrainSceneNode* terrainSceneNode, int widthInCells, int heightInCells, vector3df gridPos = vector3df(0.0f, 0.0f, 0.0f), float cellSize = 1.0f, SColor color = SColor(255, 255, 255, 255));
  39.         void initGridFlat(int widthInCells, int heightInCells, vector3df gridPos = vector3df(0.0f, 0.0f, 0.0f), float cellSize = 1.0f, SColor color = SColor(255, 255, 255, 255));
  40.  
  41.         virtual void OnRegisterSceneNode();
  42.         virtual void render();
  43.         virtual const core::aabbox3d<f32>& getBoundingBox() const;
  44.         virtual u32 getMaterialCount() const;
  45.         virtual video::SMaterial& getMaterial(u32 i);
  46. };
Advertisement
Add Comment
Please, Sign In to add comment