Update function focusPosition in Camera and add a solar path for OSIRIS REx.

This commit is contained in:
Kalle Bladin
2016-08-12 16:13:24 -04:00
parent fd5355b00f
commit b0d8dd59f4
4 changed files with 67 additions and 9 deletions

View File

@@ -40,8 +40,67 @@ return {
GuiName = "/Solar/OsirisRex"
},
{
Name = "ORX_OCAMS_POLYCAM",
Parent = "OsirisRex",
Renderable = {
Type = "RenderableModel",
Body = "OSIRIS-REX",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = "models/Osiris.obj",
Magnification = 0,
},
Textures = {
Type = "simple",
Color = "textures/osirisTex.png",
},
Shading = {
PerformShading = true,
Fadeable = false,
Ghosting = false,
},
},
Ephemeris = {
Type = "Spice",
Body = "OSIRIS-REX",
-- Reference = "ECLIPJ2000",
Reference = "GALACTIC",
Observer = BENNU_BODY,
},
Rotation = {
Source = "ORX_SPACECRAFT",
Destination = "GALACTIC"
},
GuiName = "/Solar/OsirisRex"
},
{
Name = "OsirisRexPath",
Name = "OsirisRexPathSolar",
Parent = "SolarSystemBarycenter",
Renderable = {
Type = "RenderablePath",
Body = "OSIRIS-REX",
Frame = "GALACTIC",
Observer = "SUN",
RGB = { 0.0, 1.0, 0.5},
TimeSteps = 86400, -- Number of seconds in a day
PointSteps = 10, -- Every 10 days
Textures = {
Type = "simple",
Color = "textures/glare_blue.png",
-- need to add different texture
},
DrawLine = true,
StartTime = "2016 SEP 8 12:00:00",
EndTime = "2023 SEP 24 12:00:00"
},
GuiName = "/Solar/OsirisRexPathSolar"
},
{
Name = "OsirisRexPathLocal",
Parent = "Bennu2",
Renderable = {
Type = "RenderablePath",
@@ -61,6 +120,6 @@ return {
StartTime = "2016 SEP 8 12:00:00",
EndTime = "2023 SEP 24 12:00:00"
},
GuiName = "/Solar/OsirisRexTrail"
GuiName = "/Solar/OsirisRexPathLocal"
},
}

View File

@@ -51,6 +51,7 @@ namespace {
const std::string keyTimeSteps = "TimeSteps";
const std::string keyPointSteps = "PointSteps";
const std::string keyDrawLine = "DrawLine";
const std::string keRenderDistanceInterval = "RenderDistanceInterval";
}
@@ -74,8 +75,10 @@ RenderablePath::RenderablePath(const ghoul::Dictionary& dictionary)
_successfullDictionaryFetch &= dictionary.getValue(keyFrame, _frame);
_successfullDictionaryFetch &= dictionary.getValue(keyTimeSteps, _increment);
if (!dictionary.getValue(keyPointSteps, _pointSteps))
_pointSteps = 4;
float fPointSteps; // Dictionary can not pick out ints...
if (!dictionary.getValue(keyPointSteps, fPointSteps))
fPointSteps = 4;
_pointSteps = fPointSteps;
glm::vec3 color(0.f);
if (dictionary.hasKeyAndValue<glm::vec3>(keyColor))

View File

@@ -790,6 +790,7 @@ void InteractionHandler::postSynchronizationPreDraw() {
}
else {
_currentInteractionMode->updateCameraStateFromMouseStates(*_camera);
_camera->setFocusPositionVec3(focusNode()->worldPosition());
}
}

View File

@@ -80,11 +80,6 @@ namespace openspace {
void Camera::setFocusPositionVec3(Vec3 pos) {
std::lock_guard<std::mutex> _lock(_mutex);
_focusPosition = pos;
_cachedViewDirection.isDirty = true;
_cachedLookupVector.isDirty = true;
_cachedViewRotationMatrix.isDirty = true;
_cachedCombinedViewMatrix.isDirty = true;
}
void Camera::setRotation(Quat rotation) {