I know this has been asked before but there doesn’t seem to be any working examples in the posts I’ve seen for pregenerated only for reading them after attaching in the scenecomposer
I’m trying to generate navmeshes on the fly then I want to save them so my client can load pregenerated navmeshes later because I need to edit them before finalizing. this is possible with the current version of the ai library hopefully?
At the moment I pass in my scene and i get a minute or so of warning messages
[java]Warning, normal of the plane faces downward!!![/java]
With my application timing out even though I am using a callable to generate the navmesh then the whole application locks up
I am currently using Jmonkey SDK stable
I have installed the jM3 AI Library Version: 0.1.831
This is the code I am using to generate the navmesh
[java]public Callable GenerateMap(Node roomRoot)
{
if(navmesh != null)
{
navmesh.clear();
}
Mesh mesh = new Mesh();
GeometryBatchFactory.mergeGeometries(findGeometries(roomRoot, new LinkedList<Geometry>()), mesh);
navmesh = new NavMesh();
navmesh.loadFromMesh(mesh);
pathFinder = new NavMeshPathfinder(navmesh);
return null;
}
private List<Geometry> findGeometries(Node node, List<Geometry> geoms)
{
for (Iterator<Spatial> it = node.getChildren().iterator(); it.hasNext()
{
Spatial spatial = it.next();
if (spatial instanceof Geometry)
{
geoms.add((Geometry) spatial);
}
else if (spatial instanceof Node)
{
findGeometries((Node) spatial, geoms);
}
}
return geoms;
}[/java]
Does anyone have a working example of dynamic NavMesh loading or know what I am doing wrong please?