Open MJohnson459 opened 9 months ago
When creating a mesh file using PolyanyaFile it creates the file mostly to spec but doesn't include the polygon neighbours as defined here.
PolyanyaFile
Using the same example, instead of the expected
mesh 2 4 2 0.0 0.0 2 0 -1 1.5 0.0 3 0 1 -1 1.5 1.5 2 1 -1 0.0 1.5 3 -1 1 0 3 0 1 3 -1 -1 1 3 1 2 3 0 -1 -1
it writes
mesh 2 4 2 0.0 0.0 2 0 -1 1.5 0.0 3 0 1 -1 1.5 1.5 2 1 -1 0.0 1.5 3 -1 1 0 3 0 1 3 3 1 2 3
Loading this file then fails this assert
assert!(data.len() == nb * 2);
While removing this assert does allow the file to be loaded, the one-way flag is wrong as it defaults to true when there are no neighbours.
true
I saved the file with this code:
let mut mesh = PolyanyaMesh::new(vertices, polygons); let file: PolyanyaFile = mesh.clone().into(); file.to_file(&"nav_mesh.mesh");
When creating a mesh file using
PolyanyaFile
it creates the file mostly to spec but doesn't include the polygon neighbours as defined here.Using the same example, instead of the expected
it writes
Loading this file then fails this assert
While removing this assert does allow the file to be loaded, the one-way flag is wrong as it defaults to
true
when there are no neighbours.I saved the file with this code: