feat: realtime editing

This commit is contained in:
Sara Gerretsen 2026-02-23 12:01:35 +01:00
parent cd4f619a20
commit fc6034242e
5 changed files with 146 additions and 12 deletions

View file

@ -14,6 +14,7 @@ public:
GDENUM(BlendMode, Add, Subtract, Override);
protected:
void _notification(int what);
float blend(float under, float over);
public:
@ -24,8 +25,12 @@ private:
BlendMode blend_mode{ Add };
public:
GET_SET_FNS(float, blend_distance);
GET_SET_FNS(BlendMode, blend_mode);
void set_blend_distance(float value);
float get_blend_distance() const;
void set_blend_mode(BlendMode mode);
BlendMode get_blend_mode() const;
static String const sig_changed;
};
MAKE_TYPE_INFO(TerrainModifier::BlendMode, Variant::INT);
@ -46,6 +51,8 @@ private:
Ref<Curve> distance_height_curve{};
public:
GET_SET_FNS_EX(Ref<Curve>, distance_weight_curve, update_configuration_warnings());
GET_SET_FNS_EX(Ref<Curve>, distance_height_curve, update_configuration_warnings());
void set_distance_weight_curve(Ref<Curve> curve);
Ref<Curve> get_distance_weight_curve() const;
void set_distance_height_curve(Ref<Curve> curve);
Ref<Curve> get_distance_height_curve() const;
};