28 lines
733 B
C++
28 lines
733 B
C++
#pragma once
|
|
|
|
#include "terrain/shared_mutex.h"
|
|
#include "terrain/terrain_modifier.h"
|
|
|
|
class TerrainModifierDistance : public TerrainModifier {
|
|
GDCLASS(TerrainModifierDistance, TerrainModifier);
|
|
static void _bind_methods();
|
|
void curves_changed();
|
|
bool update_bounds();
|
|
|
|
protected:
|
|
void _notification(int what);
|
|
float distance_at(Vector2 const &world_coordinate);
|
|
|
|
public:
|
|
float evaluate_at(Vector2 world_coordinate, float before) override;
|
|
PackedStringArray get_configuration_warnings() const override;
|
|
|
|
private:
|
|
SharedMutex lock{};
|
|
Ref<Curve> distance_weight_curve{};
|
|
Ref<Curve> distance_weight_curve_buffer{};
|
|
|
|
public:
|
|
void set_distance_weight_curve(Ref<Curve> curve);
|
|
Ref<Curve> get_distance_weight_curve() const;
|
|
};
|