public void create_compact_heightfield() { using (var ctx = new RecastContext()) { var mesh = GetInputGeom(ctx); var chf = ctx.CreateCompactHeightfield(_config, mesh); Assert.IsNotNull(chf); } }
public void create_polymesh_detail() { using (var ctx = new RecastContext()) { var mesh = GetInputGeom(ctx); var chf = ctx.CreateCompactHeightfield(_config, mesh); var polyMesh = ctx.CreatePolyMesh(_config, chf); var polyMeshDetail = ctx.CreatePolyMeshDetail(_config, polyMesh, chf); } }
public void create_navmesh() { using (var ctx = new RecastContext()) { var mesh = GetInputGeom(ctx); var chf = ctx.CreateCompactHeightfield(_config, mesh); var polyMesh = ctx.CreatePolyMesh(_config, chf); var polyMeshDetail = ctx.CreatePolyMeshDetail(_config, polyMesh, chf); var navMeshData = ctx.CreateNavMeshData(_config, polyMeshDetail, polyMesh, mesh, 0, 0, BuildSettings.agentHeight, BuildSettings.agentRadius, BuildSettings.agentMaxClimb); var navMesh = ctx.CreateNavMesh(navMeshData); Assert.IsNotNull(navMesh); } }
private NavMesh CreateNavMesh(RecastContext ctx) { var mesh = ctx.LoadInputGeom(TestUtils.ResolveResource("Resources/Tile_+007_+006_L21.obj"), true); Assert.IsNotNull(mesh); ctx.CalcGridSize(ref _config, mesh); var chf = ctx.CreateCompactHeightfield(_config, mesh); var polyMesh = ctx.CreatePolyMesh(_config, chf); var polyMeshDetail = ctx.CreatePolyMeshDetail(_config, polyMesh, chf); var navMeshData = ctx.CreateNavMeshData(_config, polyMeshDetail, polyMesh, mesh, 0, 0, BuildSettings.agentHeight, BuildSettings.agentRadius, BuildSettings.agentMaxClimb); return(ctx.CreateNavMesh(navMeshData)); }
public void create_navmesh_data() { using (var ctx = new RecastContext()) { var mesh = GetInputGeom(ctx); var chf = ctx.CreateCompactHeightfield(_config, mesh); var polyMesh = ctx.CreatePolyMesh(_config, chf); var polyMeshDetail = ctx.CreatePolyMeshDetail(_config, polyMesh, chf); var navMeshData = ctx.CreateNavMeshData(_config, polyMeshDetail, polyMesh, mesh, 0, 0, BuildSettings.agentHeight, BuildSettings.agentRadius, BuildSettings.agentMaxClimb); // TODO: This is different to Java!! Assert.AreEqual(114764, navMeshData.size); var bytes = navMeshData.GetData(); Assert.AreEqual(bytes.Length, navMeshData.size); } }
public void disposes_work() { var ctx = new RecastContext(); var mesh = GetInputGeom(ctx); var chf = ctx.CreateCompactHeightfield(_config, mesh); var polyMesh = ctx.CreatePolyMesh(_config, chf); var polyMeshDetail = ctx.CreatePolyMeshDetail(_config, polyMesh, chf); var navMeshData = ctx.CreateNavMeshData(_config, polyMeshDetail, polyMesh, mesh, 0, 0, BuildSettings.agentHeight, BuildSettings.agentRadius, BuildSettings.agentMaxClimb); var navMesh = ctx.CreateNavMesh(navMeshData); var navMeshQuery = ctx.CreateNavMeshQuery(navMesh); Assert.IsNotNull(navMeshQuery); navMeshQuery.Dispose(); navMesh.Dispose(); polyMeshDetail.Dispose(); polyMesh.Dispose(); chf.Dispose(); mesh.Dispose(); ctx.Dispose(); }