NvBlastTkFramework.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 NVBLASTTKFRAMEWORK_H
30 #define NVBLASTTKFRAMEWORK_H
31 
32 
33 #include "NvBlastTkType.h"
34 #include "NvBlastTkEvent.h"
35 
36 #include "NvBlastPreprocessor.h"
37 #include "NvBlastTypes.h"
38 
39 #include "PxVec3.h"
40 
41 
42 // Forward declarations
43 namespace physx
44 {
45 class PxTransform;
46 }
47 
48 
49 namespace Nv
50 {
51 namespace Blast
52 {
53 
54 // Forward declarations
55 class TkObject;
56 class TkEventDispatcher;
57 class TkAsset;
58 struct TkGroupDesc;
59 class TkGroup;
60 class TkActor;
61 class TkJoint;
62 class TkIdentifiable;
63 struct TkAssetJointDesc;
64 
65 
66 
75 {
79  enum BondFlags
80  {
81  NoFlags = 0,
82 
90  BondJointed = (1 << 0)
91  };
92 
97  const uint8_t* bondFlags;
98 
100  TkAssetDesc() : bondFlags(nullptr)
101  {
102  chunkCount = bondCount = 0;
103  chunkDescs = nullptr;
104  bondDescs = nullptr;
105  }
106 };
107 
108 
115 {
116  const TkAsset* asset;
117 
119  TkActorDesc(const TkAsset* inAsset = nullptr) : asset(inAsset)
120  {
121  uniformInitialBondHealth = uniformInitialLowerSupportChunkHealth = 1.0f;
122  initialBondHealths = initialSupportChunkHealths = nullptr;
123  }
124 };
125 
126 
131 {
132  TkFamily* families[2];
133  uint32_t chunkIndices[2];
134  physx::PxVec3 attachPositions[2];
135 };
136 
137 
142 {
143  enum Enum
144  {
145  Asset = 0,
148 
149  TypeCount
150  };
151 };
152 
153 
161 {
162 public:
167  virtual void release() = 0;
168 
177  virtual const TkType* getType(TkTypeIndex::Enum typeIndex) const = 0;
178 
186  virtual TkIdentifiable* findObjectByID(const NvBlastID& id) const = 0;
187 
195  virtual uint32_t getObjectCount(const TkType& type) const = 0;
196 
207  virtual uint32_t getObjects(TkIdentifiable** buffer, uint32_t bufferSize, const TkType& type, uint32_t indexStart = 0) const = 0;
208 
210 
226  virtual bool reorderAssetDescChunks(NvBlastChunkDesc* chunkDescs, uint32_t chunkCount, NvBlastBondDesc* bondDescs, uint32_t bondCount, uint32_t* chunkReorderMap = nullptr, bool keepBondNormalChunkOrder = false) const = 0;
227 
240  virtual bool ensureAssetExactSupportCoverage(NvBlastChunkDesc* chunkDescs, uint32_t chunkCount) const = 0;
241 
249  virtual TkAsset* createAsset(const TkAssetDesc& desc) = 0;
250 
261  virtual TkAsset* createAsset(const NvBlastAsset* assetLL, Nv::Blast::TkAssetJointDesc* jointDescs = nullptr, uint32_t jointDescCount = 0, bool ownsAsset = false) = 0;
262 
264 
273  virtual TkGroup* createGroup(const TkGroupDesc& desc) = 0;
274 
276 
283  virtual TkActor* createActor(const TkActorDesc& desc) = 0;
284 
286 
298  virtual TkJoint* createJoint(const TkJointDesc& desc) = 0;
299 
300 protected:
304  virtual ~TkFramework() {}
305 };
306 
307 } // namespace Blast
308 } // namespace Nv
309 
310 
312 
319 
320 
327 
328 
329 #endif // ifndef NVBLASTTKFRAMEWORK_H
Definition: NvBlastExtApexImportTool.h:40
Definition: NvBlastTkFamily.h:55
Definition: NvBlastTypes.h:395
Enum
Definition: NvBlastTkFramework.h:143
Definition: NvBlastTkJoint.h:63
const uint8_t * bondFlags
Definition: NvBlastTkFramework.h:97
virtual ~TkFramework()
Definition: NvBlastTkFramework.h:304
TkAssetDesc()
Definition: NvBlastTkFramework.h:100
Definition: NvBlastTypes.h:345
Definition: NvBlastTkActor.h:57
Definition: NvBlastTkAsset.h:59
Definition: NvBlastTypes.h:322
Nv::Blast::TkFramework * NvBlastTkFrameworkGet()
Definition: NvBlastTkFramework.h:74
Definition: NvBlastTkGroup.h:48
const TkAsset * asset
The TkAsset to instance.
Definition: NvBlastTkFramework.h:116
Definition: NvBlastTkFramework.h:130
Definition: NvBlastTkIdentifiable.h:50
Nv::Blast::TkFramework * NvBlastTkFrameworkCreate()
TkGroup object type.
Definition: NvBlastTkFramework.h:147
#define NVBLAST_API
Definition: NvBlastPreprocessor.h:37
Definition: NvBlastTkType.h:46
TkActorDesc(const TkAsset *inAsset=nullptr)
Definition: NvBlastTkFramework.h:119
Definition: NvBlastTypes.h:69
TkFamily object type.
Definition: NvBlastTkFramework.h:146
BondFlags
Definition: NvBlastTkFramework.h:79
Definition: NvBlastTypes.h:292
Definition: NvBlastTkFramework.h:114
Definition: NvBlastTypes.h:286
Definition: NvBlastTkFramework.h:141
Definition: NvBlastTkFramework.h:160
Definition: NvBlastTkAsset.h:48
Definition: NvBlastTkGroup.h:101
Definition: NvBlastExtAuthoring.h:34