worked on 2D/3D raytracing

adjusted BVH
improved 2D/3D BVH
new bounding volumes
new test cases
renamed some test-cases for grouping reasons
made GPC header-only using slight adjustments
This commit is contained in:
2017-09-13 08:08:00 +02:00
parent c19d18a3a6
commit 686151b511
38 changed files with 1257 additions and 253 deletions

View File

@@ -0,0 +1,36 @@
#ifndef BOUNDINGVOLUMEAABB2_H
#define BOUNDINGVOLUMEAABB2_H
#include <vector>
#include "BoundingVolume.h"
#include "../BBox2.h"
class BoundingVolumeAABB2 : public BBox2 {
public:
BoundingVolumeAABB2() {;}
BoundingVolumeAABB2(const BBox2& bb) : BBox2(bb) {;}
float getVolumeSize() const {
const float dx = getMax().x - getMin().x;
const float dy = getMax().y - getMin().y;
return (dx*dy);
}
/** construct a volume around the given point-set */
static BoundingVolumeAABB2 fromVertices(const std::vector<Point2>& verts) {
BoundingVolumeAABB2 bvs;
for (const Point2 p : verts) {bvs.add(p);}
return bvs;
}
static BoundingVolumeAABB2 join(const BoundingVolumeAABB2 a, const BoundingVolumeAABB2 b) {
return BoundingVolumeAABB2(BBox2::join(a, b));
}
};
#endif // BOUNDINGVOLUMEAABB2_H