Made position depend on parent

This commit is contained in:
Anton Arbring
2015-04-20 11:34:19 -04:00
parent 2b8b8c0416
commit f95b746ee1
6 changed files with 13 additions and 10 deletions

View File

@@ -107,8 +107,10 @@ private:
double lightTime;
std::string _target;
std::string _frame;
std::string _defaultProjImage;
std::string _next;
bool _capture;
// FBO stuff

View File

@@ -105,7 +105,8 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
_geometry = planetgeometryprojection::PlanetGeometryProjection::createFromDictionary(geometryDictionary);
}
dictionary.getValue(keyFrame, _target);
dictionary.getValue(keyBody, _target);
dictionary.getValue(keyFrame, _frame);
bool b1 = dictionary.getValue(keyInstrument, _instrumentID);
@@ -340,7 +341,7 @@ glm::mat4 RenderablePlanetProjection::computeProjectorMatrix(const glm::vec3 loc
void RenderablePlanetProjection::attitudeParameters(double time){
// precomputations for shader
openspace::SpiceManager::ref().getPositionTransformMatrix(_target, _mainFrame, time, _stateMatrix);
openspace::SpiceManager::ref().getPositionTransformMatrix(_frame, _mainFrame, time, _stateMatrix);
openspace::SpiceManager::ref().getPositionTransformMatrix(_instrumentID, _mainFrame, time, _instrumentMatrix);
_transform = glm::mat4(1);

View File

@@ -26,11 +26,11 @@
#include <openspace/engine/openspaceengine.h>
#include <openspace/util/constants.h>
#include <openspace/util/imagesequencer.h>
#include <openspace/scenegraph/scenegraphnode.h>
#include <openspace/scene/scenegraphnode.h>
#include <openspace/util/spicemanager.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/scenegraph/staticephemeris.h>
#include <openspace/scenegraph/dynamicephemeris.h>
#include <openspace/scene/staticephemeris.h>
#include <openspace/scene/dynamicephemeris.h>
#include <ghoul/filesystem/filesystem>
#include <ghoul/io/texture/texturereader.h>
@@ -225,10 +225,10 @@ void RenderablePlaneProjection::updatePlane(double time, std::string newPath) {
}
if (!_moving) {
SceneGraphNode* thisNode = OsEng.renderEngine()->sceneGraph()->sceneGraphNode(_name);
SceneGraphNode* thisNode = OsEng.renderEngine()->scene()->sceneGraphNode(_name);
bool orphan = thisNode->parent()->abandonChild(thisNode);
if (orphan) {
SceneGraphNode* newParent = OsEng.renderEngine()->sceneGraph()->sceneGraphNode(_target.node);
SceneGraphNode* newParent = OsEng.renderEngine()->scene()->sceneGraphNode(_target.node);
if (newParent != nullptr)
newParent->addNode(thisNode);
}

View File

@@ -1059,7 +1059,7 @@ void RenderEngine::changeViewPoint(std::string origin) {
{ std::string("Type"), std::string("Spice") },
{ std::string("Body"), std::string("NEW HORIZONS") },
{ std::string("Reference"), std::string("GALACTIC") },
{ std::string("Observer"), std::string("JUPITER BARYCENTER") },
{ std::string("Observer"), std::string("SUN") },
{ std::string("Kernels"), ghoul::Dictionary() }
};
newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));

View File

@@ -22,7 +22,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <openspace/scenegraph/dynamicephemeris.h>
#include <openspace/scene/dynamicephemeris.h>
#include <openspace/util/constants.h>

View File

@@ -252,7 +252,7 @@ void SceneGraphNode::evaluate(const Camera* camera, const psc& parentPosition) {
}
void SceneGraphNode::render(const RenderData& data) {
const psc thisPosition = data.position + _ephemeris->position();
const psc thisPosition = data.position + worldPosition();
RenderData newData = {data.camera, thisPosition, data.doPerformanceMeasurement};