1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Open Dynamics Engine: collision.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<h1>collision.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment"> * *</span>
<a name="l00003"></a>00003 <span class="comment"> * Open Dynamics Engine, Copyright (C) 2001-2003 Russell L. Smith. *</span>
<a name="l00004"></a>00004 <span class="comment"> * All rights reserved. Email: russ@q12.org Web: www.q12.org *</span>
<a name="l00005"></a>00005 <span class="comment"> * *</span>
<a name="l00006"></a>00006 <span class="comment"> * This library is free software; you can redistribute it and/or *</span>
<a name="l00007"></a>00007 <span class="comment"> * modify it under the terms of EITHER: *</span>
<a name="l00008"></a>00008 <span class="comment"> * (1) The GNU Lesser General Public License as published by the Free *</span>
<a name="l00009"></a>00009 <span class="comment"> * Software Foundation; either version 2.1 of the License, or (at *</span>
<a name="l00010"></a>00010 <span class="comment"> * your option) any later version. The text of the GNU Lesser *</span>
<a name="l00011"></a>00011 <span class="comment"> * General Public License is included with this library in the *</span>
<a name="l00012"></a>00012 <span class="comment"> * file LICENSE.TXT. *</span>
<a name="l00013"></a>00013 <span class="comment"> * (2) The BSD-style license that is included with this library in *</span>
<a name="l00014"></a>00014 <span class="comment"> * the file LICENSE-BSD.TXT. *</span>
<a name="l00015"></a>00015 <span class="comment"> * *</span>
<a name="l00016"></a>00016 <span class="comment"> * This library is distributed in the hope that it will be useful, *</span>
<a name="l00017"></a>00017 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of *</span>
<a name="l00018"></a>00018 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *</span>
<a name="l00019"></a>00019 <span class="comment"> * LICENSE.TXT and LICENSE-BSD.TXT for more details. *</span>
<a name="l00020"></a>00020 <span class="comment"> * *</span>
<a name="l00021"></a>00021 <span class="comment"> *************************************************************************/</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef _ODE_COLLISION_H_</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define _ODE_COLLISION_H_</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include <ode/common.h></span>
<a name="l00027"></a>00027 <span class="preprocessor">#include <ode/collision_space.h></span>
<a name="l00028"></a>00028 <span class="preprocessor">#include <ode/contact.h></span>
<a name="l00029"></a>00029
<a name="l00030"></a>00030 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
<a name="l00032"></a>00032 <span class="preprocessor">#endif</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00049"></a>00049 <span class="comment">/* ************************************************************************ */</span>
<a name="l00050"></a>00050 <span class="comment">/* general functions */</span>
<a name="l00051"></a>00051
<a name="l00065"></a>00065 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g96b9e7d3a7ca769b0c8f37eecfaf98c6" title="Destroy a geom, removing it from any space.">dGeomDestroy</a> (dGeomID geom);
<a name="l00066"></a>00066
<a name="l00067"></a>00067
<a name="l00075"></a>00075 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#gf68eb443d5c66ab1aaa8a7d38d1dbc4f" title="Set the user-defined data pointer stored in the geom.">dGeomSetData</a> (dGeomID geom, <span class="keywordtype">void</span>* data);
<a name="l00076"></a>00076
<a name="l00077"></a>00077
<a name="l00084"></a>00084 ODE_API <span class="keywordtype">void</span> *<a class="code" href="group__collide.html#gc1a185e22b136814fd3afc8469d98996" title="Get the user-defined data pointer stored in the geom.">dGeomGetData</a> (dGeomID geom);
<a name="l00085"></a>00085
<a name="l00086"></a>00086
<a name="l00105"></a>00105 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g97cad1194789477eac19fe364d986505" title="Set the body associated with a placeable geom.">dGeomSetBody</a> (dGeomID geom, dBodyID body);
<a name="l00106"></a>00106
<a name="l00107"></a>00107
<a name="l00114"></a>00114 ODE_API dBodyID <a class="code" href="group__collide.html#gd6cedf77fde0dddf751c5d42fcc8eebf" title="Get the body associated with a placeable geom.">dGeomGetBody</a> (dGeomID geom);
<a name="l00115"></a>00115
<a name="l00116"></a>00116
<a name="l00131"></a>00131 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g71043b70a735e8f5451c3e13cef345fe" title="Set the position vector of a placeable geom.">dGeomSetPosition</a> (dGeomID geom, dReal x, dReal y, dReal z);
<a name="l00132"></a>00132
<a name="l00133"></a>00133
<a name="l00146"></a>00146 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g76c510f4b7d5a036d8a36f2d60d670e5" title="Set the rotation matrix of a placeable geom.">dGeomSetRotation</a> (dGeomID geom, <span class="keyword">const</span> dMatrix3 R);
<a name="l00147"></a>00147
<a name="l00148"></a>00148
<a name="l00162"></a>00162 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g989149d93162264d699444a57b045150" title="Set the rotation of a placeable geom.">dGeomSetQuaternion</a> (dGeomID geom, <span class="keyword">const</span> dQuaternion Q);
<a name="l00163"></a>00163
<a name="l00164"></a>00164
<a name="l00181"></a>00181 ODE_API <span class="keyword">const</span> dReal * <a class="code" href="group__collide.html#g95b93f803880cac2619fe2635aa93ad8" title="Get the position vector of a placeable geom.">dGeomGetPosition</a> (dGeomID geom);
<a name="l00182"></a>00182
<a name="l00183"></a>00183
<a name="l00191"></a>00191 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#gd2cccf2b4c62bec58720d4f5fab8108d" title="Copy the position of a geom into a vector.">dGeomCopyPosition</a> (dGeomID geom, dVector3 pos);
<a name="l00192"></a>00192
<a name="l00193"></a>00193
<a name="l00210"></a>00210 ODE_API <span class="keyword">const</span> dReal * <a class="code" href="group__collide.html#g293b2264cefb12f9a6659cacc6a722f7" title="Get the rotation matrix of a placeable geom.">dGeomGetRotation</a> (dGeomID geom);
<a name="l00211"></a>00211
<a name="l00212"></a>00212
<a name="l00226"></a>00226 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g800b702e148a8c279596f591b910cfbd" title="Get the rotation matrix of a placeable geom.">dGeomCopyRotation</a>(dGeomID geom, dMatrix3 R);
<a name="l00227"></a>00227
<a name="l00228"></a>00228
<a name="l00242"></a>00242 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g11ad7f0098639b06f4bcd2d681122842" title="Get the rotation quaternion of a placeable geom.">dGeomGetQuaternion</a> (dGeomID geom, dQuaternion result);
<a name="l00243"></a>00243
<a name="l00244"></a>00244
<a name="l00261"></a>00261 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g904e360ac6e9e85a05e67929990e5b72" title="Return the axis-aligned bounding box.">dGeomGetAABB</a> (dGeomID geom, dReal aabb[6]);
<a name="l00262"></a>00262
<a name="l00263"></a>00263
<a name="l00270"></a>00270 ODE_API <span class="keywordtype">int</span> <a class="code" href="group__collide.html#ge5a58bdc78fb4f163a0e9c3ecabf64c9" title="Determing if a geom is a space.">dGeomIsSpace</a> (dGeomID geom);
<a name="l00271"></a>00271
<a name="l00272"></a>00272
<a name="l00280"></a>00280 ODE_API dSpaceID <a class="code" href="group__collide.html#gfdc35eade2cbd0b6886ce957325d7c03" title="Query for the space containing a particular geom.">dGeomGetSpace</a> (dGeomID);
<a name="l00281"></a>00281
<a name="l00282"></a>00282
<a name="l00307"></a>00307 ODE_API <span class="keywordtype">int</span> <a class="code" href="group__collide.html#g07b5ed5b915f756f419a4a7ce69dc67e" title="Given a geom, this returns its class.">dGeomGetClass</a> (dGeomID geom);
<a name="l00308"></a>00308
<a name="l00309"></a>00309
<a name="l00322"></a>00322 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g80fd5741701eb48472521780d5e2f9b9" title="Set the &quot;category&quot; bitfield for the given geom.">dGeomSetCategoryBits</a> (dGeomID geom, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> bits);
<a name="l00323"></a>00323
<a name="l00324"></a>00324
<a name="l00337"></a>00337 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#ga55b4de01a61be41668685857b78455d" title="Set the &quot;collide&quot; bitfield for the given geom.">dGeomSetCollideBits</a> (dGeomID geom, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> bits);
<a name="l00338"></a>00338
<a name="l00339"></a>00339
<a name="l00348"></a>00348 ODE_API <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="group__collide.html#gfb62d3493b6789382f65776ab931e78d" title="Get the &quot;category&quot; bitfield for the given geom.">dGeomGetCategoryBits</a> (dGeomID);
<a name="l00349"></a>00349
<a name="l00350"></a>00350
<a name="l00359"></a>00359 ODE_API <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="group__collide.html#g5591e5c496a5a6f8b66dc57e03d0cd8d" title="Get the &quot;collide&quot; bitfield for the given geom.">dGeomGetCollideBits</a> (dGeomID);
<a name="l00360"></a>00360
<a name="l00361"></a>00361
<a name="l00374"></a>00374 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#ga7c64b8fcae37ee9541208a0351f3d05" title="Enable a geom.">dGeomEnable</a> (dGeomID geom);
<a name="l00375"></a>00375
<a name="l00376"></a>00376
<a name="l00389"></a>00389 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g6cb32b4161435fe491859680b463fc12" title="Disable a geom.">dGeomDisable</a> (dGeomID geom);
<a name="l00390"></a>00390
<a name="l00391"></a>00391
<a name="l00405"></a>00405 ODE_API <span class="keywordtype">int</span> <a class="code" href="group__collide.html#g6533d33f870cf0fb6684ec05e5c0562e" title="Check to see if a geom is enabled.">dGeomIsEnabled</a> (dGeomID geom);
<a name="l00406"></a>00406
<a name="l00407"></a>00407 <span class="comment">/* ************************************************************************ */</span>
<a name="l00408"></a>00408 <span class="comment">/* geom offset from body */</span>
<a name="l00409"></a>00409
<a name="l00425"></a>00425 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#gdc292bc01d5bed32f145ee42760d73b4" title="Set the local offset position of a geom from its body.">dGeomSetOffsetPosition</a> (dGeomID geom, dReal x, dReal y, dReal z);
<a name="l00426"></a>00426
<a name="l00427"></a>00427
<a name="l00441"></a>00441 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g805d896b4bc79ceb40e70aadb9629cab" title="Set the local offset rotation matrix of a geom from its body.">dGeomSetOffsetRotation</a> (dGeomID geom, <span class="keyword">const</span> dMatrix3 R);
<a name="l00442"></a>00442
<a name="l00443"></a>00443
<a name="l00457"></a>00457 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g9eba87b7598eb6b3a9b6bde1abbeaa1a" title="Set the local offset rotation of a geom from its body.">dGeomSetOffsetQuaternion</a> (dGeomID geom, <span class="keyword">const</span> dQuaternion Q);
<a name="l00458"></a>00458
<a name="l00459"></a>00459
<a name="l00476"></a>00476 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g934fe31c543d588991d28cd8571e52ed" title="Set the offset position of a geom from its body.">dGeomSetOffsetWorldPosition</a> (dGeomID geom, dReal x, dReal y, dReal z);
<a name="l00477"></a>00477
<a name="l00478"></a>00478
<a name="l00493"></a>00493 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g2c1ef27e7e8ced6eb8488221a1a7c200" title="Set the offset rotation of a geom from its body.">dGeomSetOffsetWorldRotation</a> (dGeomID geom, <span class="keyword">const</span> dMatrix3 R);
<a name="l00494"></a>00494
<a name="l00495"></a>00495
<a name="l00510"></a>00510 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#ga04f2117ab18a1d3e27270defdad83a8" title="Set the offset rotation of a geom from its body.">dGeomSetOffsetWorldQuaternion</a> (dGeomID geom, <span class="keyword">const</span> dQuaternion);
<a name="l00511"></a>00511
<a name="l00512"></a>00512
<a name="l00526"></a>00526 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#gc81929d988b21c4e5338017f2e92a6f2" title="Clear any offset from the geom.">dGeomClearOffset</a>(dGeomID geom);
<a name="l00527"></a>00527
<a name="l00528"></a>00528
<a name="l00544"></a>00544 ODE_API <span class="keywordtype">int</span> <a class="code" href="group__collide.html#g46260e0668373aa600b1cf8f83276e10" title="Check to see whether the geom has an offset.">dGeomIsOffset</a>(dGeomID geom);
<a name="l00545"></a>00545
<a name="l00546"></a>00546
<a name="l00560"></a>00560 ODE_API <span class="keyword">const</span> dReal * <a class="code" href="group__collide.html#gb200f73800d253ab3a87f9856d4e18d2" title="Get the offset position vector of a geom.">dGeomGetOffsetPosition</a> (dGeomID geom);
<a name="l00561"></a>00561
<a name="l00562"></a>00562
<a name="l00573"></a>00573 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#gd4a1e59ecc3c570e3c37c5b8fad71220" title="Copy the offset position vector of a geom.">dGeomCopyOffsetPosition</a> (dGeomID geom, dVector3 pos);
<a name="l00574"></a>00574
<a name="l00575"></a>00575
<a name="l00590"></a>00590 ODE_API <span class="keyword">const</span> dReal * <a class="code" href="group__collide.html#gba28cf4ca8f552c782fc30ce3073dc73" title="Get the offset rotation matrix of a geom.">dGeomGetOffsetRotation</a> (dGeomID geom);
<a name="l00591"></a>00591
<a name="l00592"></a>00592
<a name="l00604"></a>00604 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#gcf96cd4f9913dc258e6f29da9979388c" title="Copy the offset rotation matrix of a geom.">dGeomCopyOffsetRotation</a> (dGeomID geom, dMatrix3 R);
<a name="l00605"></a>00605
<a name="l00606"></a>00606
<a name="l00617"></a>00617 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g8fc20f761daf36976e50d057cf2650ca" title="Get the offset rotation quaternion of a geom.">dGeomGetOffsetQuaternion</a> (dGeomID geom, dQuaternion result);
<a name="l00618"></a>00618
<a name="l00619"></a>00619
<a name="l00620"></a>00620 <span class="comment">/* ************************************************************************ */</span>
<a name="l00621"></a>00621 <span class="comment">/* collision detection */</span>
<a name="l00622"></a>00622
<a name="l00623"></a>00623 <span class="comment">/*</span>
<a name="l00624"></a>00624 <span class="comment"> * Just generate any contacts (disables any contact refining).</span>
<a name="l00625"></a>00625 <span class="comment"> */</span>
<a name="l00626"></a>00626 <span class="preprocessor">#define CONTACTS_UNIMPORTANT 0x80000000</span>
<a name="l00627"></a>00627 <span class="preprocessor"></span>
<a name="l00675"></a>00675 ODE_API <span class="keywordtype">int</span> <a class="code" href="group__collide.html#g08508345384abb95e25d674b39157bf8" title="Given two geoms o1 and o2 that potentially intersect, generate contact information...">dCollide</a> (dGeomID o1, dGeomID o2, <span class="keywordtype">int</span> flags, <a class="code" href="structd_contact_geom.html" title="Describe the contact point between two geoms.">dContactGeom</a> *contact,
<a name="l00676"></a>00676 <span class="keywordtype">int</span> skip);
<a name="l00677"></a>00677
<a name="l00705"></a>00705 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#gfd185829b6940e2b3238517e1acd2fbb" title="Determines which pairs of geoms in a space may potentially intersect, and calls the...">dSpaceCollide</a> (dSpaceID space, <span class="keywordtype">void</span> *data, <a class="code" href="group__collide.html#g9f458413ace07fa9e3e7e52d6652ace0" title="User callback for geom-geom collision testing.">dNearCallback</a> *callback);
<a name="l00706"></a>00706
<a name="l00707"></a>00707
<a name="l00742"></a>00742 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g72a6bb0b550d3e181f8b7a9be7179db5" title="Determines which geoms from one space may potentially intersect with geoms from another...">dSpaceCollide2</a> (dGeomID space1, dGeomID space2, <span class="keywordtype">void</span> *data, <a class="code" href="group__collide.html#g9f458413ace07fa9e3e7e52d6652ace0" title="User callback for geom-geom collision testing.">dNearCallback</a> *callback);
<a name="l00743"></a>00743
<a name="l00744"></a>00744
<a name="l00745"></a>00745 <span class="comment">/* ************************************************************************ */</span>
<a name="l00746"></a>00746 <span class="comment">/* standard classes */</span>
<a name="l00747"></a>00747
<a name="l00748"></a>00748 <span class="comment">/* the maximum number of user classes that are supported */</span>
<a name="l00749"></a>00749 <span class="keyword">enum</span> {
<a name="l00750"></a>00750 dMaxUserClasses = 4
<a name="l00751"></a>00751 };
<a name="l00752"></a>00752
<a name="l00753"></a>00753 <span class="comment">/* class numbers - each geometry object needs a unique number */</span>
<a name="l00754"></a>00754 <span class="keyword">enum</span> {
<a name="l00755"></a>00755 dSphereClass = 0,
<a name="l00756"></a>00756 dBoxClass,
<a name="l00757"></a>00757 dCapsuleClass,
<a name="l00758"></a>00758 dCylinderClass,
<a name="l00759"></a>00759 dPlaneClass,
<a name="l00760"></a>00760 dRayClass,
<a name="l00761"></a>00761 dConvexClass,
<a name="l00762"></a>00762 dGeomTransformClass,
<a name="l00763"></a>00763 dTriMeshClass,
<a name="l00764"></a>00764 dHeightfieldClass,
<a name="l00765"></a>00765
<a name="l00766"></a>00766 dFirstSpaceClass,
<a name="l00767"></a>00767 dSimpleSpaceClass = dFirstSpaceClass,
<a name="l00768"></a>00768 dHashSpaceClass,
<a name="l00769"></a>00769 dQuadTreeSpaceClass,
<a name="l00770"></a>00770 dLastSpaceClass = dQuadTreeSpaceClass,
<a name="l00771"></a>00771
<a name="l00772"></a>00772 dFirstUserClass,
<a name="l00773"></a>00773 dLastUserClass = dFirstUserClass + dMaxUserClasses - 1,
<a name="l00774"></a>00774 dGeomNumClasses
<a name="l00775"></a>00775 };
<a name="l00776"></a>00776
<a name="l00777"></a>00777
<a name="l00797"></a>00797 ODE_API dGeomID <a class="code" href="group__collide__sphere.html#g53c79c860638ca3600744a193da68474" title="Create a sphere geom of the given radius, and return its ID.">dCreateSphere</a> (dSpaceID space, dReal radius);
<a name="l00798"></a>00798
<a name="l00799"></a>00799
<a name="l00809"></a>00809 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide__sphere.html#g2341ae9b3b733571eff7a1857109f394" title="Set the radius of a sphere geom.">dGeomSphereSetRadius</a> (dGeomID sphere, dReal radius);
<a name="l00810"></a>00810
<a name="l00811"></a>00811
<a name="l00820"></a>00820 ODE_API dReal <a class="code" href="group__collide__sphere.html#g0e7f664deb9f557a6a24f93705b29fa9" title="Retrieves the radius of a sphere geom.">dGeomSphereGetRadius</a> (dGeomID sphere);
<a name="l00821"></a>00821
<a name="l00822"></a>00822
<a name="l00837"></a>00837 ODE_API dReal <a class="code" href="group__collide__sphere.html#gee86d3744471e447ffc85f85ee6578b1" title="Calculate the depth of the a given point within a sphere.">dGeomSpherePointDepth</a> (dGeomID sphere, dReal x, dReal y, dReal z);
<a name="l00838"></a>00838
<a name="l00839"></a>00839
<a name="l00840"></a>00840 <span class="comment">//--> Convex Functions</span>
<a name="l00841"></a>00841 ODE_API dGeomID dCreateConvex (dSpaceID space,
<a name="l00842"></a>00842 dReal *_planes,
<a name="l00843"></a>00843 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _planecount,
<a name="l00844"></a>00844 dReal *_points,
<a name="l00845"></a>00845 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _pointcount,<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *_polygons);
<a name="l00846"></a>00846
<a name="l00847"></a>00847 ODE_API <span class="keywordtype">void</span> dGeomSetConvex (dGeomID g,
<a name="l00848"></a>00848 dReal *_planes,
<a name="l00849"></a>00849 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _count,
<a name="l00850"></a>00850 dReal *_points,
<a name="l00851"></a>00851 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _pointcount,<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *_polygons);
<a name="l00852"></a>00852 <span class="comment">//<-- Convex Functions</span>
<a name="l00853"></a>00853
<a name="l00875"></a>00875 ODE_API dGeomID <a class="code" href="group__collide__box.html#g3e3b0b249a8ccd40a9969e3a26548397" title="Create a box geom with the provided side lengths.">dCreateBox</a> (dSpaceID space, dReal lx, dReal ly, dReal lz);
<a name="l00876"></a>00876
<a name="l00877"></a>00877
<a name="l00889"></a>00889 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide__box.html#g4c7060780be9eaf74228565910168273" title="Set the side lengths of the given box.">dGeomBoxSetLengths</a> (dGeomID box, dReal lx, dReal ly, dReal lz);
<a name="l00890"></a>00890
<a name="l00891"></a>00891
<a name="l00901"></a>00901 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide__box.html#ge24d9264235d2487b2e2d52b2c62c879" title="Get the side lengths of a box.">dGeomBoxGetLengths</a> (dGeomID box, dVector3 result);
<a name="l00902"></a>00902
<a name="l00903"></a>00903
<a name="l00916"></a>00916 ODE_API dReal dGeomBoxPointDepth (dGeomID box, dReal x, dReal y, dReal z);
<a name="l00917"></a>00917
<a name="l00918"></a>00918
<a name="l00919"></a>00919 ODE_API dGeomID dCreatePlane (dSpaceID space, dReal a, dReal b, dReal c, dReal d);
<a name="l00920"></a>00920 ODE_API <span class="keywordtype">void</span> dGeomPlaneSetParams (dGeomID plane, dReal a, dReal b, dReal c, dReal d);
<a name="l00921"></a>00921 ODE_API <span class="keywordtype">void</span> dGeomPlaneGetParams (dGeomID plane, dVector4 result);
<a name="l00922"></a>00922 ODE_API dReal dGeomPlanePointDepth (dGeomID plane, dReal x, dReal y, dReal z);
<a name="l00923"></a>00923
<a name="l00924"></a>00924 ODE_API dGeomID dCreateCapsule (dSpaceID space, dReal radius, dReal length);
<a name="l00925"></a>00925 ODE_API <span class="keywordtype">void</span> dGeomCapsuleSetParams (dGeomID ccylinder, dReal radius, dReal length);
<a name="l00926"></a>00926 ODE_API <span class="keywordtype">void</span> dGeomCapsuleGetParams (dGeomID ccylinder, dReal *radius, dReal *length);
<a name="l00927"></a>00927 ODE_API dReal dGeomCapsulePointDepth (dGeomID ccylinder, dReal x, dReal y, dReal z);
<a name="l00928"></a>00928
<a name="l00929"></a>00929 <span class="comment">// For now we want to have a backwards compatible C-API, note: C++ API is not.</span>
<a name="l00930"></a>00930 <span class="preprocessor">#define dCreateCCylinder dCreateCapsule</span>
<a name="l00931"></a>00931 <span class="preprocessor"></span><span class="preprocessor">#define dGeomCCylinderSetParams dGeomCapsuleSetParams</span>
<a name="l00932"></a>00932 <span class="preprocessor"></span><span class="preprocessor">#define dGeomCCylinderGetParams dGeomCapsuleGetParams</span>
<a name="l00933"></a>00933 <span class="preprocessor"></span><span class="preprocessor">#define dGeomCCylinderPointDepth dGeomCapsulePointDepth</span>
<a name="l00934"></a>00934 <span class="preprocessor"></span><span class="preprocessor">#define dCCylinderClass dCapsuleClass</span>
<a name="l00935"></a>00935 <span class="preprocessor"></span>
<a name="l00936"></a>00936 ODE_API dGeomID dCreateCylinder (dSpaceID space, dReal radius, dReal length);
<a name="l00937"></a>00937 ODE_API <span class="keywordtype">void</span> dGeomCylinderSetParams (dGeomID cylinder, dReal radius, dReal length);
<a name="l00938"></a>00938 ODE_API <span class="keywordtype">void</span> dGeomCylinderGetParams (dGeomID cylinder, dReal *radius, dReal *length);
<a name="l00939"></a>00939
<a name="l00940"></a>00940 ODE_API dGeomID dCreateRay (dSpaceID space, dReal length);
<a name="l00941"></a>00941 ODE_API <span class="keywordtype">void</span> dGeomRaySetLength (dGeomID ray, dReal length);
<a name="l00942"></a>00942 ODE_API dReal dGeomRayGetLength (dGeomID ray);
<a name="l00943"></a>00943 ODE_API <span class="keywordtype">void</span> dGeomRaySet (dGeomID ray, dReal px, dReal py, dReal pz,
<a name="l00944"></a>00944 dReal dx, dReal dy, dReal dz);
<a name="l00945"></a>00945 ODE_API <span class="keywordtype">void</span> dGeomRayGet (dGeomID ray, dVector3 start, dVector3 dir);
<a name="l00946"></a>00946
<a name="l00947"></a>00947 <span class="comment">/*</span>
<a name="l00948"></a>00948 <span class="comment"> * Set/get ray flags that influence ray collision detection.</span>
<a name="l00949"></a>00949 <span class="comment"> * These flags are currently only noticed by the trimesh collider, because</span>
<a name="l00950"></a>00950 <span class="comment"> * they can make a major differences there.</span>
<a name="l00951"></a>00951 <span class="comment"> */</span>
<a name="l00952"></a>00952 ODE_API <span class="keywordtype">void</span> dGeomRaySetParams (dGeomID g, <span class="keywordtype">int</span> FirstContact, <span class="keywordtype">int</span> BackfaceCull);
<a name="l00953"></a>00953 ODE_API <span class="keywordtype">void</span> dGeomRayGetParams (dGeomID g, <span class="keywordtype">int</span> *FirstContact, <span class="keywordtype">int</span> *BackfaceCull);
<a name="l00954"></a>00954 ODE_API <span class="keywordtype">void</span> dGeomRaySetClosestHit (dGeomID g, <span class="keywordtype">int</span> closestHit);
<a name="l00955"></a>00955 ODE_API <span class="keywordtype">int</span> dGeomRayGetClosestHit (dGeomID g);
<a name="l00956"></a>00956
<a name="l00957"></a>00957 <span class="preprocessor">#include "collision_trimesh.h"</span>
<a name="l00958"></a>00958
<a name="l00959"></a>00959 ODE_API dGeomID dCreateGeomTransform (dSpaceID space);
<a name="l00960"></a>00960 ODE_API <span class="keywordtype">void</span> dGeomTransformSetGeom (dGeomID g, dGeomID obj);
<a name="l00961"></a>00961 ODE_API dGeomID dGeomTransformGetGeom (dGeomID g);
<a name="l00962"></a>00962 ODE_API <span class="keywordtype">void</span> dGeomTransformSetCleanup (dGeomID g, <span class="keywordtype">int</span> mode);
<a name="l00963"></a>00963 ODE_API <span class="keywordtype">int</span> dGeomTransformGetCleanup (dGeomID g);
<a name="l00964"></a>00964 ODE_API <span class="keywordtype">void</span> dGeomTransformSetInfo (dGeomID g, <span class="keywordtype">int</span> mode);
<a name="l00965"></a>00965 ODE_API <span class="keywordtype">int</span> dGeomTransformGetInfo (dGeomID g);
<a name="l00966"></a>00966
<a name="l00967"></a>00967
<a name="l00968"></a>00968 <span class="comment">/* ************************************************************************ */</span>
<a name="l00969"></a>00969 <span class="comment">/* heightfield functions */</span>
<a name="l00970"></a>00970
<a name="l00971"></a>00971
<a name="l00972"></a>00972 <span class="comment">// Data storage for heightfield data.</span>
<a name="l00973"></a>00973 <span class="keyword">struct </span>dxHeightfieldData;
<a name="l00974"></a>00974 <span class="keyword">typedef</span> <span class="keyword">struct </span>dxHeightfieldData* dHeightfieldDataID;
<a name="l00975"></a>00975
<a name="l00976"></a>00976
<a name="l00994"></a><a class="code" href="group__collide.html#g32d2c58e3b2b589bd7672f3453102eb9">00994</a> <span class="keyword">typedef</span> dReal <a class="code" href="group__collide.html#g32d2c58e3b2b589bd7672f3453102eb9" title="Callback prototype.">dHeightfieldGetHeight</a>( <span class="keywordtype">void</span>* p_user_data, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> z );
<a name="l00995"></a>00995
<a name="l00996"></a>00996
<a name="l00997"></a>00997
<a name="l01017"></a>01017 ODE_API dGeomID <a class="code" href="group__collide.html#gd50d5cd5fea5bfc12584e60d4a936cfb" title="Creates a heightfield geom.">dCreateHeightfield</a>( dSpaceID space,
<a name="l01018"></a>01018 dHeightfieldDataID data, <span class="keywordtype">int</span> bPlaceable );
<a name="l01019"></a>01019
<a name="l01020"></a>01020
<a name="l01033"></a>01033 ODE_API dHeightfieldDataID <a class="code" href="group__collide.html#g7de82d5cf9aa10bb3144d51f4360eea1" title="Creates a new empty dHeightfieldDataID.">dGeomHeightfieldDataCreate</a>();
<a name="l01034"></a>01034
<a name="l01035"></a>01035
<a name="l01044"></a>01044 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#gf98fc1f3d1784df5a5dff114b483d408" title="Destroys a dHeightfieldDataID.">dGeomHeightfieldDataDestroy</a>( dHeightfieldDataID d );
<a name="l01045"></a>01045
<a name="l01046"></a>01046
<a name="l01047"></a>01047
<a name="l01088"></a>01088 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g34566000a5a2673cc013294f0ed85926" title="Configures a dHeightfieldDataID to use a callback to retrieve height data.">dGeomHeightfieldDataBuildCallback</a>( dHeightfieldDataID d,
<a name="l01089"></a>01089 <span class="keywordtype">void</span>* pUserData, <a class="code" href="group__collide.html#g32d2c58e3b2b589bd7672f3453102eb9" title="Callback prototype.">dHeightfieldGetHeight</a>* pCallback,
<a name="l01090"></a>01090 dReal width, dReal depth, <span class="keywordtype">int</span> widthSamples, <span class="keywordtype">int</span> depthSamples,
<a name="l01091"></a>01091 dReal scale, dReal offset, dReal thickness, <span class="keywordtype">int</span> bWrap );
<a name="l01092"></a>01092
<a name="l01136"></a>01136 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g2c15b7c1a36c7526b66911beab1b7934" title="Configures a dHeightfieldDataID to use height data in byte format.">dGeomHeightfieldDataBuildByte</a>( dHeightfieldDataID d,
<a name="l01137"></a>01137 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* pHeightData, <span class="keywordtype">int</span> bCopyHeightData,
<a name="l01138"></a>01138 dReal width, dReal depth, <span class="keywordtype">int</span> widthSamples, <span class="keywordtype">int</span> depthSamples,
<a name="l01139"></a>01139 dReal scale, dReal offset, dReal thickness, <span class="keywordtype">int</span> bWrap );
<a name="l01140"></a>01140
<a name="l01184"></a>01184 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g2f7582d64cc8219141bc10efeca86d17" title="Configures a dHeightfieldDataID to use height data in short format.">dGeomHeightfieldDataBuildShort</a>( dHeightfieldDataID d,
<a name="l01185"></a>01185 <span class="keyword">const</span> <span class="keywordtype">short</span>* pHeightData, <span class="keywordtype">int</span> bCopyHeightData,
<a name="l01186"></a>01186 dReal width, dReal depth, <span class="keywordtype">int</span> widthSamples, <span class="keywordtype">int</span> depthSamples,
<a name="l01187"></a>01187 dReal scale, dReal offset, dReal thickness, <span class="keywordtype">int</span> bWrap );
<a name="l01188"></a>01188
<a name="l01234"></a>01234 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g8da529419317e7bd4e01dabbe94daa09" title="Configures a dHeightfieldDataID to use height data in single precision floating point...">dGeomHeightfieldDataBuildSingle</a>( dHeightfieldDataID d,
<a name="l01235"></a>01235 <span class="keyword">const</span> <span class="keywordtype">float</span>* pHeightData, <span class="keywordtype">int</span> bCopyHeightData,
<a name="l01236"></a>01236 dReal width, dReal depth, <span class="keywordtype">int</span> widthSamples, <span class="keywordtype">int</span> depthSamples,
<a name="l01237"></a>01237 dReal scale, dReal offset, dReal thickness, <span class="keywordtype">int</span> bWrap );
<a name="l01238"></a>01238
<a name="l01284"></a>01284 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g98ec0c952b3b4e0fb3cd8cf66e267c86" title="Configures a dHeightfieldDataID to use height data in double precision floating point...">dGeomHeightfieldDataBuildDouble</a>( dHeightfieldDataID d,
<a name="l01285"></a>01285 <span class="keyword">const</span> <span class="keywordtype">double</span>* pHeightData, <span class="keywordtype">int</span> bCopyHeightData,
<a name="l01286"></a>01286 dReal width, dReal depth, <span class="keywordtype">int</span> widthSamples, <span class="keywordtype">int</span> depthSamples,
<a name="l01287"></a>01287 dReal scale, dReal offset, dReal thickness, <span class="keywordtype">int</span> bWrap );
<a name="l01288"></a>01288
<a name="l01306"></a>01306 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#gcdef420e65e3751388b315f5de2804b2" title="Manually set the minimum and maximum height bounds.">dGeomHeightfieldDataSetBounds</a>( dHeightfieldDataID d,
<a name="l01307"></a>01307 dReal minHeight, dReal maxHeight );
<a name="l01308"></a>01308
<a name="l01309"></a>01309
<a name="l01320"></a>01320 ODE_API <span class="keywordtype">void</span> <a class="code" href="group__collide.html#g6c1ae1f3ca652d6410e7804cdf8f8491" title="Assigns a dHeightfieldDataID to a heightfield geom.">dGeomHeightfieldSetHeightfieldData</a>( dGeomID g, dHeightfieldDataID d );
<a name="l01321"></a>01321
<a name="l01322"></a>01322
<a name="l01332"></a>01332 ODE_API dHeightfieldDataID <a class="code" href="group__collide.html#g747176d26ce4f9b10ebfa6c865ef1cca" title="Gets the dHeightfieldDataID bound to a heightfield geom.">dGeomHeightfieldGetHeightfieldData</a>( dGeomID g );
<a name="l01333"></a>01333
<a name="l01334"></a>01334
<a name="l01335"></a>01335
<a name="l01336"></a>01336 <span class="comment">/* ************************************************************************ */</span>
<a name="l01337"></a>01337 <span class="comment">/* utility functions */</span>
<a name="l01338"></a>01338
<a name="l01339"></a>01339 ODE_API <span class="keywordtype">void</span> dClosestLineSegmentPoints (<span class="keyword">const</span> dVector3 a1, <span class="keyword">const</span> dVector3 a2,
<a name="l01340"></a>01340 <span class="keyword">const</span> dVector3 b1, <span class="keyword">const</span> dVector3 b2,
<a name="l01341"></a>01341 dVector3 cp1, dVector3 cp2);
<a name="l01342"></a>01342
<a name="l01343"></a>01343 ODE_API <span class="keywordtype">int</span> dBoxTouchesBox (<span class="keyword">const</span> dVector3 _p1, <span class="keyword">const</span> dMatrix3 R1,
<a name="l01344"></a>01344 <span class="keyword">const</span> dVector3 side1, <span class="keyword">const</span> dVector3 _p2,
<a name="l01345"></a>01345 <span class="keyword">const</span> dMatrix3 R2, <span class="keyword">const</span> dVector3 side2);
<a name="l01346"></a>01346
<a name="l01347"></a>01347 <span class="comment">// The meaning of flags parameter is the same as in dCollide()</span>
<a name="l01348"></a>01348 ODE_API <span class="keywordtype">int</span> dBoxBox (<span class="keyword">const</span> dVector3 p1, <span class="keyword">const</span> dMatrix3 R1,
<a name="l01349"></a>01349 <span class="keyword">const</span> dVector3 side1, <span class="keyword">const</span> dVector3 p2,
<a name="l01350"></a>01350 <span class="keyword">const</span> dMatrix3 R2, <span class="keyword">const</span> dVector3 side2,
<a name="l01351"></a>01351 dVector3 normal, dReal *depth, <span class="keywordtype">int</span> *return_code,
<a name="l01352"></a>01352 <span class="keywordtype">int</span> flags, <a class="code" href="structd_contact_geom.html" title="Describe the contact point between two geoms.">dContactGeom</a> *contact, <span class="keywordtype">int</span> skip);
<a name="l01353"></a>01353
<a name="l01354"></a>01354 ODE_API <span class="keywordtype">void</span> dInfiniteAABB (dGeomID geom, dReal aabb[6]);
<a name="l01355"></a>01355 ODE_API <span class="keywordtype">void</span> dInitODE(<span class="keywordtype">void</span>);
<a name="l01356"></a>01356 ODE_API <span class="keywordtype">void</span> dCloseODE(<span class="keywordtype">void</span>);
<a name="l01357"></a>01357
<a name="l01358"></a>01358 <span class="comment">/* ************************************************************************ */</span>
<a name="l01359"></a>01359 <span class="comment">/* custom classes */</span>
<a name="l01360"></a>01360
<a name="l01361"></a>01361 <span class="keyword">typedef</span> <span class="keywordtype">void</span> dGetAABBFn (dGeomID, dReal aabb[6]);
<a name="l01362"></a>01362 <span class="keyword">typedef</span> <span class="keywordtype">int</span> dColliderFn (dGeomID o1, dGeomID o2,
<a name="l01363"></a>01363 <span class="keywordtype">int</span> flags, <a class="code" href="structd_contact_geom.html" title="Describe the contact point between two geoms.">dContactGeom</a> *contact, <span class="keywordtype">int</span> skip);
<a name="l01364"></a>01364 <span class="keyword">typedef</span> dColliderFn * dGetColliderFnFn (<span class="keywordtype">int</span> num);
<a name="l01365"></a>01365 <span class="keyword">typedef</span> <span class="keywordtype">void</span> dGeomDtorFn (dGeomID o);
<a name="l01366"></a>01366 <span class="keyword">typedef</span> <span class="keywordtype">int</span> dAABBTestFn (dGeomID o1, dGeomID o2, dReal aabb[6]);
<a name="l01367"></a>01367
<a name="l01368"></a>01368 <span class="keyword">typedef</span> <span class="keyword">struct </span>dGeomClass {
<a name="l01369"></a>01369 <span class="keywordtype">int</span> bytes;
<a name="l01370"></a>01370 dGetColliderFnFn *collider;
<a name="l01371"></a>01371 dGetAABBFn *aabb;
<a name="l01372"></a>01372 dAABBTestFn *aabb_test;
<a name="l01373"></a>01373 dGeomDtorFn *dtor;
<a name="l01374"></a>01374 } dGeomClass;
<a name="l01375"></a>01375
<a name="l01376"></a>01376 ODE_API <span class="keywordtype">int</span> dCreateGeomClass (<span class="keyword">const</span> dGeomClass *classptr);
<a name="l01377"></a>01377 ODE_API <span class="keywordtype">void</span> * dGeomGetClassData (dGeomID);
<a name="l01378"></a>01378 ODE_API dGeomID dCreateGeom (<span class="keywordtype">int</span> classnum);
<a name="l01379"></a>01379
<a name="l01380"></a>01380 <span class="comment">/* ************************************************************************ */</span>
<a name="l01381"></a>01381
<a name="l01382"></a>01382 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l01383"></a>01383 <span class="preprocessor"></span>}
<a name="l01384"></a>01384 <span class="preprocessor">#endif</span>
<a name="l01385"></a>01385 <span class="preprocessor"></span>
<a name="l01386"></a>01386 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Oct 12 08:36:51 2007 for Open Dynamics Engine by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>
|