Kelsidavis-WoWee/tools/editor/editor_brush.hpp
Kelsi a91233a6ec feat(editor): erosion brush, NPC load, auto-save
- Erode brush mode: simulates water erosion by moving height downhill
  based on slope, creating natural drainage patterns and gullies
- NPC JSON loader: File > Load NPCs parses saved creatures.json back
  into the spawn list (round-trip save/load now works)
- Auto-save: every 5 minutes when unsaved changes exist, exports the
  full zone (ADT + WDT + creatures) to the output directory
- Sculpt mode now has 6 brush types: Raise/Lower/Smooth/Flatten/Level/Erode
2026-05-05 04:44:54 -07:00

45 lines
938 B
C++

#pragma once
#include <glm/glm.hpp>
namespace wowee {
namespace editor {
enum class BrushMode {
Raise,
Lower,
Smooth,
Flatten,
Level,
Erode
};
struct BrushSettings {
BrushMode mode = BrushMode::Raise;
float radius = 30.0f;
float strength = 5.0f;
float falloff = 0.5f; // 0 = hard edge, 1 = full falloff
float flattenHeight = 0.0f;
};
class EditorBrush {
public:
BrushSettings& settings() { return settings_; }
const BrushSettings& settings() const { return settings_; }
bool isActive() const { return active_; }
void setActive(bool a) { active_ = a; }
const glm::vec3& getPosition() const { return worldPos_; }
void setPosition(const glm::vec3& pos) { worldPos_ = pos; }
float getInfluence(float distance) const;
private:
BrushSettings settings_;
glm::vec3 worldPos_{0.0f};
bool active_ = false;
};
} // namespace editor
} // namespace wowee