| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- $#include "TerrainPatch.h"
- /// Individually rendered part of a heightmap terrain.
- class TerrainPatch : public Drawable
- {
- public:
- /// Set owner terrain.
- void SetOwner(Terrain* terrain);
- /// Set neighbor patches.
- void SetNeighbors(TerrainPatch* north, TerrainPatch* south, TerrainPatch* west, TerrainPatch* east);
- /// Set material.
- void SetMaterial(Material* material);
- /// Set local-space bounding box.
- void SetBoundingBox(const BoundingBox& box);
- /// Set patch coordinates.
- void SetCoordinates(const IntVector2& coordinates);
- /// Set vertical offset for occlusion geometry. Should be negative.
- void SetOcclusionOffset(float offset);
- /// Reset to LOD level 0.
- void ResetLod();
-
- /// Return visible geometry.
- Geometry* GetGeometry() const;
- /// Return max LOD geometry.
- Geometry* GetMaxLodGeometry() const;
- /// Return min LOD geometry.
- Geometry* GetMinLodGeometry() const;
- /// Return vertex buffer.
- VertexBuffer* GetVertexBuffer() const;
- /// Return owner terrain.
- Terrain* GetOwner() const;
- /// Return north neighbor patch.
- TerrainPatch* GetNorthPatch() const { return north_; }
- /// Return south neighbor patch.
- TerrainPatch* GetSouthPatch() const { return south_; }
- /// Return west neighbor patch.
- TerrainPatch* GetWestPatch() const { return west_; }
- /// Return east neighbor patch.
- TerrainPatch* GetEastPatch() const { return east_; }
- /// Return local-space bounding box.
- const BoundingBox& GetBoundingBox() const { return boundingBox_; }
- /// Return patch coordinates.
- const IntVector2& GetCoordinates() const { return coordinates_; }
- /// Return current LOD level.
- unsigned GetLodLevel() const { return lodLevel_; }
- /// Return vertical offset for occlusion geometry..
- float GetOcclusionOffset() const { return occlusionOffset_; }
- float GetOcclusionOffset() const;
- };
|