Fix problems with camera paths when multiple nodes have the same position

This commit is contained in:
Emma Broman
2021-09-24 15:02:12 +02:00
parent 24fafc8718
commit 679d723930
+6 -1
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;
}