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
This commit is contained in:
29
Graphics2/PerlinTerrainNode.h
Normal file
29
Graphics2/PerlinTerrainNode.h
Normal file
@ -0,0 +1,29 @@
|
||||
#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();
|
||||
};
|
||||
|
Reference in New Issue
Block a user