Updated world module (now voronoi roads work
This commit is contained in:
29
modules/world/world_height_map.h
Normal file
29
modules/world/world_height_map.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef WORLD_HEIGHT_MAP_H
|
||||
#define WORLD_HEIGHT_MAP_H
|
||||
#include <core/resource.h>
|
||||
#include <core/math/random_number_generator.h>
|
||||
#include <core/math/rect2.h>
|
||||
#include <modules/opensimplex/open_simplex_noise.h>
|
||||
#include <scene/main/node.h>
|
||||
class WorldHeightMap: public Resource {
|
||||
GDCLASS(WorldHeightMap, Resource);
|
||||
public:
|
||||
WorldHeightMap();
|
||||
~WorldHeightMap();
|
||||
protected:
|
||||
Ref<OpenSimplexNoise> noise;
|
||||
Ref<Curve> curve;
|
||||
bool _set(const StringName &p_name, const Variant &p_value);
|
||||
bool _get(const StringName &p_name, Variant &r_ret) const;
|
||||
void _get_property_list(List<PropertyInfo> *p_list) const;
|
||||
static void _bind_methods();
|
||||
public:
|
||||
void update_all();
|
||||
float get_surface_height(float x, float y);
|
||||
float get_base_height(float x, float y);
|
||||
float get_base_steepness(float x, float y);
|
||||
void draw_height_map(Node *draw, const Rect2 &draw_rect, const Rect2 &world_rect);
|
||||
private:
|
||||
int seed;
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user