mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-14 13:19:44 +02:00
fix shapeManagerTests
This commit is contained in:
parent
b79af55e16
commit
e473edff4a
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue