• Advertisement
Sign in to follow this  

Do I have a use case of a Navigation Mesh Manager?

Recommended Posts

I know if I open up a mesh, the navigation mesh will be either generated or loaded from file with the asset.

But in some uncommon cases, like I sometimes attach a navigation mesh with a truck, and that

they will be instanced out, I want to treat them as separate entities and they only differ in their transformations.

Then when I open up the truck mesh, I would call the navigation mesh manager and if they already exist,

I don't load them up anymore, do I have a case?

====

Another question is the interface is going to be weird, because

NavigationMeshMgr::getInstance()->getMesh("xxx.nav");

would not supply any arguments,

but I need to give it the object geometry, the cell size,  cell height etc,

I am thinking about using some interfaces and they must be called before retrieving the navmesh

class NavigationMeshMgr
{
    NavigationMeshMgr() { m_fCellSize = 0; ... }
   
    void setCellSize(float fCellSize) { m_fCellSize = fCellSize; }
    ///
};
NavMesh* NavigationMeshMgr::getMesh(const std::string& l_name)
{ 
     if (m_fCellSize == 0) return;
     // get the mesh 
}

Note that When I have multiple navmeshes, how do I test the parameters, each set will have different ones.

This only fits one cellsize for all navmeshes....

Is it useful and worth the effort to do these things?

Thanks

Jack

Edited by lucky6969b

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Advertisement