Hello,
i try to have a map where one can place/remove props(considered as obstacles)
it is for a strategy kind of game
but if i create a navmesh, it does not take these obstacles in consideration,
unless i merge obstacles and map to the same node
wich i don’t want, cos i also need to remove these props later
so i cant merge them , i need to be able to access them as nodes, so keeping the hierarchy of the world intact
i tried with a duplicate of landscape that i merge with a bounding box of the added obstacle
[java]
//------------------ create bounding volume for added prop
Geometry box=BuildBoxFromProp(node);
((Node)landscapeDuplicate).attachChild(box);
//---------------------------- merge landscape duplicate + bounding volume
GeometryBatchFactory.optimize((Node)landscapeDuplicate);
//--------------------------- create navmesh with optimize
Geometry ground=(Geometry) ((Node)((Node)landscape).getChild(0)).getChild(0);
Mesh me=ground.getMesh();
NavMeshGenerator generator= new NavMeshGenerator();
Mesh optiMesh = generator.optimize(me);
navmesh.loadFromMesh(optiMesh);
//--------------------------------------------------------------------i am screwed, cos if i want to remove a prop, i need to rebuild a new duplicate from scratch
[/java]
but if i want to remove one prop, i would have to rebuild the whole landscape duplicate without adding a bounding box for the obstacle i removed
is there a way to build the nav mesh from
1 - landscape mesh
2 - a separate mesh hierarchy of all obstacles that would be taken into account by the navmesh algo
[edit : in game programming gems, there is a sample code that uses 1 mesh for the map, 1 mesh for the map props]
???