mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 20:21:24 -06:00
add option to sessionrecording to override recording stereo depth
This commit is contained in:
@@ -595,6 +595,10 @@ public:
|
||||
|
||||
void binary2ascii(const std::string& filename);
|
||||
|
||||
void setOverrideRecordingStereoDepth(bool override);
|
||||
|
||||
const bool shouldOverrideRecordingStereoDepth() const;
|
||||
|
||||
protected:
|
||||
properties::BoolProperty _renderPlaybackInformation;
|
||||
properties::BoolProperty _ignoreRecordedScale;
|
||||
@@ -740,6 +744,7 @@ protected:
|
||||
double _playbackPauseOffset = 0.0;
|
||||
double _previousTime = 0.0;
|
||||
|
||||
bool _overrideRecordingStereoDepth = false;
|
||||
bool _saveRenderingDuringPlayback = false;
|
||||
double _saveRenderingDeltaTime = 1.0 / 30.0;
|
||||
double _saveRenderingCurrentRecordedTime = 0.0;
|
||||
|
||||
@@ -2713,6 +2713,14 @@ void SessionRecording::binary2ascii(const std::string& filename) {
|
||||
}
|
||||
}
|
||||
|
||||
void SessionRecording::setOverrideRecordingStereoDepth(bool value) {
|
||||
_overrideRecordingStereoDepth = value;
|
||||
}
|
||||
|
||||
const bool SessionRecording::shouldOverrideRecordingStereoDepth() const {
|
||||
return _overrideRecordingStereoDepth;
|
||||
}
|
||||
|
||||
bool SessionRecording_legacy_0085::convertScript(std::stringstream& inStream,
|
||||
DataMode mode, int lineNum,
|
||||
std::string& inputLine,
|
||||
@@ -2754,8 +2762,9 @@ scripting::LuaLibrary SessionRecording::luaLibrary() {
|
||||
codegen::lua::SetPlaybackPause,
|
||||
codegen::lua::TogglePlaybackPause,
|
||||
codegen::lua::IsPlayingBack,
|
||||
codegen::lua::IsRecording
|
||||
codegen::lua::Binary2ascii
|
||||
codegen::lua::IsRecording,
|
||||
codegen::lua::Binary2ascii,
|
||||
codegen::lua::SetOverrideRecordingStereoDepth
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -214,6 +214,10 @@ namespace {
|
||||
openspace::global::sessionRecording->binary2ascii(fp);
|
||||
}
|
||||
|
||||
[[codegen::luawrap]] void setOverrideRecordingStereoDepth(bool value) {
|
||||
openspace::global::sessionRecording->setOverrideRecordingStereoDepth(value);
|
||||
}
|
||||
|
||||
#include "sessionrecording_lua_codegen.cpp"
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <openspace/camera/camera.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/interaction/sessionrecording.h>
|
||||
#include <openspace/scene/scenegraphnode.h>
|
||||
#include <openspace/scene/scene.h>
|
||||
#include <openspace/util/time.h>
|
||||
@@ -150,7 +151,7 @@ bool KeyframeNavigator::updateCamera(Camera* camera, const CameraPose& prevPose,
|
||||
// We want to affect view scaling, such that we achieve
|
||||
// logarithmic interpolation of distance to an imagined focus node.
|
||||
// To do this, we interpolate the scale reciprocal logarithmically.
|
||||
if (!ignoreFutureKeyframes) {
|
||||
if (!ignoreFutureKeyframes && !global::sessionRecording->shouldOverrideRecordingStereoDepth()) {
|
||||
const float prevInvScaleExp = glm::log(1.f / prevPose.scale);
|
||||
const float nextInvScaleExp = glm::log(1.f / nextPose.scale);
|
||||
const float interpolatedInvScaleExp = static_cast<float>(
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <openspace/events/eventengine.h>
|
||||
#include <openspace/interaction/actionmanager.h>
|
||||
#include <openspace/interaction/scriptcamerastates.h>
|
||||
#include <openspace/interaction/sessionrecording.h>
|
||||
#include <openspace/navigation/navigationstate.h>
|
||||
#include <openspace/navigation/waypoint.h>
|
||||
#include <openspace/network/parallelpeer.h>
|
||||
@@ -241,6 +242,9 @@ void NavigationHandler::updateCamera(double deltaTime) {
|
||||
// If we're in session recording payback mode, the session recording is responsible
|
||||
// for navigation. So don't do anything more here
|
||||
if (playbackMode || !_camera) {
|
||||
if (global::sessionRecording->shouldOverrideRecordingStereoDepth()) {
|
||||
_orbitalNavigator.updateCameraScalingFromAnchor(deltaTime);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user