You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once the objects are set, we can perform the proximity computation between them. All the proximity queries in FCL follow a common pipeline: first, set the query request data structure and then run the query function by using request as the input. The result is returned in a query result data structure. For example, for collision checking, we first set the CollisionRequest data structure, and then run the collision function:
88
90
```cpp
89
91
// Given two objects o1 and o2
90
-
CollisionObject* o1 = ...
91
-
CollisionObject* o2 = ...
92
+
CollisionObjectf* o1 = ...
93
+
CollisionObjectf* o2 = ...
92
94
// set the collision request structure, here we just use the default setting
93
95
CollisionRequest request;
94
96
// result will be returned via the collision result structure
@@ -104,8 +106,8 @@ For distance computation, the pipeline is almost the same:
104
106
105
107
```cpp
106
108
// Given two objects o1 and o2
107
-
CollisionObject* o1 = ...
108
-
CollisionObject* o2 = ...
109
+
CollisionObjectf* o1 = ...
110
+
CollisionObjectf* o2 = ...
109
111
// set the distance request structure, here we just use the default setting
110
112
DistanceRequest request;
111
113
// result will be returned via the collision result structure
@@ -118,8 +120,8 @@ For continuous collision, FCL requires the goal transform to be provided (the in
118
120
119
121
```cpp
120
122
// Given two objects o1 and o2
121
-
CollisionObject* o1 = ...
122
-
CollisionObject* o2 = ...
123
+
CollisionObjectf* o1 = ...
124
+
CollisionObjectf* o2 = ...
123
125
// The goal transforms for o1 and o2
124
126
Transform3f tf_goal_o1 = ...
125
127
Transform3f tf_goal_o2 = ...
@@ -136,41 +138,43 @@ FCL supports broadphase collision/distance between two groups of objects and can
136
138
// Initialize the collision manager for the first group of objects.
137
139
// FCL provides various different implementations of CollisionManager.
138
140
// Generally, the DynamicAABBTreeCollisionManager would provide the best performance.
139
-
BroadPhaseCollisionManager* manager1 = new DynamicAABBTreeCollisionManager();
141
+
BroadPhaseCollisionManagerf* manager1 = new DynamicAABBTreeCollisionManagerf();
140
142
// Initialize the collision manager for the second group of objects.
141
-
BroadPhaseCollisionManager* manager2 = new DynamicAABBTreeCollisionManager();
143
+
BroadPhaseCollisionManagerf* manager2 = new DynamicAABBTreeCollisionManagerf();
142
144
// To add objects into the collision manager, using BroadPhaseCollisionManager::registerObject() function to add one object
143
-
std::vector<CollisionObject*> objects1 = ...
145
+
std::vector<CollisionObjectf*> objects1 = ...
144
146
for(std::size_t i = 0; i < objects1.size(); ++i)
145
147
manager1->registerObject(objects1[i]);
146
148
// Another choose is to use BroadPhaseCollisionManager::registerObjects() function to add a set of objects
147
-
std::vector<CollisionObject*> objects2 = ...
149
+
std::vector<CollisionObjectf*> objects2 = ...
148
150
manager2->registerObjects(objects2);
149
151
// In order to collect the information during broadphase, CollisionManager requires two settings:
150
152
// a) a callback to collision or distance;
151
153
// b) an intermediate data to store the information generated during the broadphase computation
152
-
// For a), FCL provides the default callbacks for both collision and distance.
153
-
// For b), FCL uses the CollisionData structure for collision and DistanceData structure for distance. CollisionData/DistanceData is just a container including both the CollisionRequest/DistanceRequest and CollisionResult/DistanceResult structures mentioned above.
154
+
// For a), FCL's test framework provides default callbacks for both collision and distance.
155
+
// For b), FCL uses the CollisionData structure for collision and DistanceData structure for distance.
156
+
// CollisionData/DistanceData is just a container from the test framework including both the
157
+
// CollisionRequest/DistanceRequest and CollisionResult/DistanceResult structures mentioned above.
154
158
CollisionData collision_data;
155
159
DistanceData distance_data;
156
160
// Setup the managers, which is related with initializing the broadphase acceleration structure according to objects input
157
161
manager1->setup();
158
162
manager2->setup();
159
163
// Examples for various queries
160
164
// 1. Collision query between two object groups and get collision numbers
0 commit comments