Merge branch 'OctTree' of github.com:teamfisk/TacticalZ into OctTree

This commit is contained in:
verysecrethero
2015-12-03 17:31:07 +01:00
10 changed files with 289 additions and 40 deletions
+8 -6
View File
@@ -4,6 +4,8 @@
using boost::unit_test_framework::test_suite;
using boost::unit_test_framework::test_case;
#include <Engine\Core\Collision.h>
#include "Engine/Core/AABB.h"
#include "Engine/Core/Ray.h"
#include <stdlib.h>//srand
//vs memleaks
@@ -22,8 +24,8 @@ BOOST_AUTO_TEST_CASE(collisionTest)
//fixed seed
srand(2);
Collision::Ray ray;
Collision::AABB someAABB;
Ray ray;
AABB someAABB;
glm::vec3 minPos;
glm::vec3 maxPos;
bool z;
@@ -43,7 +45,7 @@ BOOST_AUTO_TEST_CASE(collisionTest)
maxPos.y = rand() % 100;
maxPos.z = rand() % 100;
someAABB = Collision::AABB(minPos, maxPos);
someAABB = AABB(minPos, maxPos);
z = Collision::RayVsAABB(ray, someAABB);
if (z) ++test;
}
@@ -56,8 +58,8 @@ BOOST_AUTO_TEST_CASE(collisionTest2)
{
//fixed seed
srand(2);
Collision::Ray ray;
Collision::AABB someAABB;
Ray ray;
AABB someAABB;
glm::vec3 minPos;
glm::vec3 maxPos;
bool z;
@@ -77,7 +79,7 @@ BOOST_AUTO_TEST_CASE(collisionTest2)
maxPos.y = rand() % 100;
maxPos.z = rand() % 100;
someAABB = Collision::AABB(minPos, maxPos);
someAABB = AABB(minPos, maxPos);
z = Collision::RayAABBIntr(ray, someAABB);
if (z) ++test;
}