49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
/*
|
||
* © Copyright 2014 – Urheberrechtshinweis
|
||
* Alle Rechte vorbehalten / All Rights Reserved
|
||
*
|
||
* Programmcode ist urheberrechtlich geschuetzt.
|
||
* Das Urheberrecht liegt, soweit nicht ausdruecklich anders gekennzeichnet, bei Frank Ebner.
|
||
* Keine Verwendung ohne explizite Genehmigung.
|
||
* (vgl. § 106 ff UrhG / § 97 UrhG)
|
||
*/
|
||
|
||
#ifndef BOUDINGVOLUMECIRCLE2_H
|
||
#define BOUDINGVOLUMECIRCLE2_H
|
||
|
||
#include <vector>
|
||
|
||
#include "BoundingVolume.h"
|
||
#include "../Circle2.h"
|
||
|
||
class BoundingVolumeCircle2 : public Circle2 {
|
||
|
||
public:
|
||
|
||
BoundingVolumeCircle2() {;}
|
||
|
||
BoundingVolumeCircle2(const Circle2& c) : Circle2(c) {;}
|
||
|
||
float getVolumeSize() const {
|
||
return M_PI * (radius*radius);
|
||
}
|
||
|
||
bool intersects(const Ray2 ray) const {
|
||
return Circle2::intersects(ray);
|
||
}
|
||
|
||
/** construct a volume around the given point-set */
|
||
static BoundingVolumeCircle2 fromVertices(const std::vector<Point2>& verts) {
|
||
BoundingVolumeCircle2 bvs;
|
||
bvs.adjustToPointSet(verts);
|
||
return bvs;
|
||
}
|
||
|
||
static BoundingVolumeCircle2 join(const BoundingVolumeCircle2 a, const BoundingVolumeCircle2 b) {
|
||
return BoundingVolumeCircle2(Circle2::join(a, b));
|
||
}
|
||
|
||
};
|
||
|
||
#endif // BOUDINGVOLUMECIRCLE2_H
|