Main Page   Class List   Class Members  

  • Main Page
  • User's Guide
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

sdk/lowlevel/include/NvBlastTypes.h

Go to the documentation of this file.
00001 // This code contains NVIDIA Confidential Information and is disclosed to you
00002 // under a form of NVIDIA software license agreement provided separately to you.
00003 //
00004 // Notice
00005 // NVIDIA Corporation and its licensors retain all intellectual property and
00006 // proprietary rights in and to this software and related documentation and
00007 // any modifications thereto. Any use, reproduction, disclosure, or
00008 // distribution of this software and related documentation without an express
00009 // license agreement from NVIDIA Corporation is strictly prohibited.
00010 //
00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
00015 //
00016 // Information and code furnished is believed to be accurate and reliable.
00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
00018 // information or for any infringement of patents or other rights of third parties that may
00019 // result from its use. No license is granted by implication or otherwise under any patent
00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
00021 // This code supersedes and replaces all information previously supplied.
00022 // NVIDIA Corporation products are not authorized for use as critical
00023 // components in life support devices or systems without express written approval of
00024 // NVIDIA Corporation.
00025 //
00026 // Copyright (c) 2016-2020 NVIDIA Corporation. All rights reserved.
00027 
00028 
00029 #ifndef NVBLASTTYPES_H
00030 #define NVBLASTTYPES_H
00031 
00032 
00033 #include "NvBlastPreprocessor.h"
00034 #include <stdint.h>
00035 
00036 
00038 //  NvBlast common types
00041 
00045 struct NvBlastMessage
00046 {
00047     enum Type
00048     {
00049         Error,      
00050         Warning,    
00051         Info,       
00052         Debug       
00053     };
00054 };
00055 
00056 
00063 typedef void(*NvBlastLog)(int type, const char* msg, const char* file, int line);
00064 
00065 
00069 struct NvBlastID
00070 {
00071     char data[16];
00072 };
00073 
00074 
00085 struct NvBlastTimers
00086 {
00087     int64_t  material;      
00088     int64_t  fracture;      
00089     int64_t  island;        
00090     int64_t  partition;     
00091     int64_t  visibility;    
00092 };
00093 
00094 
00098 struct NvBlastDataBlock
00099 {
00103     enum Type
00104     {
00105         AssetDataBlock,
00106         FamilyDataBlock,
00107 
00108         Count
00109     };
00110 
00111 
00115     uint32_t    dataType;
00116 
00121     uint32_t    formatVersion;
00122 
00128     uint32_t    size;
00129 
00133     uint32_t    reserved;
00134 };
00135 
00137 
00138 
00140 //  NvBlastAsset related types
00143 
00152 struct NvBlastChunk
00153 {
00157     float       centroid[3];
00158 
00162     float       volume;
00163 
00167     uint32_t    parentChunkIndex;
00168 
00172     uint32_t    firstChildIndex;
00173 
00177     uint32_t    childIndexStop;
00178 
00182     uint32_t    userData;
00183 };
00184 
00185 
00189 struct NvBlastBond
00190 {
00194     float       normal[3];
00195 
00199     float       area;
00200 
00204     float       centroid[3];
00205 
00209     uint32_t    userData;
00210 };
00211 
00212 
00244 struct NvBlastSupportGraph
00245 {
00249     uint32_t    nodeCount;
00250 
00254     uint32_t*   chunkIndices;
00255 
00263     uint32_t*   adjacencyPartition;
00264 
00268     uint32_t*   adjacentNodeIndices;
00269 
00273     uint32_t*   adjacentBondIndices;
00274 };
00275 
00276 
00286 struct NvBlastAsset {};
00287 
00288 
00292 struct NvBlastChunkDesc
00293 {
00294     enum Flags
00295     {
00296         NoFlags = 0,
00297 
00299         SupportFlag = (1 << 0)
00300     };
00301 
00303     float       centroid[3];
00304 
00306     float       volume;
00307 
00309     uint32_t    parentChunkIndex;
00310 
00312     uint32_t    flags;
00313 
00315     uint32_t    userData;
00316 };
00317 
00318 
00322 struct NvBlastBondDesc
00323 {
00325     NvBlastBond bond;
00326 
00333     uint32_t    chunkIndices[2];
00334 };
00335 
00336 
00345 struct NvBlastAssetDesc
00346 {
00348     uint32_t                chunkCount;
00349 
00351     const NvBlastChunkDesc* chunkDescs;
00352 
00354     uint32_t                bondCount;
00355 
00357     const NvBlastBondDesc*  bondDescs;
00358 };
00359 
00361 
00362 
00364 //  NvBlastActor related types
00367 
00376 struct NvBlastFamily {};
00377 
00378 
00387 struct NvBlastActor {};
00388 
00389 
00395 struct NvBlastActorDesc
00396 {
00400     float           uniformInitialBondHealth;
00401 
00406     const float*    initialBondHealths;
00407 
00411     float           uniformInitialLowerSupportChunkHealth;
00412 
00421     const float*    initialSupportChunkHealths;
00422 };
00423 
00425 
00426 
00428 //  Types used for damage and fracturing
00431 
00432 
00439 struct NvBlastChunkFractureData
00440 {
00441     uint32_t    userdata;   
00442     uint32_t    chunkIndex; 
00443     float       health;     
00444 };
00445 
00446 
00453 struct NvBlastBondFractureData
00454 {
00455     uint32_t    userdata;   
00456     uint32_t    nodeIndex0; 
00457     uint32_t    nodeIndex1; 
00458     float       health;     
00459 };
00460 
00461 
00468 struct NvBlastFractureBuffers
00469 {
00470     uint32_t                    bondFractureCount;      
00471     uint32_t                    chunkFractureCount;     
00472     NvBlastBondFractureData*    bondFractures;          
00473     NvBlastChunkFractureData*   chunkFractures;         
00474 };
00475 
00476 
00481 struct NvBlastActorSplitEvent
00482 {
00483     NvBlastActor*   deletedActor;   
00484     NvBlastActor**  newActors;      
00485 };
00486 
00487 
00491 struct NvBlastGraphShaderActor
00492 {
00493     uint32_t            actorIndex;             
00494     uint32_t            graphNodeCount;         
00495     uint32_t            assetNodeCount;         
00496     uint32_t            firstGraphNodeIndex;    
00497     const uint32_t*     graphNodeIndexLinks;    
00498     const uint32_t*     chunkIndices;           
00499     const uint32_t*     adjacencyPartition;     
00500     const uint32_t*     adjacentNodeIndices;    
00501     const uint32_t*     adjacentBondIndices;    
00502     const NvBlastBond*  assetBonds;             
00503     const NvBlastChunk* assetChunks;            
00504     const float*        familyBondHealths;      
00505     const float*        supportChunkHealths;    
00506     const uint32_t*     nodeActorIndices;       
00507 };
00508 
00509 
00513 struct NvBlastSubgraphShaderActor
00514 {
00515     uint32_t            chunkIndex;     
00516     const NvBlastChunk* assetChunks;    
00517 };
00518 
00519 
00545 typedef void(*NvBlastGraphShaderFunction)(NvBlastFractureBuffers* commandBuffers, const NvBlastGraphShaderActor* actor, const void* programParams);
00546 
00547 
00573 typedef void(*NvBlastSubgraphShaderFunction)(NvBlastFractureBuffers* commandBuffers, const NvBlastSubgraphShaderActor* actor, const void* programParams);
00574 
00575 
00584 struct NvBlastDamageProgram
00585 {
00586     NvBlastGraphShaderFunction      graphShaderFunction;
00587     NvBlastSubgraphShaderFunction   subgraphShaderFunction;
00588 };
00589 
00590 
00592 
00593 
00594 #endif // ifndef NVBLASTTYPES_H
Copyright © 2015-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com