broadphase.cc
Go to the documentation of this file.
1 //
2 // Software License Agreement (BSD License)
3 //
4 // Copyright (c) 2022 INRIA
5 // Author: Justin Carpentier
6 // All rights reserved.
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions
10 // are met:
11 //
12 // * Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 // * Redistributions in binary form must reproduce the above
15 // copyright notice, this list of conditions and the following
16 // disclaimer in the documentation and/or other materials provided
17 // with the distribution.
18 // * Neither the name of CNRS-LAAS. nor the names of its
19 // contributors may be used to endorse or promote products derived
20 // from this software without specific prior written permission.
21 //
22 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 // POSSIBILITY OF SUCH DAMAGE.
34 
35 #include "coal/fwd.hh"
36 #include "../coal.hh"
37 #include "../utils/std-pair.hh"
38 
46 
49 #ifdef COAL_HAS_DOXYGEN_AUTODOC
50 #include "doxygen_autodoc/functions.h"
52 #include "doxygen_autodoc/coal/broadphase/default_broadphase_callbacks.h"
53 // #include "doxygen_autodoc/coal/broadphase/broadphase_dynamic_AABB_tree.h"
54 // #include
55 //"doxygen_autodoc/coal/broadphase/broadphase_dynamic_AABB_tree_array.h"
56 // #include "doxygen_autodoc/coal/broadphase/broadphase_bruteforce.h"
57 // #include "doxygen_autodoc/coal/broadphase/broadphase_SaP.h"
58 // #include "doxygen_autodoc/coal/broadphase/broadphase_SSaP.h"
59 // #include "doxygen_autodoc/coal/broadphase/broadphase_interval_tree.h"
60 // #include "doxygen_autodoc/coal/broadphase/broadphase_spatialhash.h"
61 #endif
62 
63 #include "broadphase_callbacks.hh"
65 
66 using namespace coal;
67 
73 
74  // CollisionCallBackDefault
75  bp::class_<CollisionCallBackDefault, bp::bases<CollisionCallBackBase>>(
76  "CollisionCallBackDefault", bp::no_init)
77  .def(dv::init<CollisionCallBackDefault>())
79 
80  // DistanceCallBackDefault
81  bp::class_<DistanceCallBackDefault, bp::bases<DistanceCallBackBase>>(
82  "DistanceCallBackDefault", bp::no_init)
83  .def(dv::init<DistanceCallBackDefault>())
85 
86  // CollisionCallBackCollect
87  bp::class_<CollisionCallBackCollect, bp::bases<CollisionCallBackBase>>(
88  "CollisionCallBackCollect", bp::no_init)
89  .def(dv::init<CollisionCallBackCollect, const size_t>())
90  .DEF_CLASS_FUNC(CollisionCallBackCollect, numCollisionPairs)
91  .DEF_CLASS_FUNC2(CollisionCallBackCollect, getCollisionPairs,
92  bp::return_value_policy<bp::copy_const_reference>())
94  "exist", (bool(CollisionCallBackCollect::*)(
97  .def(dv::member_func("exist",
98  (bool(CollisionCallBackCollect::*)(
99  CollisionObject *, CollisionObject *) const) &
101 
103 
104  bp::class_<CollisionData>("CollisionData", bp::no_init)
105  .def(dv::init<CollisionData>())
106  .DEF_RW_CLASS_ATTRIB(CollisionData, request)
107  .DEF_RW_CLASS_ATTRIB(CollisionData, result)
108  .DEF_RW_CLASS_ATTRIB(CollisionData, done)
109  .DEF_CLASS_FUNC(CollisionData, clear);
110 
111  bp::class_<DistanceData>("DistanceData", bp::no_init)
112  .def(dv::init<DistanceData>())
113  .DEF_RW_CLASS_ATTRIB(DistanceData, request)
114  .DEF_RW_CLASS_ATTRIB(DistanceData, result)
115  .DEF_RW_CLASS_ATTRIB(DistanceData, done)
116  .DEF_CLASS_FUNC(DistanceData, clear);
117 
119 
126  BroadPhaseCollisionManagerWrapper::exposeDerived<SSaPCollisionManager>();
127  BroadPhaseCollisionManagerWrapper::exposeDerived<SaPCollisionManager>();
128  BroadPhaseCollisionManagerWrapper::exposeDerived<NaiveCollisionManager>();
129 
130  // Specific case of SpatialHashingCollisionManager
131  {
134  HashTable;
136  bp::class_<Derived, bp::bases<BroadPhaseCollisionManager>>(
137  "SpatialHashingCollisionManager", bp::no_init)
138  .def(dv::init<Derived, CoalScalar, const Vec3s &, const Vec3s &,
139  bp::optional<unsigned int>>());
140  }
141 }
coal::SpatialHashingCollisionManager
spatial hashing collision mananger
Definition: coal/broadphase/broadphase_spatialhash.h:54
broadphase_collision_manager.hh
StdPairConverter::registration
static void registration()
Definition: std-pair.hh:53
coal::Vec3s
Eigen::Matrix< CoalScalar, 3, 1 > Vec3s
Definition: coal/data_types.h:77
broadphase_dynamic_AABB_tree.h
COAL_COMPILER_DIAGNOSTIC_PUSH
#define COAL_COMPILER_DIAGNOSTIC_PUSH
Definition: include/coal/fwd.hh:120
broadphase_SaP.h
coal::CollisionCallBackDefault
Default collision callback to check collision between collision objects.
Definition: coal/broadphase/default_broadphase_callbacks.h:196
coal::DynamicAABBTreeCollisionManager
Definition: coal/broadphase/broadphase_dynamic_AABB_tree.h:53
coal::DistanceData
Distance data stores the distance request and the result given by distance algorithm.
Definition: coal/broadphase/default_broadphase_callbacks.h:76
coal::CollisionCallBackCollect::CollisionPair
std::pair< CollisionObject *, CollisionObject * > CollisionPair
Definition: coal/broadphase/default_broadphase_callbacks.h:224
data
data
coal
Main namespace.
Definition: coal/broadphase/broadphase_bruteforce.h:44
doxygen::def
void def(const char *name, Func func)
Definition: doxygen-boost.hh:106
coal::CollisionCallBackCollect
Collision callback to collect collision pairs potentially in contacts.
Definition: coal/broadphase/default_broadphase_callbacks.h:223
coal::AABB
A class describing the AABB collision structure, which is a box in 3D space determined by two diagona...
Definition: coal/BV/AABB.h:55
coal::CollisionCallBackCollect::exist
bool exist(const CollisionPair &pair) const
Check whether a collision pair exists.
Definition: default_broadphase_callbacks.cpp:119
DEF_RW_CLASS_ATTRIB
#define DEF_RW_CLASS_ATTRIB(CLASS, ATTRIB)
Definition: python/fwd.hh:29
coal::DistanceCallBackDefault
Default distance callback to check collision between collision objects.
Definition: coal/broadphase/default_broadphase_callbacks.h:210
coal::CollisionCallBackBaseWrapper::expose
static void expose()
Definition: broadphase_callbacks.hh:64
coal::DynamicAABBTreeArrayCollisionManager
Definition: coal/broadphase/broadphase_dynamic_AABB_tree_array.h:54
coal::detail::SpatialHash
Spatial hash function: hash an AABB to a set of integer values.
Definition: coal/broadphase/detail/spatial_hash.h:49
coal::DistanceCallBackBaseWrapper::expose
static void expose()
Definition: broadphase_callbacks.hh:94
DEF_CLASS_FUNC
#define DEF_CLASS_FUNC(CLASS, ATTRIB)
Definition: python/fwd.hh:35
exposeBroadPhase
COAL_COMPILER_DIAGNOSTIC_PUSH COAL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS void exposeBroadPhase()
Definition: broadphase.cc:70
coal::BroadPhaseCollisionManagerWrapper::exposeDerived
static void exposeDerived()
Definition: broadphase_collision_manager.hh:216
fwd.hh
coal::BroadPhaseCollisionManagerWrapper::expose
static void expose()
Definition: broadphase_collision_manager.hh:122
doxygen::visitor::member_func
member_func_impl< function_type > member_func(const char *name, const function_type &function)
Definition: doxygen-boost.hh:49
coal::IntervalTreeCollisionManager
Collision manager based on interval tree.
Definition: coal/broadphase/broadphase_interval_tree.h:50
broadphase_spatialhash.h
coal::CollisionObject
the object for collision or distance computation, contains the geometry and the transform information
Definition: coal/collision_object.h:214
broadphase_bruteforce.h
broadphase_dynamic_AABB_tree_array.h
coal::detail::SimpleHashTable
A simple hash table implemented as multiple buckets. HashFnc is any extended hash function: HashFnc(k...
Definition: coal/broadphase/detail/simple_hash_table.h:52
COAL_COMPILER_DIAGNOSTIC_POP
#define COAL_COMPILER_DIAGNOSTIC_POP
Definition: include/coal/fwd.hh:121
COAL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
#define COAL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
Definition: include/coal/fwd.hh:122
broadphase_callbacks.hh
coal::CollisionData
Collision data stores the collision request and the result given by collision algorithm.
Definition: coal/broadphase/default_broadphase_callbacks.h:55
broadphase_SSaP.h
coal::CoalScalar
double CoalScalar
Definition: coal/data_types.h:76
broadphase_interval_tree.h


hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:57