mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-24 21:19:46 -06:00
Feature/anchor and aim (#799)
Introduce the ability to navigate using an anchor and aim. Example use: Set spacecraft as anchor and planet as aim to always look down at a planet, while followin the spacecraft in its orbit.
This commit is contained in:
@@ -588,7 +588,7 @@ void SceneGraphNode::setDependencies(const std::vector<SceneGraphNode*>& depende
|
||||
}
|
||||
|
||||
SurfacePositionHandle SceneGraphNode::calculateSurfacePositionHandle(
|
||||
const glm::dvec3& targetModelSpace)
|
||||
const glm::dvec3& targetModelSpace) const
|
||||
{
|
||||
if (_renderable) {
|
||||
return _renderable->calculateSurfacePositionHandle(targetModelSpace);
|
||||
@@ -809,19 +809,4 @@ const SceneGraphNode::PerformanceRecord& SceneGraphNode::performanceRecord() con
|
||||
return _performanceRecord;
|
||||
}
|
||||
|
||||
void SceneGraphNode::updateCamera(Camera* camera) const {
|
||||
psc origin(worldPosition());
|
||||
//int i = 0;
|
||||
// the camera position
|
||||
|
||||
psc relative = camera->position();
|
||||
psc focus = camera->focusPosition();
|
||||
psc relative_focus = relative - focus;
|
||||
|
||||
psc target = origin + relative_focus;
|
||||
|
||||
camera->setPosition(target);
|
||||
camera->setFocusPosition(origin);
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user