Nebula
Loading...
Searching...
No Matches
terraineditor.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
20//------------------------------------------------------------------------------
21#if WITH_NEBULA_EDITOR
22#include "neweditor/core/editorpanel.h"
24
25namespace Editor
26{
27struct ToolView;
28}
29
30namespace GraphicsFeature
31{
32
33class TerrainPanel final : public Editor::EditorPanel
34{
36public:
38 virtual ~TerrainPanel();
39
40 void Draw() override;
41 bool OnEditAction(Editor::EditAction action) override;
42
44 static void Register();
46 static void Clear();
47
48protected:
49 bool OnSetup() override;
50
51private:
53 TerrainSession* SelectedSession(bool create);
55 void DrawTools(TerrainSession* session);
56 void DrawSettings(TerrainSession* session);
57 void DrawBiomes(TerrainSession* session);
58 void DrawPlants(TerrainSession* session);
60 bool SaveSession(TerrainSession* session);
61
63 static bool ViewportInput(const Editor::ToolView& view);
65 static void UpdateSessions();
66 static void ListUnsaved(Util::Array<Util::String>& out);
67 static bool SaveUnsaved();
68
70 void CommandTerrain(const Util::Array<Util::String>& args);
71
72 static TerrainPanel* instance;
73
74 TerrainBrush brush;
75 bool editing;
77 TerrainSession::Map paintMap;
78 IndexT paintIndex;
79 IndexT selectedBiome;
80 IndexT selectedPlant;
81 char saveFile[256];
82
84 Ptr<TerrainSession> strokeSession;
85 Math::vec3 hover;
86 bool hoverValid;
87};
88
89} // namespace GraphicsFeature
90#endif // WITH_NEBULA_EDITOR
91//------------------------------------------------------------------------------
The terrain editor: sculpting the heightmap, painting where each biome and each plant is,...
One terrain being edited: the Terrain component of an entity in a scene, the terrain file it names an...
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Nebula's dynamic array class.
Definition array.h:61
Definition graphicsfeatureunit.cc:66
#define __DeclareClass(type)
A 3D vector.
Definition vec3.h:37
int IndexT
Definition types.h:49