Need to try and figure out how to use these two methods.
RecastArea.java#L243-L377
I have successfully been able to mark triangles with the markBoxArea which uses AABB bounding box but the area type is removed once the navmesh is built.
This is the Recast version of these two methods.
Recast.h#L972-L993
This is where markConvexPolyArea is used in solo mesh builds.
RecastSoloMeshTest.java#L155
This is the loop to use:
// (Optional) Mark areas.
List<ConvexVolume> vols = geomProvider.getConvexVolumes();
for (ConvexVolume convexVolume: vols) {
RecastArea.markConvexPolyArea(m_ctx, convexVolume.verts, convexVolume.hmin, convexVolume.hmax, convexVolume.areaMod, m_chf);
}
I could only get markBoxArea to work if I used it prior to RecastArea.erodeWalkableArea at this point.
RecastSoloMeshTest.java#L151
One problem faced was that Piotr does not have ConvexVolumes working for SimpleInputGeomProvider.
SimpleInputGeomProvider.java#L83
To overcome this I just created my own convexVolumes list.
To use markBoxArea I created a custom object to hold the variables,
private class BoxArea {
public float[] bmin;
public float[] bmax;
public AreaModification areaMod;
public BoxArea(float[] bmin, float[] bmax, AreaModification areaMod) {
this.bmin = bmin;
this.bmax = bmax;
this.areaMod = areaMod;
}
}
used depthFirstTraversal on the geometry going into GeometryProviderBuilder and set the bmin, bmax, and areaMod.
For ConvexVolumes I used a similar technique except with ConvexVolume objects and used verts from the triangles returned in the TriMesh loop. I based the triangles lengths from each geometry gathered by the depthFirstTraversal triangle lengths.
RecastSoloMeshTest.java#L113