90 enum class WireframeMode :
U8
101 enum class ParallaxMode :
U8
108 enum class TextureUsageType :
U8
110 ALBEDO_ROUGHNESS = 0,
126 void toggleBoundingBoxes();
129 [[nodiscard]] Vert getVert(
F32 x_clampf,
F32 z_clampf,
bool smooth)
const;
130 [[nodiscard]] Vert getVertFromGlobal(
F32 x,
F32 z,
bool smooth)
const;
131 [[nodiscard]]
vec2<U16> getDimensions()
const noexcept;
132 [[nodiscard]]
vec2<F32> getAltitudeRange()
const noexcept;
134 [[nodiscard]]
const Quadtree& getQuadtree()
const noexcept {
return _terrainQuadtree; }
136 void getVegetationStats(
U32& maxGrassInstances,
U32& maxTreeInstances)
const;
139 [[nodiscard]]
const TerrainDescriptor& descriptor()
const noexcept {
return _descriptor; }
141 void saveToXML(boost::property_tree::ptree& pt)
const override;
142 void loadFromXML(
const boost::property_tree::ptree& pt)
override;
145 [[nodiscard]] Vert getVert(
F32 x_clampf,
F32 z_clampf)
const;
146 [[nodiscard]] Vert getSmoothVert(
F32 x_clampf,
F32 z_clampf)
const;
159 bool refreshData)
override;
163 void onEditorChange(std::string_view field);
172 bool postLoad()
override;
180 GenericVertexData_ptr _terrainBuffer =
nullptr;
183 bool _initialSetupDone =
false;
188 std::array<Handle<ShaderProgram>,
to_base(WireframeMode::COUNT)> _terrainColourShader;
189 std::array<Handle<ShaderProgram>,
to_base(WireframeMode::COUNT)> _terrainPrePassShader;
194inline size_t GetHash( Terrain* terrain )
noexcept
196 return GetHash( terrain->descriptor() );
204 terrain._terrainChunks.push_back(chunk);
#define DEFINE_3D_OBJECT_TYPE(Name, Enum)
static void registerTerrainChunk(Terrain &terrain, Divide::TerrainChunk *const chunk)
Handle console commands that start with a forward slash.
size_t GetHash(const PropertyDescriptor< T > &descriptor) noexcept
eastl::vector< Type > vector
eastl::fixed_vector< GenericDrawCommand, 1, true > GenericDrawCommandContainer
T TER_COORD(T x, T y, T width) noexcept
constexpr auto to_base(const Type value) -> Type
static constexpr U16 QUAD_LIST_INDEX_COUNT
static constexpr U8 PATCHES_PER_TILE_EDGE
PROPERTY_RW(vec2< F32 >, SnapGridSize)
PROPERTY_RW(vec2< F32 >, WorldScale)
PROPERTY_RW(U32, tessellatedTriangleWidth, 32u)
void fromDescriptor(const TerrainDescriptor &descriptor) noexcept
static constexpr U8 VTX_PER_TILE_EDGE