-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(dis)allow corner crossing in diagonal mode #30
Labels
Comments
Yonaba
changed the title
Add ability to allow/disallow corner crossing in diagonal mode
(dis)allow corner crossing in diagonal mode
Jun 4, 2014
Hello, was this feature added? I can't find it in the pathfinder.lua script, also "myFinder:setTunnelling(false)" doesn't work. Have you abandoned this project? or am I missing something? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When diagonal moves are allowed, an agent when turning around a corner (wall edge) can cross the corner. This behaviour might not be suitable for some games, as it results in unaesthetic paths, especially for agents having a certain size. Although it can be solved with clearance, we shoud be able to allow/disallow the ability to cross a corner when making a diagonal move.
This can be easily implemented by skipping an adjacent neighbor when getting the list of a node neighbors. Assuming
dx
anddy
are the normalized vectors of movement, we check if the node at (currentNode.x+dx, currentNode.y) is walkable. In case it is, we only add it to the list of neighbors ifcornerCrossing
is allowed.The ability to
(dis)allowCornerCrossing
will be added as a new method to thepathfinder
interface.The text was updated successfully, but these errors were encountered: