broken because of using Core::RenderContext
This commit is contained in:
parent
6718cd7e5e
commit
7431154600
23
PlanetCreator/cw 6/src/Distribution.cpp
Normal file
23
PlanetCreator/cw 6/src/Distribution.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#include "Distribution.h"
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
|
||||||
|
float humMean; float humSD; float tempMean; float tempSD; std::string name; std::string fileName; Core::RenderContext modelContext; glm::mat4 modelMatrix;
|
||||||
|
Plant::Plant::Plant(float humMean, float humSD, float tempMean, float tempSD, std::string name, std::string fileName) {
|
||||||
|
humMean = humMean;
|
||||||
|
humSD = humSD;
|
||||||
|
tempMean = tempMean;
|
||||||
|
tempSD = tempSD;
|
||||||
|
name = name;
|
||||||
|
fileName = fileName;
|
||||||
|
modelContext = Core::RenderContext{};
|
||||||
|
modelMatrix = glm::mat4();
|
||||||
|
}
|
||||||
|
float Plant::Plant::calcProbability(float xValue, float mean, float sd)
|
||||||
|
{
|
||||||
|
float temp = (xValue - mean) / sd * sqrt(2);
|
||||||
|
return (1+erf(temp))/2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
16
PlanetCreator/cw 6/src/Distribution.h
Normal file
16
PlanetCreator/cw 6/src/Distribution.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <string>
|
||||||
|
#include "Render_Utils.h"
|
||||||
|
#include "Render_Utils.cpp"
|
||||||
|
#include "glm.hpp"
|
||||||
|
|
||||||
|
namespace Plant
|
||||||
|
{
|
||||||
|
class Plant {
|
||||||
|
public:
|
||||||
|
float humMean; float humSD; float tempMean; float tempSD; std::string name; std::string fileName; glm::mat4 modelMatrix;
|
||||||
|
Plant(float humMean, float humSD, float tempMean, float tempSD, std::string name, std::string fileName);
|
||||||
|
static float calcProbability(float xValue, float mean, float sd);
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user