This commit is contained in:
ikpil 2023-04-29 13:29:40 +09:00
parent da8c66bd1a
commit 5ed9e602fb
23 changed files with 124 additions and 124 deletions

View File

@ -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);
}
}
}

View File

@ -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,12 +735,12 @@ 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));
}
}
}

View File

@ -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]}");
}
}
}

View File

@ -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));
}
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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++)