Main Page   Class List   Class Members  

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

sdk/toolkit/include/NvBlastTkFramework.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 NVBLASTTKFRAMEWORK_H
00030 #define NVBLASTTKFRAMEWORK_H
00031 
00032 
00033 #include "NvBlastTkType.h"
00034 #include "NvBlastTkEvent.h"
00035 
00036 #include "NvBlastPreprocessor.h"
00037 #include "NvBlastTypes.h"
00038 
00039 #include "PxVec3.h"
00040 
00041 
00042 // Forward declarations
00043 namespace physx
00044 {
00045 class PxTransform;
00046 }
00047 
00048 
00049 namespace Nv
00050 {
00051 namespace Blast
00052 {
00053 
00054 // Forward declarations
00055 class TkObject;
00056 class TkEventDispatcher;
00057 class TkAsset;
00058 struct TkGroupDesc;
00059 class TkGroup;
00060 class TkActor;
00061 class TkJoint;
00062 class TkIdentifiable;
00063 struct TkAssetJointDesc;
00064 
00065 
00066 
00074 struct TkAssetDesc : public NvBlastAssetDesc
00075 {
00079     enum BondFlags
00080     {
00081         NoFlags = 0,
00082 
00090         BondJointed = (1 << 0)
00091     };
00092 
00097     const uint8_t*  bondFlags;
00098 
00100     TkAssetDesc() : bondFlags(nullptr)
00101     {
00102         chunkCount = bondCount = 0;
00103         chunkDescs = nullptr;
00104         bondDescs = nullptr;
00105     }
00106 };
00107 
00108 
00114 struct TkActorDesc : public NvBlastActorDesc
00115 {
00116     const TkAsset* asset;   
00117 
00119     TkActorDesc(const TkAsset* inAsset = nullptr) : asset(inAsset)
00120     {
00121         uniformInitialBondHealth = uniformInitialLowerSupportChunkHealth = 1.0f;
00122         initialBondHealths = initialSupportChunkHealths = nullptr;
00123     }
00124 };
00125 
00126 
00130 struct TkJointDesc
00131 {
00132     TkFamily*       families[2];        
00133     uint32_t        chunkIndices[2];    
00134     physx::PxVec3   attachPositions[2]; 
00135 };
00136 
00137 
00141 struct TkTypeIndex
00142 {
00143     enum Enum
00144     {
00145         Asset = 0,  
00146         Family,     
00147         Group,      
00148 
00149         TypeCount
00150     };
00151 };
00152 
00153 
00160 class TkFramework
00161 {
00162 public:
00167     virtual void            release() = 0;
00168 
00177     virtual const TkType*   getType(TkTypeIndex::Enum typeIndex) const = 0;
00178 
00186     virtual TkIdentifiable* findObjectByID(const NvBlastID& id) const = 0;
00187 
00195     virtual uint32_t        getObjectCount(const TkType& type) const = 0;
00196 
00207     virtual uint32_t        getObjects(TkIdentifiable** buffer, uint32_t bufferSize, const TkType& type, uint32_t indexStart = 0) const = 0;
00208 
00210 
00226     virtual bool            reorderAssetDescChunks(NvBlastChunkDesc* chunkDescs, uint32_t chunkCount, NvBlastBondDesc* bondDescs, uint32_t bondCount, uint32_t* chunkReorderMap = nullptr, bool keepBondNormalChunkOrder = false) const = 0;
00227 
00240     virtual bool            ensureAssetExactSupportCoverage(NvBlastChunkDesc* chunkDescs, uint32_t chunkCount) const = 0;
00241 
00249     virtual TkAsset*        createAsset(const TkAssetDesc& desc) = 0;
00250 
00261     virtual TkAsset*        createAsset(const NvBlastAsset* assetLL, Nv::Blast::TkAssetJointDesc* jointDescs = nullptr, uint32_t jointDescCount = 0, bool ownsAsset = false) = 0;
00262 
00264 
00273     virtual TkGroup*        createGroup(const TkGroupDesc& desc) = 0;
00274 
00276 
00283     virtual TkActor*        createActor(const TkActorDesc& desc) = 0;
00284 
00286 
00298     virtual TkJoint*        createJoint(const TkJointDesc& desc)  = 0;
00299 
00300 protected:
00304     virtual                 ~TkFramework() {}
00305 };
00306 
00307 } // namespace Blast
00308 } // namespace Nv
00309 
00310 
00312 
00318 NVBLAST_API Nv::Blast::TkFramework* NvBlastTkFrameworkCreate();
00319 
00320 
00326 NVBLAST_API Nv::Blast::TkFramework* NvBlastTkFrameworkGet();
00327 
00328 
00329 #endif // ifndef NVBLASTTKFRAMEWORK_H
Copyright © 2015-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com