Planet Shadows

This commit is contained in:
Jonathas Costa
2016-05-16 15:41:04 -04:00
parent 31e6b0e2b3
commit 3fa5ed39d5
9 changed files with 586 additions and 38 deletions
+20
View File
@@ -31,6 +31,9 @@
#include <openspace/properties/stringproperty.h>
#include <openspace/util/updatestructures.h>
#include <vector>
#include <string>
// ghoul includes
namespace ghoul {
namespace opengl {
@@ -46,6 +49,21 @@ class PlanetGeometry;
}
class RenderablePlanet : public Renderable {
public:
// Shadow structure
typedef struct {
std::pair<std::string, float> source;
std::pair<std::string, float> caster;
} ShadowConf;
struct ShadowRenderingStruct {
float xu, xp;
float rs, rc;
glm::vec3 sourceCasterVec;
glm::vec3 casterPositionVec;
bool isShadowing;
};
public:
RenderablePlanet(const ghoul::Dictionary& dictionary);
~RenderablePlanet();
@@ -69,6 +87,8 @@ private:
properties::BoolProperty _performShading;
properties::IntProperty _rotation;
float _alpha;
std::vector< ShadowConf > _shadowConfArray;
float _planetRadius;
glm::dmat3 _stateMatrix;
std::string _nightTexturePath;