4jcraft/targets/minecraft/world/level/levelgen/synth/Rotate.cpp

16 lines
332 B
C++

#include "Rotate.h"
#include <cmath>
#include "minecraft/world/level/levelgen/synth/Synth.h"
Rotate::Rotate(Synth* synth, float angle) {
this->synth = synth;
_sin = sin(angle);
_cos = cos(angle);
}
double Rotate::getValue(double x, double y) {
return synth->getValue(x * _cos + y * _sin, y * _cos - x * _sin);
}