stevefsp / critterai

Archive of CAINav Project (Inactive)
MIT License
126 stars 75 forks source link

The TriNavMesh.build() operation is not linking cells correctly. #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Cell linking in meshes created via TriNavMesh.build() is not complete.

The cause is the following code:

for (int iLink = 0; iLink < maxLinks; iLink++)
{
    if (cell.getLink(iLink) == null)
    {
        for (TriCell nCell : neighborCells)
        {
            if (cell.link(nCell, true) != TriCell.NULL_INDEX)
                // Successful link.
                break;
        }
    }
}

As a minimum, the getLink() check is inappropriate and needs to be removed.

The code should be re-designed to loop through the neighbor list and
exit early if link count reaches 3.

Original issue reported on code.google.com by steve...@gmail.com on 6 Jul 2010 at 8:37

GoogleCodeExporter commented 9 years ago

Original comment by steve...@gmail.com on 9 Jul 2010 at 4:07

GoogleCodeExporter commented 9 years ago
Fixed in R78.  Passed junit tests.

Original comment by steve...@gmail.com on 9 Jul 2010 at 4:10

GoogleCodeExporter commented 9 years ago
Fix deployed in cai-nav-0.1.2

Original comment by steve...@gmail.com on 10 Jul 2010 at 7:07