mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-06 19:39:56 -05:00
Small coding style fixes
This commit is contained in:
@@ -65,8 +65,8 @@ public:
|
||||
void setCamera(Camera* camera);
|
||||
void clearPreviousState();
|
||||
|
||||
SceneGraphNode* focusNode() const;
|
||||
void setFocusNode(const SceneGraphNode* focusNode, bool resetVelocitiesOnChange = true);
|
||||
void setFocusNode(const SceneGraphNode* focusNode,
|
||||
bool resetVelocitiesOnChange = true);
|
||||
void setFocusNode(const std::string& focusNode, bool resetVelocitiesOnChange = true);
|
||||
void setAnchorNode(const std::string& anchorNode);
|
||||
void setAimNode(const std::string& aimNode);
|
||||
@@ -121,7 +121,8 @@ private:
|
||||
properties::FloatProperty friction;
|
||||
};
|
||||
|
||||
void setAnchorNode(const SceneGraphNode* anchorNode, bool resetVelocitiesOnChange = true);
|
||||
void setAnchorNode(const SceneGraphNode* anchorNode,
|
||||
bool resetVelocitiesOnChange = true);
|
||||
void setAimNode(const SceneGraphNode* aimNode);
|
||||
|
||||
Camera* _camera;
|
||||
|
||||
@@ -309,9 +309,9 @@ void FlightControllerTopic::changeFocus(const nlohmann::json& json) const {
|
||||
);
|
||||
if (json.find(AnchorKey) == json.end()) {
|
||||
const std::string j = json;
|
||||
LWARNING(
|
||||
fmt::format("Could not find {} key in JSON. JSON was:\n{}", AnchorKey, j)
|
||||
);
|
||||
LWARNING(fmt::format(
|
||||
"Could not find {} key in JSON. JSON was:\n{}", AnchorKey, j
|
||||
));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -325,11 +325,15 @@ void FlightControllerTopic::changeFocus(const nlohmann::json& json) const {
|
||||
const bool retargetAnchor = json[RetargetAnchorKey];
|
||||
const bool retargetAim = json[RetargetAimKey];
|
||||
|
||||
const SceneGraphNode* focusNode = global::renderEngine.scene()->sceneGraphNode(focus);
|
||||
const SceneGraphNode* aimNode = global::renderEngine.scene()->sceneGraphNode(aim);
|
||||
const SceneGraphNode* anchorNode = global::renderEngine.scene()->sceneGraphNode(anchor);
|
||||
Scene* scene = global::renderEngine.scene();
|
||||
const SceneGraphNode* focusNode = scene->sceneGraphNode(focus);
|
||||
const SceneGraphNode* aimNode = scene->sceneGraphNode(aim);
|
||||
const SceneGraphNode* anchorNode = scene->sceneGraphNode(anchor);
|
||||
if (focusNode) {
|
||||
global::navigationHandler.orbitalNavigator().setFocusNode(focusNode, resetVelocities);
|
||||
global::navigationHandler.orbitalNavigator().setFocusNode(
|
||||
focusNode,
|
||||
resetVelocities
|
||||
);
|
||||
}
|
||||
else {
|
||||
if (aimNode) {
|
||||
|
||||
@@ -659,17 +659,21 @@ glm::dvec3 OrbitalNavigator::cameraToSurfaceVector(const glm::dvec3& cameraPos,
|
||||
return centerToActualSurface - posDiff;
|
||||
}
|
||||
|
||||
void OrbitalNavigator::setFocusNode(const SceneGraphNode* focusNode, bool resetVelocitiesOnChange) {
|
||||
void OrbitalNavigator::setFocusNode(const SceneGraphNode* focusNode,
|
||||
bool resetVelocitiesOnChange)
|
||||
{
|
||||
setAnchorNode(focusNode, resetVelocitiesOnChange);
|
||||
setAimNode(nullptr);
|
||||
}
|
||||
|
||||
void OrbitalNavigator::setFocusNode(const std::string& focusNode, bool resetVelocitiesOnChange) {
|
||||
void OrbitalNavigator::setFocusNode(const std::string& focusNode, bool) {
|
||||
_anchor.set(focusNode);
|
||||
_aim.set(std::string(""));
|
||||
}
|
||||
|
||||
void OrbitalNavigator::setAnchorNode(const SceneGraphNode* anchorNode, bool resetVelocitiesOnChange) {
|
||||
void OrbitalNavigator::setAnchorNode(const SceneGraphNode* anchorNode,
|
||||
bool resetVelocitiesOnChange)
|
||||
{
|
||||
if (!_anchorNode) {
|
||||
_directlySetStereoDistance = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user