|
|
|
@ -25,12 +25,15 @@ namespace
|
|
|
|
|
{
|
|
|
|
|
const osg::Vec3f mAgentHalfExtents {1, 2, 3};
|
|
|
|
|
const TilePosition mTilePosition {0, 0};
|
|
|
|
|
const std::size_t mGeneration = 0;
|
|
|
|
|
const std::size_t mRevision = 0;
|
|
|
|
|
const std::vector<int> mIndices {{0, 1, 2}};
|
|
|
|
|
const std::vector<float> mVertices {{0, 0, 0, 1, 0, 0, 1, 1, 0}};
|
|
|
|
|
const std::vector<AreaType> mAreaTypes {1, AreaType_ground};
|
|
|
|
|
const std::vector<RecastMesh::Water> mWater {};
|
|
|
|
|
const std::size_t mTrianglesPerChunk {1};
|
|
|
|
|
const RecastMesh mRecastMesh {mIndices, mVertices, mAreaTypes, mWater, mTrianglesPerChunk};
|
|
|
|
|
const RecastMesh mRecastMesh {mGeneration, mRevision, mIndices, mVertices,
|
|
|
|
|
mAreaTypes, mWater, mTrianglesPerChunk};
|
|
|
|
|
const std::vector<OffMeshConnection> mOffMeshConnections {};
|
|
|
|
|
unsigned char* const mData = reinterpret_cast<unsigned char*>(dtAlloc(1, DT_ALLOC_PERM));
|
|
|
|
|
NavMeshData mNavMeshData {mData, 1};
|
|
|
|
@ -128,7 +131,8 @@ namespace
|
|
|
|
|
const std::size_t maxSize = 1;
|
|
|
|
|
NavMeshTilesCache cache(maxSize);
|
|
|
|
|
const std::vector<RecastMesh::Water> water {1, RecastMesh::Water {1, btTransform::getIdentity()}};
|
|
|
|
|
const RecastMesh unexistentRecastMesh {mIndices, mVertices, mAreaTypes, water, mTrianglesPerChunk};
|
|
|
|
|
const RecastMesh unexistentRecastMesh {mGeneration, mRevision, mIndices, mVertices,
|
|
|
|
|
mAreaTypes, water, mTrianglesPerChunk};
|
|
|
|
|
|
|
|
|
|
cache.set(mAgentHalfExtents, mTilePosition, mRecastMesh, mOffMeshConnections, std::move(mNavMeshData));
|
|
|
|
|
EXPECT_FALSE(cache.get(mAgentHalfExtents, mTilePosition, unexistentRecastMesh, mOffMeshConnections));
|
|
|
|
@ -142,7 +146,8 @@ namespace
|
|
|
|
|
NavMeshTilesCache cache(maxSize);
|
|
|
|
|
|
|
|
|
|
const std::vector<RecastMesh::Water> water {1, RecastMesh::Water {1, btTransform::getIdentity()}};
|
|
|
|
|
const RecastMesh anotherRecastMesh {mIndices, mVertices, mAreaTypes, water, mTrianglesPerChunk};
|
|
|
|
|
const RecastMesh anotherRecastMesh {mGeneration, mRevision, mIndices, mVertices,
|
|
|
|
|
mAreaTypes, water, mTrianglesPerChunk};
|
|
|
|
|
const auto anotherData = reinterpret_cast<unsigned char*>(dtAlloc(1, DT_ALLOC_PERM));
|
|
|
|
|
NavMeshData anotherNavMeshData {anotherData, 1};
|
|
|
|
|
|
|
|
|
@ -162,7 +167,8 @@ namespace
|
|
|
|
|
NavMeshTilesCache cache(maxSize);
|
|
|
|
|
|
|
|
|
|
const std::vector<RecastMesh::Water> water {1, RecastMesh::Water {1, btTransform::getIdentity()}};
|
|
|
|
|
const RecastMesh anotherRecastMesh {mIndices, mVertices, mAreaTypes, water, mTrianglesPerChunk};
|
|
|
|
|
const RecastMesh anotherRecastMesh {mGeneration, mRevision, mIndices, mVertices,
|
|
|
|
|
mAreaTypes, water, mTrianglesPerChunk};
|
|
|
|
|
const auto anotherData = reinterpret_cast<unsigned char*>(dtAlloc(1, DT_ALLOC_PERM));
|
|
|
|
|
NavMeshData anotherNavMeshData {anotherData, 1};
|
|
|
|
|
|
|
|
|
@ -180,14 +186,14 @@ namespace
|
|
|
|
|
NavMeshTilesCache cache(maxSize);
|
|
|
|
|
|
|
|
|
|
const std::vector<RecastMesh::Water> leastRecentlySetWater {1, RecastMesh::Water {1, btTransform::getIdentity()}};
|
|
|
|
|
const RecastMesh leastRecentlySetRecastMesh {mIndices, mVertices, mAreaTypes, leastRecentlySetWater,
|
|
|
|
|
mTrianglesPerChunk};
|
|
|
|
|
const RecastMesh leastRecentlySetRecastMesh {mGeneration, mRevision, mIndices, mVertices,
|
|
|
|
|
mAreaTypes, leastRecentlySetWater, mTrianglesPerChunk};
|
|
|
|
|
const auto leastRecentlySetData = reinterpret_cast<unsigned char*>(dtAlloc(1, DT_ALLOC_PERM));
|
|
|
|
|
NavMeshData leastRecentlySetNavMeshData {leastRecentlySetData, 1};
|
|
|
|
|
|
|
|
|
|
const std::vector<RecastMesh::Water> mostRecentlySetWater {1, RecastMesh::Water {2, btTransform::getIdentity()}};
|
|
|
|
|
const RecastMesh mostRecentlySetRecastMesh {mIndices, mVertices, mAreaTypes, mostRecentlySetWater,
|
|
|
|
|
mTrianglesPerChunk};
|
|
|
|
|
const RecastMesh mostRecentlySetRecastMesh {mGeneration, mRevision, mIndices, mVertices,
|
|
|
|
|
mAreaTypes, mostRecentlySetWater, mTrianglesPerChunk};
|
|
|
|
|
const auto mostRecentlySetData = reinterpret_cast<unsigned char*>(dtAlloc(1, DT_ALLOC_PERM));
|
|
|
|
|
NavMeshData mostRecentlySetNavMeshData {mostRecentlySetData, 1};
|
|
|
|
|
|
|
|
|
@ -212,14 +218,14 @@ namespace
|
|
|
|
|
NavMeshTilesCache cache(maxSize);
|
|
|
|
|
|
|
|
|
|
const std::vector<RecastMesh::Water> leastRecentlyUsedWater {1, RecastMesh::Water {1, btTransform::getIdentity()}};
|
|
|
|
|
const RecastMesh leastRecentlyUsedRecastMesh {mIndices, mVertices, mAreaTypes, leastRecentlyUsedWater,
|
|
|
|
|
mTrianglesPerChunk};
|
|
|
|
|
const RecastMesh leastRecentlyUsedRecastMesh {mGeneration, mRevision, mIndices, mVertices,
|
|
|
|
|
mAreaTypes, leastRecentlyUsedWater, mTrianglesPerChunk};
|
|
|
|
|
const auto leastRecentlyUsedData = reinterpret_cast<unsigned char*>(dtAlloc(1, DT_ALLOC_PERM));
|
|
|
|
|
NavMeshData leastRecentlyUsedNavMeshData {leastRecentlyUsedData, 1};
|
|
|
|
|
|
|
|
|
|
const std::vector<RecastMesh::Water> mostRecentlyUsedWater {1, RecastMesh::Water {2, btTransform::getIdentity()}};
|
|
|
|
|
const RecastMesh mostRecentlyUsedRecastMesh {mIndices, mVertices, mAreaTypes, mostRecentlyUsedWater,
|
|
|
|
|
mTrianglesPerChunk};
|
|
|
|
|
const RecastMesh mostRecentlyUsedRecastMesh {mGeneration, mRevision, mIndices, mVertices,
|
|
|
|
|
mAreaTypes, mostRecentlyUsedWater, mTrianglesPerChunk};
|
|
|
|
|
const auto mostRecentlyUsedData = reinterpret_cast<unsigned char*>(dtAlloc(1, DT_ALLOC_PERM));
|
|
|
|
|
NavMeshData mostRecentlyUsedNavMeshData {mostRecentlyUsedData, 1};
|
|
|
|
|
|
|
|
|
@ -256,7 +262,7 @@ namespace
|
|
|
|
|
NavMeshTilesCache cache(maxSize);
|
|
|
|
|
|
|
|
|
|
const std::vector<RecastMesh::Water> water {1, RecastMesh::Water {1, btTransform::getIdentity()}};
|
|
|
|
|
const RecastMesh tooLargeRecastMesh {mIndices, mVertices, mAreaTypes, water, mTrianglesPerChunk};
|
|
|
|
|
const RecastMesh tooLargeRecastMesh {mGeneration, mRevision, mIndices, mVertices, mAreaTypes, water, mTrianglesPerChunk};
|
|
|
|
|
const auto tooLargeData = reinterpret_cast<unsigned char*>(dtAlloc(2, DT_ALLOC_PERM));
|
|
|
|
|
NavMeshData tooLargeNavMeshData {tooLargeData, 2};
|
|
|
|
|
|
|
|
|
@ -275,12 +281,13 @@ namespace
|
|
|
|
|
NavMeshTilesCache cache(maxSize);
|
|
|
|
|
|
|
|
|
|
const std::vector<RecastMesh::Water> anotherWater {1, RecastMesh::Water {1, btTransform::getIdentity()}};
|
|
|
|
|
const RecastMesh anotherRecastMesh {mIndices, mVertices, mAreaTypes, anotherWater, mTrianglesPerChunk};
|
|
|
|
|
const RecastMesh anotherRecastMesh {mGeneration, mRevision, mIndices, mVertices, mAreaTypes, anotherWater, mTrianglesPerChunk};
|
|
|
|
|
const auto anotherData = reinterpret_cast<unsigned char*>(dtAlloc(1, DT_ALLOC_PERM));
|
|
|
|
|
NavMeshData anotherNavMeshData {anotherData, 1};
|
|
|
|
|
|
|
|
|
|
const std::vector<RecastMesh::Water> tooLargeWater {1, RecastMesh::Water {2, btTransform::getIdentity()}};
|
|
|
|
|
const RecastMesh tooLargeRecastMesh {mIndices, mVertices, mAreaTypes, tooLargeWater, mTrianglesPerChunk};
|
|
|
|
|
const RecastMesh tooLargeRecastMesh {mGeneration, mRevision, mIndices, mVertices,
|
|
|
|
|
mAreaTypes, tooLargeWater, mTrianglesPerChunk};
|
|
|
|
|
const auto tooLargeData = reinterpret_cast<unsigned char*>(dtAlloc(2, DT_ALLOC_PERM));
|
|
|
|
|
NavMeshData tooLargeNavMeshData {tooLargeData, 2};
|
|
|
|
|
|
|
|
|
@ -303,7 +310,8 @@ namespace
|
|
|
|
|
NavMeshTilesCache cache(maxSize);
|
|
|
|
|
|
|
|
|
|
const std::vector<RecastMesh::Water> water {1, RecastMesh::Water {1, btTransform::getIdentity()}};
|
|
|
|
|
const RecastMesh anotherRecastMesh {mIndices, mVertices, mAreaTypes, water, mTrianglesPerChunk};
|
|
|
|
|
const RecastMesh anotherRecastMesh {mGeneration, mRevision, mIndices, mVertices,
|
|
|
|
|
mAreaTypes, water, mTrianglesPerChunk};
|
|
|
|
|
const auto anotherData = reinterpret_cast<unsigned char*>(dtAlloc(1, DT_ALLOC_PERM));
|
|
|
|
|
NavMeshData anotherNavMeshData {anotherData, 1};
|
|
|
|
|
|
|
|
|
@ -326,7 +334,7 @@ namespace
|
|
|
|
|
NavMeshTilesCache cache(maxSize);
|
|
|
|
|
|
|
|
|
|
const std::vector<RecastMesh::Water> water {1, RecastMesh::Water {1, btTransform::getIdentity()}};
|
|
|
|
|
const RecastMesh anotherRecastMesh {mIndices, mVertices, mAreaTypes, water, mTrianglesPerChunk};
|
|
|
|
|
const RecastMesh anotherRecastMesh {mGeneration, mRevision, mIndices, mVertices, mAreaTypes, water, mTrianglesPerChunk};
|
|
|
|
|
const auto anotherData = reinterpret_cast<unsigned char*>(dtAlloc(1, DT_ALLOC_PERM));
|
|
|
|
|
NavMeshData anotherNavMeshData {anotherData, 1};
|
|
|
|
|
|
|
|
|
|