Code Monkey home page Code Monkey logo

Comments (7)

jakobbotsch avatar jakobbotsch commented on May 8, 2024

I think the check can indeed be removed without any side effects - it was based on the assumption that all external links would have side != 0xff. However, after layers were introduced, I think this is no longer the case.
On the other hand it suffices to check that the link reference is to the target tile, as this will be true for external links only. I'm just not sure why the problem only occurs with off-mesh connections, and not regular external links between layers (for example due to stairs).

@memononen can you confirm if my understanding is correct?

from recastnavigation.

memononen avatar memononen commented on May 8, 2024

I think the check is valid, 0xff == this tile. The problem could potentially be also in connectExtOffMeshLinks. I recommend to double check all the side == -1 cases, those cases should connect off-mesh links between layers inside same tile location.

from recastnavigation.

jakobbotsch avatar jakobbotsch commented on May 8, 2024

Indeed, the off-mesh links between layers are connected with side = 0xff from here (connectExtOffMeshLinks is called with side = -1 from here). However, there is no similar mechanism in removeTile to remove these links again. The external links are removed here and the check @Sandern is referencing then indeed prevents those off-mesh connections between layers from being removed (here, for posterity).

Is checking that side != 0xff not redundant? Can there be external links within the same tile?
EDIT: Or a better way to ask - can there be links to a different tile or layer that are not external?

from recastnavigation.

memononen avatar memononen commented on May 8, 2024

Looks like tile internal off-mesh links also get side = 0xff. I think that explains skipping those links. So I'd say it is safe to remove tile->links[j].side != 0xff.

from recastnavigation.

jakobbotsch avatar jakobbotsch commented on May 8, 2024

I may have misunderstood this. I read it as if the problem was that off mesh connections between layers in the same tile location were not being disconnected. Reading the code, it looks like any external link between layers in the same tile location are connected with side = 0xff, so indeed these are not disconnected.

@Sandern Did I misunderstand? Can you clarify what you mean by tiles in the same layer?

from recastnavigation.

Sandern avatar Sandern commented on May 8, 2024

@JanielS You are right, description was not correct. It's between layers in the same tile location.

from recastnavigation.

jakobbotsch avatar jakobbotsch commented on May 8, 2024

PR is at #139 for it. Thanks for the report!

from recastnavigation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.