You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Portals order in upside down poly make string pull algorithm not work as intended #319
Not only does pathfinding return duplicate node but also a longer path (it follow the outter ring).
I belived this is cause by the order of portal created in Builder.js:
static _getSharedVerticesInOrder (a, b) {
...
// it seems that we shouldn't have an a and b with <2 shared vertices here unless there's a bug
// in the neighbor identification code, or perhaps a malformed input geometry; 3 shared vertices
// is a kind of embarrassing but possible geometry we should handle
if (shared0 && shared1 && shared2) {
return Array.from(aList);
} else if (shared0 && shared1) {
return [a0, a1];
} else if (shared1 && shared2) {
return [a1, a2];
} else if (shared0 && shared2) {
return [a2, a0]; // this ordering will affect the string pull algorithm later, not clear if significant
} else {
console.warn("Error processing navigation mesh neighbors; neighbors with <2 shared vertices found.");
return [];
}
}
when the ring is navmesh is created, the order of portal is using the local up (which is pointing downward), but when running the string pull algorithm, channel is using the world up, which cause pts to take all the portal.left, hence the error.
if fix, this, the simple path test should also be fix to have 4 node on path.
Activity