Merge branch 'develop' into feature/test

This commit is contained in:
Alexander Bock
2016-07-08 11:03:07 +02:00
10 changed files with 46 additions and 97 deletions
+10 -28
View File
@@ -1,35 +1,17 @@
<?xml version="1.0" ?>
<Cluster masterAddress="127.0.0.1">
<Node address="127.0.0.1" port="20401">
<Window fullScreen="false">
<Cluster masterAddress="localhost">
<Node address="localhost" port="20401">
<Window fullScreen="false" numberOfSamples="8" name="OpenSpace">
<Stereo type="side_by_side" />
<!-- <Stereo type="side_by_side_inverted" /> -->
<Pos x="200" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="360" />
<Viewport eye="left">
<Size x="3840" y="1080" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="0.5" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-1.778" y="-1.0" z="0.0" />
<!-- Upper left -->
<Pos x="-1.778" y="1.0" z="0.0" />
<!-- Upper right -->
<Pos x="1.778" y="1.0" z="0.0" />
</Viewplane>
</Viewport>
<Viewport eye="right">
<Pos x="0.5" y="0.0" />
<Size x="0.5" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-1.778" y="-1.0" z="0.0" />
<!-- Upper left -->
<Pos x="-1.778" y="1.0" z="0.0" />
<!-- Upper right -->
<Pos x="1.778" y="1.0" z="0.0" />
</Viewplane>
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="16.875" left="30.0" right="30.0" up="16.875" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
+1 -1
View File
@@ -37,7 +37,7 @@ return {
-- IoTrail module
{
Name = "IoTrail",
Parent = "Io",
Parent = "JupiterBarycenter",
Renderable = {
Type = "RenderableTrail",
Body = "IO",
+1 -1
View File
@@ -1,6 +1,6 @@
return {
FileRequest = {
{ Identifier = "rosetta_model", Destination = "obj", Version = 1 },
{ Identifier = "rosetta_model", Destination = "obj", Version = 2 },
{ Identifier = "rosetta_textures", Destination = "textures", Version = 1 }
},
TorrentFiles = {
+1 -50
View File
@@ -8,7 +8,7 @@ return {
Body = "ROSETTA",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = "obj/mainbodyros.obj",
GeometryFile = "obj/Rosetta.obj",
Magnification = 1,
},
Textures = {
@@ -126,55 +126,6 @@ return {
},
GuiName = "RosettaCometTrail"
},
-- Rosetta Solar Array module 1
{
Name = "RosettaSolar1",
Parent = "Rosetta",
Renderable = {
Type = "RenderableModel",
Body = "ROSETTA",
Geometry = {
Type = "MultiModelGeometry",
Magnification = 1,
GeometryFile = "obj/solarpanelleft.obj",
},
Textures = {
Type = "simple",
Color = "textures/gray.png",
},
Rotation = {
Source = "ROS_SA+Y",
Destination = "ROS_SPACECRAFT"
},
},
},
-- Rosetta Solar Array module 2
{
Name = "RosettaSolar2",
Parent = "Rosetta",
Renderable = {
Type = "RenderableModel",
Body = "ROSETTA",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = "obj/solarpanelright.obj",
Magnification = 1,
},
Textures = {
Type = "simple",
Color = "textures/gray.png",
},
Rotation = {
Source = "ROS_SA-Y",
Destination = "ROS_SPACECRAFT"
},
},
},
-- RosettaFov main module
{
Name = "NAVCAM",
Parent = "Rosetta",
+4 -1
View File
@@ -28,6 +28,7 @@
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/misc/assert.h>
#include <memory>
#include <stdint.h>
#include <vector>
@@ -43,6 +44,8 @@ public:
SyncBuffer(size_t n);
~SyncBuffer();
void encode(const std::string& s) {
const size_t size = sizeof(char) * s.size() + sizeof(int32_t);
ghoul_assert(_encodeOffset + size < _n, "");
@@ -107,7 +110,7 @@ private:
size_t _encodeOffset;
size_t _decodeOffset;
std::vector<char> _dataStream;
sgct::SharedVector<char>* _synchronizationBuffer;
std::unique_ptr<sgct::SharedVector<char>> _synchronizationBuffer;
};
} // namespace openspace
+1 -1
View File
@@ -674,7 +674,7 @@ void OpenSpaceEngine::loadFonts() {
if (!initSuccess)
LERROR("Error initializing default font renderer");
ghoul::fontrendering::FontRenderer::defaultRenderer().setWindowSize(glm::vec2(_windowWrapper->currentDrawBufferResolution()));
ghoul::fontrendering::FontRenderer::defaultRenderer().setFramebufferSize(glm::vec2(_windowWrapper->currentDrawBufferResolution()));
}
+15 -8
View File
@@ -347,7 +347,7 @@ void RenderEngine::postSynchronizationPreDraw() {
if (windowResized) {
glm::ivec2 res = OsEng.windowWrapper().currentDrawBufferResolution();
_renderer->setResolution(res);
ghoul::fontrendering::FontRenderer::defaultRenderer().setWindowSize(glm::vec2(res));
ghoul::fontrendering::FontRenderer::defaultRenderer().setFramebufferSize(glm::vec2(res));
}
// update and evaluate the scene starting from the root node
@@ -849,9 +849,11 @@ void RenderEngine::changeViewPoint(std::string origin) {
if (origin == "Sun") {
solarSystemBarycenterNode->setParent(scene()->sceneGraphNode("SolarSystem"));
plutoBarycenterNode->setParent(solarSystemBarycenterNode);
if (plutoBarycenterNode)
plutoBarycenterNode->setParent(solarSystemBarycenterNode);
jupiterBarycenterNode->setParent(solarSystemBarycenterNode);
newHorizonsNode->setParent(solarSystemBarycenterNode);
if (newHorizonsNode)
newHorizonsNode->setParent(solarSystemBarycenterNode);
//newHorizonsGhostNode->setParent(solarSystemBarycenterNode);
//newHorizonsTrailNode->setParent(solarSystemBarycenterNode);
@@ -877,7 +879,8 @@ void RenderEngine::changeViewPoint(std::string origin) {
solarSystemBarycenterNode->setEphemeris(new StaticEphemeris);
jupiterBarycenterNode->setEphemeris(new SpiceEphemeris(jupiterDictionary));
plutoBarycenterNode->setEphemeris(new SpiceEphemeris(plutoDictionary));
if (plutoBarycenterNode)
plutoBarycenterNode->setEphemeris(new SpiceEphemeris(plutoDictionary));
ghoul::Dictionary newHorizonsDictionary =
{
@@ -887,7 +890,8 @@ void RenderEngine::changeViewPoint(std::string origin) {
{ std::string("Observer"), std::string("SUN") },
{ std::string("Kernels"), ghoul::Dictionary() }
};
newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
if (newHorizonsNode)
newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
//newHorizonsTrailNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
@@ -937,7 +941,8 @@ void RenderEngine::changeViewPoint(std::string origin) {
jupiterBarycenterNode->setEphemeris(new StaticEphemeris);
solarSystemBarycenterNode->setParent(jupiterBarycenterNode);
newHorizonsNode->setParent(jupiterBarycenterNode);
if (newHorizonsNode)
newHorizonsNode->setParent(jupiterBarycenterNode);
//newHorizonsTrailNode->setParent(jupiterBarycenterNode);
//dawnNode->setParent(jupiterBarycenterNode);
@@ -971,8 +976,10 @@ void RenderEngine::changeViewPoint(std::string origin) {
{ std::string("Kernels"), ghoul::Dictionary() }
};
solarSystemBarycenterNode->setEphemeris(new SpiceEphemeris(solarDictionary));
plutoBarycenterNode->setEphemeris(new SpiceEphemeris(plutoDictionary));
newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
if (plutoBarycenterNode)
plutoBarycenterNode->setEphemeris(new SpiceEphemeris(plutoDictionary));
if (newHorizonsNode)
newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
//newHorizonsGhostNode->setParent(jupiterBarycenterNode);
//newHorizonsTrailNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
+2 -3
View File
@@ -654,13 +654,12 @@ void ScriptEngine::postSynchronizationPreDraw() {
while (!scripts.empty()) {
try {
const std::string& script = scripts.back();
scripts.pop_back();
runScript(script);
runScript(scripts.back());
}
catch (const ghoul::RuntimeError& e) {
LERRORC(e.component, e.message);
}
scripts.pop_back();
}
}
+10 -3
View File
@@ -32,22 +32,29 @@ SyncBuffer::SyncBuffer(size_t n)
: _n(n)
, _encodeOffset(0)
, _decodeOffset(0)
, _synchronizationBuffer(new sgct::SharedVector<char>())
{
_dataStream.resize(_n);
}
SyncBuffer::~SyncBuffer() {
// The destructor is defined here, so that the otherwise default inlined destructor is
// not created (which would make it impossible to use a forward declaration with
// unique_ptr
}
void SyncBuffer::write() {
_synchronizationBuffer->setVal(_dataStream);
sgct::SharedData::instance()->writeVector(_synchronizationBuffer);
sgct::SharedData::instance()->writeVector(_synchronizationBuffer.get());
_encodeOffset = 0;
_decodeOffset = 0;
}
void SyncBuffer::read() {
sgct::SharedData::instance()->readVector(_synchronizationBuffer);
sgct::SharedData::instance()->readVector(_synchronizationBuffer.get());
_dataStream = std::move(_synchronizationBuffer->getVal());
_encodeOffset = 0;
_decodeOffset = 0;
}
} // namespace openspace
} // namespace openspace