@Test public void testTriangle() { long start = TimeUtil.currentTimeMillis(); for (int i = 0; i < 1; i++) { Triangle triangle = navMesh.getTriangle(new Vector3(264, 18, 117)); if (triangle != null) { System.err.println(triangle.toString()); } Assert.assertNotNull(triangle); } System.out.println("获取三角形耗时：" + (TimeUtil.currentTimeMillis() - start)); }
public Triangle getTriangle(Vector3 point) { Optional<Triangle> optional = graph.getTriangles().stream().filter(t -> t.isInnerPoint(point)).findFirst(); if (optional.isPresent()) { return optional.get(); } return null; }
TriangleNavMesh extends NavMesh { public Triangle getTriangle(Vector3 point) { Optional<Triangle> optional = graph.getTriangles().stream().filter(t -> t.isInnerPoint(point)).findFirst(); if (optional.isPresent()) { return optional.get(); } return null; } }
TriangleNavMesh extends NavMesh { public Triangle getTriangle(Vector3 point) { Optional<Triangle> optional = graph.getTriangles().stream().filter(t -> t.isInnerPoint(point)).findFirst(); if (optional.isPresent()) { return optional.get(); } return null; } TriangleNavMesh(String navMeshStr);  TriangleNavMesh(String navMeshStr,int scale); }
TriangleNavMesh extends NavMesh { public Triangle getTriangle(Vector3 point) { Optional<Triangle> optional = graph.getTriangles().stream().filter(t -> t.isInnerPoint(point)).findFirst(); if (optional.isPresent()) { return optional.get(); } return null; } TriangleNavMesh(String navMeshStr);  TriangleNavMesh(String navMeshStr,int scale); TriangleGraph getGraph(); TriangleHeuristic getHeuristic(); IndexedAStarPathFinder<Triangle> getPathFinder(); List<Vector3> findPath(Vector3 fromPoint, Vector3 toPoint, TrianglePointPath navMeshPointPath); Triangle getTriangle(Vector3 point); Vector3 getPointInPath(float x, float z); }
TriangleNavMesh extends NavMesh { public Triangle getTriangle(Vector3 point) { Optional<Triangle> optional = graph.getTriangles().stream().filter(t -> t.isInnerPoint(point)).findFirst(); if (optional.isPresent()) { return optional.get(); } return null; } TriangleNavMesh(String navMeshStr);  TriangleNavMesh(String navMeshStr,int scale); TriangleGraph getGraph(); TriangleHeuristic getHeuristic(); IndexedAStarPathFinder<Triangle> getPathFinder(); List<Vector3> findPath(Vector3 fromPoint, Vector3 toPoint, TrianglePointPath navMeshPointPath); Triangle getTriangle(Vector3 point); Vector3 getPointInPath(float x, float z);  }