Replies: 5 comments
-
Hi @6ther! Something you could try is passing const path = navMeshQuery.computePath(
navMeshQuery.getClosestPoint({ x: -88.92649, y: 0, z: -84.2824}), // start position
navMeshQuery.getClosestPoint({ x: 173.07352, y: 0, z: -131.28241 }) // end position
); Also, do you mind sharing the file you uploaded to navmesh.isaacmason.com so I can test with that as well? The geometry I've created using the positions and indices provided looks different: Let me know if I'm doing something silly. |
Beta Was this translation helpful? Give feedback.
-
planeXunlu.txt |
Beta Was this translation helpful? Give feedback.
-
Hey @6ther, could you could share a codesandbox (or similar) reproduction? I'm having some trouble recreating your environment so I can debug. Using the obj model, the navmesh config provided, and the given start and end points, I get a different result: |
Beta Was this translation helpful? Give feedback.
-
My code like this: export async function getNavMesh()
} |
Beta Was this translation helpful? Give feedback.
-
Hi @6ther, I think this is an input issue. There is some difference between the obj model and the positions and indices in the code snippets. You can visualise the resulting navmesh generated by the above snippet using Creating a buffer geometry shows a geometry that matches the navmesh: |
Beta Was this translation helpful? Give feedback.
-
`const positions = [
173.07352, 0, -131.28241,
173.07352, 0, 50.717583,
-88.92649, 0, 50.717583,
-88.92649, 0, -84.2824,
-45.926494, 0, -84.2824,
-45.926494, 0, -9.2824164,
83.07351, 0, -9.2824164,
83.07351, 0, -131.28241,
173.07352, 0, -131.28241,
];
const navMeshQuery = new NavMeshQuery({ navMesh });
const path = navMeshQuery.computePath(
{ x: -88.92649, y: 0, z: -84.2824}, // start position
{ x: 173.07352, y: 0, z: -131.28241 } // end position
);`
navMeshQuery.computePath return the path is empty.
And the Navmesh is right as shown in the figure.
Beta Was this translation helpful? Give feedback.
All reactions