Code Monkey home page Code Monkey logo

Comments (2)

sagaceilo avatar sagaceilo commented on May 7, 2024

Actually, I did that so my open world engine would stream a huge parts of world.

DetourNavMesh.cpp :

255 - m_saltBits = dtMin((unsigned int)31, 32 - m_tileBits - m_polyBits);
255 + m_saltBits = dtMin((unsigned int)sizeof( dtPolyRef )*8 - 1, sizeof( dtPolyRef ) * 8 - m_tileBits - m_polyBits);

DetourNavMesh.h

30 -typedef unsigned int dtPolyRef;
30 +typedef unsigned long long dtPolyRef;

34 -typedef unsigned int dtTileRef;
34 +typedef unsigned long long dtTileRef;

It doesnt change the m_tileBits m_polyBits politicy, bu adds 64bit poly refID. It dynamicly scales salt Bits also. Thanks to that in my project I can use like ~30k tile meshes each one with a couple of K polys.

But it brokes the saving to data and readig from buffor ready tiles ( in case You saves ready tile meshes somewhere - not compatable with 32bit poly ref ID ).

from recastnavigation.

memononen avatar memononen commented on May 7, 2024

Added a #define support for compiling Detour with 64bit dtPolyRefs, check the latest version. Let me know if you ran into any problems with it.

With the change, the bits used for tiles, polygons, and salt are fixed (as there are so many bits to spare), you don't need to specify max polygons when you init the navmesh, but you'll need to define max tiles at it is also used for allocating the tile stubs.

As noted, you will need to rebuild all your tiles when you change to 64bit indices as some of the fields in the tile data use polyrefs. Yes, I do regret this choice :)

--mikko

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.