Merge branch 'master' into feature/animation-fixes

This commit is contained in:
Malin E
2021-09-28 08:40:16 +02:00
5 changed files with 19 additions and 13 deletions

View File

@@ -832,16 +832,16 @@ public:
~SessionRecording_legacy_0085() {}
char FileHeaderVersion[FileHeaderVersionLength+1] = "00.85";
char TargetConvertVersion[FileHeaderVersionLength+1] = "01.00";
std::string fileFormatVersion() {
std::string fileFormatVersion() override {
return std::string(FileHeaderVersion);
}
std::string targetFileFormatVersion() {
std::string targetFileFormatVersion() override {
return std::string(TargetConvertVersion);
}
std::string getLegacyConversionResult(std::string filename, int depth);
std::string getLegacyConversionResult(std::string filename, int depth) override;
struct ScriptMessage_legacy_0085 : public datamessagestructures::ScriptMessage {
void read(std::istream* in) {
void read(std::istream* in) override {
size_t strLen;
//Read string length from file
in->read(reinterpret_cast<char*>(&strLen), sizeof(strLen));
@@ -860,7 +860,7 @@ public:
protected:
bool convertScript(std::stringstream& inStream, DataMode mode, int lineNum,
std::string& inputLine, std::ofstream& outFile, unsigned char* buffer);
std::string& inputLine, std::ofstream& outFile, unsigned char* buffer) override;
};
} // namespace openspace

View File

@@ -196,7 +196,9 @@ struct CameraKeyframe {
<< std::fixed << std::setprecision(7) << _rotation.y << ' '
<< std::fixed << std::setprecision(7) << _rotation.z << ' '
<< std::fixed << std::setprecision(7) << _rotation.w << ' ';
out << std::scientific << _scale << ' ';
out << std::fixed
<< std::setprecision(std::numeric_limits<double>::max_digits10)
<< _scale << ' ';
if (_followNodeRotation) {
out << "F ";
}

View File

@@ -42,5 +42,5 @@ elseif extension == ".asset" then
return [[openspace.printInfo("Adding asset: ']] .. filename .. [[' (drag-and-drop)");
openspace.asset.add("]] .. filename .. [[");]] .. ReloadUIScript
elseif extension == ".osrec" or extension == ".osrectxt" then
return [[openspace.sessionRecording.startPlayback("]] .. basename .. [[")]]
return [[openspace.sessionRecording.startPlayback("]] .. filename .. [[")]]
end

View File

@@ -355,15 +355,15 @@ bool SessionRecording::startPlayback(std::string& filename,
bool loop)
{
std::string absFilename;
// Run through conversion in case file is older. Does nothing if the file format
// is up-to-date
filename = convertFile(filename);
if (std::filesystem::is_regular_file(filename)) {
absFilename = filename;
}
else {
absFilename = absPath("${RECORDINGS}/" + filename).string();
}
// Run through conversion in case file is older. Does nothing if the file format
// is up-to-date
absFilename = convertFile(absFilename);
if (_state == SessionState::Recording) {
LERROR("Unable to start playback while in session recording mode");
@@ -1777,7 +1777,6 @@ bool SessionRecording::addKeyframe(Timestamps t3stamps,
void SessionRecording::moveAheadInTime() {
using namespace std::chrono;
bool paused = global::timeManager->isPaused();
bool playbackPaused = (_state == SessionState::PlaybackPaused);
if (playbackPaused) {
_playbackPauseOffset
@@ -2202,7 +2201,7 @@ void SessionRecording::readFileIntoStringStream(std::string filename,
std::ifstream& inputFstream,
std::stringstream& stream)
{
std::filesystem::path conversionInFilename = absPath("${RECORDINGS}/" + filename);
std::filesystem::path conversionInFilename = absPath(filename);
if (!std::filesystem::is_regular_file(conversionInFilename)) {
throw ConversionError(fmt::format(
"Cannot find the specified playback file {} to convert", conversionInFilename

View File

@@ -291,7 +291,12 @@ SceneGraphNode* findNodeNearTarget(const SceneGraphNode* node) {
global::navigationHandler->pathNavigator().relevantNodes();
for (SceneGraphNode* n : relevantNodes) {
if (n->identifier() == node->identifier()) {
bool isSame = (n->identifier() == node->identifier());
// If the nodes are in the very same position, they are probably representing
// the same object
isSame |= glm::distance(n->worldPosition(), node->worldPosition()) < Epsilon;
if (isSame) {
continue;
}