mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-28 14:59:31 -05:00
Added camera offset support
This commit is contained in:
@@ -61,6 +61,7 @@ namespace scenegraph {
|
||||
const std::string keyCamera = "Camera";
|
||||
const std::string keyFocusObject = "Focus";
|
||||
const std::string keyPositionObject = "Position";
|
||||
const std::string keyViewOffset = "Offset";
|
||||
const std::string keyPathModule = "ModulePath";
|
||||
} // namespace scenegraph
|
||||
|
||||
|
||||
@@ -13,7 +13,10 @@ openspace.bindKey("f2", "openspace.setPerformanceMeasurement(true)")
|
||||
openspace.bindKey("f3", "openspace.setPerformanceMeasurement(false)")
|
||||
openspace.bindKey("f5", "loadKeyBindings()")
|
||||
|
||||
|
||||
openspace.bindKey("T", "openspace.distance(-interaction_speed * openspace.dt(), 6.0)")
|
||||
openspace.bindKey("G", "openspace.distance(interaction_speed * openspace.dt(), 6.0)")
|
||||
openspace.bindKey("Y", "openspace.distance(-interaction_speed * openspace.dt(), 10.0)")
|
||||
openspace.bindKey("H", "openspace.distance(interaction_speed * openspace.dt(), 10.0)")
|
||||
openspace.bindKey("U", "openspace.distance(-interaction_speed * openspace.dt(), 13.0)")
|
||||
openspace.bindKey("J", "openspace.distance(interaction_speed * openspace.dt(), 13.0)")
|
||||
|
||||
|
||||
@@ -441,6 +441,13 @@ bool SceneGraph::loadSceneInternal(const std::string& sceneDescriptionFilePath)
|
||||
glm::mat4 la = glm::lookAt(c->position().vec3(), fn->worldPosition().vec3(), c->lookUpVector());
|
||||
c->setRotation(la);
|
||||
|
||||
glm::vec3 viewOffset;
|
||||
if (cameraDictionary.hasKey(constants::scenegraph::keyViewOffset)
|
||||
&& cameraDictionary.getValue(constants::scenegraph::keyViewOffset, viewOffset)) {
|
||||
glm::quat rot = glm::quat(viewOffset);
|
||||
c->rotate(rot);
|
||||
}
|
||||
|
||||
|
||||
for (SceneGraphNode* node : _nodes) {
|
||||
std::vector<properties::Property*> properties = node->propertiesRecursive();
|
||||
|
||||
Reference in New Issue
Block a user