aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Documentation/PhysXGuide/Manual/GeometryQueries.html
blob: 1716fee572887620870006af7cc98ead9888cdda (plain) (blame)
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
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Geometry Queries &mdash; NVIDIA PhysX SDK 3.4.2 Documentation</title>
    
    <link rel="stylesheet" href="../_static/nvidia.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/breathe.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '3.4.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="NVIDIA PhysX SDK 3.4.2 Documentation" href="../index.html" />
    <link rel="up" title="User&#39;s Guide" href="Index.html" />
    <link rel="next" title="Spatial Queries" href="SpatialQueries.html" />
    <link rel="prev" title="GPU Rigid Bodies" href="GPURigidBodies.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="SpatialQueries.html" title="Spatial Queries"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="GPURigidBodies.html" title="GPU Rigid Bodies"
             accesskey="P">previous</a> |</li>
        <li><a href="../Index.html">NVIDIA PhysX SDK 3.4.2 Documentation</a> &raquo;</li>
          <li><a href="Index.html" accesskey="U">User's Guide</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="geometry-queries">
<span id="geometryqueries"></span><h1>Geometry Queries<a class="headerlink" href="#geometry-queries" title="Permalink to this headline"></a></h1>
<div class="section" id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h2>
<p>This chapter describes how to use PhysX' collision functionality with individual geometry objects. There are four main kinds of geometry queries:</p>
<ul class="simple">
<li>raycasts (&quot;raycast queries&quot;) test a ray against a geometry object.</li>
<li>sweeps (&quot;sweep queries&quot;) move one geometry object along a line to find the first point of intersection with another geometry object.</li>
<li>overlaps (&quot;overlap queries&quot;) determine whether two geometry objects intersect.</li>
<li>penetration depth computations (&quot;minimal translational distance queries&quot;, abbreviated here to &quot;MTD&quot;) test two overlapping geometry objects to find the direction along which they can be separated by the minimum distance.</li>
</ul>
<p>In addition, PhysX provides helpers to compute the AABB of a geometry object, and to compute the distance between a point and a geometry object.</p>
<p>In all of the following functions, a geometry object is defined by its shape (a <em>PxGeometry</em> structure) and its pose (a <em>PxTransform</em> structure). All transforms and vectors are interpreted as being in the same space, and the results are also returned in that space.</p>
</div>
<hr class="docutils" />
<div class="section" id="raycasts">
<h2>Raycasts<a class="headerlink" href="#raycasts" title="Permalink to this headline"></a></h2>
<img alt="../_images/GeomQueryRaycast.png" src="../_images/GeomQueryRaycast.png" />
<p>A raycast query traces a point along a line segment until it hits a geometry object. PhysX supports raycasts for all geometry types.</p>
<p>The following code illustrates how to use a raycast query:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="n">PxRaycastHit</span> <span class="n">hitInfo</span><span class="p">;</span>
<span class="n">PxU32</span> <span class="n">maxHits</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
<span class="n">PxHitFlags</span> <span class="n">hitFlags</span> <span class="o">=</span> <span class="n">PxHitFlag</span><span class="o">::</span><span class="n">ePOSITION</span><span class="o">|</span><span class="n">PxHitFlag</span><span class="o">::</span><span class="n">eNORMAL</span><span class="o">|</span><span class="n">PxHitFlag</span><span class="o">::</span><span class="n">eDISTANCE</span><span class="o">|</span><span class="n">PxHitFlag</span><span class="o">::</span><span class="n">eUV</span><span class="p">;</span>
<span class="n">PxU32</span> <span class="n">hitCount</span> <span class="o">=</span> <span class="n">PxGeometryQuery</span><span class="o">::</span><span class="n">raycast</span><span class="p">(</span><span class="n">origin</span><span class="p">,</span> <span class="n">unitDir</span><span class="p">,</span>
                                          <span class="n">geom</span><span class="p">,</span> <span class="n">pose</span><span class="p">,</span>
                                          <span class="n">maxDist</span><span class="p">,</span>
                                          <span class="n">hitFlags</span><span class="p">,</span>
                                          <span class="n">maxHits</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">hitInfo</span><span class="p">);</span>
</pre></div>
</div>
<p>The arguments are interpreted as follows:</p>
<ul class="simple">
<li><em>origin</em> is the start point of the ray.</li>
<li><em>unitDir</em> is a unit vector defining the direction of the ray.</li>
<li><em>maxDist</em> is the maximum distance to search along the ray. It must be in the [0, inf) range. If the maximum distance is 0, a hit will only be returned if the ray starts inside a shape, as detailed below for each geometry.</li>
<li><em>geom</em> is the geometry to test against.</li>
<li><em>pose</em> is the pose of the geometry.</li>
<li><em>hitFlags</em> specifies the values that should be returned by the query, and options for processing the query.</li>
<li><em>maxHits</em> is the maximum number of hits to return.</li>
<li><em>hitInfo</em> specifies the <em>PxRaycastHit</em> structure(s) into which the raycast results will be stored.</li>
<li>The <em>anyHit</em> parameter is <strong>deprecated</strong>. It is equivalent to <em>PxHitFlag::eMESH_ANY</em>, which should be used instead.</li>
</ul>
<p>The returned result is the number of intersections found. For each intersection, a <em>PxRaycastHit</em> is populated. The fields of this structure are as follows:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="n">PxRigidActor</span><span class="o">*</span>   <span class="n">actor</span><span class="p">;</span>
<span class="n">PxShape</span><span class="o">*</span>        <span class="n">shape</span><span class="p">;</span>
<span class="n">PxVec3</span>          <span class="n">position</span><span class="p">;</span>
<span class="n">PxVec3</span>          <span class="n">normal</span><span class="p">;</span>
<span class="n">PxF32</span>           <span class="n">distance</span><span class="p">;</span>
<span class="n">PxHitFlags</span>      <span class="n">flags</span><span class="p">;</span>
<span class="n">PxU32</span>           <span class="n">faceIndex</span><span class="p">;</span>
<span class="n">PxF32</span>           <span class="n">u</span><span class="p">,</span> <span class="n">v</span><span class="p">;</span>
</pre></div>
</div>
<p>Some fields are optional, and the flags field indicates which members have been filled with result values. The query will fill fields in the output structure if the corresponding flags were set in the input - for example, if the <em>PxHitFlag::ePOSITION</em> is set in the input hitFlags, the query will fill in the <em>PxRaycastHit::position</em> field, and set the <em>PxHitFlag::ePOSITION</em> flag in <em>PxRaycastHit::flags</em>. If the input flag is not set for a specific member, the result structure may or may not contain valid data for that member. Omitting the <em>eNORMAL</em> and <em>ePOSITION</em> flags in the input can sometimes result in faster queries.</p>
<p>For a raycast which is not initially intersecting the geometry object, the fields are populated as follows (optional fields are listed together with the flag that controls them):</p>
<ul class="simple">
<li><em>actor</em> and <em>shape</em> are not filled (these fields are used only in scene-level raycasts, see <a class="reference internal" href="SceneQueries.html#scenequeries"><em>Scene Queries</em></a>).</li>
<li><em>position</em> (<em>PxHitFlag::ePOSITION</em>) is the position of the intersection.</li>
<li><em>normal</em> (<em>PxHitFlag::eNORMAL</em>) is the surface normal at the point of intersection.</li>
<li><em>distance</em> (<em>PxHitFlag::eDISTANCE</em>) is the distance along the ray at which the intersection was found.</li>
<li><em>flags</em> specifies which fields of the structure are valid.</li>
<li><em>faceIndex</em> is the index of the face which the ray hit. For triangle mesh and height field intersections, it is a triangle index. For convex mesh intersections it is a polygon index. For other shapes it is always set to 0xffffffff.</li>
<li><em>u</em> and <em>v</em> (<em>PxHitFlag::eUV</em>) are the barycentric coordinates of the intersection. These fields (and the flag) are supported only for meshes and heightfields.</li>
</ul>
<p>The position field is related to the barycentric coordinates via the following formula, where v0, v1 and v2 are the vertices from the hit triangle:</p>
<blockquote>
<div>position = (1 - u - v)*v0 + u*v1 + v*v2;</div></blockquote>
<p>This mapping is implemented in <em>PxTriangle::pointFromUV()</em>.</p>
<p>See <a class="reference internal" href="Geometry.html#geometry"><em>Geometry</em></a> for details of how to retrieve face and vertex data from triangle meshes, convex meshes and height fields using face and vertex indices.</p>
<p>Exceptions to the above behavior may apply if a ray starts inside an object, in which case PhysX may not be able to compute meaningful output values for some fields. In these cases the field will remain unmodified and the corresponding flag will not be set. Specific details vary by geometry type, and are described below.</p>
<p>The exact conditions for raycast intersections are as follows:</p>
<div class="section" id="raycasts-against-spheres-capsules-boxes-and-convex-meshes">
<h3>Raycasts against Spheres, Capsules, Boxes and Convex Meshes<a class="headerlink" href="#raycasts-against-spheres-capsules-boxes-and-convex-meshes" title="Permalink to this headline"></a></h3>
<p>For solid objects (sphere, capsule, box, convex) at most 1 result is returned. If the ray origin is inside a solid object:</p>
<ul class="simple">
<li>the reported hit distance is set to zero, and the <em>PxHitFlag::eDISTANCE</em> flag is set in the output.</li>
<li>the hit normal is set to be the opposite of the ray's direction, and the <em>PxHitFlag::eNORMAL</em> flag is set in the output.</li>
<li>the hit impact position is set to the ray's origin and the <em>PxHitFlag::ePOSITION</em> flag is set in the output.</li>
</ul>
<p>If the start or end point of a ray is very close to the surface of the object, it may be treated as being on either side of the surface.</p>
</div>
<div class="section" id="raycasts-against-planes">
<h3>Raycasts against Planes<a class="headerlink" href="#raycasts-against-planes" title="Permalink to this headline"></a></h3>
<p>For raycasts, a plane is treated as an infinite single-sided quad that includes its boundary (note that this is not the same as for overlaps). At most one result is returned, and if the ray origin is behind the plane's surface, no hit will be reported even in case the ray intersects the plane.</p>
<p>If the start or end point of a ray is very close to the plane, it may be treated as being on either side of the plane.</p>
</div>
<div class="section" id="raycasts-against-triangle-meshes">
<span id="raycasts-vs-meshes"></span><h3>Raycasts against Triangle Meshes<a class="headerlink" href="#raycasts-against-triangle-meshes" title="Permalink to this headline"></a></h3>
<p>Triangle meshes are treated as thin triangle surfaces rather than solid objects. They may be configured to return either an arbitrary hit, the closest hit, or multiple hits.</p>
<ul class="simple">
<li>if maxHits is 1 and <em>PxHitFlag::eMESH_ANY</em> is not set, the query will return the closest intersection.</li>
<li>if maxHits is 1 and <em>PxHitFlag::eMESH_ANY</em> is set, the query will return an arbitrary intersection. Use this when it is sufficient to know whether or not the ray hit the mesh, e.g. for line-of-sight queries or shadow rays.</li>
<li>if maxHits is greater than 1, the query will return multiple intersections, up to maxHits. If more than maxHits intersection points exist, there is no guarantee that the results will include the closest. Use this for e.g. wall-piercing bullets that hit multiple triangles, or where special filtering is required. Note that <em>PxHitFlag::eMESH_MULTIPLE</em> must be used in this case.</li>
</ul>
<p>In general &quot;any hit&quot; queries are faster than &quot;closest hit&quot; queries, and &quot;closest hit&quot; queries are faster than &quot;multiple hits&quot; queries.</p>
<p>By default, back face hits (where the triangle's outward-facing normal has a positive dot product with the ray direction) are culled, and so for any triangle hit the reported normal will have a negative dot product with the ray direction. This behavior may be modified by the mesh instance's <em>PxMeshGeometryFlag::eDOUBLE_SIDED</em> flag and the query's <em>PxHitFlag::eMESH_BOTH_SIDES</em> flag:</p>
<ul class="simple">
<li>if either <em>PxMeshGeometryFlag::eDOUBLE_SIDED</em> or <em>PxHitFlag::eMESH_BOTH_SIDES</em> is set, culling is disabled.</li>
<li>if <em>PxMeshGeometryFlag::eDOUBLE_SIDED</em> is set, the reported normal is reversed for a back face hit.</li>
</ul>
<p>For example a transparent glass window could be modeled as a double-sided mesh, so that a ray would hit either side with the reported normal facing opposite to the ray direction. A raycast tracing the path of a bullet that may penetrate the front side of a mesh and emerge from the back could use <em>eMESH_BOTH_SIDES</em> to find both front and back facing triangles even when the mesh is single-sided.</p>
<p>The following diagram shows what happens with different flags, for a single raycast intersecting a mesh in several places.</p>
<a class="reference internal image-reference" href="../_images/RayMeshDS_Permutations.png"><img alt="../_images/RayMeshDS_Permutations.png" src="../_images/RayMeshDS_Permutations.png" /></a>
<p>To use <em>PxHitFlag::eMESH_BOTH_SIDES</em> for selected meshes rather than all, set the flag inside the <em>PxQueryFilterCallback</em>.</p>
<p>If the start or end point of a ray is very close to the surface of a triangle, it may be treated as being on either side of the triangle.</p>
<p>If the start or end point of a ray is very close to the surface of a triangle, it may be treated as being on the either side of the triangle.</p>
</div>
<div class="section" id="raycasts-against-heightfields">
<h3>Raycasts against Heightfields<a class="headerlink" href="#raycasts-against-heightfields" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Heightfields are treated the same way as triangle meshes with normals oriented (in shape space) in +y direction when thickness is &lt;=0 and in -y direction when thickness is &gt;0.</li>
<li>Double-sided heightfields are treated the same way as double sided triangle meshes.</li>
</ul>
</div>
</div>
<hr class="docutils" />
<div class="section" id="overlaps">
<h2>Overlaps<a class="headerlink" href="#overlaps" title="Permalink to this headline"></a></h2>
<img alt="../_images/GeomQueryOverlap.png" src="../_images/GeomQueryOverlap.png" />
<p>Overlap queries simply check whether two geometry objects overlap. One of the geometries must be a box, sphere, capsule or convex, and the other may be of any type.</p>
<p>The following code illustrates how to use an overlap query:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="kt">bool</span> <span class="n">isOverlapping</span> <span class="o">=</span> <span class="n">overlap</span><span class="p">(</span><span class="n">geom0</span><span class="p">,</span> <span class="n">pose0</span><span class="p">,</span> <span class="n">geom1</span><span class="p">,</span> <span class="n">pose1</span><span class="p">);</span>
</pre></div>
</div>
<p>Overlaps do not support hit flags and return only a boolean result.</p>
<ul class="simple">
<li>A plane is treated as a solid half-space: that is, everything behind the plane is considered part of the volume.</li>
<li>Triangle meshes are treated as thin triangle surfaces rather than solid objects.</li>
<li>Heightfields are treated as triangle surface extruded by their thickness. Overlap geometries that do not intersect with the heightfield surface but are within the extruded space will report a hit.</li>
</ul>
<p>If more than a boolean result is needed for meshes and heightfields, use the <em>PxMeshQuery</em> API instead (see <a class="reference internal" href="#meshquery"><em>PxMeshQuery</em></a>).</p>
</div>
<hr class="docutils" />
<div class="section" id="penetration-depth">
<h2>Penetration Depth<a class="headerlink" href="#penetration-depth" title="Permalink to this headline"></a></h2>
<img alt="../_images/GeomQueryPenetration.png" src="../_images/GeomQueryPenetration.png" />
<p>When two objects are intersecting, PhysX can compute the minimal distance and direction by which the objects must be translated to separate them (this quantity is sometimes referred to as MTD, for <em>minimum translational distance</em>, as it is the vector of minimal length by which translation will separate the shapes). One geometry object must be a box, sphere, capsule or convex mesh, and the other may be of any type.</p>
<p>The following code illustrates how to use a penetration depth query:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="kt">bool</span> <span class="n">isPenetrating</span> <span class="o">=</span> <span class="n">PxGeometryQuery</span><span class="o">::</span><span class="n">computePenetration</span><span class="p">(</span><span class="n">direction</span><span class="p">,</span> <span class="n">depth</span><span class="p">,</span>
                                                         <span class="n">geom0</span><span class="p">,</span> <span class="n">pose0</span><span class="p">,</span>
                                                         <span class="n">geom1</span><span class="p">,</span> <span class="n">pose1</span><span class="p">);</span>
</pre></div>
</div>
<p>The arguments are interpreted as follows:</p>
<ul class="simple">
<li><em>direction</em> is set to the direction in which the first object should be translated in order to depenetrate from the second.</li>
<li><em>distance</em> is set to the distance by which the first object should be translated in order to depenetrate from the second.</li>
<li><em>geom0</em> is the first geometry.</li>
<li><em>pose0</em> is the transform of the first geometry.</li>
<li><em>geom1</em> is the second geometry.</li>
<li><em>pose2</em> is the transform of the second geometry.</li>
</ul>
<p>The function returns true if the objects are penetrating, in which case it sets the direction and depth fields. Translating the first object by the depenetration vector D = direction * depth will separate the two objects. If the function returns true, the returned depth will always be positive or zero. If objects do not overlap, the function returns false, and the values of the direction and distance fields are undefined.</p>
<p>For simple (convex) shapes, returned results are accurate.</p>
<p>For meshes and heightfields, an iterative algorithm is used and dedicated functions are exposed in <em>PxExtensions</em>:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="n">PxVec3</span> <span class="n">direction</span> <span class="o">=</span> <span class="n">PxComputeMeshPenetration</span><span class="p">(</span><span class="n">direction</span><span class="p">,</span> <span class="n">depth</span><span class="p">,</span>
                                            <span class="n">geom</span><span class="p">,</span> <span class="n">geomPose</span><span class="p">,</span>
                                            <span class="n">meshGeom</span><span class="p">,</span> <span class="n">meshPose</span><span class="p">,</span>
                                            <span class="n">maxIter</span><span class="p">,</span> <span class="n">nb</span><span class="p">);</span>

<span class="n">PxVec3</span> <span class="n">direction</span> <span class="o">=</span> <span class="n">PxComputeHeightFieldPenetration</span><span class="p">(</span><span class="n">direction</span><span class="p">,</span> <span class="n">depth</span>
                                                   <span class="n">geom</span><span class="p">,</span> <span class="n">geomPose</span><span class="p">,</span>
                                                   <span class="n">heightFieldGeom</span><span class="p">,</span> <span class="n">heightFieldPose</span><span class="p">,</span>
                                                   <span class="n">maxIter</span><span class="p">,</span> <span class="n">nb</span><span class="p">);</span>
</pre></div>
</div>
<p>Here, <em>maxIter</em> is the maximum number of iterations for the algorithm, and <em>nb</em> is an optional output argument which will be set to the number of iterations performed. If no overlap is detected, <em>nb</em> is set to zero. The code will attempt at most maxIter iterations but may exit earlier if a depenetration vector is found. Usually maxIter = 4 gives good results.</p>
<p>These functions only compute an approximate depenetration vector, and work best when the amount of overlap between the geometry object and the mesh/heightfield is small. In particular, an intersection with a triangle will be ignored when the object's center is behind the triangle, and if this holds for all intersecting triangles then no overlap is detected, and the functions do not compute an MTD vector.</p>
</div>
<hr class="docutils" />
<div class="section" id="sweeps">
<h2>Sweeps<a class="headerlink" href="#sweeps" title="Permalink to this headline"></a></h2>
<img alt="../_images/GeomQuerySweep.png" src="../_images/GeomQuerySweep.png" />
<p>A sweep query traces one geometry object through space to find the impact point on a second geometry object, and reports information concerning the impact point if one is found. PhysX only supports sweep queries where  the first geometry object (the one that is traced through space) is a sphere, box, capsule or convex geometry. The second geometry object may be of any type.</p>
<p>The following code illustrates how to use a sweep query:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="n">PxSweepHit</span> <span class="n">hitInfo</span><span class="p">;</span>
<span class="n">PxHitFlags</span> <span class="n">hitFlags</span> <span class="o">=</span> <span class="n">PxHitFlag</span><span class="o">::</span><span class="n">ePOSITION</span><span class="o">|</span><span class="n">PxHitFlag</span><span class="o">::</span><span class="n">eNORMAL</span><span class="o">|</span><span class="n">PxHitFlag</span><span class="o">::</span><span class="n">eDISTANCE</span><span class="p">;</span>
<span class="n">PxReal</span> <span class="n">inflation</span> <span class="o">=</span> <span class="mf">0.0f</span><span class="p">;</span>
<span class="n">PxU32</span> <span class="n">hitCount</span> <span class="o">=</span> <span class="n">PxGeometryQuery</span><span class="o">::</span><span class="n">sweep</span><span class="p">(</span><span class="n">unitDir</span><span class="p">,</span> <span class="n">maxDist</span><span class="p">,</span>
                                        <span class="n">geomToSweep</span><span class="p">,</span> <span class="n">poseToSweep</span><span class="p">,</span>
                                        <span class="n">geomSweptAgainst</span><span class="p">,</span> <span class="n">poseSweptAgainst</span><span class="p">,</span>
                                        <span class="n">hitInfo</span><span class="p">,</span>
                                        <span class="n">hitFlags</span><span class="p">,</span>
                                        <span class="n">inflation</span><span class="p">);</span>
</pre></div>
</div>
<p>The arguments are interpreted as follows:</p>
<ul class="simple">
<li><em>unitDir</em> is a unit vector defining the direction of the sweep.</li>
<li><em>maxDist</em> is the maximum distance to search along the sweep. It must be in the [0, inf) range, and is clamped by SDK code to at most <em>PX_MAX_SWEEP_DISTANCE</em>. A sweep of length 0 is equivalent to an overlap check.</li>
<li><em>geomToSweep</em> is the geometry to sweep. Supported geometries are: box, sphere, capsule or convex mesh.</li>
<li><em>poseToSweep</em> is the initial pose of the geometry to sweep.</li>
<li><em>geomSweptAgainst</em> is the geometry to sweep against (any geometry type can be used here).</li>
<li><em>poseSweptAgainst</em> is the pose of the geometry to sweep against.</li>
<li><em>hitInfo</em> is the returned result. A sweep will return at most one hit.</li>
<li><em>hitFlags</em> determines how the sweep is processed, and which data is returned if an impact is found.</li>
<li><em>inflation</em> inflates the first geometry with a shell extending outward from the object surface, making any corners rounded. It can be used to ensure a minimum margin of space is kept around the geometry when using sweeps to test whether movement is possible.</li>
</ul>
<p>As with raycasts, fields will be filled in the output structure if the corresponding flags were set in the input hitFlags. The fields of PxSweepHit are as follows:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="n">PxRigidActor</span><span class="o">*</span>   <span class="n">actor</span><span class="p">;</span>
<span class="n">PxShape</span><span class="o">*</span>        <span class="n">shape</span><span class="p">;</span>
<span class="n">PxVec3</span>          <span class="n">position</span><span class="p">;</span>
<span class="n">PxVec3</span>          <span class="n">normal</span><span class="p">;</span>
<span class="n">PxF32</span>           <span class="n">distance</span><span class="p">;</span>
<span class="n">PxHitFlags</span>      <span class="n">flags</span><span class="p">;</span>
<span class="n">PxU32</span>           <span class="n">faceIndex</span><span class="p">;</span>
</pre></div>
</div>
<ul class="simple">
<li><em>actor</em> and <em>shape</em> are not filled (these fields are used only in scene-level sweeps, see <a class="reference internal" href="SceneQueries.html#scenequeries"><em>Scene Queries</em></a>).</li>
<li><em>position</em> (<em>PxHitFlag::ePOSITION</em>) is the position of the intersection. When there are multiple impact points, such as two boxes meeting face-to-face, PhysX will select one point arbitrarily. More detailed information for meshes or height fields may be obtained using the functions in <a class="reference internal" href="#meshquery"><em>PxMeshQuery</em></a>.</li>
<li><em>normal</em> (<em>PxHitFlag::eNORMAL</em>) is the surface normal at the point of impact. It is a unit vector, pointing outwards from the hit object and backwards along the sweep direction (in the sense that the dot product between the sweep direction and the impact normal is negative).</li>
<li><em>distance</em> (<em>PxHitFlag::eDISTANCE</em>) is the distance along the ray at which the intersection was found.</li>
<li><em>flags</em> specifies which fields of the structure are valid.</li>
<li><em>faceIndex</em> is the index of the face hit by the sweep. This is a face from the hit object, not from the swept object. For triangle mesh and height field intersections, it is a triangle index. For convex mesh intersections it is a polygon index. For other shapes it is always set to 0xffffffff. For convex meshes the face index computation is rather expensive. The face index computation can be disabled by not providing the scene query hit flag <em>PxHitFlag::eFACE_INDEX</em>. If needed the face index can also be computed externally using the function <em>PxFindFaceIndex</em> which is part of the PhysX extensions library.</li>
</ul>
<p>Unlike raycasts, u,v coordinates are not supported for sweeps.</p>
<p>For the geometry object swept against:</p>
<ul class="simple">
<li>A plane is treated as a solid half-space: that is, everything behind the plane is considered part of the volume to sweep against.</li>
<li>The same backface-culling rules as for raycasts apply for sweeps, with the notable difference that <em>eMESH_MULTIPLE</em> is not supported.</li>
</ul>
<div class="section" id="initial-overlaps">
<h3>Initial Overlaps<a class="headerlink" href="#initial-overlaps" title="Permalink to this headline"></a></h3>
<p>Similarly to a raycast starting inside an object, a sweep may start with the two geometries initially intersecting. By default PhysX will detect and report the overlap. Use <em>PxSweepHit::hadInitialOverlap()</em> to see if the hit was generated by an initial overlap.</p>
<p>For triangle meshes and height fields, backface culling is performed before overlap checks, and thus no initial overlap is reported if a triangle is culled.</p>
<p>Depending on the value of <em>PxHitFlag::eMTD</em>, PhysX may also calculate the MTD. If <em>PxHitFlag::eMTD</em> is not set:</p>
<ul class="simple">
<li>the distance is set to zero, and the <em>PxHitFlag::eDISTANCE</em> flag is set in the <em>PxSweepHit</em> result structure.</li>
<li>the normal is set to be the opposite of the sweep direction, and the <em>PxHitFlag::eNORMAL</em> flag is set in the <em>PxSweepHit</em> result structure.</li>
<li>the position is undefined, and the <em>PxHitFlag::ePOSITION</em> flag is <em>not</em> set in the <em>PxSweepHit</em> result structure.</li>
<li>the faceIndex is a face from the second geometry object. For a heightfield or triangle mesh, it is the index of the first overlapping triangle found. For other geometry types, the index is set to 0xffffffff.</li>
</ul>
<p>If <em>PxHitFlag::eMTD</em> is set, the hit results are defined as follows:</p>
<ul class="simple">
<li>the distance is set to the penetration depth, and the <em>PxHitFlag::eDISTANCE</em> flag is set in the <em>PxSweepHit</em> result structure.</li>
<li>the normal is set to the depenetration direction, and the <em>PxHitFlag::eNORMAL</em> flag is set in the <em>PxSweepHit</em> result structure.</li>
<li>the position is a point on the sweep geometry object (i.e. the first geometry argument) and the <em>PxHitFlag::ePOSITION</em> flag is set in the <em>PxSweepHit</em> result structure.</li>
<li>the faceIndex is a face from the second geometry object:</li>
</ul>
<blockquote>
<div><ul class="simple">
<li>For triangle meshes and heightfields it is the last penetrated triangle found during the last iteration of the depenetration algorithm.</li>
<li>For other geometry types, the index is set to 0xffffffff.</li>
</ul>
</div></blockquote>
<p>This flag will incur additional processing overhead in the case of an initial overlap. In addition, the following restrictions apply:</p>
<ul class="simple">
<li><em>PxHitFlag::eMTD</em> is incompatible with <em>PxHitFlag::ePRECISE_SWEEP</em> and <em>PxHitFlag::eASSUME_NO_INITIAL_OVERLAP</em> (see below). Using <em>PxHitFlag::eMTD</em> in conjunction with either of these flags will result in a warning being issued and the flag(s) that are incompatible with <em>PxHitFlag::eMTD</em> being ignored.</li>
</ul>
<p>Testing for initial overlaps sometimes uses a specialized code path and incurs a performance penalty. If is it possible to guarantee that geometry objects are not initially overlapping, the check for overlaps can be suppressed with <em>PxHitFlag::eASSUME_NO_INITIAL_OVERLAP</em>. There are some restrictions on the use of this flag (also, see <a class="reference internal" href="#sweep-pitfalls"><em>Pitfalls</em></a>)</p>
<ul class="simple">
<li>Using <em>PxHitFlag::eASSUME_NO_INITIAL_OVERLAP</em> flag when the geometries initially overlap produces undefined behavior.</li>
<li><em>PxHitFlag::eASSUME_NO_INITIAL_OVERLAP</em> in combination with zero sweep distance produces a warning and undefined behavior.</li>
</ul>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">sweeps with <em>PxHitFlag::eMTD</em> use two kinds of backface culling for triangles. First, the triangles are culled based on sweep direction to determine whether there is an overlap. If an overlap is detected, they are further culled by whether the centroid is behind the triangle, and if no triangles are found, the direction will be set opposite to the sweep direction and the distance to 0.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">in most cases, translating the first geometry object by -normal*distance will separate the objects. However, an iterative depenetration algorithm is used to find the MTD for triangle meshes and height fields, and the MTD result may not provide complete depenetration from the mesh in extreme cases. In this case the query should be called a second time after the translation has been applied.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">a known issue in PhysX 3.3 is that the face index for a sweep against a convex mesh is undefined when the eMTD flag is not set.</p>
</div>
</div>
<div class="section" id="precise-sweeps">
<h3>Precise Sweeps<a class="headerlink" href="#precise-sweeps" title="Permalink to this headline"></a></h3>
<p><em>PxHitFlag::ePRECISE_SWEEP</em> enables more accurate sweep code (by default a potentially faster but less accurate solution is used). The <em>ePRECISE_SWEEP</em> flag is not compatible with the inflation parameter, or with the flag <em>PxHitFlag::eMTD</em>.</p>
</div>
<div class="section" id="sweeps-against-height-fields">
<h3>Sweeps against Height Fields<a class="headerlink" href="#sweeps-against-height-fields" title="Permalink to this headline"></a></h3>
<ul>
<li><p class="first">Height fields are treated as thin triangle surfaces rather than solid objects.</p>
</li>
<li><p class="first">Thickness magnitude has no effect on initial overlap detection or point of impact.</p>
</li>
<li><p class="first">For single-sided height fields the normal of the hit will face in +y local space direction if thickness is &lt; 0 and -y when thickness is &gt; 0.</p>
</li>
<li><p class="first">Height fields are treated as double sided if either one of eDOUBLE_SIDED or eMESH_BOTH_SIDES flags are used.</p>
<blockquote>
<div><ul class="simple">
<li>The returned hit normal will always face the sweep direction.</li>
</ul>
</div></blockquote>
</li>
<li><p class="first">eMESH_ANY flag has no effect.</p>
</li>
<li><p class="first">ePRECISE_SWEEP flag has no effect.</p>
</li>
</ul>
</div>
<div class="section" id="pitfalls">
<span id="sweep-pitfalls"></span><h3>Pitfalls<a class="headerlink" href="#pitfalls" title="Permalink to this headline"></a></h3>
<p>There are some pitfalls to be aware of when using sweeps:</p>
<ul class="simple">
<li>Due to numerical precision issues, incorrect results may be returned when the objects have very large size disparities.</li>
<li>Due to algorithmic differences, a sweep query may detect a different set of initially overlapping shapes than an overlap query. In particular, it is not sufficient to perform an overlap check in order to determine the safety of the <em>PxHitFlag::eIGNORE_INITIAL_OVERLAP</em> flag. Applications that need consistent overlap/sweep/penetration depth information should use sweep checks with initial overlap testing and the <em>PxHitFlag::eMTD</em> flag.</li>
</ul>
</div>
</div>
<hr class="docutils" />
<div class="section" id="additional-pxgeometryquery-functions">
<h2>Additional PxGeometryQuery functions<a class="headerlink" href="#additional-pxgeometryquery-functions" title="Permalink to this headline"></a></h2>
<img alt="../_images/GeomQueryPointDistance.png" src="../_images/GeomQueryPointDistance.png" />
<p>The following function computes the distance between a point and a geometry object. Only solid objects (box, sphere, capsule, convex) are supported:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="n">PxReal</span> <span class="n">dist</span> <span class="o">=</span> <span class="n">PxGeometryQuery</span><span class="o">::</span><span class="n">pointDistance</span><span class="p">(</span><span class="n">point</span><span class="p">,</span> <span class="n">geom</span><span class="p">,</span> <span class="n">pose</span><span class="p">,</span> <span class="n">closestPoint</span><span class="p">);</span>
</pre></div>
</div>
<p><em>closestPoint</em> is an optional output argument which returns the closest point.</p>
<img alt="../_images/GeomQueryWorldBounds.png" src="../_images/GeomQueryWorldBounds.png" />
<p>The following function computes the axis-aligned bounding box (AABB) enclosing a geometry object, given its pose:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="n">PxBounds3</span> <span class="n">bounds</span> <span class="o">=</span> <span class="n">PxGeometryQuery</span><span class="o">::</span><span class="n">getWorldBounds</span><span class="p">(</span><span class="n">geom</span><span class="p">,</span> <span class="n">pose</span><span class="p">,</span> <span class="n">inflation</span><span class="p">);</span>
</pre></div>
</div>
<p>The bounding box is scaled by the <em>inflation</em> value, which defaults to 1.01f if not explicitly specified.</p>
<hr class="docutils" />
</div>
<div class="section" id="pxmeshquery">
<span id="meshquery"></span><h2>PxMeshQuery<a class="headerlink" href="#pxmeshquery" title="Permalink to this headline"></a></h2>
<p>PhysX provides additional functionality for obtaining multiple results for triangle mesh and height field overlaps, and for sweeping against arrays of triangles. Only boxes, spheres and capsules may be tested against meshes or heightfields using these functions.</p>
<div class="section" id="mesh-overlaps">
<h3>Mesh Overlaps<a class="headerlink" href="#mesh-overlaps" title="Permalink to this headline"></a></h3>
<p>The following code illustrates how to process the mesh triangles touching a given spherical volume:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="n">PxU32</span> <span class="n">triangleIndexBuffer</span><span class="p">[</span><span class="n">bufferSize</span><span class="p">];</span>
<span class="n">PxU32</span> <span class="n">startIndex</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="kt">bool</span> <span class="n">bufferOverflowOccured</span> <span class="o">=</span> <span class="nb">false</span><span class="p">;</span>
<span class="n">PxU32</span> <span class="n">nbTriangles</span> <span class="o">=</span> <span class="n">PxMeshQuery</span><span class="o">::</span><span class="n">findOverlapTriangleMesh</span><span class="p">(</span><span class="n">sphereGeom</span><span class="p">,</span> <span class="n">spherePose</span><span class="p">,</span>
                                                         <span class="n">meshGeom</span><span class="p">,</span> <span class="n">meshPose</span><span class="p">,</span>
                                                         <span class="n">triangleIndexBuffer</span><span class="p">,</span> <span class="n">bufferSize</span><span class="p">,</span>
                                                         <span class="n">startIndex</span><span class="p">,</span> <span class="n">bufferOverflowOccured</span><span class="p">);</span>

<span class="k">for</span><span class="p">(</span><span class="n">PxU32</span> <span class="n">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">nbTriangles</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span>
<span class="p">{</span>
    <span class="n">PxTriangle</span> <span class="n">tri</span><span class="p">;</span>
    <span class="n">PxU32</span> <span class="n">vertexIndices</span><span class="p">[</span><span class="mi">3</span><span class="p">];</span>
    <span class="n">PxMeshQuery</span><span class="o">::</span><span class="n">getTriangle</span><span class="p">(</span><span class="n">meshGeom</span><span class="p">,</span> <span class="n">meshPose</span><span class="p">,</span> <span class="n">triangleIndexBuffer</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">tri</span><span class="p">,</span> <span class="n">vertexIndices</span><span class="p">);</span>

     <span class="p">...</span>  <span class="c1">// process triangle info</span>
<span class="p">}</span>
</pre></div>
</div>
<p>The <em>findOverlapTriangleMesh</em> method is used to extract the indices of the triangles:</p>
<ul class="simple">
<li><em>sphereGeom</em> and <em>spherePose</em> specify the region to test for overlap.</li>
<li><em>meshGeom</em> and <em>meshPose</em> specify the mesh and its pose.</li>
<li><em>triangleIndexBuffer</em> and <em>triangleSize</em> specify the output buffer and its size.</li>
<li><em>startIndex</em> is used to restart the query if the buffer size is exceeded. In this case, to query for more triangles set this parameter to the number retrieved so far.</li>
<li><em>bufferOverflowOccured</em> is set if more triangles would be returned from the query than would fit in the buffer.</li>
</ul>
<p>Similar query functionality exists for height fields.</p>
</div>
<div class="section" id="sweeps-against-triangles">
<h3>Sweeps against Triangles<a class="headerlink" href="#sweeps-against-triangles" title="Permalink to this headline"></a></h3>
<p>Sometimes, for example, when using the mesh overlap API, it is convenient to be able to sweep against groups of triangles. PhysX provides a function specifically for this purpose, with the following signature:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="kt">bool</span> <span class="nf">sweep</span><span class="p">(</span><span class="k">const</span> <span class="n">PxVec3</span><span class="o">&amp;</span> <span class="n">unitDir</span><span class="p">,</span>
           <span class="k">const</span> <span class="n">PxReal</span> <span class="n">distance</span><span class="p">,</span>
           <span class="k">const</span> <span class="n">PxGeometry</span><span class="o">&amp;</span> <span class="n">geom</span><span class="p">,</span>
           <span class="k">const</span> <span class="n">PxTransform</span><span class="o">&amp;</span> <span class="n">pose</span><span class="p">,</span>
           <span class="n">PxU32</span> <span class="n">triangleCount</span><span class="p">,</span>
           <span class="k">const</span> <span class="n">PxTriangle</span><span class="o">*</span> <span class="n">triangles</span><span class="p">,</span>
           <span class="n">PxSweepHit</span><span class="o">&amp;</span> <span class="n">sweepHit</span><span class="p">,</span>
           <span class="n">PxHitFlags</span> <span class="n">hitFlags</span> <span class="o">=</span> <span class="n">PxHitFlag</span><span class="o">::</span><span class="n">eDEFAULT</span><span class="p">,</span>
           <span class="k">const</span> <span class="n">PxU32</span><span class="o">*</span> <span class="n">cachedIndex</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">,</span>
           <span class="k">const</span> <span class="n">PxReal</span> <span class="n">inflation</span> <span class="o">=</span> <span class="mf">0.0f</span><span class="p">,</span>
           <span class="kt">bool</span> <span class="n">doubleSided</span> <span class="o">=</span> <span class="nb">false</span><span class="p">);</span>
</pre></div>
</div>
<p>The arguments are interpreted as follows:</p>
<ul class="simple">
<li><em>unitDir</em>, <em>distance</em>, <em>geom</em> and <em>pose</em> function identically to the first four parameters of PxGeometryQuery::sweep(). <em>distance</em> is clamped to PX_MAX_SWEEP_DISTANCE.</li>
<li><em>triangleCount</em> is the number of triangles contained in the buffer against which to sweep.</li>
<li><em>triangles</em> is the buffer of triangles.</li>
<li><em>hitFlags</em> specifies the required information in the output.</li>
<li><em>cachedIndex</em>, if set, specifies the index of a triangle to test first. This can be a useful optimization when repeatedly sweeping against the same set of triangles.</li>
<li><em>inflation</em> functions identically to the inflation parameter of PxGeometryQuery::sweep().</li>
<li><em>doubleSided</em> indicates whether the input triangles are double-sided or not. This is equivalent to the <em>PxMeshGeometryFlag::eDOUBLE_SIDED</em> flag - that is, it suppresses backface culling, and for any hit the returned normal faces opposite to the sweep direction (see <a class="reference internal" href="#raycasts-vs-meshes"><em>Raycasts against Triangle Meshes</em></a>).</li>
</ul>
<p>This function has extra limitations compared to the other sweep queries:</p>
<ul class="simple">
<li>the geometry type must be either a sphere, a capsule or a box. Convex geometry is not supported.</li>
<li>the function returns a single hit. Multiple hits (and in particular PxHitFlag::eMESH_MULTIPLE) are not supported.</li>
<li>The function always returns the closest hit.</li>
<li>The only supported flags are PxHitFlag::eDEFAULT, PxHitFlag::eASSUME_NO_INITIAL_OVERLAP, PxHitFlag::ePRECISE_SWEEP, PxHitFlag::eMESH_BOTH_SIDES and PxHitFlag::eMESH_ANY.</li>
</ul>
<p>The function tests each input triangle in the order they are given. By default, the function will test all triangles and return the closest sweep hit (if a hit has been found). If PxHitFlag::eMESH_ANY is used, the function will return as soon as a hit is found (skipping the remaining untested triangles). This flag can also be used to emulate PxHitFlag::eMESH_MULTIPLE, by calling the function repeatedly with PxHitFlag::eMESH_ANY, using as a starting point the previously returned hit triangle (whose index, between 0 and 'triangleCount', is available in sweepHit.faceIndex).</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../Index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Geometry Queries</a><ul>
<li><a class="reference internal" href="#introduction">Introduction</a></li>
<li><a class="reference internal" href="#raycasts">Raycasts</a><ul>
<li><a class="reference internal" href="#raycasts-against-spheres-capsules-boxes-and-convex-meshes">Raycasts against Spheres, Capsules, Boxes and Convex Meshes</a></li>
<li><a class="reference internal" href="#raycasts-against-planes">Raycasts against Planes</a></li>
<li><a class="reference internal" href="#raycasts-against-triangle-meshes">Raycasts against Triangle Meshes</a></li>
<li><a class="reference internal" href="#raycasts-against-heightfields">Raycasts against Heightfields</a></li>
</ul>
</li>
<li><a class="reference internal" href="#overlaps">Overlaps</a></li>
<li><a class="reference internal" href="#penetration-depth">Penetration Depth</a></li>
<li><a class="reference internal" href="#sweeps">Sweeps</a><ul>
<li><a class="reference internal" href="#initial-overlaps">Initial Overlaps</a></li>
<li><a class="reference internal" href="#precise-sweeps">Precise Sweeps</a></li>
<li><a class="reference internal" href="#sweeps-against-height-fields">Sweeps against Height Fields</a></li>
<li><a class="reference internal" href="#pitfalls">Pitfalls</a></li>
</ul>
</li>
<li><a class="reference internal" href="#additional-pxgeometryquery-functions">Additional PxGeometryQuery functions</a></li>
<li><a class="reference internal" href="#pxmeshquery">PxMeshQuery</a><ul>
<li><a class="reference internal" href="#mesh-overlaps">Mesh Overlaps</a></li>
<li><a class="reference internal" href="#sweeps-against-triangles">Sweeps against Triangles</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="GPURigidBodies.html"
                        title="previous chapter">GPU Rigid Bodies</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="SpatialQueries.html"
                        title="next chapter">Spatial Queries</a></p>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="SpatialQueries.html" title="Spatial Queries"
             >next</a></li>
        <li class="right" >
          <a href="GPURigidBodies.html" title="GPU Rigid Bodies"
             >previous</a> |</li>
        <li><a href="../Index.html">NVIDIA PhysX SDK 3.4.2 Documentation</a> &raquo;</li>
          <li><a href="Index.html" >User's Guide</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2008-2018 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.
    </div>
  </body>
</html>