TerrainPatch.pkg 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. $#include "TerrainPatch.h"
  2. /// Individually rendered part of a heightmap terrain.
  3. class TerrainPatch : public Drawable
  4. {
  5. public:
  6. /// Set owner terrain.
  7. void SetOwner(Terrain* terrain);
  8. /// Set neighbor patches.
  9. void SetNeighbors(TerrainPatch* north, TerrainPatch* south, TerrainPatch* west, TerrainPatch* east);
  10. /// Set material.
  11. void SetMaterial(Material* material);
  12. /// Set local-space bounding box.
  13. void SetBoundingBox(const BoundingBox& box);
  14. /// Set patch coordinates.
  15. void SetCoordinates(const IntVector2& coordinates);
  16. /// Set vertical offset for occlusion geometry. Should be negative.
  17. void SetOcclusionOffset(float offset);
  18. /// Reset to LOD level 0.
  19. void ResetLod();
  20. /// Return visible geometry.
  21. Geometry* GetGeometry() const;
  22. /// Return max LOD geometry.
  23. Geometry* GetMaxLodGeometry() const;
  24. /// Return min LOD geometry.
  25. Geometry* GetMinLodGeometry() const;
  26. /// Return vertex buffer.
  27. VertexBuffer* GetVertexBuffer() const;
  28. /// Return owner terrain.
  29. Terrain* GetOwner() const;
  30. /// Return north neighbor patch.
  31. TerrainPatch* GetNorthPatch() const { return north_; }
  32. /// Return south neighbor patch.
  33. TerrainPatch* GetSouthPatch() const { return south_; }
  34. /// Return west neighbor patch.
  35. TerrainPatch* GetWestPatch() const { return west_; }
  36. /// Return east neighbor patch.
  37. TerrainPatch* GetEastPatch() const { return east_; }
  38. /// Return local-space bounding box.
  39. const BoundingBox& GetBoundingBox() const { return boundingBox_; }
  40. /// Return patch coordinates.
  41. const IntVector2& GetCoordinates() const { return coordinates_; }
  42. /// Return current LOD level.
  43. unsigned GetLodLevel() const { return lodLevel_; }
  44. /// Return vertical offset for occlusion geometry..
  45. float GetOcclusionOffset() const { return occlusionOffset_; }
  46. float GetOcclusionOffset() const;
  47. };