godot_voxel/util/noise/fast_noise_2.h
Marc Gilleron 973cf729cd Added FastNoise2 for SIMD noise, but it won't be integrated yet.
It requires C++17, while Godot uses C++14. I was unable to override it,
and I'm not sure how compatible this will be with the runtime.
At least this would be doable in Godot 4.
2021-01-09 16:35:40 +00:00

27 lines
698 B
C++

#ifndef VOXEL_FAST_NOISE_2_H
#define VOXEL_FAST_NOISE_2_H
#include "FastNoise/FastNoise.h"
#include <core/resource.h>
// Can't call it FastNoise? because FastNoise is a namespace already
class FastNoise2 : public Resource {
GDCLASS(FastNoise2, Resource)
public:
FastNoise2();
void set_encoded_node_tree(String data);
String get_encoded_node_tree() const;
void get_noise_2d(unsigned int count, const float *src_x, const float *src_y, float *dst);
void get_noise_3d(unsigned int count, const float *src_x, const float *src_y, const float *src_z, float *dst);
private:
static void _bind_methods();
FastNoise::SmartNode<> _generator;
int _seed = 1337;
};
#endif // VOXEL_FAST_NOISE_2_H