diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Interfaces/ITerrainManager.h |
Diffstat (limited to 'Runtime/Interfaces/ITerrainManager.h')
-rw-r--r-- | Runtime/Interfaces/ITerrainManager.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Runtime/Interfaces/ITerrainManager.h b/Runtime/Interfaces/ITerrainManager.h new file mode 100644 index 0000000..97f930d --- /dev/null +++ b/Runtime/Interfaces/ITerrainManager.h @@ -0,0 +1,46 @@ +#pragma once +#include <list> + +#include "Runtime/Modules/ExportModules.h" +#include "Runtime/Camera/SceneNode.h" +#include "Runtime/Geometry/AABB.h" +#include "Runtime/Utilities/dynamic_array.h" + +class Light; +class Object; +class TerrainInstance; +class Vector3f; +class NxHeightField; +class Heightmap; + +typedef UNITY_LIST(kMemRenderer, TerrainInstance*) TerrainList; + +class ITerrainManager +{ +public: +#if ENABLE_PHYSICS + virtual NxHeightField* Heightmap_GetNxHeightField(Heightmap& heightmap) = 0; +#endif + virtual int Heightmap_GetMaterialIndex(Heightmap& heightmap) = 0; + virtual Vector3f Heightmap_GetSize(Heightmap& heightmap) = 0; + + /// Extracts the height on the heightmap from a TerrainData + /// Returns true if the heightmap was sampled and the position is inside the terrain extents. + virtual bool GetInterpolatedHeight (const Object* terrainData, const Vector3f& terrainPosition, const Vector3f& position, float& outputHeight) = 0; + + /// Render all terrains + virtual void CullAllTerrains (int cullingMask) = 0; + /// Set the lightmap index on all terrains + virtual void SetLightmapIndexOnAllTerrains (int lightmapIndex) = 0; + virtual void AddTerrainAndSetActive (TerrainInstance* terrain) = 0; + virtual void RemoveTerrain (TerrainInstance* terrain) = 0; + virtual TerrainInstance* GetActiveTerrain () const = 0; + virtual const TerrainList& GetActiveTerrains () const = 0; + virtual void UnloadTerrainsFromGfxDevice () = 0; + virtual void ReloadTerrainsToGfxDevice () = 0; + + virtual void CollectTreeRenderers(dynamic_array<SceneNode>& sceneNodes, dynamic_array<AABB>& boundingBoxes) const = 0; +}; + +EXPORT_COREMODULE ITerrainManager* GetITerrainManager (); +EXPORT_COREMODULE void SetITerrainManager (ITerrainManager* manager); |