Main Page Class List Class Members

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
45 struct NvBlastMessage
46 {
47 enum Type
48 {
49 Error,
50 Warning,
51 Info,
52 Debug
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
85 struct NvBlastTimers
86 {
87 int64_t material;
88 int64_t fracture;
89 int64_t island;
90 int64_t partition;
91 int64_t visibility;
92 };
93
94
98 struct NvBlastDataBlock
99 {
103 enum Type
104 {
105 AssetDataBlock,
106 FamilyDataBlock,
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
152 struct NvBlastChunk
153 {
157 float centroid[3];
158
162 float volume;
163
167 uint32_t parentChunkIndex;
168
172 uint32_t firstChildIndex;
173
177 uint32_t childIndexStop;
178
182 uint32_t userData;
183 };
184
185
189 struct NvBlastBond
190 {
194 float normal[3];
195
199 float area;
200
204 float centroid[3];
205
209 uint32_t userData;
210 };
211
212
244 struct NvBlastSupportGraph
245 {
249 uint32_t nodeCount;
250
254 uint32_t* chunkIndices;
255
263 uint32_t* adjacencyPartition;
264
268 uint32_t* adjacentNodeIndices;
269
273 uint32_t* adjacentBondIndices;
274 };
275
276
286 struct NvBlastAsset {};
287
288
292 struct NvBlastChunkDesc
293 {
294 enum Flags
295 {
296 NoFlags = 0,
297
299 SupportFlag = (1 << 0)
300 };
301
303 float centroid[3];
304
306 float volume;
307
309 uint32_t parentChunkIndex;
310
312 uint32_t flags;
313
315 uint32_t userData;
316 };
317
318
322 struct NvBlastBondDesc
323 {
325 NvBlastBond bond;
326
333 uint32_t chunkIndices[2];
334 };
335
336
345 struct NvBlastAssetDesc
346 {
348 uint32_t chunkCount;
349
351 const NvBlastChunkDesc* chunkDescs;
352
354 uint32_t bondCount;
355
357 const NvBlastBondDesc* bondDescs;
358 };
359
361
362
364 // NvBlastActor related types
367
376 struct NvBlastFamily {};
377
378
387 struct NvBlastActor {};
388
389
395 struct NvBlastActorDesc
396 {
400 float uniformInitialBondHealth;
401
406 const float* initialBondHealths;
407
411 float uniformInitialLowerSupportChunkHealth;
412
421 const float* initialSupportChunkHealths;
422 };
423
425
426
428 // Types used for damage and fracturing
431
432
439 struct NvBlastChunkFractureData
440 {
441 uint32_t userdata;
442 uint32_t chunkIndex;
443 float health;
444 };
445
446
453 struct NvBlastBondFractureData
454 {
455 uint32_t userdata;
456 uint32_t nodeIndex0;
457 uint32_t nodeIndex1;
458 float health;
459 };
460
461
468 struct NvBlastFractureBuffers
469 {
470 uint32_t bondFractureCount;
471 uint32_t chunkFractureCount;
472 NvBlastBondFractureData* bondFractures;
473 NvBlastChunkFractureData* chunkFractures;
474 };
475
476
481 struct NvBlastActorSplitEvent
482 {
483 NvBlastActor* deletedActor;
484 NvBlastActor** newActors;
485 };
486
487
491 struct NvBlastGraphShaderActor
492 {
493 uint32_t actorIndex;
494 uint32_t graphNodeCount;
495 uint32_t assetNodeCount;
496 uint32_t firstGraphNodeIndex;
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;
502 const NvBlastBond* assetBonds;
503 const NvBlastChunk* assetChunks;
504 const float* familyBondHealths;
505 const float* supportChunkHealths;
506 const uint32_t* nodeActorIndices;
507 };
508
509
513 struct NvBlastSubgraphShaderActor
514 {
515 uint32_t chunkIndex;
516 const NvBlastChunk* assetChunks;
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
584 struct NvBlastDamageProgram
585 {
586 NvBlastGraphShaderFunction graphShaderFunction;
587 NvBlastSubgraphShaderFunction subgraphShaderFunction;
588 };
589
590
592
593
594 #endif // ifndef NVBLASTTYPES_H
NvBlastBond::userData
uint32_t userData
Definition: NvBlastTypes.h:209
NvBlastMessage::Error
Error messages.
Definition: NvBlastTypes.h:49
NvBlastSupportGraph
Definition: NvBlastTypes.h:244
NvBlastActorDesc
Definition: NvBlastTypes.h:395
NvBlastTimers::fracture
int64_t fracture
Time spent applying damage.
Definition: NvBlastTypes.h:88
NvBlastGraphShaderActor::supportChunkHealths
const float * supportChunkHealths
Actual chunk health values for dead chunk detection.
Definition: NvBlastTypes.h:505
NvBlastDataBlock::Type
Type
Definition: NvBlastTypes.h:103
NvBlastGraphShaderActor
Definition: NvBlastTypes.h:491
NvBlastBond
Definition: NvBlastTypes.h:189
NvBlastActorDesc::initialSupportChunkHealths
const float * initialSupportChunkHealths
Definition: NvBlastTypes.h:421
NvBlastGraphShaderActor::adjacentBondIndices
const uint32_t * adjacentBondIndices
See NvBlastSupportGraph::adjacentBondIndices.
Definition: NvBlastTypes.h:501
NvBlastMessage
Definition: NvBlastTypes.h:45
NvBlastBondFractureData::nodeIndex1
uint32_t nodeIndex1
pair graph node index of bond
Definition: NvBlastTypes.h:457
NvBlastSupportGraph::adjacentBondIndices
uint32_t * adjacentBondIndices
Definition: NvBlastTypes.h:273
NvBlastGraphShaderActor::assetChunks
const NvBlastChunk * assetChunks
NvBlastChunks geometry in the NvBlastAsset.
Definition: NvBlastTypes.h:503
NvBlastDamageProgram::graphShaderFunction
NvBlastGraphShaderFunction graphShaderFunction
Definition: NvBlastTypes.h:586
NvBlastFractureBuffers::chunkFractureCount
uint32_t chunkFractureCount
available elements in chunkFractures
Definition: NvBlastTypes.h:471
NvBlastGraphShaderActor::adjacencyPartition
const uint32_t * adjacencyPartition
See NvBlastSupportGraph::adjacencyPartition.
Definition: NvBlastTypes.h:499
NvBlastDataBlock::AssetDataBlock
Definition: NvBlastTypes.h:105
NvBlastActorDesc::uniformInitialLowerSupportChunkHealth
float uniformInitialLowerSupportChunkHealth
Definition: NvBlastTypes.h:411
NvBlastTimers::partition
int64_t partition
Time spent partitioning the graph.
Definition: NvBlastTypes.h:90
NvBlastAssetDesc
Definition: NvBlastTypes.h:345
NvBlastBondFractureData
Definition: NvBlastTypes.h:453
NvBlastAssetDesc::bondDescs
const NvBlastBondDesc * bondDescs
Definition: NvBlastTypes.h:357
NvBlastBondDesc
Definition: NvBlastTypes.h:322
NvBlastChunkFractureData::chunkIndex
uint32_t chunkIndex
asset chunk index
Definition: NvBlastTypes.h:442
NvBlastMessage::Warning
Warning messages.
Definition: NvBlastTypes.h:50
NvBlastDataBlock::dataType
uint32_t dataType
Definition: NvBlastTypes.h:115
NvBlastGraphShaderActor::familyBondHealths
const float * familyBondHealths
Actual bond health values for broken bond detection.
Definition: NvBlastTypes.h:504
NvBlastBondFractureData::health
float health
health value (damage or remains)
Definition: NvBlastTypes.h:458
NvBlastTimers::material
int64_t material
Time spent in material function.
Definition: NvBlastTypes.h:87
NvBlastLog
void(* NvBlastLog)(int type, const char *msg, const char *file, int line)
Definition: NvBlastTypes.h:63
NvBlastMessage::Info
Information messages.
Definition: NvBlastTypes.h:51
NvBlastChunkDesc::volume
float volume
Definition: NvBlastTypes.h:306
NvBlastDataBlock::size
uint32_t size
Definition: NvBlastTypes.h:128
NvBlastFractureBuffers::chunkFractures
NvBlastChunkFractureData * chunkFractures
memory to be filled by fracture functions
Definition: NvBlastTypes.h:473
NvBlastBondFractureData::nodeIndex0
uint32_t nodeIndex0
graph node index of bond
Definition: NvBlastTypes.h:456
NvBlastChunkDesc::userData
uint32_t userData
Definition: NvBlastTypes.h:315
NvBlastChunkDesc::Flags
Flags
Definition: NvBlastTypes.h:294
NvBlastGraphShaderActor::adjacentNodeIndices
const uint32_t * adjacentNodeIndices
See NvBlastSupportGraph::adjacentNodeIndices.
Definition: NvBlastTypes.h:500
NvBlastActorDesc::uniformInitialBondHealth
float uniformInitialBondHealth
Definition: NvBlastTypes.h:400
NvBlastTimers
Definition: NvBlastTypes.h:85
NvBlastGraphShaderActor::graphNodeCount
uint32_t graphNodeCount
Actor&#39;s graph node count.
Definition: NvBlastTypes.h:494
NvBlastActorSplitEvent::newActors
NvBlastActor ** newActors
list of created actors
Definition: NvBlastTypes.h:484
NvBlastMessage::Type
Type
Definition: NvBlastTypes.h:47
NvBlastDamageProgram
Definition: NvBlastTypes.h:584
NvBlastDataBlock
Definition: NvBlastTypes.h:98
NvBlastFractureBuffers::bondFractures
NvBlastBondFractureData * bondFractures
memory to be filled by fracture functions
Definition: NvBlastTypes.h:472
NvBlastChunkDesc::parentChunkIndex
uint32_t parentChunkIndex
Definition: NvBlastTypes.h:309
NvBlastGraphShaderActor::graphNodeIndexLinks
const uint32_t * graphNodeIndexLinks
Linked index list of connected nodes. Traversable with nextIndex = graphNodeIndexLinks[currentIndex]...
Definition: NvBlastTypes.h:497
NvBlastChunkDesc::flags
uint32_t flags
Definition: NvBlastTypes.h:312
NvBlastGraphShaderActor::assetBonds
const NvBlastBond * assetBonds
NvBlastBonds geometry in the NvBlastAsset.
Definition: NvBlastTypes.h:502
NvBlastGraphShaderActor::actorIndex
uint32_t actorIndex
Actor&#39;s index.
Definition: NvBlastTypes.h:493
NvBlastDataBlock::reserved
uint32_t reserved
Definition: NvBlastTypes.h:133
NvBlastActorSplitEvent
Definition: NvBlastTypes.h:481
NvBlastChunk::childIndexStop
uint32_t childIndexStop
Definition: NvBlastTypes.h:177
NvBlastChunk::userData
uint32_t userData
Definition: NvBlastTypes.h:182
NvBlastSupportGraph::adjacencyPartition
uint32_t * adjacencyPartition
Definition: NvBlastTypes.h:263
NvBlastFractureBuffers::bondFractureCount
uint32_t bondFractureCount
available elements in bondFractures
Definition: NvBlastTypes.h:470
NvBlastDamageProgram::subgraphShaderFunction
NvBlastSubgraphShaderFunction subgraphShaderFunction
Definition: NvBlastTypes.h:587
NvBlastAssetDesc::chunkDescs
const NvBlastChunkDesc * chunkDescs
Definition: NvBlastTypes.h:351
NvBlastGraphShaderActor::nodeActorIndices
const uint32_t * nodeActorIndices
Family&#39;s map from node index to actor index.
Definition: NvBlastTypes.h:506
NvBlastTimers::island
int64_t island
Time spent discovering islands.
Definition: NvBlastTypes.h:89
NvBlastDataBlock::formatVersion
uint32_t formatVersion
Definition: NvBlastTypes.h:121
NvBlastChunk::volume
float volume
Definition: NvBlastTypes.h:162
NvBlastTimers::visibility
int64_t visibility
Time spent updating visibility.
Definition: NvBlastTypes.h:91
NvBlastID
Definition: NvBlastTypes.h:69
NvBlastSubgraphShaderActor::chunkIndex
uint32_t chunkIndex
Index of chunk represented by this actor.
Definition: NvBlastTypes.h:515
NvBlastSupportGraph::chunkIndices
uint32_t * chunkIndices
Definition: NvBlastTypes.h:254
NvBlastChunkDesc
Definition: NvBlastTypes.h:292
NvBlastGraphShaderActor::assetNodeCount
uint32_t assetNodeCount
Asset node count.
Definition: NvBlastTypes.h:495
NvBlastChunk
Definition: NvBlastTypes.h:152
NvBlastChunkFractureData
Definition: NvBlastTypes.h:439
NvBlastSupportGraph::nodeCount
uint32_t nodeCount
Definition: NvBlastTypes.h:249
NvBlastBond::area
float area
Definition: NvBlastTypes.h:199
NvBlastActorSplitEvent::deletedActor
NvBlastActor * deletedActor
deleted actor or nullptr if actor has not changed
Definition: NvBlastTypes.h:483
NvBlastAssetDesc::chunkCount
uint32_t chunkCount
Definition: NvBlastTypes.h:348
NvBlastAsset
Definition: NvBlastTypes.h:286
NvBlastDataBlock::FamilyDataBlock
Definition: NvBlastTypes.h:106
NvBlastFractureBuffers
Definition: NvBlastTypes.h:468
NvBlastMessage::Debug
Used only in debug version of dll.
Definition: NvBlastTypes.h:52
NvBlastSupportGraph::adjacentNodeIndices
uint32_t * adjacentNodeIndices
Definition: NvBlastTypes.h:268
NvBlastSubgraphShaderActor::assetChunks
const NvBlastChunk * assetChunks
NvBlastChunks geometry in the NvBlastAsset.
Definition: NvBlastTypes.h:516
NvBlastChunk::parentChunkIndex
uint32_t parentChunkIndex
Definition: NvBlastTypes.h:167
NvBlastGraphShaderFunction
void(* NvBlastGraphShaderFunction)(NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *programParams)
Definition: NvBlastTypes.h:545
NvBlastSubgraphShaderFunction
void(* NvBlastSubgraphShaderFunction)(NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *programParams)
Definition: NvBlastTypes.h:573
NvBlastSubgraphShaderActor
Definition: NvBlastTypes.h:513
NvBlastGraphShaderActor::firstGraphNodeIndex
uint32_t firstGraphNodeIndex
Entry index for graphNodeIndexLinks.
Definition: NvBlastTypes.h:496
NvBlastChunkFractureData::userdata
uint32_t userdata
chunk&#39;s user data
Definition: NvBlastTypes.h:441
NvBlastBondDesc::bond
NvBlastBond bond
Definition: NvBlastTypes.h:325
NvBlastGraphShaderActor::chunkIndices
const uint32_t * chunkIndices
Graph&#39;s map from node index to support chunk index.
Definition: NvBlastTypes.h:498
NvBlastActorDesc::initialBondHealths
const float * initialBondHealths
Definition: NvBlastTypes.h:406
NvBlastPreprocessor.h
NvBlastAssetDesc::bondCount
uint32_t bondCount
Definition: NvBlastTypes.h:354
NvBlastChunkFractureData::health
float health
health value (damage or remains)
Definition: NvBlastTypes.h:443
NvBlastActor
Definition: NvBlastTypes.h:387
NvBlastFamily
Definition: NvBlastTypes.h:376
NvBlastChunk::firstChildIndex
uint32_t firstChildIndex
Definition: NvBlastTypes.h:172
NvBlastBondFractureData::userdata
uint32_t userdata
bond&#39;s user data
Definition: NvBlastTypes.h:455