From 5ed9e602fbb862cdaadd88cf1b702efecd8641bf Mon Sep 17 00:00:00 2001 From: ikpil Date: Sat, 29 Apr 2023 13:29:40 +0900 Subject: [PATCH] 012->xyz --- .../AbstractCrowdTest.cs | 12 +-- .../DotRecast.Detour.Crowd.Test/Crowd1Test.cs | 98 +++++++++---------- .../DotRecast.Detour.Crowd.Test/Crowd4Test.cs | 38 +++---- .../Crowd4VelocityTest.cs | 14 +-- .../PathCorridorTest.cs | 2 +- .../RecastTestMeshBuilder.cs | 2 +- .../Io/VoxelFileReaderTest.cs | 2 +- .../Io/VoxelFileReaderWriterTest.cs | 2 +- .../UnityAStarPathfindingImporterTest.cs | 2 +- .../FindPolysAroundShapeTest.cs | 30 +++--- .../Io/MeshSetReaderTest.cs | 2 +- .../Io/MeshSetReaderWriterTest.cs | 2 +- .../NavMeshBuilderTest.cs | 2 +- test/DotRecast.Detour.Test/RandomPointTest.cs | 18 ++-- .../RecastTestMeshBuilder.cs | 2 +- .../AbstractTileCacheTest.cs | 2 +- .../Io/TileCacheReaderTest.cs | 2 +- .../TempObstaclesTest.cs | 2 +- .../TestTileLayerBuilder.cs | 2 +- .../TileCacheTest.cs | 2 +- .../DotRecast.Recast.Test/RecastLayersTest.cs | 2 +- .../RecastSoloMeshTest.cs | 6 +- test/DotRecast.Recast.Test/RecastTest.cs | 2 +- 23 files changed, 124 insertions(+), 124 deletions(-) diff --git a/test/DotRecast.Detour.Crowd.Test/AbstractCrowdTest.cs b/test/DotRecast.Detour.Crowd.Test/AbstractCrowdTest.cs index b6291d9..0b57673 100644 --- a/test/DotRecast.Detour.Crowd.Test/AbstractCrowdTest.cs +++ b/test/DotRecast.Detour.Crowd.Test/AbstractCrowdTest.cs @@ -121,9 +121,9 @@ public class AbstractCrowdTest for (int j = 0; j < size; j++) { Vector3f pos = new Vector3f(); - pos[0] = startPos[0] + i * distance; - pos[1] = startPos[1]; - pos[2] = startPos[2] + j * distance; + pos.x = startPos.x + i * distance; + pos.y = startPos.y; + pos.z = startPos.z + j * distance; agents.Add(crowd.addAgent(pos, ap)); } } @@ -154,7 +154,7 @@ public class AbstractCrowdTest protected Vector3f calcVel(Vector3f pos, Vector3f tgt, float speed) { Vector3f vel = vSub(tgt, pos); - vel[1] = 0.0f; + vel.y = 0.0f; vNormalize(ref vel); vel = vScale(vel, speed); return vel; @@ -166,8 +166,8 @@ public class AbstractCrowdTest foreach (CrowdAgent ag in crowd.getActiveAgents()) { Console.WriteLine(ag.state + ", " + ag.targetState); - Console.WriteLine(ag.npos[0] + ", " + ag.npos[1] + ", " + ag.npos[2]); - Console.WriteLine(ag.nvel[0] + ", " + ag.nvel[1] + ", " + ag.nvel[2]); + Console.WriteLine(ag.npos.x + ", " + ag.npos.y + ", " + ag.npos.z); + Console.WriteLine(ag.nvel.x + ", " + ag.nvel.y + ", " + ag.nvel.z); } } } \ No newline at end of file diff --git a/test/DotRecast.Detour.Crowd.Test/Crowd1Test.cs b/test/DotRecast.Detour.Crowd.Test/Crowd1Test.cs index 75fa8f3..42369b3 100644 --- a/test/DotRecast.Detour.Crowd.Test/Crowd1Test.cs +++ b/test/DotRecast.Detour.Crowd.Test/Crowd1Test.cs @@ -575,12 +575,12 @@ public class Crowd1Test : AbstractCrowdTest crowd.update(1 / 5f, null); foreach (CrowdAgent ag in crowd.getActiveAgents()) { - Assert.That(ag.npos[0], Is.EqualTo(EXPECTED_A1Q0TVTA[i][0]).Within(0.001f)); - Assert.That(ag.npos[1], Is.EqualTo(EXPECTED_A1Q0TVTA[i][1]).Within(0.001f)); - Assert.That(ag.npos[2], Is.EqualTo(EXPECTED_A1Q0TVTA[i][2]).Within(0.001f)); - Assert.That(ag.nvel[0], Is.EqualTo(EXPECTED_A1Q0TVTA[i][3]).Within(0.001f)); - Assert.That(ag.nvel[1], Is.EqualTo(EXPECTED_A1Q0TVTA[i][4]).Within(0.001f)); - Assert.That(ag.nvel[2], Is.EqualTo(EXPECTED_A1Q0TVTA[i][5]).Within(0.001f)); + Assert.That(ag.npos.x, Is.EqualTo(EXPECTED_A1Q0TVTA[i][0]).Within(0.001f)); + Assert.That(ag.npos.y, Is.EqualTo(EXPECTED_A1Q0TVTA[i][1]).Within(0.001f)); + Assert.That(ag.npos.z, Is.EqualTo(EXPECTED_A1Q0TVTA[i][2]).Within(0.001f)); + Assert.That(ag.nvel.x, Is.EqualTo(EXPECTED_A1Q0TVTA[i][3]).Within(0.001f)); + Assert.That(ag.nvel.y, Is.EqualTo(EXPECTED_A1Q0TVTA[i][4]).Within(0.001f)); + Assert.That(ag.nvel.z, Is.EqualTo(EXPECTED_A1Q0TVTA[i][5]).Within(0.001f)); } } } @@ -598,12 +598,12 @@ public class Crowd1Test : AbstractCrowdTest crowd.update(1 / 5f, null); foreach (CrowdAgent ag in crowd.getActiveAgents()) { - Assert.That(ag.npos[0], Is.EqualTo(EXPECTED_A1Q0TVT[i][0]).Within(0.001f)); - Assert.That(ag.npos[1], Is.EqualTo(EXPECTED_A1Q0TVT[i][1]).Within(0.001f)); - Assert.That(ag.npos[2], Is.EqualTo(EXPECTED_A1Q0TVT[i][2]).Within(0.001f)); - Assert.That(ag.nvel[0], Is.EqualTo(EXPECTED_A1Q0TVT[i][3]).Within(0.001f)); - Assert.That(ag.nvel[1], Is.EqualTo(EXPECTED_A1Q0TVT[i][4]).Within(0.001f)); - Assert.That(ag.nvel[2], Is.EqualTo(EXPECTED_A1Q0TVT[i][5]).Within(0.001f)); + Assert.That(ag.npos.x, Is.EqualTo(EXPECTED_A1Q0TVT[i][0]).Within(0.001f)); + Assert.That(ag.npos.y, Is.EqualTo(EXPECTED_A1Q0TVT[i][1]).Within(0.001f)); + Assert.That(ag.npos.z, Is.EqualTo(EXPECTED_A1Q0TVT[i][2]).Within(0.001f)); + Assert.That(ag.nvel.x, Is.EqualTo(EXPECTED_A1Q0TVT[i][3]).Within(0.001f)); + Assert.That(ag.nvel.y, Is.EqualTo(EXPECTED_A1Q0TVT[i][4]).Within(0.001f)); + Assert.That(ag.nvel.z, Is.EqualTo(EXPECTED_A1Q0TVT[i][5]).Within(0.001f)); } } } @@ -620,12 +620,12 @@ public class Crowd1Test : AbstractCrowdTest crowd.update(1 / 5f, null); foreach (CrowdAgent ag in crowd.getActiveAgents()) { - Assert.That(ag.npos[0], Is.EqualTo(EXPECTED_A1Q0TV[i][0]).Within(0.001f)); - Assert.That(ag.npos[1], Is.EqualTo(EXPECTED_A1Q0TV[i][1]).Within(0.001f)); - Assert.That(ag.npos[2], Is.EqualTo(EXPECTED_A1Q0TV[i][2]).Within(0.001f)); - Assert.That(ag.nvel[0], Is.EqualTo(EXPECTED_A1Q0TV[i][3]).Within(0.001f)); - Assert.That(ag.nvel[1], Is.EqualTo(EXPECTED_A1Q0TV[i][4]).Within(0.001f)); - Assert.That(ag.nvel[2], Is.EqualTo(EXPECTED_A1Q0TV[i][5]).Within(0.001f)); + Assert.That(ag.npos.x, Is.EqualTo(EXPECTED_A1Q0TV[i][0]).Within(0.001f)); + Assert.That(ag.npos.y, Is.EqualTo(EXPECTED_A1Q0TV[i][1]).Within(0.001f)); + Assert.That(ag.npos.z, Is.EqualTo(EXPECTED_A1Q0TV[i][2]).Within(0.001f)); + Assert.That(ag.nvel.x, Is.EqualTo(EXPECTED_A1Q0TV[i][3]).Within(0.001f)); + Assert.That(ag.nvel.y, Is.EqualTo(EXPECTED_A1Q0TV[i][4]).Within(0.001f)); + Assert.That(ag.nvel.z, Is.EqualTo(EXPECTED_A1Q0TV[i][5]).Within(0.001f)); } } } @@ -642,12 +642,12 @@ public class Crowd1Test : AbstractCrowdTest crowd.update(1 / 5f, null); foreach (CrowdAgent ag in crowd.getActiveAgents()) { - Assert.That(ag.npos[0], Is.EqualTo(EXPECTED_A1Q0T[i][0]).Within(0.001)); - Assert.That(ag.npos[1], Is.EqualTo(EXPECTED_A1Q0T[i][1]).Within(0.001)); - Assert.That(ag.npos[2], Is.EqualTo(EXPECTED_A1Q0T[i][2]).Within(0.001)); - Assert.That(ag.nvel[0], Is.EqualTo(EXPECTED_A1Q0T[i][3]).Within(0.001)); - Assert.That(ag.nvel[1], Is.EqualTo(EXPECTED_A1Q0T[i][4]).Within(0.001)); - Assert.That(ag.nvel[2], Is.EqualTo(EXPECTED_A1Q0T[i][5]).Within(0.001)); + Assert.That(ag.npos.x, Is.EqualTo(EXPECTED_A1Q0T[i][0]).Within(0.001)); + Assert.That(ag.npos.y, Is.EqualTo(EXPECTED_A1Q0T[i][1]).Within(0.001)); + Assert.That(ag.npos.z, Is.EqualTo(EXPECTED_A1Q0T[i][2]).Within(0.001)); + Assert.That(ag.nvel.x, Is.EqualTo(EXPECTED_A1Q0T[i][3]).Within(0.001)); + Assert.That(ag.nvel.y, Is.EqualTo(EXPECTED_A1Q0T[i][4]).Within(0.001)); + Assert.That(ag.nvel.z, Is.EqualTo(EXPECTED_A1Q0T[i][5]).Within(0.001)); } } } @@ -665,12 +665,12 @@ public class Crowd1Test : AbstractCrowdTest crowd.update(1 / 5f, null); foreach (CrowdAgent ag in crowd.getActiveAgents()) { - Assert.That(ag.npos[0], Is.EqualTo(EXPECTED_A1Q1TVTA[i][0]).Within(0.001f)); - Assert.That(ag.npos[1], Is.EqualTo(EXPECTED_A1Q1TVTA[i][1]).Within(0.001f)); - Assert.That(ag.npos[2], Is.EqualTo(EXPECTED_A1Q1TVTA[i][2]).Within(0.001f)); - Assert.That(ag.nvel[0], Is.EqualTo(EXPECTED_A1Q1TVTA[i][3]).Within(0.001f)); - Assert.That(ag.nvel[1], Is.EqualTo(EXPECTED_A1Q1TVTA[i][4]).Within(0.001f)); - Assert.That(ag.nvel[2], Is.EqualTo(EXPECTED_A1Q1TVTA[i][5]).Within(0.001f)); + Assert.That(ag.npos.x, Is.EqualTo(EXPECTED_A1Q1TVTA[i][0]).Within(0.001f)); + Assert.That(ag.npos.y, Is.EqualTo(EXPECTED_A1Q1TVTA[i][1]).Within(0.001f)); + Assert.That(ag.npos.z, Is.EqualTo(EXPECTED_A1Q1TVTA[i][2]).Within(0.001f)); + Assert.That(ag.nvel.x, Is.EqualTo(EXPECTED_A1Q1TVTA[i][3]).Within(0.001f)); + Assert.That(ag.nvel.y, Is.EqualTo(EXPECTED_A1Q1TVTA[i][4]).Within(0.001f)); + Assert.That(ag.nvel.z, Is.EqualTo(EXPECTED_A1Q1TVTA[i][5]).Within(0.001f)); } } } @@ -688,12 +688,12 @@ public class Crowd1Test : AbstractCrowdTest crowd.update(1 / 5f, null); foreach (CrowdAgent ag in crowd.getActiveAgents()) { - Assert.That(ag.npos[0], Is.EqualTo(EXPECTED_A1Q2TVTA[i][0]).Within(0.001f)); - Assert.That(ag.npos[1], Is.EqualTo(EXPECTED_A1Q2TVTA[i][1]).Within(0.001f)); - Assert.That(ag.npos[2], Is.EqualTo(EXPECTED_A1Q2TVTA[i][2]).Within(0.001f)); - Assert.That(ag.nvel[0], Is.EqualTo(EXPECTED_A1Q2TVTA[i][3]).Within(0.001f)); - Assert.That(ag.nvel[1], Is.EqualTo(EXPECTED_A1Q2TVTA[i][4]).Within(0.001f)); - Assert.That(ag.nvel[2], Is.EqualTo(EXPECTED_A1Q2TVTA[i][5]).Within(0.001f)); + Assert.That(ag.npos.x, Is.EqualTo(EXPECTED_A1Q2TVTA[i][0]).Within(0.001f)); + Assert.That(ag.npos.y, Is.EqualTo(EXPECTED_A1Q2TVTA[i][1]).Within(0.001f)); + Assert.That(ag.npos.z, Is.EqualTo(EXPECTED_A1Q2TVTA[i][2]).Within(0.001f)); + Assert.That(ag.nvel.x, Is.EqualTo(EXPECTED_A1Q2TVTA[i][3]).Within(0.001f)); + Assert.That(ag.nvel.y, Is.EqualTo(EXPECTED_A1Q2TVTA[i][4]).Within(0.001f)); + Assert.That(ag.nvel.z, Is.EqualTo(EXPECTED_A1Q2TVTA[i][5]).Within(0.001f)); } } } @@ -711,12 +711,12 @@ public class Crowd1Test : AbstractCrowdTest crowd.update(1 / 5f, null); foreach (CrowdAgent ag in crowd.getActiveAgents()) { - Assert.That(ag.npos[0], Is.EqualTo(EXPECTED_A1Q3TVTA[i][0]).Within(0.001f)); - Assert.That(ag.npos[1], Is.EqualTo(EXPECTED_A1Q3TVTA[i][1]).Within(0.001f)); - Assert.That(ag.npos[2], Is.EqualTo(EXPECTED_A1Q3TVTA[i][2]).Within(0.001f)); - Assert.That(ag.nvel[0], Is.EqualTo(EXPECTED_A1Q3TVTA[i][3]).Within(0.001f)); - Assert.That(ag.nvel[1], Is.EqualTo(EXPECTED_A1Q3TVTA[i][4]).Within(0.001f)); - Assert.That(ag.nvel[2], Is.EqualTo(EXPECTED_A1Q3TVTA[i][5]).Within(0.001f)); + Assert.That(ag.npos.x, Is.EqualTo(EXPECTED_A1Q3TVTA[i][0]).Within(0.001f)); + Assert.That(ag.npos.y, Is.EqualTo(EXPECTED_A1Q3TVTA[i][1]).Within(0.001f)); + Assert.That(ag.npos.z, Is.EqualTo(EXPECTED_A1Q3TVTA[i][2]).Within(0.001f)); + Assert.That(ag.nvel.x, Is.EqualTo(EXPECTED_A1Q3TVTA[i][3]).Within(0.001f)); + Assert.That(ag.nvel.y, Is.EqualTo(EXPECTED_A1Q3TVTA[i][4]).Within(0.001f)); + Assert.That(ag.nvel.z, Is.EqualTo(EXPECTED_A1Q3TVTA[i][5]).Within(0.001f)); } } } @@ -735,13 +735,13 @@ public class Crowd1Test : AbstractCrowdTest crowd.update(1 / 5f, null); foreach (CrowdAgent ag in crowd.getActiveAgents()) { - Assert.That(ag.npos[0], Is.EqualTo(EXPECTED_A1Q3TVTAS[i][0]).Within(0.001f)); - Assert.That(ag.npos[1], Is.EqualTo(EXPECTED_A1Q3TVTAS[i][1]).Within(0.001f)); - Assert.That(ag.npos[2], Is.EqualTo(EXPECTED_A1Q3TVTAS[i][2]).Within(0.001f)); - Assert.That(ag.nvel[0], Is.EqualTo(EXPECTED_A1Q3TVTAS[i][3]).Within(0.001f)); - Assert.That(ag.nvel[1], Is.EqualTo(EXPECTED_A1Q3TVTAS[i][4]).Within(0.001f)); - Assert.That(ag.nvel[2], Is.EqualTo(EXPECTED_A1Q3TVTAS[i][5]).Within(0.001f)); + Assert.That(ag.npos.x, Is.EqualTo(EXPECTED_A1Q3TVTAS[i][0]).Within(0.001f)); + Assert.That(ag.npos.y, Is.EqualTo(EXPECTED_A1Q3TVTAS[i][1]).Within(0.001f)); + Assert.That(ag.npos.z, Is.EqualTo(EXPECTED_A1Q3TVTAS[i][2]).Within(0.001f)); + Assert.That(ag.nvel.x, Is.EqualTo(EXPECTED_A1Q3TVTAS[i][3]).Within(0.001f)); + Assert.That(ag.nvel.y, Is.EqualTo(EXPECTED_A1Q3TVTAS[i][4]).Within(0.001f)); + Assert.That(ag.nvel.z, Is.EqualTo(EXPECTED_A1Q3TVTAS[i][5]).Within(0.001f)); } } } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.Crowd.Test/Crowd4Test.cs b/test/DotRecast.Detour.Crowd.Test/Crowd4Test.cs index c50c4b8..09646c7 100644 --- a/test/DotRecast.Detour.Crowd.Test/Crowd4Test.cs +++ b/test/DotRecast.Detour.Crowd.Test/Crowd4Test.cs @@ -317,12 +317,12 @@ public class Crowd4Test : AbstractCrowdTest { crowd.update(1 / 5f, null); CrowdAgent ag = agents[2]; - Assert.That(ag.npos[0], Is.EqualTo(EXPECTED_A1Q2TVTA[i][0]).Within(0.001f), $"{i}"); - Assert.That(ag.npos[1], Is.EqualTo(EXPECTED_A1Q2TVTA[i][1]).Within(0.001f), $"{i}"); - Assert.That(ag.npos[2], Is.EqualTo(EXPECTED_A1Q2TVTA[i][2]).Within(0.001f), $"{i}"); - Assert.That(ag.nvel[0], Is.EqualTo(EXPECTED_A1Q2TVTA[i][3]).Within(0.001f), $"{i}"); - Assert.That(ag.nvel[1], Is.EqualTo(EXPECTED_A1Q2TVTA[i][4]).Within(0.001f), $"{i}"); - Assert.That(ag.nvel[2], Is.EqualTo(EXPECTED_A1Q2TVTA[i][5]).Within(0.001f), $"{i}"); + Assert.That(ag.npos.x, Is.EqualTo(EXPECTED_A1Q2TVTA[i][0]).Within(0.001f), $"{i}"); + Assert.That(ag.npos.y, Is.EqualTo(EXPECTED_A1Q2TVTA[i][1]).Within(0.001f), $"{i}"); + Assert.That(ag.npos.z, Is.EqualTo(EXPECTED_A1Q2TVTA[i][2]).Within(0.001f), $"{i}"); + Assert.That(ag.nvel.x, Is.EqualTo(EXPECTED_A1Q2TVTA[i][3]).Within(0.001f), $"{i}"); + Assert.That(ag.nvel.y, Is.EqualTo(EXPECTED_A1Q2TVTA[i][4]).Within(0.001f), $"{i}"); + Assert.That(ag.nvel.z, Is.EqualTo(EXPECTED_A1Q2TVTA[i][5]).Within(0.001f), $"{i}"); } } @@ -339,12 +339,12 @@ public class Crowd4Test : AbstractCrowdTest { crowd.update(1 / 5f, null); CrowdAgent ag = agents[2]; - Assert.That(ag.npos[0], Is.EqualTo(EXPECTED_A1Q2TVTAS[i][0]).Within(0.001f), $"{i}"); - Assert.That(ag.npos[1], Is.EqualTo(EXPECTED_A1Q2TVTAS[i][1]).Within(0.001f), $"{i}"); - Assert.That(ag.npos[2], Is.EqualTo(EXPECTED_A1Q2TVTAS[i][2]).Within(0.001f), $"{i}"); - Assert.That(ag.nvel[0], Is.EqualTo(EXPECTED_A1Q2TVTAS[i][3]).Within(0.001f), $"{i}"); - Assert.That(ag.nvel[1], Is.EqualTo(EXPECTED_A1Q2TVTAS[i][4]).Within(0.001f), $"{i}"); - Assert.That(ag.nvel[2], Is.EqualTo(EXPECTED_A1Q2TVTAS[i][5]).Within(0.001f), $"{i}"); + Assert.That(ag.npos.x, Is.EqualTo(EXPECTED_A1Q2TVTAS[i][0]).Within(0.001f), $"{i}"); + Assert.That(ag.npos.y, Is.EqualTo(EXPECTED_A1Q2TVTAS[i][1]).Within(0.001f), $"{i}"); + Assert.That(ag.npos.z, Is.EqualTo(EXPECTED_A1Q2TVTAS[i][2]).Within(0.001f), $"{i}"); + Assert.That(ag.nvel.x, Is.EqualTo(EXPECTED_A1Q2TVTAS[i][3]).Within(0.001f), $"{i}"); + Assert.That(ag.nvel.y, Is.EqualTo(EXPECTED_A1Q2TVTAS[i][4]).Within(0.001f), $"{i}"); + Assert.That(ag.nvel.z, Is.EqualTo(EXPECTED_A1Q2TVTAS[i][5]).Within(0.001f), $"{i}"); } } @@ -359,12 +359,12 @@ public class Crowd4Test : AbstractCrowdTest { crowd.update(1 / 5f, null); CrowdAgent ag = agents[2]; - Assert.That(ag.npos[0], Is.EqualTo(EXPECTED_A1Q2T[i][0]).Within(0.00001f), $"{i} - {ag.npos[0]} {EXPECTED_A1Q2T[i][0]}"); - Assert.That(ag.npos[1], Is.EqualTo(EXPECTED_A1Q2T[i][1]).Within(0.00001f), $"{i} - {ag.npos[1]} {EXPECTED_A1Q2T[i][1]}"); - Assert.That(ag.npos[2], Is.EqualTo(EXPECTED_A1Q2T[i][2]).Within(0.00001f), $"{i} - {ag.npos[2]} {EXPECTED_A1Q2T[i][2]}"); - Assert.That(ag.nvel[0], Is.EqualTo(EXPECTED_A1Q2T[i][3]).Within(0.00001f), $"{i} - {ag.nvel[0]} {EXPECTED_A1Q2T[i][3]}"); - Assert.That(ag.nvel[1], Is.EqualTo(EXPECTED_A1Q2T[i][4]).Within(0.00001f), $"{i} - {ag.nvel[1]} {EXPECTED_A1Q2T[i][4]}"); - Assert.That(ag.nvel[2], Is.EqualTo(EXPECTED_A1Q2T[i][5]).Within(0.00001f), $"{i} - {ag.nvel[2]} {EXPECTED_A1Q2T[i][5]}"); + Assert.That(ag.npos.x, Is.EqualTo(EXPECTED_A1Q2T[i][0]).Within(0.00001f), $"{i} - {ag.npos.x} {EXPECTED_A1Q2T[i][0]}"); + Assert.That(ag.npos.y, Is.EqualTo(EXPECTED_A1Q2T[i][1]).Within(0.00001f), $"{i} - {ag.npos.y} {EXPECTED_A1Q2T[i][1]}"); + Assert.That(ag.npos.z, Is.EqualTo(EXPECTED_A1Q2T[i][2]).Within(0.00001f), $"{i} - {ag.npos.z} {EXPECTED_A1Q2T[i][2]}"); + Assert.That(ag.nvel.x, Is.EqualTo(EXPECTED_A1Q2T[i][3]).Within(0.00001f), $"{i} - {ag.nvel.x} {EXPECTED_A1Q2T[i][3]}"); + Assert.That(ag.nvel.y, Is.EqualTo(EXPECTED_A1Q2T[i][4]).Within(0.00001f), $"{i} - {ag.nvel.y} {EXPECTED_A1Q2T[i][4]}"); + Assert.That(ag.nvel.z, Is.EqualTo(EXPECTED_A1Q2T[i][5]).Within(0.00001f), $"{i} - {ag.nvel.z} {EXPECTED_A1Q2T[i][5]}"); } } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.Crowd.Test/Crowd4VelocityTest.cs b/test/DotRecast.Detour.Crowd.Test/Crowd4VelocityTest.cs index a439eb7..dae1ba2 100644 --- a/test/DotRecast.Detour.Crowd.Test/Crowd4VelocityTest.cs +++ b/test/DotRecast.Detour.Crowd.Test/Crowd4VelocityTest.cs @@ -113,12 +113,12 @@ public class Crowd4VelocityTest : AbstractCrowdTest } CrowdAgent ag = agents[1]; - Assert.That(ag.npos[0], Is.EqualTo(EXPECTED_A1Q3TVTA[i][0]).Within(0.001f)); - Assert.That(ag.npos[1], Is.EqualTo(EXPECTED_A1Q3TVTA[i][1]).Within(0.001f)); - Assert.That(ag.npos[2], Is.EqualTo(EXPECTED_A1Q3TVTA[i][2]).Within(0.001f)); - Assert.That(ag.nvel[0], Is.EqualTo(EXPECTED_A1Q3TVTA[i][3]).Within(0.001f)); - Assert.That(ag.nvel[1], Is.EqualTo(EXPECTED_A1Q3TVTA[i][4]).Within(0.001f)); - Assert.That(ag.nvel[2], Is.EqualTo(EXPECTED_A1Q3TVTA[i][5]).Within(0.001f)); + Assert.That(ag.npos.x, Is.EqualTo(EXPECTED_A1Q3TVTA[i][0]).Within(0.001f)); + Assert.That(ag.npos.y, Is.EqualTo(EXPECTED_A1Q3TVTA[i][1]).Within(0.001f)); + Assert.That(ag.npos.z, Is.EqualTo(EXPECTED_A1Q3TVTA[i][2]).Within(0.001f)); + Assert.That(ag.nvel.x, Is.EqualTo(EXPECTED_A1Q3TVTA[i][3]).Within(0.001f)); + Assert.That(ag.nvel.y, Is.EqualTo(EXPECTED_A1Q3TVTA[i][4]).Within(0.001f)); + Assert.That(ag.nvel.z, Is.EqualTo(EXPECTED_A1Q3TVTA[i][5]).Within(0.001f)); } } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.Crowd.Test/PathCorridorTest.cs b/test/DotRecast.Detour.Crowd.Test/PathCorridorTest.cs index f25cb59..9bc242f 100644 --- a/test/DotRecast.Detour.Crowd.Test/PathCorridorTest.cs +++ b/test/DotRecast.Detour.Crowd.Test/PathCorridorTest.cs @@ -82,4 +82,4 @@ public class PathCorridorTest Assert.That(path.Count, Is.EqualTo(2)); Assert.That(path, Is.EqualTo(new List { straightPath[2], straightPath[3] })); } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.Crowd.Test/RecastTestMeshBuilder.cs b/test/DotRecast.Detour.Crowd.Test/RecastTestMeshBuilder.cs index fdfe75c..1a51746 100644 --- a/test/DotRecast.Detour.Crowd.Test/RecastTestMeshBuilder.cs +++ b/test/DotRecast.Detour.Crowd.Test/RecastTestMeshBuilder.cs @@ -111,4 +111,4 @@ public class RecastTestMeshBuilder { return meshData; } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderTest.cs b/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderTest.cs index d2c2ec1..820ea5e 100644 --- a/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderTest.cs +++ b/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderTest.cs @@ -78,4 +78,4 @@ public class VoxelFileReaderTest Assert.That(f.tiles[0].boundsMin, Is.EqualTo(Vector3f.Of(-101.25f, 0f, -101.25f))); Assert.That(f.tiles[0].boundsMax, Is.EqualTo(Vector3f.Of(-78.75f, 5.0f, -78.75f))); } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderWriterTest.cs b/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderWriterTest.cs index e76ba63..d89f007 100644 --- a/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderWriterTest.cs +++ b/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderWriterTest.cs @@ -99,4 +99,4 @@ public class VoxelFileReaderWriterTest using var brIn = new BinaryReader(msIn); return reader.read(brIn); } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs b/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs index d1b8e1b..e02bb0a 100644 --- a/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs +++ b/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs @@ -137,4 +137,4 @@ public class UnityAStarPathfindingImporterTest using var os = new BinaryWriter(fs); writer.write(os, mesh, ByteOrder.LITTLE_ENDIAN, true); } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.Test/FindPolysAroundShapeTest.cs b/test/DotRecast.Detour.Test/FindPolysAroundShapeTest.cs index ca432e4..e10fc99 100644 --- a/test/DotRecast.Detour.Test/FindPolysAroundShapeTest.cs +++ b/test/DotRecast.Detour.Test/FindPolysAroundShapeTest.cs @@ -155,26 +155,26 @@ public class FindPolysAroundShapeTest : AbstractDetourTest private float[] getQueryPoly(Vector3f m_spos, Vector3f m_epos) { - float nx = (m_epos[2] - m_spos[2]) * 0.25f; - float nz = -(m_epos[0] - m_spos[0]) * 0.25f; + float nx = (m_epos.z - m_spos.z) * 0.25f; + float nz = -(m_epos.x - m_spos.x) * 0.25f; float agentHeight = 2.0f; float[] m_queryPoly = new float[12]; - m_queryPoly[0] = m_spos[0] + nx * 1.2f; - m_queryPoly[1] = m_spos[1] + agentHeight / 2; - m_queryPoly[2] = m_spos[2] + nz * 1.2f; + m_queryPoly[0] = m_spos.x + nx * 1.2f; + m_queryPoly[1] = m_spos.y + agentHeight / 2; + m_queryPoly[2] = m_spos.z + nz * 1.2f; - m_queryPoly[3] = m_spos[0] - nx * 1.3f; - m_queryPoly[4] = m_spos[1] + agentHeight / 2; - m_queryPoly[5] = m_spos[2] - nz * 1.3f; + m_queryPoly[3] = m_spos.x - nx * 1.3f; + m_queryPoly[4] = m_spos.y + agentHeight / 2; + m_queryPoly[5] = m_spos.z - nz * 1.3f; - m_queryPoly[6] = m_epos[0] - nx * 0.8f; - m_queryPoly[7] = m_epos[1] + agentHeight / 2; - m_queryPoly[8] = m_epos[2] - nz * 0.8f; + m_queryPoly[6] = m_epos.x - nx * 0.8f; + m_queryPoly[7] = m_epos.y + agentHeight / 2; + m_queryPoly[8] = m_epos.z - nz * 0.8f; - m_queryPoly[9] = m_epos[0] + nx; - m_queryPoly[10] = m_epos[1] + agentHeight / 2; - m_queryPoly[11] = m_epos[2] + nz; + m_queryPoly[9] = m_epos.x + nx; + m_queryPoly[10] = m_epos.y + agentHeight / 2; + m_queryPoly[11] = m_epos.z + nz; return m_queryPoly; } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.Test/Io/MeshSetReaderTest.cs b/test/DotRecast.Detour.Test/Io/MeshSetReaderTest.cs index 25de9af..b5ab8da 100644 --- a/test/DotRecast.Detour.Test/Io/MeshSetReaderTest.cs +++ b/test/DotRecast.Detour.Test/Io/MeshSetReaderTest.cs @@ -114,4 +114,4 @@ public class MeshSetReaderTest Assert.That(tiles[0].data.polys.Length, Is.EqualTo(5)); Assert.That(tiles[0].data.verts.Length, Is.EqualTo(17 * 3)); } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs b/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs index c800c69..3dc8d1f 100644 --- a/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs +++ b/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs @@ -119,4 +119,4 @@ public class MeshSetReaderWriterTest Assert.That(tiles[0].data.polys.Length, Is.EqualTo(5)); Assert.That(tiles[0].data.verts.Length, Is.EqualTo(17 * 3)); } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.Test/NavMeshBuilderTest.cs b/test/DotRecast.Detour.Test/NavMeshBuilderTest.cs index 0857836..258e436 100644 --- a/test/DotRecast.Detour.Test/NavMeshBuilderTest.cs +++ b/test/DotRecast.Detour.Test/NavMeshBuilderTest.cs @@ -66,4 +66,4 @@ public class NavMeshBuilderTest Assert.That(nmd.polys[118].getArea(), Is.EqualTo(2)); Assert.That(nmd.polys[118].getType(), Is.EqualTo(Poly.DT_POLYTYPE_OFFMESH_CONNECTION)); } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.Test/RandomPointTest.cs b/test/DotRecast.Detour.Test/RandomPointTest.cs index f8d24f2..6249a81 100644 --- a/test/DotRecast.Detour.Test/RandomPointTest.cs +++ b/test/DotRecast.Detour.Test/RandomPointTest.cs @@ -49,10 +49,10 @@ public class RandomPointTest : AbstractDetourTest bmax[1] = j == 0 ? tileAndPoly.Item1.data.verts[v + 2] : Math.Max(bmax[1], tileAndPoly.Item1.data.verts[v + 2]); } - Assert.That(point.result.getRandomPt()[0] >= bmin[0], Is.True); - Assert.That(point.result.getRandomPt()[0] <= bmax[0], Is.True); - Assert.That(point.result.getRandomPt()[2] >= bmin[1], Is.True); - Assert.That(point.result.getRandomPt()[2] <= bmax[1], Is.True); + Assert.That(point.result.getRandomPt().x >= bmin[0], Is.True); + Assert.That(point.result.getRandomPt().x <= bmax[0], Is.True); + Assert.That(point.result.getRandomPt().z >= bmin[1], Is.True); + Assert.That(point.result.getRandomPt().z <= bmax[1], Is.True); } } @@ -80,10 +80,10 @@ public class RandomPointTest : AbstractDetourTest bmax[1] = j == 0 ? tileAndPoly.Item1.data.verts[v + 2] : Math.Max(bmax[1], tileAndPoly.Item1.data.verts[v + 2]); } - Assert.That(point.getRandomPt()[0] >= bmin[0], Is.True); - Assert.That(point.getRandomPt()[0] <= bmax[0], Is.True); - Assert.That(point.getRandomPt()[2] >= bmin[1], Is.True); - Assert.That(point.getRandomPt()[2] <= bmax[1], Is.True); + Assert.That(point.getRandomPt().x >= bmin[0], Is.True); + Assert.That(point.getRandomPt().x <= bmax[0], Is.True); + Assert.That(point.getRandomPt().z >= bmin[1], Is.True); + Assert.That(point.getRandomPt().z <= bmax[1], Is.True); } } @@ -139,4 +139,4 @@ public class RandomPointTest : AbstractDetourTest Console.WriteLine("Random point around circle: " + (t2 - t1) / TimeSpan.TicksPerMillisecond + "ms"); Console.WriteLine("Random point within circle: " + (t3 - t2) / TimeSpan.TicksPerMillisecond + "ms"); } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.Test/RecastTestMeshBuilder.cs b/test/DotRecast.Detour.Test/RecastTestMeshBuilder.cs index 8429748..c7cc9c0 100644 --- a/test/DotRecast.Detour.Test/RecastTestMeshBuilder.cs +++ b/test/DotRecast.Detour.Test/RecastTestMeshBuilder.cs @@ -112,4 +112,4 @@ public class RecastTestMeshBuilder { return meshData; } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs b/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs index 3390cfc..19694c2 100644 --- a/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs @@ -76,4 +76,4 @@ public class AbstractTileCacheTest TileCacheCompressorFactory.get(cCompatibility), new TestTileCacheMeshProcess()); return tc; } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderTest.cs b/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderTest.cs index ec33216..1def5a4 100644 --- a/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderTest.cs @@ -222,4 +222,4 @@ public class TileCacheReaderTest Assert.That(data.verts[6], Is.EqualTo(48.484783f).Within(0.0001f)); Assert.That(data.verts[9], Is.EqualTo(48.484783f).Within(0.0001f)); } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.TileCache.Test/TempObstaclesTest.cs b/test/DotRecast.Detour.TileCache.Test/TempObstaclesTest.cs index d6238c7..31b7b41 100644 --- a/test/DotRecast.Detour.TileCache.Test/TempObstaclesTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/TempObstaclesTest.cs @@ -99,4 +99,4 @@ public class TempObstaclesTest : AbstractTileCacheTest Assert.That(tile.data.header.vertCount, Is.EqualTo(16)); Assert.That(tile.data.header.polyCount, Is.EqualTo(6)); } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.TileCache.Test/TestTileLayerBuilder.cs b/test/DotRecast.Detour.TileCache.Test/TestTileLayerBuilder.cs index e23cce2..1209a4a 100644 --- a/test/DotRecast.Detour.TileCache.Test/TestTileLayerBuilder.cs +++ b/test/DotRecast.Detour.TileCache.Test/TestTileLayerBuilder.cs @@ -126,4 +126,4 @@ public class TestTileLayerBuilder : AbstractTileLayersBuilder HeightfieldLayerSet lset = rcBuilder.buildLayers(geom, cfg); return lset; } -} \ No newline at end of file +} diff --git a/test/DotRecast.Detour.TileCache.Test/TileCacheTest.cs b/test/DotRecast.Detour.TileCache.Test/TileCacheTest.cs index 4dd8995..8b596aa 100644 --- a/test/DotRecast.Detour.TileCache.Test/TileCacheTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/TileCacheTest.cs @@ -286,4 +286,4 @@ public class TileCacheTest : AbstractTileCacheTest Assert.That(data.detailVerts.Length, Is.EqualTo(0)); Assert.That(data.detailTris.Length, Is.EqualTo(4 * 3)); } -} \ No newline at end of file +} diff --git a/test/DotRecast.Recast.Test/RecastLayersTest.cs b/test/DotRecast.Recast.Test/RecastLayersTest.cs index 2316170..b9f976b 100644 --- a/test/DotRecast.Recast.Test/RecastLayersTest.cs +++ b/test/DotRecast.Recast.Test/RecastLayersTest.cs @@ -155,4 +155,4 @@ public class RecastLayersTest HeightfieldLayerSet lset = builder.buildLayers(geom, bcfg); return lset; } -} \ No newline at end of file +} diff --git a/test/DotRecast.Recast.Test/RecastSoloMeshTest.cs b/test/DotRecast.Recast.Test/RecastSoloMeshTest.cs index fc350ec..fa18771 100644 --- a/test/DotRecast.Recast.Test/RecastSoloMeshTest.cs +++ b/test/DotRecast.Recast.Test/RecastSoloMeshTest.cs @@ -277,9 +277,9 @@ public class RecastSoloMeshTest using StreamWriter fw = new StreamWriter(path); for (int v = 0; v < mesh.nverts; v++) { - fw.Write("v " + (mesh.bmin[0] + mesh.verts[v * 3] * mesh.cs) + " " - + (mesh.bmin[1] + mesh.verts[v * 3 + 1] * mesh.ch) + " " - + (mesh.bmin[2] + mesh.verts[v * 3 + 2] * mesh.cs) + "\n"); + fw.Write("v " + (mesh.bmin.x + mesh.verts[v * 3] * mesh.cs) + " " + + (mesh.bmin.y + mesh.verts[v * 3 + 1] * mesh.ch) + " " + + (mesh.bmin.z + mesh.verts[v * 3 + 2] * mesh.cs) + "\n"); } for (int i = 0; i < mesh.npolys; i++) diff --git a/test/DotRecast.Recast.Test/RecastTest.cs b/test/DotRecast.Recast.Test/RecastTest.cs index 23a639a..034c8db 100644 --- a/test/DotRecast.Recast.Test/RecastTest.cs +++ b/test/DotRecast.Recast.Test/RecastTest.cs @@ -53,4 +53,4 @@ public class RecastTest Assert.That(areas[0], Is.EqualTo(RC_NULL_AREA), "Slopes equal to the max slope are considered unwalkable."); } } -} \ No newline at end of file +}