NvBlastTkAssetImpl.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 NVBLASTTKASSETIMPL_H
30 #define NVBLASTTKASSETIMPL_H
31 
32 
33 #include "NvBlastTkCommon.h"
34 #include "NvBlastTkJoint.h"
35 #include "NvBlastTkAsset.h"
36 #include "NvBlastTkTypeImpl.h"
37 #include "NvBlastArray.h"
38 
39 
40 // Forward declarations
41 struct NvBlastAsset;
42 
43 
44 namespace Nv
45 {
46 namespace Blast
47 {
48 
53 {
54 public:
55  TkAssetImpl();
56  TkAssetImpl(const NvBlastID& id);
57  ~TkAssetImpl();
58 
59  NVBLASTTK_IMPL_DEFINE_IDENTIFIABLE('A', 'S', 'S', 'T');
60 
61  // Public methods
62 
70  static TkAssetImpl* create(const TkAssetDesc& desc);
71 
82  static TkAssetImpl* create(const NvBlastAsset* assetLL, Nv::Blast::TkAssetJointDesc* jointDescs = nullptr, uint32_t jointDescCount = 0, bool ownsAsset = false);
83 
87  const NvBlastAsset* getAssetLLInternal() const;
88 
92  uint32_t getJointDescCountInternal() const;
93 
97  const TkAssetJointDesc* getJointDescsInternal() const;
98 
99  // Begin TkAsset
100  virtual const NvBlastAsset* getAssetLL() const override;
101 
102  virtual uint32_t getChunkCount() const override;
103 
104  virtual uint32_t getLeafChunkCount() const override;
105 
106  virtual uint32_t getBondCount() const override;
107 
108  virtual const NvBlastChunk* getChunks() const override;
109 
110  virtual const NvBlastBond* getBonds() const override;
111 
112  virtual const NvBlastSupportGraph getGraph() const override;
113 
114  virtual uint32_t getDataSize() const override;
115 
116  virtual uint32_t getJointDescCount() const override;
117 
118  virtual const TkAssetJointDesc* getJointDescs() const override;
119  // End TkAsset
120 
121 private:
132  bool addJointDesc(uint32_t chunkIndex0, uint32_t chunkIndex1);
133 
134  NvBlastAsset* m_assetLL;
135  Array<TkAssetJointDesc>::type m_jointDescs;
136  bool m_ownsAsset;
137 };
138 
139 
141 
142 NV_INLINE const NvBlastAsset* TkAssetImpl::getAssetLLInternal() const
143 {
144  return m_assetLL;
145 }
146 
147 
148 NV_INLINE uint32_t TkAssetImpl::getJointDescCountInternal() const
149 {
150  return m_jointDescs.size();
151 }
152 
153 
154 NV_INLINE const TkAssetJointDesc* TkAssetImpl::getJointDescsInternal() const
155 {
156  return m_jointDescs.begin();
157 }
158 
159 } // namespace Blast
160 } // namespace Nv
161 
162 
163 #endif // ifndef NVBLASTTKASSETIMPL_H
Definition: NvBlastTypes.h:244
Definition: NvBlastTypes.h:189
physx::shdfnd::Array< T, Allocator > type
Definition: NvBlastArray.h:48
Definition: NvBlastTkFramework.h:74
#define NVBLASTTK_IMPL_DEFINE_IDENTIFIABLE(_id0, _id1, _id2, _id3)
Definition: NvBlastTkCommon.h:91
NVBLASTTK_IMPL_DECLARE(Asset)
Definition: NvBlastTkAssetImpl.h:52
#define NV_INLINE
Definition: NvPreprocessor.h:350
Definition: NvBlastTypes.h:69
Definition: NvBlastTypes.h:152
Definition: NvBlastTypes.h:286
Definition: NvBlastTkAsset.h:48
Definition: NvBlastArray.h:37
Definition: NvBlastAsset.h:45