Files
directx-plane-game/Graphics2/PerlinTerrainNode.h
iDunnoDev f6bba67897 Added follow cam
Added "Controlled" mesh classes
Added Global Lighting Class
Added Gamepad controls
Split terrain nodes into Height and Perlin classes
Fixed Splitmesh node stuff
2022-05-09 17:50:22 +01:00

30 lines
759 B
C++

#pragma once
#include "DirectXFramework.h"
#include <vector>
#include <numeric>
#include <random>
#include "SharedMethods.h"
#include "TerrainNode.h"
class PerlinTerrainNode : public TerrainNode
{
public:
PerlinTerrainNode(wstring name, wstring seed, float offsetX, float offsetY, float chunkSize, int layers, int widthX = 1023, int widthZ = 1023, float waterHeight = 150.0f, int cellSizeX = 10, int cellSizeZ = 10);
private:
vector<int> p;
float _offsetX;
float _offsetY;
float _chunkSize;
int _layers;
float Fade(float t);
float Grad(int hash, float x, float y);
bool GeneratePerlinHeights();
float GetPerlinValueAt(float x, float y, int octaves, float persistance);
float GetNoiseValueAt(float x, float y);
void GeneratePerlinValues();
};