6 #include "btBulletCollisionCommon.h" 7 #include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h" 8 #include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h" 9 #include "BulletCollision/NarrowPhaseCollision/btPointCollector.h" 18 typedef std::unordered_map<ElementId, std::unique_ptr<btCollisionObject>>
24 btBroadphaseProxy* proxy1)
const;
44 virtual const char* what()
const throw();
48 std::string shape_name_;
57 void updateModel()
override;
61 bool updateElementWorldTransform(
62 const ElementId,
const Eigen::Isometry3d& T_local_to_world)
override;
71 const bool use_margins,
72 std::vector<PointPair>& closest_points)
override;
74 bool ComputeMaximumDepthCollisionPoints(
75 const bool use_margins, std::vector<PointPair>& points)
override;
84 const bool use_margins,
85 std::vector<PointPair>& closest_points)
override;
87 void collisionDetectFromPoints(
88 const Eigen::Matrix3Xd& points,
bool use_margins,
89 std::vector<PointPair>& closest_points)
override;
91 void ClearCachedResults(
bool use_margins)
override;
93 bool collisionRaycast(
const Eigen::Matrix3Xd& origins,
94 const Eigen::Matrix3Xd& ray_endpoints,
bool use_margins,
95 Eigen::VectorXd& distances,
96 Eigen::Matrix3Xd& normals)
override;
120 std::vector<PointPair> potentialCollisionPoints(
bool use_margins)
override;
122 bool collidingPointsCheckOnly(
123 const std::vector<Eigen::Vector3d>& input_points,
124 double collision_threshold)
override;
126 std::vector<size_t> collidingPoints(
127 const std::vector<Eigen::Vector3d>& input_points,
128 double collision_threshold)
override;
131 enum DispatchMethod {
133 kClosestPointsAllToAll,
134 kCollisionPointsAllToAll,
135 kPotentialCollisionPoints
138 static constexpr
double kSmallMargin = 1e-9;
139 static constexpr
double kLargeMargin = 0.05;
152 virtual PointPair findClosestPointsBetweenElements(
156 static std::unique_ptr<btCollisionShape> newBulletBoxShape(
158 static std::unique_ptr<btCollisionShape> newBulletSphereShape(
160 static std::unique_ptr<btCollisionShape> newBulletCylinderShape(
162 static std::unique_ptr<btCollisionShape> newBulletCapsuleShape(
164 static std::unique_ptr<btCollisionShape> newBulletMeshShape(
166 static std::unique_ptr<btCollisionShape> newBulletStaticMeshShape(
168 static std::unique_ptr<btCollisionShape> newBulletMeshPointsShape(
171 std::vector<std::unique_ptr<btCollisionShape>> bt_collision_shapes_;
174 DispatchMethod dispatch_method_in_use_{kNotYetDecided};
virtual ~UnknownShapeException()
Definition: bullet_model.h:45
Definition: bullet_model.h:21
btDefaultCollisionConfiguration bt_collision_configuration
Definition: bullet_model.h:33
Definition: Geometry.h:81
BulletModel()
Definition: bullet_model.h:53
Definition: Geometry.h:116
ElementToBtObjMap bt_collision_objects
Definition: bullet_model.h:31
btDbvtBroadphase bt_collision_broadphase
Definition: bullet_model.h:34
Definition: Geometry.h:98
Definition: bullet_model.h:29
OverlapFilterCallback filter_callback
Definition: bullet_model.h:35
Definition: bullet_model.h:51
virtual ~BulletModel()
Definition: bullet_model.h:55
BulletModel * parent_model
Definition: bullet_model.h:26
Definition: bullet_model.h:41
Definition: Geometry.h:180
bool closestPointsPairwise(const vector< ElementIdPair > &id_pairs, const bool use_margins, vector< PointPair > &closest_points)
Definition: Model.cpp:76
std::unique_ptr< btCollisionDispatcher > bt_collision_dispatcher
Definition: bullet_model.h:37
virtual bool needBroadphaseCollision(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1) const
Definition: bullet_model.cc:48
Definition: bullet_model.cc:17
std::unique_ptr< btCollisionWorld > bt_collision_world
Definition: bullet_model.h:38
uintptr_t ElementId
Definition: Element.h:23
Structure containing the results of a collision query.
Definition: point_pair.h:12
Definition: Geometry.h:62
Definition: Geometry.h:136
bool closestPointsAllToAll(const vector< ElementId > &ids_to_check, const bool use_margins, vector< PointPair > &closest_points)
Definition: Model.cpp:65
std::unordered_map< ElementId, std::unique_ptr< btCollisionObject > > ElementToBtObjMap
Definition: bullet_model.h:16