Clean up code for planet radius and bounding sphere calculation (#289)

- Remove some power scaled coordaintes.
- Remove spice dependency from sphere geometry.
- Remove dead code.
This commit is contained in:
Emil Axelsson
2017-04-18 09:58:27 +02:00
committed by GitHub
parent 481ee7d821
commit 4b38b33e18
62 changed files with 178 additions and 342 deletions

View File

@@ -27,6 +27,7 @@
#include <openspace/engine/configurationmanager.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/util/spicemanager.h>
#include <glm/glm.hpp>
#define _USE_MATH_DEFINES
#include <math.h>
@@ -39,12 +40,10 @@ namespace {
const char* KeyGridSegments = "GridSegments";
const char* KeyGridRadius = "GridRadius";
const char* KeyGridParentsRotation = "ParentsRotation";
const glm::vec2 GridRadius = { 1.f, 20.f };
}
namespace openspace {
// needs to be set from dictionary - REMEMBER
const PowerScaledScalar radius = PowerScaledScalar(1.f, 20.f);
RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _gridProgram(nullptr)
@@ -78,7 +77,7 @@ RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictio
int nr = 0;
const float fsegments = static_cast<float>(_segments);
const float r = static_cast<float>(radius[0]);
const float r = static_cast<float>(GridRadius[0]);
//int nr2 = 0;
@@ -117,7 +116,7 @@ RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictio
_varray[nr].location[i] = tmp[i];
_varray[nr].normal[i] = normal[i];
}
_varray[nr].location[3] = static_cast<GLfloat>(radius[1]);
_varray[nr].location[3] = static_cast<GLfloat>(GridRadius[1]);
++nr;
}
}