mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 11:39:49 -06:00
Made position depend on parent
This commit is contained in:
@@ -107,8 +107,10 @@ private:
|
||||
double lightTime;
|
||||
|
||||
std::string _target;
|
||||
std::string _frame;
|
||||
std::string _defaultProjImage;
|
||||
std::string _next;
|
||||
|
||||
bool _capture;
|
||||
|
||||
// FBO stuff
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user