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
|
<html>
<head>
<title>NVIDIA(R) PhysX(R) SDK 3.4 API Reference: PxHitBuffer< HitType > Struct Template Reference</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK HREF="NVIDIA.css" REL="stylesheet" TYPE="text/css">
</head>
<body bgcolor="#FFFFFF">
<div id="header">
<hr class="first">
<img alt="" src="images/PhysXlogo.png" align="middle"> <br>
<center>
<a class="qindex" href="main.html">Main Page</a>
<a class="qindex" href="hierarchy.html">Class Hierarchy</a>
<a class="qindex" href="annotated.html">Compound List</a>
<a class="qindex" href="functions.html">Compound Members</a>
</center>
<hr class="second">
</div>
<!-- Generated by Doxygen 1.5.8 -->
<div class="contents">
<h1>PxHitBuffer< HitType > Struct Template Reference<br>
<small>
[<a class="el" href="group__scenequery.html">Scenequery</a>]</small>
</h1><!-- doxytag: class="PxHitBuffer" --><!-- doxytag: inherits="PxHitCallback< HitType >" -->Returns scene query hits (intersections) to the user in a preallocated buffer.
<a href="#_details">More...</a>
<p>
<code>#include <<a class="el" href="PxQueryReport_8h-source.html">PxQueryReport.h</a>></code>
<p>
<div class="dynheader">
Inheritance diagram for PxHitBuffer< HitType >:</div>
<div class="dynsection">
<p><center><img src="structPxHitBuffer__inherit__graph.png" border="0" usemap="#PxHitBuffer_3_01HitType_01_4__inherit__map" alt="Inheritance graph"></center>
<map name="PxHitBuffer_3_01HitType_01_4__inherit__map">
<area shape="rect" href="structPxHitCallback.html" title="PxHitCallback\< HitType \>" alt="PxHitCallback\< HitType \>" coords="7,16,164,37"></map>
<center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center></div>
<div class="dynheader">
Collaboration diagram for PxHitBuffer< HitType >:</div>
<div class="dynsection">
<p><center><img src="structPxHitBuffer__coll__graph.png" border="0" usemap="#PxHitBuffer_3_01HitType_01_4__coll__map" alt="Collaboration graph"></center>
<map name="PxHitBuffer_3_01HitType_01_4__coll__map">
<area shape="rect" href="structPxHitCallback.html" title="PxHitCallback\< HitType \>" alt="PxHitCallback\< HitType \>" coords="7,122,164,144"></map>
<center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center></div>
<p>
<a href="structPxHitBuffer-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="structPxHitBuffer.html#89bcec685c76c5cdc0662eb52b67d699">PxHitBuffer</a> (HitType *aTouches=NULL, <a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> aMaxNbTouches=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initializes the buffer with user memory. <a href="#89bcec685c76c5cdc0662eb52b67d699"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">PX_INLINE <a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structPxHitBuffer.html#cc1a660048a41387c74d362719669a3f">getNbAnyHits</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Computes the number of any hits in this result, blocking or touching. <a href="#cc1a660048a41387c74d362719669a3f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">PX_INLINE const HitType & </td><td class="memItemRight" valign="bottom"><a class="el" href="structPxHitBuffer.html#03c5d03b908348194193456ae29be988">getAnyHit</a> (const <a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> index) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience iterator used to access any hits in this result, blocking or touching. <a href="#03c5d03b908348194193456ae29be988"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">PX_INLINE <a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structPxHitBuffer.html#8bf58cc81ca6587e1d9974f2864dacb2">getNbTouches</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">PX_INLINE const HitType * </td><td class="memItemRight" valign="bottom"><a class="el" href="structPxHitBuffer.html#ab32a62e05389a4cc2c3baa2db0b3500">getTouches</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">PX_INLINE const HitType & </td><td class="memItemRight" valign="bottom"><a class="el" href="structPxHitBuffer.html#92b117a1958a0cdcbb4aec3bc1fa1f64">getTouch</a> (const <a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> index) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">PX_INLINE <a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structPxHitBuffer.html#6cd9ee7153cc87849af8b365fa558ee1">getMaxNbTouches</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="structPxHitBuffer.html#f3810ae6d94b93028e7a7d813f820cb4">~PxHitBuffer</a> ()</td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="group__scenequery.html#g4d0184965c0a910f5c96cb69c0690f5c">PxAgain</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structPxHitBuffer.html#f60ac2d3405c5af467f767f812f3f01d">processTouches</a> (const HitType *buffer, <a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> nbHits)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">virtual callback function used to communicate query results to the user. <a href="#f60ac2d3405c5af467f767f812f3f01d"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template<typename HitType><br>
struct PxHitBuffer< HitType ></h3>
Returns scene query hits (intersections) to the user in a preallocated buffer.
<p>
Will clip touch hits to maximum buffer capacity. When clipped, an arbitrary subset of touching hits will be discarded. Overflow does not trigger warnings or errors. block and hasBlock will be valid in finalizeQuery callback and after query completion. Touching hits are guaranteed to have closer or same distance ( <= condition) as the globally nearest blocking hit at the time any <a class="el" href="structPxHitBuffer.html#f60ac2d3405c5af467f767f812f3f01d" title="virtual callback function used to communicate query results to the user.">processTouches()</a> callback is issued.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Pre-made typedef shorthands, such as <a class="el" href="group__scenequery.html#gb21a68ce9e5a18aa742111920b75a84c" title="Raycast query buffer.">PxRaycastBuffer</a> can be used for raycast, overlap and sweep queries.</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="structPxHitCallback.html" title="This callback class facilitates reporting scene query hits (intersections) to the...">PxHitCallback</a> <p>
<a class="el" href="group__scenequery.html#gb21a68ce9e5a18aa742111920b75a84c" title="Raycast query buffer.">PxRaycastBuffer</a> <a class="el" href="group__scenequery.html#g54a708942a891f3321c2427d5c160750" title="Overlap query buffer.">PxOverlapBuffer</a> <a class="el" href="group__scenequery.html#gecfed2b83a930b922b3d95e22ff30665" title="Sweep query buffer.">PxSweepBuffer</a> <a class="el" href="structPxRaycastBufferN.html" title="Returns touching raycast hits to the user in a fixed size array embedded in the buffer...">PxRaycastBufferN</a> <a class="el" href="structPxOverlapBufferN.html" title="Returns touching overlap hits to the user in a fixed size array embedded in the buffer...">PxOverlapBufferN</a> <a class="el" href="structPxSweepBufferN.html" title="Returns touching sweep hits to the user in a fixed size array embedded in the buffer...">PxSweepBufferN</a> </dd></dl>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="89bcec685c76c5cdc0662eb52b67d699"></a><!-- doxytag: member="PxHitBuffer::PxHitBuffer" ref="89bcec685c76c5cdc0662eb52b67d699" args="(HitType *aTouches=NULL, PxU32 aMaxNbTouches=0)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename HitType> </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structPxHitBuffer.html">PxHitBuffer</a>< HitType >::<a class="el" href="structPxHitBuffer.html">PxHitBuffer</a> </td>
<td>(</td>
<td class="paramtype">HitType * </td>
<td class="paramname"> <em>aTouches</em> = <code>NULL</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> </td>
<td class="paramname"> <em>aMaxNbTouches</em> = <code>0</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Initializes the buffer with user memory.
<p>
The buffer is initialized with 0 touch hits by default => query will only report a single closest blocking hit. Use <a class="el" href="structPxQueryFlag.html#2124ff0cff0a021e01e6880a1bba431f2837a6ac649b29ee72af661b65f4d8ab">PxQueryFlag::eANY_HIT</a> to tell the query to abort and return any first hit encoutered as blocking.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>aTouches</em> </td><td>Optional buffer for recording <a class="el" href="structPxQueryHitType.html#cab1ef408184995d169330ed689b79e3ac7ebce08c20ff88ea4328035daa2498" title="a hit on the shape touches the intersection geometry of the query but does not block...">PxQueryHitType::eTOUCH</a> type hits. </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>aMaxNbTouches</em> </td><td>Size of touch buffer.</td></tr>
</table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="structPxHitCallback.html" title="This callback class facilitates reporting scene query hits (intersections) to the...">PxHitCallback</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="f3810ae6d94b93028e7a7d813f820cb4"></a><!-- doxytag: member="PxHitBuffer::~PxHitBuffer" ref="f3810ae6d94b93028e7a7d813f820cb4" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename HitType> </div>
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="structPxHitBuffer.html">PxHitBuffer</a>< HitType >::~<a class="el" href="structPxHitBuffer.html">PxHitBuffer</a> </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td><code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="03c5d03b908348194193456ae29be988"></a><!-- doxytag: member="PxHitBuffer::getAnyHit" ref="03c5d03b908348194193456ae29be988" args="(const PxU32 index) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename HitType> </div>
<table class="memname">
<tr>
<td class="memname">PX_INLINE const HitType& <a class="el" href="structPxHitBuffer.html">PxHitBuffer</a>< HitType >::getAnyHit </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> </td>
<td class="paramname"> <em>index</em> </td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Convenience iterator used to access any hits in this result, blocking or touching.
<p>
</div>
</div><p>
<a class="anchor" name="6cd9ee7153cc87849af8b365fa558ee1"></a><!-- doxytag: member="PxHitBuffer::getMaxNbTouches" ref="6cd9ee7153cc87849af8b365fa558ee1" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename HitType> </div>
<table class="memname">
<tr>
<td class="memname">PX_INLINE <a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> <a class="el" href="structPxHitBuffer.html">PxHitBuffer</a>< HitType >::getMaxNbTouches </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="cc1a660048a41387c74d362719669a3f"></a><!-- doxytag: member="PxHitBuffer::getNbAnyHits" ref="cc1a660048a41387c74d362719669a3f" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename HitType> </div>
<table class="memname">
<tr>
<td class="memname">PX_INLINE <a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> <a class="el" href="structPxHitBuffer.html">PxHitBuffer</a>< HitType >::getNbAnyHits </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Computes the number of any hits in this result, blocking or touching.
<p>
</div>
</div><p>
<a class="anchor" name="8bf58cc81ca6587e1d9974f2864dacb2"></a><!-- doxytag: member="PxHitBuffer::getNbTouches" ref="8bf58cc81ca6587e1d9974f2864dacb2" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename HitType> </div>
<table class="memname">
<tr>
<td class="memname">PX_INLINE <a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> <a class="el" href="structPxHitBuffer.html">PxHitBuffer</a>< HitType >::getNbTouches </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="92b117a1958a0cdcbb4aec3bc1fa1f64"></a><!-- doxytag: member="PxHitBuffer::getTouch" ref="92b117a1958a0cdcbb4aec3bc1fa1f64" args="(const PxU32 index) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename HitType> </div>
<table class="memname">
<tr>
<td class="memname">PX_INLINE const HitType& <a class="el" href="structPxHitBuffer.html">PxHitBuffer</a>< HitType >::getTouch </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> </td>
<td class="paramname"> <em>index</em> </td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="ab32a62e05389a4cc2c3baa2db0b3500"></a><!-- doxytag: member="PxHitBuffer::getTouches" ref="ab32a62e05389a4cc2c3baa2db0b3500" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename HitType> </div>
<table class="memname">
<tr>
<td class="memname">PX_INLINE const HitType* <a class="el" href="structPxHitBuffer.html">PxHitBuffer</a>< HitType >::getTouches </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="f60ac2d3405c5af467f767f812f3f01d"></a><!-- doxytag: member="PxHitBuffer::processTouches" ref="f60ac2d3405c5af467f767f812f3f01d" args="(const HitType *buffer, PxU32 nbHits)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename HitType> </div>
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="group__scenequery.html#g4d0184965c0a910f5c96cb69c0690f5c">PxAgain</a> <a class="el" href="structPxHitBuffer.html">PxHitBuffer</a>< HitType >::processTouches </td>
<td>(</td>
<td class="paramtype">const HitType * </td>
<td class="paramname"> <em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__foundation.html#gcce5749db3dcfb916e98c253374264ed">PxU32</a> </td>
<td class="paramname"> <em>nbHits</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline, protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
virtual callback function used to communicate query results to the user.
<p>
This callback will always be invoked with <a class="el" href="structPxHitCallback.html#a3fa478af9db3e043a540fca72a2f468" title="User specified buffer for touching hits.">touches</a> as a buffer if <a class="el" href="structPxHitCallback.html#a3fa478af9db3e043a540fca72a2f468" title="User specified buffer for touching hits.">touches</a> was specified as non-NULL. All reported touch hits are guaranteed to be closer than the closest blocking hit.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>buffer</em> </td><td>Callback will report touch hits to the user in this buffer. This pointer will be the same as <a class="el" href="structPxHitCallback.html#a3fa478af9db3e043a540fca72a2f468" title="User specified buffer for touching hits.">touches</a>. </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>nbHits</em> </td><td>Number of touch hits reported in buffer. This number will not exceed <a class="el" href="structPxHitCallback.html#0e64f72a5edf7c442ce81e3e4a8c61d1" title="Size of the user specified touching hits buffer.">maxNbTouches</a>.</td></tr>
</table>
</dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>There is a significant performance penalty in case multiple touch callbacks are issued (up to 2x) <p>
to avoid the penalty use a bigger buffer so that all touching hits can be reported in a single buffer. <p>
If true (again) is returned from the callback, nbTouches will be reset to 0, <p>
If false is returned, nbTouched will remain unchanged. <p>
By the time processTouches is first called, the globally closest blocking hit is already determined, <p>
values of hasBlock and block are final and all touch hits are guaranteed to be closer than the blocking hit. <p>
touches and maxNbTouches can be modified inside of processTouches callback.</dd></dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>true to continue receiving callbacks in case there are more hits or false to stop.</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__scenequery.html#g4d0184965c0a910f5c96cb69c0690f5c" title="Describes query behavior after returning a partial query result via a callback.">PxAgain</a> <a class="el" href="structPxRaycastHit.html" title="Stores results of raycast queries.">PxRaycastHit</a> <a class="el" href="structPxSweepHit.html" title="Stores results of sweep queries.">PxSweepHit</a> <a class="el" href="structPxOverlapHit.html" title="Stores results of overlap queries.">PxOverlapHit</a> </dd></dl>
<p>Implements <a class="el" href="structPxHitCallback.html#9c6fc25eb66c22dad2a35d5630d4ec68">PxHitCallback< HitType ></a>.</p>
</div>
</div><p>
<hr>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="PxQueryReport_8h-source.html">PxQueryReport.h</a></ul>
</div>
<hr style="width: 100%; height: 2px;"><br>
Copyright © 2008-2018 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. <a href="http://www.nvidia.com ">www.nvidia.com</a>
</body>
</html>
|