* Connects the node. This will connect the node to the previous node along the path to @a target * and update the pathfinding information. * @param tuCost The total cost of the path so far. * @param prevNode The previous node along the path. * @param prevDir The direction FROM the previous node. * @param target The target position (used to update our guess cost). */
| 106 | * @param target The target position (used to update our guess cost). |
| 107 | */ |
| 108 | void PathfindingNode::connect(int tuCost, PathfindingNode* prevNode, int prevDir, const Position &target) |
| 109 | { |
| 110 | _tuCost = tuCost; |
| 111 | _prevNode = prevNode; |
| 112 | _prevDir = prevDir; |
| 113 | if (!inOpenSet()) // Otherwise we have this already. |
| 114 | { |
| 115 | Position d = target - _pos; |
| 116 | d *= d; |
| 117 | _tuGuess = 4 * sqrt((double)d.x + d.y + d.z); |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * Connects the node. This will connect the node to the previous node along the path. |
no outgoing calls
no test coverage detected