fix shapeManagerTests

This commit is contained in:
Andrew Meadows 2016-07-14 14:04:26 -07:00
parent b79af55e16
commit e473edff4a

View file

@ -12,6 +12,7 @@
#include <iostream> #include <iostream>
#include <ShapeManager.h> #include <ShapeManager.h>
#include <StreamUtils.h> #include <StreamUtils.h>
#include <Extents.h>
#include "ShapeManagerTests.h" #include "ShapeManagerTests.h"
@ -197,6 +198,7 @@ void ShapeManagerTests::addCompoundShape() {
ShapeInfo::PointCollection pointCollection; ShapeInfo::PointCollection pointCollection;
int numHulls = 5; int numHulls = 5;
glm::vec3 offsetNormal(1.0f, 0.0f, 0.0f); glm::vec3 offsetNormal(1.0f, 0.0f, 0.0f);
Extents extents;
for (int i = 0; i < numHulls; ++i) { for (int i = 0; i < numHulls; ++i) {
glm::vec3 offset = (float)(i - numHulls/2) * offsetNormal; glm::vec3 offset = (float)(i - numHulls/2) * offsetNormal;
ShapeInfo::PointList pointList; ShapeInfo::PointList pointList;
@ -204,13 +206,16 @@ void ShapeManagerTests::addCompoundShape() {
for (int j = 0; j < numHullPoints; ++j) { for (int j = 0; j < numHullPoints; ++j) {
glm::vec3 point = radius * tetrahedron[j] + offset; glm::vec3 point = radius * tetrahedron[j] + offset;
pointList.push_back(point); pointList.push_back(point);
extents.addPoint(point);
} }
pointCollection.push_back(pointList); pointCollection.push_back(pointList);
} }
// create the ShapeInfo // create the ShapeInfo
ShapeInfo info; ShapeInfo info;
info.setPointCollection(hulls); glm::vec3 halfExtents = 0.5f * (extents.maximum - extents.minimum);
info.setParams(SHAPE_TYPE_COMPOUND, halfExtents);
info.setPointCollection(pointCollection);
// create the shape // create the shape
ShapeManager shapeManager; ShapeManager shapeManager;