NvBlastTypes.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2016-2020 NVIDIA Corporation. All rights reserved.
27 
28 
29 #ifndef NVBLASTTYPES_H
30 #define NVBLASTTYPES_H
31 
32 
33 #include "NvBlastPreprocessor.h"
34 #include <stdint.h>
35 
36 
38 // NvBlast common types
41 
46 {
47  enum Type
48  {
51  Info,
53  };
54 };
55 
56 
63 typedef void(*NvBlastLog)(int type, const char* msg, const char* file, int line);
64 
65 
69 struct NvBlastID
70 {
71  char data[16];
72 };
73 
74 
86 {
87  int64_t material;
88  int64_t fracture;
89  int64_t island;
90  int64_t partition;
91  int64_t visibility;
92 };
93 
94 
99 {
103  enum Type
104  {
107 
108  Count
109  };
110 
111 
115  uint32_t dataType;
116 
121  uint32_t formatVersion;
122 
128  uint32_t size;
129 
133  uint32_t reserved;
134 };
135 
137 
138 
140 // NvBlastAsset related types
143 
153 {
157  float centroid[3];
158 
162  float volume;
163 
168 
172  uint32_t firstChildIndex;
173 
177  uint32_t childIndexStop;
178 
182  uint32_t userData;
183 };
184 
185 
190 {
194  float normal[3];
195 
199  float area;
200 
204  float centroid[3];
205 
209  uint32_t userData;
210 };
211 
212 
245 {
249  uint32_t nodeCount;
250 
254  uint32_t* chunkIndices;
255 
264 
269 
274 };
275 
276 
286 struct NvBlastAsset {};
287 
288 
293 {
294  enum Flags
295  {
296  NoFlags = 0,
297 
299  SupportFlag = (1 << 0)
300  };
301 
303  float centroid[3];
304 
306  float volume;
307 
310 
312  uint32_t flags;
313 
315  uint32_t userData;
316 };
317 
318 
323 {
326 
333  uint32_t chunkIndices[2];
334 };
335 
336 
346 {
348  uint32_t chunkCount;
349 
352 
354  uint32_t bondCount;
355 
358 };
359 
361 
362 
364 // NvBlastActor related types
367 
376 struct NvBlastFamily {};
377 
378 
387 struct NvBlastActor {};
388 
389 
396 {
401 
406  const float* initialBondHealths;
407 
412 
422 };
423 
425 
426 
428 // Types used for damage and fracturing
431 
432 
440 {
441  uint32_t userdata;
442  uint32_t chunkIndex;
443  float health;
444 };
445 
446 
454 {
455  uint32_t userdata;
456  uint32_t nodeIndex0;
457  uint32_t nodeIndex1;
458  float health;
459 };
460 
461 
469 {
470  uint32_t bondFractureCount;
474 };
475 
476 
482 {
485 };
486 
487 
492 {
493  uint32_t actorIndex;
494  uint32_t graphNodeCount;
495  uint32_t assetNodeCount;
497  const uint32_t* graphNodeIndexLinks;
498  const uint32_t* chunkIndices;
499  const uint32_t* adjacencyPartition;
500  const uint32_t* adjacentNodeIndices;
501  const uint32_t* adjacentBondIndices;
504  const float* familyBondHealths;
505  const float* supportChunkHealths;
506  const uint32_t* nodeActorIndices;
507 };
508 
509 
514 {
515  uint32_t chunkIndex;
517 };
518 
519 
545 typedef void(*NvBlastGraphShaderFunction)(NvBlastFractureBuffers* commandBuffers, const NvBlastGraphShaderActor* actor, const void* programParams);
546 
547 
573 typedef void(*NvBlastSubgraphShaderFunction)(NvBlastFractureBuffers* commandBuffers, const NvBlastSubgraphShaderActor* actor, const void* programParams);
574 
575 
585 {
588 };
589 
590 
592 
593 
594 #endif // ifndef NVBLASTTYPES_H
uint32_t userData
Definition: NvBlastTypes.h:209
Error messages.
Definition: NvBlastTypes.h:49
Definition: NvBlastTypes.h:244
Definition: NvBlastTypes.h:395
int64_t fracture
Time spent applying damage.
Definition: NvBlastTypes.h:88
const float * supportChunkHealths
Actual chunk health values for dead chunk detection.
Definition: NvBlastTypes.h:505
Type
Definition: NvBlastTypes.h:103
Definition: NvBlastTypes.h:491
Definition: NvBlastTypes.h:189
const float * initialSupportChunkHealths
Definition: NvBlastTypes.h:421
const uint32_t * adjacentBondIndices
See NvBlastSupportGraph::adjacentBondIndices.
Definition: NvBlastTypes.h:501
Definition: NvBlastTypes.h:45
uint32_t nodeIndex1
pair graph node index of bond
Definition: NvBlastTypes.h:457
NV_INLINE float normal(const float a[3], float r[3])
Definition: NvBlastMath.h:93
uint32_t * adjacentBondIndices
Definition: NvBlastTypes.h:273
const NvBlastChunk * assetChunks
NvBlastChunks geometry in the NvBlastAsset.
Definition: NvBlastTypes.h:503
NvBlastGraphShaderFunction graphShaderFunction
Definition: NvBlastTypes.h:586
uint32_t chunkFractureCount
available elements in chunkFractures
Definition: NvBlastTypes.h:471
const uint32_t * adjacencyPartition
See NvBlastSupportGraph::adjacencyPartition.
Definition: NvBlastTypes.h:499
Definition: NvBlastTypes.h:105
float uniformInitialLowerSupportChunkHealth
Definition: NvBlastTypes.h:411
int64_t partition
Time spent partitioning the graph.
Definition: NvBlastTypes.h:90
Definition: NvBlastTypes.h:345
Definition: NvBlastTypes.h:453
const NvBlastBondDesc * bondDescs
Definition: NvBlastTypes.h:357
Definition: NvBlastTypes.h:322
uint32_t chunkIndex
asset chunk index
Definition: NvBlastTypes.h:442
Warning messages.
Definition: NvBlastTypes.h:50
uint32_t dataType
Definition: NvBlastTypes.h:115
const float * familyBondHealths
Actual bond health values for broken bond detection.
Definition: NvBlastTypes.h:504
float health
health value (damage or remains)
Definition: NvBlastTypes.h:458
int64_t material
Time spent in material function.
Definition: NvBlastTypes.h:87
void(* NvBlastLog)(int type, const char *msg, const char *file, int line)
Definition: NvBlastTypes.h:63
Information messages.
Definition: NvBlastTypes.h:51
float volume
Definition: NvBlastTypes.h:306
uint32_t size
Definition: NvBlastTypes.h:128
NvBlastChunkFractureData * chunkFractures
memory to be filled by fracture functions
Definition: NvBlastTypes.h:473
uint32_t nodeIndex0
graph node index of bond
Definition: NvBlastTypes.h:456
uint32_t userData
Definition: NvBlastTypes.h:315
Flags
Definition: NvBlastTypes.h:294
const uint32_t * adjacentNodeIndices
See NvBlastSupportGraph::adjacentNodeIndices.
Definition: NvBlastTypes.h:500
float uniformInitialBondHealth
Definition: NvBlastTypes.h:400
Definition: NvBlastTypes.h:85
uint32_t graphNodeCount
Actor&#39;s graph node count.
Definition: NvBlastTypes.h:494
NvBlastActor ** newActors
list of created actors
Definition: NvBlastTypes.h:484
Type
Definition: NvBlastTypes.h:47
Definition: NvBlastTypes.h:584
Definition: NvBlastTypes.h:98
NvBlastBondFractureData * bondFractures
memory to be filled by fracture functions
Definition: NvBlastTypes.h:472
uint32_t parentChunkIndex
Definition: NvBlastTypes.h:309
const uint32_t * graphNodeIndexLinks
Linked index list of connected nodes. Traversable with nextIndex = graphNodeIndexLinks[currentIndex]...
Definition: NvBlastTypes.h:497
uint32_t flags
Definition: NvBlastTypes.h:312
const NvBlastBond * assetBonds
NvBlastBonds geometry in the NvBlastAsset.
Definition: NvBlastTypes.h:502
uint32_t actorIndex
Actor&#39;s index.
Definition: NvBlastTypes.h:493
uint32_t reserved
Definition: NvBlastTypes.h:133
Definition: NvBlastTypes.h:481
uint32_t childIndexStop
Definition: NvBlastTypes.h:177
uint32_t userData
Definition: NvBlastTypes.h:182
uint32_t * adjacencyPartition
Definition: NvBlastTypes.h:263
uint32_t bondFractureCount
available elements in bondFractures
Definition: NvBlastTypes.h:470
NvBlastSubgraphShaderFunction subgraphShaderFunction
Definition: NvBlastTypes.h:587
const NvBlastChunkDesc * chunkDescs
Definition: NvBlastTypes.h:351
const uint32_t * nodeActorIndices
Family&#39;s map from node index to actor index.
Definition: NvBlastTypes.h:506
int64_t island
Time spent discovering islands.
Definition: NvBlastTypes.h:89
uint32_t formatVersion
Definition: NvBlastTypes.h:121
float volume
Definition: NvBlastTypes.h:162
int64_t visibility
Time spent updating visibility.
Definition: NvBlastTypes.h:91
Definition: NvBlastTypes.h:69
uint32_t chunkIndex
Index of chunk represented by this actor.
Definition: NvBlastTypes.h:515
uint32_t * chunkIndices
Definition: NvBlastTypes.h:254
Definition: NvBlastTypes.h:292
uint32_t assetNodeCount
Asset node count.
Definition: NvBlastTypes.h:495
Definition: NvBlastTypes.h:152
Definition: NvBlastTypes.h:439
uint32_t nodeCount
Definition: NvBlastTypes.h:249
float area
Definition: NvBlastTypes.h:199
NvBlastActor * deletedActor
deleted actor or nullptr if actor has not changed
Definition: NvBlastTypes.h:483
uint32_t chunkCount
Definition: NvBlastTypes.h:348
Definition: NvBlastTypes.h:286
Definition: NvBlastTypes.h:106
Definition: NvBlastTypes.h:468
Used only in debug version of dll.
Definition: NvBlastTypes.h:52
uint32_t * adjacentNodeIndices
Definition: NvBlastTypes.h:268
const NvBlastChunk * assetChunks
NvBlastChunks geometry in the NvBlastAsset.
Definition: NvBlastTypes.h:516
uint32_t parentChunkIndex
Definition: NvBlastTypes.h:167
void(* NvBlastGraphShaderFunction)(NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *programParams)
Definition: NvBlastTypes.h:545
void(* NvBlastSubgraphShaderFunction)(NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *programParams)
Definition: NvBlastTypes.h:573
Definition: NvBlastTypes.h:513
uint32_t firstGraphNodeIndex
Entry index for graphNodeIndexLinks.
Definition: NvBlastTypes.h:496
uint32_t userdata
chunk&#39;s user data
Definition: NvBlastTypes.h:441
NvBlastBond bond
Definition: NvBlastTypes.h:325
const uint32_t * chunkIndices
Graph&#39;s map from node index to support chunk index.
Definition: NvBlastTypes.h:498
const float * initialBondHealths
Definition: NvBlastTypes.h:406
uint32_t bondCount
Definition: NvBlastTypes.h:354
float health
health value (damage or remains)
Definition: NvBlastTypes.h:443
Definition: NvBlastTypes.h:387
Definition: NvBlastTypes.h:376
uint32_t firstChildIndex
Definition: NvBlastTypes.h:172
uint32_t userdata
bond&#39;s user data
Definition: NvBlastTypes.h:455