bvh: Move the basic bounding volume tree functionality into core.

The basic boundignvolume implementation does only need math and
geometry. As such it is agnostic to the scenegraph being used.
Only the parts building this query structure from terrain
depend on the implementation of the terrain.
So, move this into the simgear core component.
This commit is contained in:
Mathias Froehlich 2012-08-24 21:20:40 +02:00
parent e99064ca18
commit 22878b6f89
39 changed files with 36 additions and 23 deletions

View File

@ -3,6 +3,7 @@ file(WRITE ${PROJECT_BINARY_DIR}/simgear/version.h "#define SIMGEAR_VERSION ${SI
foreach( mylibfolder
bucket
bvh
debug
ephemeris
io

View File

@ -2,7 +2,6 @@ include (SimGearComponent)
set(HEADERS
BVHBoundingBoxVisitor.hxx
BVHDebugCollectVisitor.hxx
BVHGroup.hxx
BVHLineGeometry.hxx
BVHLineSegmentVisitor.hxx
@ -36,4 +35,16 @@ set(SOURCES
BVHTransform.cxx
)
simgear_scene_component(bvh scene/bvh "${SOURCES}" "${HEADERS}")
simgear_component(bvh bvh "${SOURCES}" "${HEADERS}")
if(ENABLE_TESTS)
if (SIMGEAR_SHARED)
set(TEST_LIBS SimGearCore)
else()
set(TEST_LIBS sgbvh sgmath sgstructure sgdebug)
endif()
add_executable(bvhtest bvhtest.cxx)
target_link_libraries(bvhtest ${TEST_LIBS})
add_test(bvhtest ${EXECUTABLE_OUTPUT_PATH}/bvhtest)
endif(ENABLE_TESTS)

View File

@ -3,7 +3,6 @@ include (SimGearComponent)
include_directories(${PROJECT_SOURCE_DIR})
foreach( mylibfolder
bvh
material
model
sky

View File

@ -32,21 +32,22 @@
#include <osg/StateSet>
#include <simgear/math/SGGeometry.hxx>
#include <simgear/scene/util/OsgMath.hxx>
#include "BVHVisitor.hxx"
#include "BVHNode.hxx"
#include "BVHGroup.hxx"
#include "BVHTransform.hxx"
#include "BVHMotionTransform.hxx"
#include "BVHStaticGeometry.hxx"
#include <simgear/bvh/BVHVisitor.hxx>
#include <simgear/bvh/BVHNode.hxx>
#include <simgear/bvh/BVHGroup.hxx>
#include <simgear/bvh/BVHTransform.hxx>
#include <simgear/bvh/BVHMotionTransform.hxx>
#include <simgear/bvh/BVHStaticGeometry.hxx>
#include "BVHStaticData.hxx"
#include <simgear/bvh/BVHStaticData.hxx>
#include "BVHStaticNode.hxx"
#include "BVHStaticTriangle.hxx"
#include "BVHStaticBinary.hxx"
#include <simgear/bvh/BVHStaticNode.hxx>
#include <simgear/bvh/BVHStaticTriangle.hxx>
#include <simgear/bvh/BVHStaticBinary.hxx>
#include "BVHBoundingBoxVisitor.hxx"
#include <simgear/bvh/BVHBoundingBoxVisitor.hxx>
namespace simgear {

View File

@ -33,7 +33,7 @@
#include <simgear/scene/util/SGSceneUserData.hxx>
#include <simgear/math/SGGeometry.hxx>
#include <simgear/scene/bvh/BVHStaticGeometryBuilder.hxx>
#include <simgear/bvh/BVHStaticGeometryBuilder.hxx>
namespace simgear {

View File

@ -2,6 +2,7 @@ include (SimGearComponent)
set(HEADERS
BoundingVolumeBuildVisitor.hxx
BVHDebugCollectVisitor.hxx
CheckSceneryVisitor.hxx
ConditionNode.hxx
ModelRegistry.hxx

View File

@ -26,10 +26,10 @@
#include <osg/NodeVisitor>
#include <osg/TemplatePrimitiveFunctor>
#include <simgear/bvh/BVHGroup.hxx>
#include <simgear/bvh/BVHLineGeometry.hxx>
#include <simgear/scene/util/OsgMath.hxx>
#include <simgear/scene/util/SGSceneUserData.hxx>
#include <simgear/scene/bvh/BVHGroup.hxx>
#include <simgear/scene/bvh/BVHLineGeometry.hxx>
class SGInteractionAnimation::LineCollector : public osg::NodeVisitor {
struct LinePrimitiveFunctor {

View File

@ -25,7 +25,7 @@
#include <vector>
#include <osg/Node>
#include <osg/Object>
#include <simgear/scene/bvh/BVHNode.hxx>
#include <simgear/bvh/BVHNode.hxx>
#include "SGPickCallback.hxx"
class SGSceneUserData : public osg::Object {