Update nodes ordering algorithm

master
Jeremy Hu 2019-08-14 17:56:15 +09:30
parent 18b339d9d7
commit d27c3fb313
1 changed files with 3 additions and 3 deletions

View File

@ -124,16 +124,16 @@ void Builder::layoutNodes()
const auto &choosenAxis = dots[0].second; const auto &choosenAxis = dots[0].second;
switch (choosenAxis) { switch (choosenAxis) {
case 0: // x case 0: // x
if (headNode.position.x() * headNode.position.x() < tailNode.position.x() * tailNode.position.x()) if (headNode.position.x() * headNode.position.x() > tailNode.position.x() * tailNode.position.x())
needReverse = true; needReverse = true;
break; break;
case 1: // y case 1: // y
if (headNode.position.y() * headNode.position.y() < tailNode.position.y() * tailNode.position.y()) if (headNode.position.y() * headNode.position.y() > tailNode.position.y() * tailNode.position.y())
needReverse = true; needReverse = true;
break; break;
case 2: // z case 2: // z
default: default:
if (headNode.position.z() * headNode.position.z() < tailNode.position.z() * tailNode.position.z()) if (headNode.position.z() * headNode.position.z() > tailNode.position.z() * tailNode.position.z())
needReverse = true; needReverse = true;
break; break;
} }