aboutsummaryrefslogtreecommitdiff
path: root/docs/source_docs/files/_nv_blast_family_8h-source.html
blob: 7aaf9a998d802e76a68ca01828f8206cb31f91b7 (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
<html>
	<head>
		<title>NVIDIA(R) Blast(R) SDK 1.1 Source Reference: sdk/lowlevel/source/NvBlastFamily.h Source File</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="blast_logo.png">
			<br>
			<center>
				<a class="qindex" href="main.html">Main Page</a> &nbsp; 
				<!-- <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; //-->
				<a class="qindex" href="annotated.html">Class List</a> &nbsp; 
				<a class="qindex" href="functions.html">Class Members</a> &nbsp;  
			</center>
			<hr class="second">
		</div>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>User's&nbsp;Guide</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>sdk/lowlevel/source/NvBlastFamily.h</h1><a href="_nv_blast_family_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// This code contains NVIDIA Confidential Information and is disclosed to you</span>
<a name="l00002"></a>00002 <span class="comment">// under a form of NVIDIA software license agreement provided separately to you.</span>
<a name="l00003"></a>00003 <span class="comment">//</span>
<a name="l00004"></a>00004 <span class="comment">// Notice</span>
<a name="l00005"></a>00005 <span class="comment">// NVIDIA Corporation and its licensors retain all intellectual property and</span>
<a name="l00006"></a>00006 <span class="comment">// proprietary rights in and to this software and related documentation and</span>
<a name="l00007"></a>00007 <span class="comment">// any modifications thereto. Any use, reproduction, disclosure, or</span>
<a name="l00008"></a>00008 <span class="comment">// distribution of this software and related documentation without an express</span>
<a name="l00009"></a>00009 <span class="comment">// license agreement from NVIDIA Corporation is strictly prohibited.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES</span>
<a name="l00012"></a>00012 <span class="comment">// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO</span>
<a name="l00013"></a>00013 <span class="comment">// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,</span>
<a name="l00014"></a>00014 <span class="comment">// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.</span>
<a name="l00015"></a>00015 <span class="comment">//</span>
<a name="l00016"></a>00016 <span class="comment">// Information and code furnished is believed to be accurate and reliable.</span>
<a name="l00017"></a>00017 <span class="comment">// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such</span>
<a name="l00018"></a>00018 <span class="comment">// information or for any infringement of patents or other rights of third parties that may</span>
<a name="l00019"></a>00019 <span class="comment">// result from its use. No license is granted by implication or otherwise under any patent</span>
<a name="l00020"></a>00020 <span class="comment">// or patent rights of NVIDIA Corporation. Details are subject to change without notice.</span>
<a name="l00021"></a>00021 <span class="comment">// This code supersedes and replaces all information previously supplied.</span>
<a name="l00022"></a>00022 <span class="comment">// NVIDIA Corporation products are not authorized for use as critical</span>
<a name="l00023"></a>00023 <span class="comment">// components in life support devices or systems without express written approval of</span>
<a name="l00024"></a>00024 <span class="comment">// NVIDIA Corporation.</span>
<a name="l00025"></a>00025 <span class="comment">//</span>
<a name="l00026"></a>00026 <span class="comment">// Copyright (c) 2016-2020 NVIDIA Corporation. All rights reserved.</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 <span class="preprocessor">#ifndef NVBLASTFAMILY_H</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define NVBLASTFAMILY_H</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="_nv_blast_asset_8h.html">NvBlastAsset.h</a>"</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="_nv_blast_preprocessor_8h.html">NvBlastPreprocessor.h</a>"</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include "<a class="code" href="_nv_blast_d_link_8h.html">NvBlastDLink.h</a>"</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="_nv_blast_atomic_8h.html">NvBlastAtomic.h</a>"</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="_nv_blast_memory_8h.html">NvBlastMemory.h</a>"</span>
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;cstring&gt;</span>
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <span class="keyword">struct </span><a class="code" href="struct_nv_blast_asset.html">NvBlastAsset</a>;
<a name="l00043"></a>00043 
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="keyword">namespace </span>Nv
<a name="l00046"></a>00046 {
<a name="l00047"></a>00047 <span class="keyword">namespace </span>Blast
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 
<a name="l00050"></a>00050 <span class="comment">// Forward declarations</span>
<a name="l00051"></a>00051 <span class="keyword">class </span>FamilyGraph;
<a name="l00052"></a>00052 <span class="keyword">class </span>Actor;
<a name="l00053"></a>00053 <span class="keyword">class </span>Asset;
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 
<a name="l00061"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html">00061</a> <span class="keyword">struct </span><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html">FamilyHeader</a> : <span class="keyword">public</span> <a class="code" href="struct_nv_blast_data_block.html">NvBlastDataBlock</a>
<a name="l00062"></a>00062 {
<a name="l00066"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#e2a59d9dd49c92dcb6abb9ad46849976">00066</a>     <a class="code" href="struct_nv_blast_i_d.html">NvBlastID</a>   <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#e2a59d9dd49c92dcb6abb9ad46849976">m_assetID</a>;
<a name="l00067"></a>00067 
<a name="l00074"></a>00074     <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#d03aae1a3bd35af2196fa03d549128f1">NvBlastBlockArrayData</a>(<a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>, m_actorsOffset, getActors, <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>-&gt;<a class="code" href="class_nv_1_1_blast_1_1_asset.html#d07d72453b9db6a1387f7fbd934eb2fd">m_graph</a>.<a class="code" href="struct_nv_1_1_blast_1_1_support_graph.html#8e25ca3c8d3213c3737e53b7094431d1">m_nodeCount</a>);
<a name="l00075"></a>00075 
<a name="l00081"></a>00081     <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#d03aae1a3bd35af2196fa03d549128f1">NvBlastBlockArrayData</a>(<a class="code" href="struct_nv_1_1_blast_1_1_index_d_link.html">IndexDLink&lt;uint32_t&gt;</a>, m_visibleChunkIndexLinksOffset, getVisibleChunkIndexLinks, <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>-&gt;<a class="code" href="class_nv_1_1_blast_1_1_asset.html#2fca1fdbe87c49f04736dd6b6d176177">m_chunkCount</a>);
<a name="l00082"></a>00082 
<a name="l00088"></a>00088     <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#d03aae1a3bd35af2196fa03d549128f1">NvBlastBlockArrayData</a>(uint32_t, m_chunkActorIndicesOffset, getChunkActorIndices, <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>-&gt;<a class="code" href="class_nv_1_1_blast_1_1_asset.html#6cfa7f72e5f815e519550dd46dc087a9">m_firstSubsupportChunkIndex</a>);
<a name="l00089"></a>00089 
<a name="l00095"></a>00095     <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#d03aae1a3bd35af2196fa03d549128f1">NvBlastBlockArrayData</a>(uint32_t, m_graphNodeIndexLinksOffset, getGraphNodeIndexLinks, <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>-&gt;<a class="code" href="class_nv_1_1_blast_1_1_asset.html#d07d72453b9db6a1387f7fbd934eb2fd">m_graph</a>.<a class="code" href="struct_nv_1_1_blast_1_1_support_graph.html#8e25ca3c8d3213c3737e53b7094431d1">m_nodeCount</a>);
<a name="l00096"></a>00096 
<a name="l00104"></a>00104     <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#d03aae1a3bd35af2196fa03d549128f1">NvBlastBlockArrayData</a>(<span class="keywordtype">float</span>, m_lowerSupportChunkHealthsOffset, getLowerSupportChunkHealths, <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>-&gt;<a class="code" href="class_nv_1_1_blast_1_1_asset.html#0b0439d2efbbf360b98342720126deb2">getLowerSupportChunkCount</a>());
<a name="l00105"></a>00105 
<a name="l00113"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#ddfc84d59d9a0b65f3f6b89d895b2041">00113</a>     <span class="keywordtype">float</span>*  <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#ddfc84d59d9a0b65f3f6b89d895b2041">getSubsupportChunkHealths</a>()<span class="keyword"> const</span>
<a name="l00114"></a>00114 <span class="keyword">    </span>{
<a name="l00115"></a>00115         <a class="code" href="_nv_blast_assert_8h.html#2b179fca67cdb57b12b65e33fe3f6c93">NVBLAST_ASSERT</a>(<a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a> != <span class="keyword">nullptr</span>);
<a name="l00116"></a>00116         <span class="keywordflow">return</span> (<span class="keywordtype">float</span>*)((uintptr_t)<span class="keyword">this</span> + m_lowerSupportChunkHealthsOffset) + <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>-&gt;<a class="code" href="class_nv_1_1_blast_1_1_asset.html#d07d72453b9db6a1387f7fbd934eb2fd">m_graph</a>.<a class="code" href="struct_nv_1_1_blast_1_1_support_graph.html#8e25ca3c8d3213c3737e53b7094431d1">m_nodeCount</a>;
<a name="l00117"></a>00117     }
<a name="l00118"></a>00118 
<a name="l00124"></a>00124     <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#d03aae1a3bd35af2196fa03d549128f1">NvBlastBlockArrayData</a>(<span class="keywordtype">float</span>, m_graphBondHealthsOffset, getBondHealths, <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>-&gt;<a class="code" href="class_nv_1_1_blast_1_1_asset.html#3b4976a2cdaf417d35fe5dffdd8b7374">getBondCount</a>());
<a name="l00125"></a>00125 
<a name="l00132"></a>00132     <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#f242d21a84d28cf24877def66e1d5729">NvBlastBlockData</a>(<a class="code" href="class_nv_1_1_blast_1_1_family_graph.html">FamilyGraph</a>, m_familyGraphOffset, getFamilyGraph);
<a name="l00133"></a>00133 
<a name="l00134"></a>00134 
<a name="l00136"></a>00136 
<a name="l00140"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#6667d4314fbb8eacf132cc81e8920846">00140</a>     <span class="keyword">volatile</span> uint32_t   <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#6667d4314fbb8eacf132cc81e8920846">m_actorCount</a>;
<a name="l00141"></a>00141 
<a name="l00146"></a>00146     <span class="keyword">union</span>
<a name="l00147"></a>00147     {
<a name="l00148"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">00148</a>         <span class="keyword">const</span> <a class="code" href="class_nv_1_1_blast_1_1_asset.html">Asset</a>*    <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>;
<a name="l00149"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#2045936da536ed27b97eb2fc9aea9b03">00149</a>         uint64_t        <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#2045936da536ed27b97eb2fc9aea9b03">m_runtimePlaceholder</a>;   <span class="comment">// Make sure we reserve enough room for an 8-byte pointer</span>
<a name="l00150"></a>00150     };
<a name="l00151"></a>00151 
<a name="l00152"></a>00152 
<a name="l00154"></a>00154 
<a name="l00162"></a>00162     <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>*      <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#6dde29ddbcaa4e7f85d3d5339db300ad">borrowActor</a>(uint32_t index);
<a name="l00163"></a>00163 
<a name="l00169"></a>00169     <span class="keywordtype">void</span>        <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#cc4fd2c9b502b0a1114ec672ee64c04a">returnActor</a>(<a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>&amp; actor);
<a name="l00170"></a>00170 
<a name="l00176"></a>00176     uint32_t    <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#4fbb4b47a687a49e22432439f3443ba6">getActorBufferSize</a>() <span class="keyword">const</span>;
<a name="l00177"></a>00177 
<a name="l00183"></a>00183     <span class="keywordtype">bool</span>        <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#636a730974285f6dbb9f2886f3306dd6">isActorActive</a>(uint32_t index) <span class="keyword">const</span>;
<a name="l00184"></a>00184 
<a name="l00192"></a>00192     <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>*      <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#6ec386c3cb8070eb817220027ffd07c0">getActorByIndex</a>(uint32_t index) <span class="keyword">const</span>;
<a name="l00193"></a>00193 
<a name="l00201"></a>00201     uint32_t    <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#be6d9f7b17ef96f60ea83df86fa03116">getGetChunkActorIndex</a>(uint32_t chunkIndex) <span class="keyword">const</span>;
<a name="l00202"></a>00202 
<a name="l00210"></a>00210     uint32_t    <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#20daa09c2621c982d27e36d8d3841302">getGetNodeActorIndex</a>(uint32_t nodeIndex) <span class="keyword">const</span>;
<a name="l00211"></a>00211 
<a name="l00219"></a>00219     <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>*      <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#d9b51b0e92f2e76180b1255e409b7b85">getGetChunkActor</a>(uint32_t chunkIndex) <span class="keyword">const</span>;
<a name="l00220"></a>00220 
<a name="l00228"></a>00228     <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>*      <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#9db44be2558e6dcc1ec74950daebc282">getGetNodeActor</a>(uint32_t nodeIndex) <span class="keyword">const</span>;
<a name="l00229"></a>00229 
<a name="l00230"></a>00230 
<a name="l00232"></a>00232 
<a name="l00242"></a>00242     <span class="keywordtype">void</span>                <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#db022b7eb3444d2ac3a8a2d5de98a9b5">fractureSubSupportNoEvents</a>(uint32_t chunkIndex, uint32_t suboffset, <span class="keywordtype">float</span> healthDamage, <span class="keywordtype">float</span>* chunkHealths, <span class="keyword">const</span> <a class="code" href="struct_nv_blast_chunk.html">NvBlastChunk</a>* chunks);
<a name="l00243"></a>00243 
<a name="l00260"></a>00260     <span class="keywordtype">void</span>                <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#2a8ef3805c7eaa784d181c5af6021eaa">fractureSubSupport</a>(uint32_t chunkIndex, uint32_t suboffset, <span class="keywordtype">float</span> healthDamage, <span class="keywordtype">float</span>* chunkHealths, <span class="keyword">const</span> <a class="code" href="struct_nv_blast_chunk.html">NvBlastChunk</a>* chunks, <a class="code" href="struct_nv_blast_chunk_fracture_data.html">NvBlastChunkFractureData</a>* outBuffer, uint32_t* currentIndex, <span class="keyword">const</span> uint32_t maxCount);
<a name="l00261"></a>00261 
<a name="l00270"></a>00270     <span class="keywordtype">void</span>                <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#8c8dbf18c71bfd84c101542fce8498ff">fractureNoEvents</a>(uint32_t chunkFractureCount, <span class="keyword">const</span> <a class="code" href="struct_nv_blast_chunk_fracture_data.html">NvBlastChunkFractureData</a>* chunkFractures, <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>* filterActor, <a class="code" href="_nv_blast_types_8h.html#fa1be237d696dc68e343189c19cc76e0">NvBlastLog</a> logFn);
<a name="l00271"></a>00271 
<a name="l00286"></a>00286     <span class="keywordtype">void</span>                <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#89f293e52b88ad129c5f202ed2205dd8">fractureWithEvents</a>(uint32_t chunkFractureCount, <span class="keyword">const</span> <a class="code" href="struct_nv_blast_chunk_fracture_data.html">NvBlastChunkFractureData</a>* commands, <a class="code" href="struct_nv_blast_chunk_fracture_data.html">NvBlastChunkFractureData</a>* events, uint32_t eventsSize, uint32_t* count, <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>* filterActor, <a class="code" href="_nv_blast_types_8h.html#fa1be237d696dc68e343189c19cc76e0">NvBlastLog</a> logFn);
<a name="l00287"></a>00287 
<a name="l00303"></a>00303     <span class="keywordtype">void</span>                <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#44bed5d2801cd48c30141d21e1852816">fractureInPlaceEvents</a>(uint32_t chunkFractureCount, <a class="code" href="struct_nv_blast_chunk_fracture_data.html">NvBlastChunkFractureData</a>* inoutbuffer, uint32_t eventsSize, uint32_t* count, <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>* filterActor, <a class="code" href="_nv_blast_types_8h.html#fa1be237d696dc68e343189c19cc76e0">NvBlastLog</a> logFn);
<a name="l00304"></a>00304 
<a name="l00316"></a>00316     <span class="keywordtype">void</span>                <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#5361b8667e8a10f440f04248e232cd2f">applyFracture</a>(<a class="code" href="struct_nv_blast_fracture_buffers.html">NvBlastFractureBuffers</a>* eventBuffers, <span class="keyword">const</span> <a class="code" href="struct_nv_blast_fracture_buffers.html">NvBlastFractureBuffers</a>* commands, <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>* filterActor, <a class="code" href="_nv_blast_types_8h.html#fa1be237d696dc68e343189c19cc76e0">NvBlastLog</a> logFn, <a class="code" href="struct_nv_blast_timers.html">NvBlastTimers</a>* timers);
<a name="l00317"></a>00317 };
<a name="l00318"></a>00318 
<a name="l00319"></a>00319 } <span class="comment">// namespace Blast</span>
<a name="l00320"></a>00320 } <span class="comment">// namespace Nv</span>
<a name="l00321"></a>00321 
<a name="l00322"></a>00322 
<a name="l00323"></a>00323 <span class="preprocessor">#include "<a class="code" href="_nv_blast_actor_8h.html">NvBlastActor.h</a>"</span>
<a name="l00324"></a>00324 
<a name="l00325"></a>00325 
<a name="l00326"></a>00326 <span class="keyword">namespace </span>Nv
<a name="l00327"></a>00327 {
<a name="l00328"></a>00328 <span class="keyword">namespace </span>Blast
<a name="l00329"></a>00329 {
<a name="l00330"></a>00330 
<a name="l00332"></a>00332 
<a name="l00333"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#6dde29ddbcaa4e7f85d3d5339db300ad">00333</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>* <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#6dde29ddbcaa4e7f85d3d5339db300ad">FamilyHeader::borrowActor</a>(uint32_t index)
<a name="l00334"></a>00334 {
<a name="l00335"></a>00335     <a class="code" href="_nv_blast_assert_8h.html#2b179fca67cdb57b12b65e33fe3f6c93">NVBLAST_ASSERT</a>(index &lt; <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#4fbb4b47a687a49e22432439f3443ba6">getActorBufferSize</a>());
<a name="l00336"></a>00336     <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>&amp; actor = getActors()[index];
<a name="l00337"></a>00337     <span class="keywordflow">if</span> (actor.<a class="code" href="class_nv_1_1_blast_1_1_actor.html#b68478ad74f2c85aa970dac00789e60a">m_familyOffset</a> == 0)
<a name="l00338"></a>00338     {
<a name="l00339"></a>00339         <span class="keyword">const</span> uintptr_t offset = (uintptr_t)&amp;actor - (uintptr_t)<span class="keyword">this</span>;
<a name="l00340"></a>00340         <a class="code" href="_nv_blast_assert_8h.html#2b179fca67cdb57b12b65e33fe3f6c93">NVBLAST_ASSERT</a>(offset &lt;= <a class="code" href="_nv_blast_preprocessor_internal_8h.html#b5eb23180f7cc12b7d6c04a8ec067fdd">UINT32_MAX</a>);
<a name="l00341"></a>00341         actor.<a class="code" href="class_nv_1_1_blast_1_1_actor.html#b68478ad74f2c85aa970dac00789e60a">m_familyOffset</a> = (uint32_t)offset;
<a name="l00342"></a>00342         <a class="code" href="namespace_nv_1_1_blast.html#02d7c995394a2e2c7f0b18ee051bec2f">atomicIncrement</a>(reinterpret_cast&lt;volatile int32_t*&gt;(&amp;<a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#6667d4314fbb8eacf132cc81e8920846">m_actorCount</a>));
<a name="l00343"></a>00343     }
<a name="l00344"></a>00344     <span class="keywordflow">return</span> &amp;actor;
<a name="l00345"></a>00345 }
<a name="l00346"></a>00346 
<a name="l00347"></a>00347 
<a name="l00348"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#cc4fd2c9b502b0a1114ec672ee64c04a">00348</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> <span class="keywordtype">void</span> <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#cc4fd2c9b502b0a1114ec672ee64c04a">FamilyHeader::returnActor</a>(<a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>&amp; actor)
<a name="l00349"></a>00349 {
<a name="l00350"></a>00350     <span class="keywordflow">if</span> (actor.<a class="code" href="class_nv_1_1_blast_1_1_actor.html#b68478ad74f2c85aa970dac00789e60a">m_familyOffset</a> != 0)
<a name="l00351"></a>00351     {
<a name="l00352"></a>00352         actor.<a class="code" href="class_nv_1_1_blast_1_1_actor.html#b68478ad74f2c85aa970dac00789e60a">m_familyOffset</a> = 0;
<a name="l00353"></a>00353         <span class="comment">// The actor count should be positive since this actor was valid.  Check to be safe.</span>
<a name="l00354"></a>00354         <a class="code" href="_nv_blast_assert_8h.html#2b179fca67cdb57b12b65e33fe3f6c93">NVBLAST_ASSERT</a>(<a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#6667d4314fbb8eacf132cc81e8920846">m_actorCount</a> &gt; 0);
<a name="l00355"></a>00355         <a class="code" href="namespace_nv_1_1_blast.html#a0a1acaf4abe11be6cfdcf14cecf4818">atomicDecrement</a>(reinterpret_cast&lt;volatile int32_t*&gt;(&amp;<a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#6667d4314fbb8eacf132cc81e8920846">m_actorCount</a>));
<a name="l00356"></a>00356     }
<a name="l00357"></a>00357 }
<a name="l00358"></a>00358 
<a name="l00359"></a>00359 
<a name="l00360"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#4fbb4b47a687a49e22432439f3443ba6">00360</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> uint32_t <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#4fbb4b47a687a49e22432439f3443ba6">FamilyHeader::getActorBufferSize</a>()<span class="keyword"> const</span>
<a name="l00361"></a>00361 <span class="keyword"></span>{
<a name="l00362"></a>00362     <a class="code" href="_nv_blast_assert_8h.html#2b179fca67cdb57b12b65e33fe3f6c93">NVBLAST_ASSERT</a>(<a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>);
<a name="l00363"></a>00363     <span class="keywordflow">return</span> <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>-&gt;<a class="code" href="class_nv_1_1_blast_1_1_asset.html#0b0439d2efbbf360b98342720126deb2">getLowerSupportChunkCount</a>();
<a name="l00364"></a>00364 }
<a name="l00365"></a>00365 
<a name="l00366"></a>00366 
<a name="l00367"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#636a730974285f6dbb9f2886f3306dd6">00367</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> <span class="keywordtype">bool</span> <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#636a730974285f6dbb9f2886f3306dd6">FamilyHeader::isActorActive</a>(uint32_t index)<span class="keyword"> const</span>
<a name="l00368"></a>00368 <span class="keyword"></span>{
<a name="l00369"></a>00369     <a class="code" href="_nv_blast_assert_8h.html#2b179fca67cdb57b12b65e33fe3f6c93">NVBLAST_ASSERT</a>(index &lt; <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#4fbb4b47a687a49e22432439f3443ba6">getActorBufferSize</a>());
<a name="l00370"></a>00370     <span class="keywordflow">return</span> getActors()[index].m_familyOffset != 0;
<a name="l00371"></a>00371 }
<a name="l00372"></a>00372 
<a name="l00373"></a>00373 
<a name="l00374"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#6ec386c3cb8070eb817220027ffd07c0">00374</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>* <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#6ec386c3cb8070eb817220027ffd07c0">FamilyHeader::getActorByIndex</a>(uint32_t index)<span class="keyword"> const</span>
<a name="l00375"></a>00375 <span class="keyword"></span>{
<a name="l00376"></a>00376     <a class="code" href="_nv_blast_assert_8h.html#2b179fca67cdb57b12b65e33fe3f6c93">NVBLAST_ASSERT</a>(index &lt; <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#4fbb4b47a687a49e22432439f3443ba6">getActorBufferSize</a>());
<a name="l00377"></a>00377     <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>&amp; actor = getActors()[index];
<a name="l00378"></a>00378     <span class="keywordflow">return</span> actor.<a class="code" href="class_nv_1_1_blast_1_1_actor.html#3d8f539000a51c21e4fd610b504a3bf6">isActive</a>() ? &amp;actor : <span class="keyword">nullptr</span>;
<a name="l00379"></a>00379 }
<a name="l00380"></a>00380 
<a name="l00381"></a>00381 
<a name="l00382"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#be6d9f7b17ef96f60ea83df86fa03116">00382</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> uint32_t <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#be6d9f7b17ef96f60ea83df86fa03116">FamilyHeader::getGetChunkActorIndex</a>(uint32_t chunkIndex)<span class="keyword"> const</span>
<a name="l00383"></a>00383 <span class="keyword"></span>{
<a name="l00384"></a>00384     <a class="code" href="_nv_blast_assert_8h.html#2b179fca67cdb57b12b65e33fe3f6c93">NVBLAST_ASSERT</a>(<a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>);
<a name="l00385"></a>00385     <a class="code" href="_nv_blast_assert_8h.html#2b179fca67cdb57b12b65e33fe3f6c93">NVBLAST_ASSERT</a>(chunkIndex &lt; m_asset-&gt;m_chunkCount);
<a name="l00386"></a>00386     <span class="keywordflow">if</span> (chunkIndex &lt; m_asset-&gt;getUpperSupportChunkCount())
<a name="l00387"></a>00387     {
<a name="l00388"></a>00388         <span class="keywordflow">return</span> getChunkActorIndices()[chunkIndex];
<a name="l00389"></a>00389     }
<a name="l00390"></a>00390     <span class="keywordflow">else</span>
<a name="l00391"></a>00391     {
<a name="l00392"></a>00392         <span class="keywordflow">return</span> chunkIndex - (<a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>-&gt;<a class="code" href="class_nv_1_1_blast_1_1_asset.html#60aa9c06e57f369ed24c185bb9769ddc">getUpperSupportChunkCount</a>() - <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>-&gt;<a class="code" href="class_nv_1_1_blast_1_1_asset.html#d07d72453b9db6a1387f7fbd934eb2fd">m_graph</a>.<a class="code" href="struct_nv_1_1_blast_1_1_support_graph.html#8e25ca3c8d3213c3737e53b7094431d1">m_nodeCount</a>);
<a name="l00393"></a>00393     }
<a name="l00394"></a>00394 }
<a name="l00395"></a>00395 
<a name="l00396"></a>00396 
<a name="l00397"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#20daa09c2621c982d27e36d8d3841302">00397</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> uint32_t <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#20daa09c2621c982d27e36d8d3841302">FamilyHeader::getGetNodeActorIndex</a>(uint32_t nodeIndex)<span class="keyword"> const</span>
<a name="l00398"></a>00398 <span class="keyword"></span>{
<a name="l00399"></a>00399     <a class="code" href="_nv_blast_assert_8h.html#2b179fca67cdb57b12b65e33fe3f6c93">NVBLAST_ASSERT</a>(<a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>);
<a name="l00400"></a>00400     <a class="code" href="_nv_blast_assert_8h.html#2b179fca67cdb57b12b65e33fe3f6c93">NVBLAST_ASSERT</a>(nodeIndex &lt; m_asset-&gt;m_graph.m_nodeCount);
<a name="l00401"></a>00401     <span class="keyword">const</span> uint32_t chunkIndex = <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#b1500a7965fb35635af84a091cf399e1">m_asset</a>-&gt;<a class="code" href="class_nv_1_1_blast_1_1_asset.html#d07d72453b9db6a1387f7fbd934eb2fd">m_graph</a>.getChunkIndices()[nodeIndex];
<a name="l00402"></a>00402     <span class="keywordflow">return</span> <a class="code" href="namespace_nv_1_1_blast.html#a5e952ab38e3501215eee523cb0a0d20">isInvalidIndex</a>(chunkIndex) ? chunkIndex : getChunkActorIndices()[chunkIndex];
<a name="l00403"></a>00403 }
<a name="l00404"></a>00404 
<a name="l00405"></a>00405 
<a name="l00406"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#d9b51b0e92f2e76180b1255e409b7b85">00406</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>* <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#d9b51b0e92f2e76180b1255e409b7b85">FamilyHeader::getGetChunkActor</a>(uint32_t chunkIndex)<span class="keyword"> const</span>
<a name="l00407"></a>00407 <span class="keyword"></span>{
<a name="l00408"></a>00408     uint32_t actorIndex = <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#be6d9f7b17ef96f60ea83df86fa03116">getGetChunkActorIndex</a>(chunkIndex);
<a name="l00409"></a>00409     <span class="keywordflow">return</span> !<a class="code" href="namespace_nv_1_1_blast.html#a5e952ab38e3501215eee523cb0a0d20">isInvalidIndex</a>(actorIndex) ? <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#6ec386c3cb8070eb817220027ffd07c0">getActorByIndex</a>(actorIndex) : <span class="keyword">nullptr</span>;
<a name="l00410"></a>00410 }
<a name="l00411"></a>00411 
<a name="l00412"></a>00412 
<a name="l00413"></a><a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#9db44be2558e6dcc1ec74950daebc282">00413</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> <a class="code" href="class_nv_1_1_blast_1_1_actor.html">Actor</a>* <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#9db44be2558e6dcc1ec74950daebc282">FamilyHeader::getGetNodeActor</a>(uint32_t nodeIndex)<span class="keyword"> const</span>
<a name="l00414"></a>00414 <span class="keyword"></span>{
<a name="l00415"></a>00415     uint32_t actorIndex = <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#20daa09c2621c982d27e36d8d3841302">getGetNodeActorIndex</a>(nodeIndex);
<a name="l00416"></a>00416     <span class="keywordflow">return</span> !<a class="code" href="namespace_nv_1_1_blast.html#a5e952ab38e3501215eee523cb0a0d20">isInvalidIndex</a>(actorIndex) ? <a class="code" href="struct_nv_1_1_blast_1_1_family_header.html#6ec386c3cb8070eb817220027ffd07c0">getActorByIndex</a>(actorIndex) : <span class="keyword">nullptr</span>;
<a name="l00417"></a>00417 }
<a name="l00418"></a>00418 
<a name="l00419"></a>00419 
<a name="l00421"></a>00421 
<a name="l00428"></a>00428 <span class="keywordtype">size_t</span> <a class="code" href="namespace_nv_1_1_blast.html#865dd402e2f1af88e0d8df296d4f10d3">getFamilyMemorySize</a>(<span class="keyword">const</span> <a class="code" href="class_nv_1_1_blast_1_1_asset.html">Asset</a>* asset);
<a name="l00429"></a>00429 
<a name="l00430"></a>00430 } <span class="comment">// namespace Blast</span>
<a name="l00431"></a>00431 } <span class="comment">// namespace Nv</span>
<a name="l00432"></a>00432 
<a name="l00433"></a>00433 
<a name="l00434"></a>00434 <span class="preprocessor">#endif // ifndef NVBLASTFAMILY_H</span>
</pre></div></div>
<!-- start footer part -->
<div class="footer">
Copyright &copy; 2015-2017 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>
</div>
</body>
</html>