00001 #ifndef OPENTISSUE_COLLISION_COLLISION_POINTS_AABB_TREE_H 00002 #define OPENTISSUE_COLLISION_COLLISION_POINTS_AABB_TREE_H 00003 // 00004 // OpenTissue Template Library 00005 // - A generic toolbox for physics-based modeling and simulation. 00006 // Copyright (C) 2008 Department of Computer Science, University of Copenhagen. 00007 // 00008 // OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php 00009 // 00010 #include <OpenTissue/configuration.h> 00011 00012 #include <OpenTissue/collision/aabb_tree/policies/aabb_tree_single_collision_policy.h> 00013 #include <OpenTissue/collision/bvh/bvh_single_collision_query.h> 00014 00015 namespace OpenTissue 00016 { 00017 namespace collision 00018 { 00019 00020 00030 template<typename point_iterator, typename aabb_tree_geometry,typename contact_point_container> 00031 void points_aabb_tree( 00032 point_iterator begin 00033 , point_iterator end 00034 , aabb_tree_geometry const & aabb_tree 00035 , contact_point_container & contacts 00036 ) 00037 { 00038 typedef typename aabb_tree_geometry::bvh_type bvh_type; 00039 00040 typedef OpenTissue::bvh::SingleCollisionQuery< OpenTissue::aabb_tree::SingleCollisionPolicy<aabb_tree_geometry> > collision_query; 00041 00042 int dont_care_identity_transform; 00043 00044 collision_query query; 00045 00046 for(point_iterator p = begin;p!=end;++p) 00047 query.run( dont_care_identity_transform, aabb_tree.m_bvh, (*p), contacts); 00048 00049 } 00050 00051 } // namespace collision 00052 00053 } // namespace OpenTissue 00054 00055 // OPENTISSUE_COLLISION_COLLISION_POINTS_AABB_TREE_H 00056 #endif