Hi
My model should not have any transforms on them. For some reason when I generate the debug mesh I need to rotate it 180 degrees around y axis to align with the source model.
updateNavMesh(): void {
const startTime = new Date().getTime();
this.navigationPlugin.createNavMesh(this.floorMeshes, {
cs: 0.3,
ch: 0.2,
walkableSlopeAngle: 45,
walkableHeight: 1,
walkableClimb: 1,
walkableRadius: 1,
maxEdgeLen: 12.,
maxSimplificationError: 1.3,
minRegionArea: 4,
mergeRegionArea: 20,
maxVertsPerPoly: 6,
detailSampleDist: 6,
detailSampleMaxError: 1,
});
const navigationDebugMesh = this.navigationPlugin.createDebugNavMesh(this.scene);
navigationDebugMesh.rotation.y = Math.PI;
const navigationDebugMaterial = new BABYLON.StandardMaterial('navigation-debug-material', this.scene);
navigationDebugMaterial.diffuseColor = new BABYLON.Color3(0.1, 0.2, 1);
navigationDebugMaterial.alpha = 0.2;
navigationDebugMesh.material = navigationDebugMaterial;
console.log("Nav mesh calculation took: " + (new Date().getTime() - startTime) + " ms.");
}
Any idea what could be wrong?
"babylonjs": "4.2.0-alpha.11",
"babylonjs-loaders": "4.2.0-alpha.11",
"recast-detour": "^1.1.0",
Kind regards,
Tommi