00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "BVHStaticGeometry.hxx"
00019
00020 #include "BVHBoundingBoxVisitor.hxx"
00021
00022 namespace simgear {
00023
00024 BVHStaticGeometry::BVHStaticGeometry(const BVHStaticNode* staticNode,
00025 const BVHStaticData* staticData) :
00026 _staticNode(staticNode),
00027 _staticData(staticData)
00028 {
00029 }
00030
00031 BVHStaticGeometry::~BVHStaticGeometry()
00032 {
00033 }
00034
00035 void
00036 BVHStaticGeometry::accept(BVHVisitor& visitor)
00037 {
00038 visitor.apply(*this);
00039 }
00040
00041 SGSphered
00042 BVHStaticGeometry::computeBoundingSphere() const
00043 {
00044 BVHBoundingBoxVisitor bbv;
00045 _staticNode->accept(bbv, *_staticData);
00046 SGSphered sphere;
00047 sphere.expandBy(SGBoxd(bbv.getBox()));
00048 return sphere;
00049 }
00050
00051 }