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
|
<html>
<head>
<title>NVIDIA(R) Blast(R) SDK 1.1 Source Reference: sdk/lowlevel/source/NvBlastAsset.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>
<!-- <a class="qindex" href="hierarchy.html">Class Hierarchy</a> //-->
<a class="qindex" href="annotated.html">Class List</a>
<a class="qindex" href="functions.html">Class Members</a>
</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 Page</span></a></li>
<li><a href="pages.html"><span>User's 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 List</span></a></li>
<li><a href="globals.html"><span>File Members</span></a></li>
</ul>
</div>
<h1>sdk/lowlevel/source/NvBlastAsset.h</h1><a href="_nv_blast_asset_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 NVBLASTASSET_H</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define NVBLASTASSET_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_support_graph_8h.html">NvBlastSupportGraph.h</a>"</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="_nv_blast_8h.html">NvBlast.h</a>"</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include "<a class="code" href="_nv_blast_assert_8h.html">NvBlastAssert.h</a>"</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="_nv_blast_index_fns_8h.html">NvBlastIndexFns.h</a>"</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="_nv_blast_chunk_hierarchy_8h.html">NvBlastChunkHierarchy.h</a>"</span>
<a name="l00038"></a>00038
<a name="l00039"></a>00039
<a name="l00040"></a>00040 <span class="keyword">namespace </span>Nv
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042 <span class="keyword">namespace </span>Blast
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044
<a name="l00045"></a><a class="code" href="class_nv_1_1_blast_1_1_asset.html">00045</a> <span class="keyword">class </span><a class="code" href="class_nv_1_1_blast_1_1_asset.html">Asset</a> : <span class="keyword">public</span> <a class="code" href="struct_nv_blast_asset.html">NvBlastAsset</a>
<a name="l00046"></a>00046 {
<a name="l00047"></a>00047 <span class="keyword">public</span>:
<a name="l00048"></a>00048
<a name="l00052"></a><a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html">00052</a> <span class="keyword">struct </span><a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html">ChunkAnnotation</a>
<a name="l00053"></a>00053 {
<a name="l00054"></a><a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html#fdc7db1ba5c96b0e9fc3d8a0c57c29e1">00054</a> <span class="keyword">enum</span> <a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html#fdc7db1ba5c96b0e9fc3d8a0c57c29e1">Enum</a>
<a name="l00055"></a>00055 {
<a name="l00056"></a><a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html#fdc7db1ba5c96b0e9fc3d8a0c57c29e1e227d4666a49fcc6940cc7b090814186">00056</a> <a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html#fdc7db1ba5c96b0e9fc3d8a0c57c29e1e227d4666a49fcc6940cc7b090814186">Parent</a> = (1 << 0),
<a name="l00057"></a><a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html#fdc7db1ba5c96b0e9fc3d8a0c57c29e1342659d6c309b8584d62165b0f329379">00057</a> <a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html#fdc7db1ba5c96b0e9fc3d8a0c57c29e1342659d6c309b8584d62165b0f329379">Support</a> = (1 << 1),
<a name="l00058"></a><a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html#fdc7db1ba5c96b0e9fc3d8a0c57c29e1d1acf45b5305ba01314110cfb5e7e9ef">00058</a> <a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html#fdc7db1ba5c96b0e9fc3d8a0c57c29e1d1acf45b5305ba01314110cfb5e7e9ef">SuperSupport</a> = (1 << 2),
<a name="l00059"></a>00059
<a name="l00060"></a>00060 <span class="comment">// Combinations</span>
<a name="l00061"></a><a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html#fdc7db1ba5c96b0e9fc3d8a0c57c29e1cf5eca8c2aba4cc6ab47143220ade97c">00061</a> <a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html#fdc7db1ba5c96b0e9fc3d8a0c57c29e1cf5eca8c2aba4cc6ab47143220ade97c">UpperSupport</a> = <a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html#fdc7db1ba5c96b0e9fc3d8a0c57c29e1342659d6c309b8584d62165b0f329379">Support</a> | <a class="code" href="struct_nv_1_1_blast_1_1_asset_1_1_chunk_annotation.html#fdc7db1ba5c96b0e9fc3d8a0c57c29e1d1acf45b5305ba01314110cfb5e7e9ef">SuperSupport</a>
<a name="l00062"></a>00062 };
<a name="l00063"></a>00063 };
<a name="l00064"></a>00064
<a name="l00065"></a>00065
<a name="l00076"></a>00076 <span class="keyword">static</span> <a class="code" href="class_nv_1_1_blast_1_1_asset.html">Asset</a>* <a class="code" href="class_nv_1_1_blast_1_1_asset.html#d6dc3a8db8057eee30b10dff9680595c">create</a>(<span class="keywordtype">void</span>* mem, <span class="keyword">const</span> <a class="code" href="struct_nv_blast_asset_desc.html">NvBlastAssetDesc</a>* desc, <span class="keywordtype">void</span>* scratch, <a class="code" href="_nv_blast_types_8h.html#fa1be237d696dc68e343189c19cc76e0">NvBlastLog</a> logFn);
<a name="l00077"></a>00077
<a name="l00084"></a>00084 <span class="keyword">static</span> <span class="keywordtype">size_t</span> <a class="code" href="class_nv_1_1_blast_1_1_asset.html#13e1d7037123db8187bc4620a7f2e97a">getMemorySize</a>(<span class="keyword">const</span> <a class="code" href="struct_nv_blast_asset_desc.html">NvBlastAssetDesc</a>* desc);
<a name="l00085"></a>00085
<a name="l00094"></a>00094 <span class="keyword">static</span> <span class="keywordtype">size_t</span> <a class="code" href="class_nv_1_1_blast_1_1_asset.html#b7a7be3a23d3cebbf4be3ef8f1b442c6">createRequiredScratch</a>(<span class="keyword">const</span> <a class="code" href="struct_nv_blast_asset_desc.html">NvBlastAssetDesc</a>* desc);
<a name="l00095"></a>00095
<a name="l00096"></a>00096
<a name="l00102"></a>00102 uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#60aa9c06e57f369ed24c185bb9769ddc">getUpperSupportChunkCount</a>() <span class="keyword">const</span>;
<a name="l00103"></a>00103
<a name="l00109"></a>00109 uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#0b0439d2efbbf360b98342720126deb2">getLowerSupportChunkCount</a>() <span class="keyword">const</span>;
<a name="l00110"></a>00110
<a name="l00116"></a>00116 uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#3b4976a2cdaf417d35fe5dffdd8b7374">getBondCount</a>() <span class="keyword">const</span>;
<a name="l00117"></a>00117
<a name="l00123"></a>00123 uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#8ad946e6215f8a15d0d6d4e79f21202b">getHierarchyCount</a>() <span class="keyword">const</span>;
<a name="l00124"></a>00124
<a name="l00132"></a>00132 uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#0db3cb362aad67c63e682c9d9fe8bbb2">getContiguousLowerSupportIndex</a>(uint32_t chunkIndex) <span class="keyword">const</span>;
<a name="l00133"></a>00133
<a name="l00134"></a>00134
<a name="l00135"></a>00135 <span class="comment">// Static functions</span>
<a name="l00136"></a>00136
<a name="l00156"></a>00156 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="class_nv_1_1_blast_1_1_asset.html#14908228fdf062c9b39b76ce027feedc">ensureExactSupportCoverage</a>(uint32_t& supportChunkCount, uint32_t& leafChunkCount, <span class="keywordtype">char</span>* chunkAnnotation, uint32_t chunkCount, <a class="code" href="struct_nv_blast_chunk_desc.html">NvBlastChunkDesc</a>* chunkDescs, <span class="keywordtype">bool</span> testOnly, <a class="code" href="_nv_blast_types_8h.html#fa1be237d696dc68e343189c19cc76e0">NvBlastLog</a> logFn);
<a name="l00157"></a>00157
<a name="l00174"></a>00174 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="class_nv_1_1_blast_1_1_asset.html#d8dea6287a5ffcab093b7b79b6266033">testForValidChunkOrder</a>(uint32_t chunkCount, <span class="keyword">const</span> <a class="code" href="struct_nv_blast_chunk_desc.html">NvBlastChunkDesc</a>* chunkDescs, <span class="keyword">const</span> <span class="keywordtype">char</span>* chunkAnnotation, <span class="keywordtype">void</span>* scratch);
<a name="l00175"></a>00175
<a name="l00176"></a>00176
<a name="l00178"></a>00178
<a name="l00182"></a><a class="code" href="class_nv_1_1_blast_1_1_asset.html#5922a3310ddab6fd4e9bedbf23c8dd1a">00182</a> <a class="code" href="struct_nv_blast_data_block.html">NvBlastDataBlock</a> <a class="code" href="class_nv_1_1_blast_1_1_asset.html#5922a3310ddab6fd4e9bedbf23c8dd1a">m_header</a>;
<a name="l00183"></a>00183
<a name="l00187"></a><a class="code" href="class_nv_1_1_blast_1_1_asset.html#68b3de340801db06e5e057434ca6137e">00187</a> <a class="code" href="struct_nv_blast_i_d.html">NvBlastID</a> <a class="code" href="class_nv_1_1_blast_1_1_asset.html#68b3de340801db06e5e057434ca6137e">m_ID</a>;
<a name="l00188"></a>00188
<a name="l00192"></a><a class="code" href="class_nv_1_1_blast_1_1_asset.html#2fca1fdbe87c49f04736dd6b6d176177">00192</a> uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#2fca1fdbe87c49f04736dd6b6d176177">m_chunkCount</a>;
<a name="l00193"></a>00193
<a name="l00197"></a><a class="code" href="class_nv_1_1_blast_1_1_asset.html#d07d72453b9db6a1387f7fbd934eb2fd">00197</a> <a class="code" href="struct_nv_1_1_blast_1_1_support_graph.html">SupportGraph</a> <a class="code" href="class_nv_1_1_blast_1_1_asset.html#d07d72453b9db6a1387f7fbd934eb2fd">m_graph</a>;
<a name="l00198"></a>00198
<a name="l00202"></a><a class="code" href="class_nv_1_1_blast_1_1_asset.html#97582e0fbb4b6c1b36ec613c850bc3b4">00202</a> uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#97582e0fbb4b6c1b36ec613c850bc3b4">m_leafChunkCount</a>;
<a name="l00203"></a>00203
<a name="l00207"></a><a class="code" href="class_nv_1_1_blast_1_1_asset.html#6cfa7f72e5f815e519550dd46dc087a9">00207</a> uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#6cfa7f72e5f815e519550dd46dc087a9">m_firstSubsupportChunkIndex</a>;
<a name="l00208"></a>00208
<a name="l00212"></a><a class="code" href="class_nv_1_1_blast_1_1_asset.html#afdb7951c9cc382b47f65c9bcd68e2a2">00212</a> uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#afdb7951c9cc382b47f65c9bcd68e2a2">m_bondCount</a>;
<a name="l00213"></a>00213
<a name="l00219"></a>00219 <a class="code" href="class_nv_1_1_blast_1_1_asset.html#93a386a2854b15b238c18ac220170924">NvBlastBlockArrayData</a>(<a class="code" href="struct_nv_blast_chunk.html">NvBlastChunk</a>, m_chunksOffset, getChunks, <a class="code" href="class_nv_1_1_blast_1_1_asset.html#2fca1fdbe87c49f04736dd6b6d176177">m_chunkCount</a>);
<a name="l00220"></a>00220
<a name="l00229"></a>00229 <a class="code" href="class_nv_1_1_blast_1_1_asset.html#93a386a2854b15b238c18ac220170924">NvBlastBlockArrayData</a>(<a class="code" href="struct_nv_blast_bond.html">NvBlastBond</a>, m_bondsOffset, getBonds, <a class="code" href="class_nv_1_1_blast_1_1_asset.html#afdb7951c9cc382b47f65c9bcd68e2a2">m_bondCount</a>);
<a name="l00230"></a>00230
<a name="l00237"></a>00237 <a class="code" href="class_nv_1_1_blast_1_1_asset.html#93a386a2854b15b238c18ac220170924">NvBlastBlockArrayData</a>(uint32_t, m_subtreeLeafChunkCountsOffset, getSubtreeLeafChunkCounts, <a class="code" href="class_nv_1_1_blast_1_1_asset.html#2fca1fdbe87c49f04736dd6b6d176177">m_chunkCount</a>);
<a name="l00238"></a>00238
<a name="l00244"></a>00244 <a class="code" href="class_nv_1_1_blast_1_1_asset.html#93a386a2854b15b238c18ac220170924">NvBlastBlockArrayData</a>(uint32_t, m_chunkToGraphNodeMapOffset, getChunkToGraphNodeMap, <a class="code" href="class_nv_1_1_blast_1_1_asset.html#2fca1fdbe87c49f04736dd6b6d176177">m_chunkCount</a>);
<a name="l00245"></a>00245
<a name="l00246"></a>00246
<a name="l00248"></a>00248
<a name="l00253"></a><a class="code" href="class_nv_1_1_blast_1_1_asset_1_1_depth_first_it.html">00253</a> <span class="keyword">class </span><a class="code" href="class_nv_1_1_blast_1_1_asset_1_1_depth_first_it.html">DepthFirstIt</a> : <span class="keyword">public</span> <a class="code" href="class_nv_1_1_blast_1_1_chunk_depth_first_it.html">ChunkDepthFirstIt</a>
<a name="l00254"></a>00254 {
<a name="l00255"></a>00255 <span class="keyword">public</span>:
<a name="l00257"></a><a class="code" href="class_nv_1_1_blast_1_1_asset_1_1_depth_first_it.html#8310079aa0f6e7b2ff0c5feaef88c0ca">00257</a> <a class="code" href="class_nv_1_1_blast_1_1_asset_1_1_depth_first_it.html">DepthFirstIt</a>(<span class="keyword">const</span> <a class="code" href="class_nv_1_1_blast_1_1_asset.html">Asset</a>& asset, uint32_t startChunkIndex, <span class="keywordtype">bool</span> upperSupportOnly = <span class="keyword">false</span>) :
<a name="l00258"></a>00258 <a class="code" href="class_nv_1_1_blast_1_1_chunk_depth_first_it.html">ChunkDepthFirstIt</a>(asset.getChunks(), startChunkIndex, upperSupportOnly ? asset.<a class="code" href="class_nv_1_1_blast_1_1_asset.html#60aa9c06e57f369ed24c185bb9769ddc">getUpperSupportChunkCount</a>() : asset.<a class="code" href="class_nv_1_1_blast_1_1_asset.html#2fca1fdbe87c49f04736dd6b6d176177">m_chunkCount</a>) {}
<a name="l00259"></a>00259 };
<a name="l00260"></a>00260 };
<a name="l00261"></a>00261
<a name="l00262"></a>00262
<a name="l00264"></a>00264
<a name="l00265"></a><a class="code" href="class_nv_1_1_blast_1_1_asset.html#60aa9c06e57f369ed24c185bb9769ddc">00265</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#60aa9c06e57f369ed24c185bb9769ddc">Asset::getUpperSupportChunkCount</a>()<span class="keyword"> const</span>
<a name="l00266"></a>00266 <span class="keyword"></span>{
<a name="l00267"></a>00267 <span class="keywordflow">return</span> <a class="code" href="class_nv_1_1_blast_1_1_asset.html#6cfa7f72e5f815e519550dd46dc087a9">m_firstSubsupportChunkIndex</a>;
<a name="l00268"></a>00268 }
<a name="l00269"></a>00269
<a name="l00270"></a>00270
<a name="l00271"></a><a class="code" href="class_nv_1_1_blast_1_1_asset.html#0b0439d2efbbf360b98342720126deb2">00271</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#0b0439d2efbbf360b98342720126deb2">Asset::getLowerSupportChunkCount</a>()<span class="keyword"> const</span>
<a name="l00272"></a>00272 <span class="keyword"></span>{
<a name="l00273"></a>00273 <span class="keywordflow">return</span> <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 class="code" href="class_nv_1_1_blast_1_1_asset.html#2fca1fdbe87c49f04736dd6b6d176177">m_chunkCount</a> - <a class="code" href="class_nv_1_1_blast_1_1_asset.html#6cfa7f72e5f815e519550dd46dc087a9">m_firstSubsupportChunkIndex</a>);
<a name="l00274"></a>00274 }
<a name="l00275"></a>00275
<a name="l00276"></a>00276
<a name="l00277"></a><a class="code" href="class_nv_1_1_blast_1_1_asset.html#3b4976a2cdaf417d35fe5dffdd8b7374">00277</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#3b4976a2cdaf417d35fe5dffdd8b7374">Asset::getBondCount</a>()<span class="keyword"> const</span>
<a name="l00278"></a>00278 <span class="keyword"></span>{
<a name="l00279"></a>00279 <a class="code" href="_nv_blast_assert_8h.html#2b179fca67cdb57b12b65e33fe3f6c93">NVBLAST_ASSERT</a>((<a class="code" href="class_nv_1_1_blast_1_1_asset.html#d07d72453b9db6a1387f7fbd934eb2fd">m_graph</a>.getAdjacencyPartition()[<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>] & 1) == 0); <span class="comment">// The bidirectional graph data should have an even number of edges</span>
<a name="l00280"></a>00280 <span class="keywordflow">return</span> <a class="code" href="class_nv_1_1_blast_1_1_asset.html#d07d72453b9db6a1387f7fbd934eb2fd">m_graph</a>.getAdjacencyPartition()[<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>] / 2; <span class="comment">// Directional bonds, divide by two</span>
<a name="l00281"></a>00281 }
<a name="l00282"></a>00282
<a name="l00283"></a>00283
<a name="l00284"></a><a class="code" href="class_nv_1_1_blast_1_1_asset.html#8ad946e6215f8a15d0d6d4e79f21202b">00284</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#8ad946e6215f8a15d0d6d4e79f21202b">Asset::getHierarchyCount</a>()<span class="keyword"> const</span>
<a name="l00285"></a>00285 <span class="keyword"></span>{
<a name="l00286"></a>00286 <span class="keyword">const</span> <a class="code" href="struct_nv_blast_chunk.html">NvBlastChunk</a>* chunks = getChunks();
<a name="l00287"></a>00287 <span class="keywordflow">for</span> (uint32_t i = 0; i < <a class="code" href="class_nv_1_1_blast_1_1_asset.html#2fca1fdbe87c49f04736dd6b6d176177">m_chunkCount</a>; ++i)
<a name="l00288"></a>00288 {
<a name="l00289"></a>00289 <span class="keywordflow">if</span> (!<a class="code" href="namespace_nv_1_1_blast.html#a5e952ab38e3501215eee523cb0a0d20">isInvalidIndex</a>(chunks[i].parentChunkIndex))
<a name="l00290"></a>00290 {
<a name="l00291"></a>00291 <span class="keywordflow">return</span> i;
<a name="l00292"></a>00292 }
<a name="l00293"></a>00293 }
<a name="l00294"></a>00294 <span class="keywordflow">return</span> m_chunkCount;
<a name="l00295"></a>00295 }
<a name="l00296"></a>00296
<a name="l00297"></a>00297
<a name="l00298"></a><a class="code" href="class_nv_1_1_blast_1_1_asset.html#0db3cb362aad67c63e682c9d9fe8bbb2">00298</a> <a class="code" href="group__foundation.html#g36a01a4a51968418a26b06da7e1ad5d0">NV_INLINE</a> uint32_t <a class="code" href="class_nv_1_1_blast_1_1_asset.html#0db3cb362aad67c63e682c9d9fe8bbb2">Asset::getContiguousLowerSupportIndex</a>(uint32_t chunkIndex)<span class="keyword"> const</span>
<a name="l00299"></a>00299 <span class="keyword"></span>{
<a name="l00300"></a>00300 <a class="code" href="_nv_blast_assert_8h.html#2b179fca67cdb57b12b65e33fe3f6c93">NVBLAST_ASSERT</a>(chunkIndex < <a class="code" href="class_nv_1_1_blast_1_1_asset.html#2fca1fdbe87c49f04736dd6b6d176177">m_chunkCount</a>);
<a name="l00301"></a>00301
<a name="l00302"></a>00302 <span class="keywordflow">return</span> chunkIndex < <a class="code" href="class_nv_1_1_blast_1_1_asset.html#6cfa7f72e5f815e519550dd46dc087a9">m_firstSubsupportChunkIndex</a> ? getChunkToGraphNodeMap()[chunkIndex] : (chunkIndex - <a class="code" href="class_nv_1_1_blast_1_1_asset.html#6cfa7f72e5f815e519550dd46dc087a9">m_firstSubsupportChunkIndex</a> + <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="l00303"></a>00303 }
<a name="l00304"></a>00304
<a name="l00305"></a>00305
<a name="l00306"></a>00306 <span class="comment">//JDM: Expose this so serialization layer can use it.</span>
<a name="l00307"></a>00307 <a class="code" href="_nv_blast_preprocessor_8h.html#e5c980f1b9848025a2fefa05a9d3bce1">NVBLAST_API</a> <a class="code" href="class_nv_1_1_blast_1_1_asset.html">Asset</a>* <a class="code" href="namespace_nv_1_1_blast.html#ae75b7f94762b03efcbbe11cb3752ef1">initializeAsset</a>(<span class="keywordtype">void</span>* mem, <a class="code" href="struct_nv_blast_i_d.html">NvBlastID</a> <span class="keywordtype">id</span>, uint32_t chunkCount, uint32_t graphNodeCount, uint32_t leafChunkCount, uint32_t firstSubsupportChunkIndex, uint32_t bondCount, <a class="code" href="_nv_blast_types_8h.html#fa1be237d696dc68e343189c19cc76e0">NvBlastLog</a> logFn);
<a name="l00308"></a>00308
<a name="l00309"></a>00309 } <span class="comment">// namespace Blast</span>
<a name="l00310"></a>00310 } <span class="comment">// namespace Nv</span>
<a name="l00311"></a>00311
<a name="l00312"></a>00312
<a name="l00313"></a>00313 <span class="preprocessor">#endif // ifndef NVBLASTASSET_H</span>
</pre></div></div>
<!-- start footer part -->
<div class="footer">
Copyright © 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>
|