mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Changed to standard position method for renderablesatellites
This commit is contained in:
@@ -593,7 +593,12 @@ void RenderableSatellites::updateBuffers() {
|
||||
double timeOffset = orbit.period *
|
||||
static_cast<double>(i)/ static_cast<double>(_nSegments);
|
||||
|
||||
glm::dvec3 position = _keplerTranslator.debrisPos(timeOffset + orbit.epoch);
|
||||
glm::dvec3 position = _keplerTranslator.position({
|
||||
{},
|
||||
Time(timeOffset + orbit.epoch),
|
||||
Time(0.0),
|
||||
false
|
||||
});
|
||||
|
||||
double positionX = position.x;
|
||||
double positionY = position.y;
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
// /****************************************************************************************
|
||||
// * *
|
||||
// * OpenSpace *
|
||||
// * *
|
||||
// * Copyright (c) 2014-2018 *
|
||||
// * *
|
||||
// * Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
// * software and associated documentation files (the "Software"), to deal in the Software *
|
||||
// * without restriction, including without limitation the rights to use, copy, modify, *
|
||||
// * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
// * permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
// * conditions: *
|
||||
// * *
|
||||
// * The above copyright notice and this permission notice shall be included in all copies *
|
||||
// * or substantial portions of the Software. *
|
||||
// * *
|
||||
// * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
// * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
// * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
// * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
// * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
// * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
// ****************************************************************************************/
|
||||
/****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_MODULE_BASE___RenderableSatellites___H__
|
||||
#define __OPENSPACE_MODULE_BASE___RenderableSatellites___H__
|
||||
|
||||
@@ -412,8 +412,12 @@ std::vector<glm::dvec3> getPositionBuffer(std::vector<KeplerParameters> tleData,
|
||||
orbit.period,
|
||||
orbit.epoch
|
||||
);
|
||||
// double timeInSeconds = Time::convertTime(timeStamp);
|
||||
glm::dvec3 position = keplerTranslator.debrisPos(timeInSeconds);
|
||||
glm::dvec3 position = keplerTranslator.position({
|
||||
{},
|
||||
Time(timeInSeconds),
|
||||
Time(0.0),
|
||||
false
|
||||
});
|
||||
// LINFO(fmt::format("cart: {} ", position));
|
||||
glm::dvec3 sphPos;
|
||||
if( gridType == "Spherical"){
|
||||
|
||||
@@ -290,27 +290,7 @@ glm::dvec3 KeplerTranslation::position(const UpdateData& data) const {
|
||||
_orbitPlaneDirty = false;
|
||||
}
|
||||
|
||||
const double t = data.time.j2000Seconds() - _epoch;
|
||||
const double meanMotion = glm::two_pi<double>() / _period;
|
||||
const double meanAnomaly = glm::radians(_meanAnomalyAtEpoch.value()) + t * meanMotion;
|
||||
const double e = eccentricAnomaly(meanAnomaly);
|
||||
|
||||
// Use the eccentric anomaly to compute the actual location
|
||||
const glm::dvec3 p = {
|
||||
_semiMajorAxis * 1000.0 * (cos(e) - _eccentricity),
|
||||
_semiMajorAxis * 1000.0 * sin(e) * sqrt(1.0 - _eccentricity * _eccentricity),
|
||||
0.0
|
||||
};
|
||||
return _orbitPlaneRotation * p;
|
||||
}
|
||||
|
||||
glm::dvec3 KeplerTranslation::debrisPos(const double& time) const {
|
||||
if (_orbitPlaneDirty) {
|
||||
computeOrbitPlane();
|
||||
_orbitPlaneDirty = false;
|
||||
}
|
||||
|
||||
const double t = time -_epoch;
|
||||
const double t = data.time.j2000Seconds() -_epoch;
|
||||
const double meanMotion = glm::two_pi<double>() / _period;
|
||||
const double meanAnomaly = glm::radians(_meanAnomalyAtEpoch.value()) + t * meanMotion;
|
||||
const double e = eccentricAnomaly(meanAnomaly);
|
||||
|
||||
@@ -70,10 +70,6 @@ public:
|
||||
*/
|
||||
glm::dvec3 position(const UpdateData& data) const override;
|
||||
|
||||
// Is only used in renderableDebris / satellites.
|
||||
glm::dvec3 debrisPos(const double& time) const;
|
||||
|
||||
|
||||
/**
|
||||
* Method returning the openspace::Documentation that describes the ghoul::Dictinoary
|
||||
* that can be passed to the constructor.
|
||||
|
||||
@@ -6,14 +6,13 @@
|
||||
-- occurs in a single window, a fisheye projection, or a dome cluster system
|
||||
|
||||
-- A regular 1280x720 window
|
||||
-- SGCTConfig = sgct.config.single{}
|
||||
SGCTConfig = sgct.config.single{}
|
||||
|
||||
-- A regular 1920x1080 window
|
||||
-- SGCTConfig = sgct.config.single{1920, 1080}
|
||||
|
||||
-- A windowed 1920x1080 fullscreen
|
||||
|
||||
SGCTConfig = sgct.config.single{1920, 1080, border=false, windowPos={0,0}}
|
||||
-- SGCTConfig = sgct.config.single{1920, 1080, border=false, windowPos={0,0}}
|
||||
|
||||
-- One window for the GUI and one window for Rendering. Good for presenting on a projector.
|
||||
-- SGCTConfig = "${CONFIG}/single_gui.xml"
|
||||
|
||||
Reference in New Issue
Block a user