worked on nav-meshes
This commit is contained in:
29
tests/navMesh/TestNavMeshSub.cpp
Normal file
29
tests/navMesh/TestNavMeshSub.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
#include "../Tests.h"
|
||||
|
||||
#include "../../navMesh/NavMeshFactory.h"
|
||||
#include "../../navMesh/walk/NavMeshSub.h"
|
||||
|
||||
TEST(NavMeshSub, build1) {
|
||||
|
||||
Floorplan::IndoorMap map;
|
||||
Floorplan::Floor floor; map.floors.push_back(&floor); floor.atHeight = 0; floor.height = 3;
|
||||
Floorplan::FloorOutlinePolygon outline; floor.outline.push_back(&outline);
|
||||
outline.poly.points.push_back(Point2(0,0));
|
||||
outline.poly.points.push_back(Point2(10,0));
|
||||
outline.poly.points.push_back(Point2(10,10));
|
||||
outline.poly.points.push_back(Point2(0,10));
|
||||
outline.outdoor = false;
|
||||
outline.method = Floorplan::OutlineMethod::ADD;
|
||||
|
||||
NavMesh<NavMeshTriangle> nm;
|
||||
NavMeshFactory<NavMeshTriangle> fac(&nm);
|
||||
fac.build(&map);
|
||||
|
||||
NavMeshLocation<NavMeshTriangle> loc = nm.getLocation(Point3(1,1,1));
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user