diff --git a/PlanetCreator/cw 6/src/Distribution.cpp b/PlanetCreator/cw 6/src/Distribution.cpp index ae8aa6a..0bc5d77 100644 --- a/PlanetCreator/cw 6/src/Distribution.cpp +++ b/PlanetCreator/cw 6/src/Distribution.cpp @@ -1,23 +1,34 @@ #include "Distribution.h" - +#include "glm.hpp" +#include #include - - - 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(); +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) { + this->humMean = humMean; + this->humSD = humSD; + this->tempMean = tempMean; + this->tempSD = tempSD; + this->name = name; + this->fileName = fileName; + //this->modelContext = Core::RenderContext{}; + this->modelMatrix = glm::mat4(); } - float Plant::Plant::calcProbability(float xValue, float mean, float sd) + + float calcProbability(float xValue, float mean, float sd) { float temp = (xValue - mean) / sd * sqrt(2); - return (1+erf(temp))/2; + return (1 + erf(temp)) / 2; } + } + ; +} + + + + diff --git a/PlanetCreator/cw 6/src/Distribution.h b/PlanetCreator/cw 6/src/Distribution.h index 70f9b48..d894fe3 100644 --- a/PlanetCreator/cw 6/src/Distribution.h +++ b/PlanetCreator/cw 6/src/Distribution.h @@ -1,16 +1,20 @@ -#pragma once -#include -#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); - - }; -} \ No newline at end of file +//#pragma once +//#include +////#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; +// //Core::RenderContext modelContext; +// +// 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); +// +// }; +//} \ No newline at end of file diff --git a/PlanetCreator/cw 6/src/ex_6_1.hpp b/PlanetCreator/cw 6/src/ex_6_1.hpp index 3a759cd..a9f8e34 100644 --- a/PlanetCreator/cw 6/src/ex_6_1.hpp +++ b/PlanetCreator/cw 6/src/ex_6_1.hpp @@ -10,7 +10,8 @@ #include "Shader_Loader.h" #include "Render_Utils.h" #include "Texture.h" - +#include "Distribution.h" +#include "Distribution.cpp" #include "Box.cpp" #include #include