XPath and ClosestOnNode exactness for end point

I’m brand new to this library and just starting to integrate it with our existing code base, so I’m currently running paths manually and not relying on AIPath or similar high level classes. When I ask for a path using XPath, there’s a function called ChangeEndNode which is called whenever the path is complete that overwrites the path’s endPoint to the final node’s center. Because of this, the ClosestOnNode exactness for the end point does not do what I expected it to, since it acts basically the same as SnapToNode. I’m not sure if this is a bug or something intentional with how XPath is supposed to work but is not obvious to me.

ABPath works like I’d expect in this regard, but I’d like to use XPath rather than ABPath so that I can run paths but with an EndingConditionProximity (to path within a specified range of a target). I can of course hack up the code myself to get the desired behavior, but I know so little about the library that it seems as if I might just be missing something.


The exactness settings relate to where to position the end point of the path on the node that was closest to the requested end point. It seems to me at least that since the ending condition changes which node is the end of the path to a node which may not be close to the requested end point at all, it doesn’t really make sense to apply that logic.

Ok, I guess I’ll go ahead and make my own ABPath-derived class that leaves the end point at the spot where the “in range” condition is actually satisfied within the node. Hopefully this won’t be too messy.

1 Like