Quantcast
Channel: Answers by "KubaPrusak"
Viewing all articles
Browse latest Browse all 21

Answer by KubaPrusak

$
0
0
I figured out a solution. Basically each wall piece has two Nodes, one for the starting point and one for the ending point of the wall. I then run an a* pathfinding algorithm where the start point and end point of the algorithm are the start and end nodes of one wall (doesnt matter what wall it is). However there is no neighbouring connection between the start and end node which forces the algorthim to find a 'U'- shaped path to connect the start of the wall to its end. You can figure out the neighbours of each node by getting colliding walls for each node.wall and then sorting through them to get only the actual/allowed nodes you want. If the wall is part of a room, the pathfinding will return a list of nodes through which you can iterate and get the walls that make up the room.

Viewing all articles
Browse latest Browse all 21

Latest Images

Trending Articles





Latest Images