NvBlastExtPxManager.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 NVBLASTEXTPXMANAGER_H
30 #define NVBLASTEXTPXMANAGER_H
31 
32 #include "NvBlastTypes.h"
33 #include "PxConvexMeshGeometry.h"
34 #include "PxTransform.h"
35 #include "NvPreprocessor.h"
36 
37 
38 // Forward declarations
39 namespace physx
40 {
41 class PxPhysics;
42 class PxCooking;
43 class PxRigidDynamic;
44 class PxJoint;
45 
46 namespace general_PxIOStream2
47 {
48 class PxFileBuf;
49 }
50 } // namespace physx
51 
52 
53 namespace Nv
54 {
55 namespace Blast
56 {
57 
58 // Forward declarations
59 class ExtPxActor;
60 class ExtPxAsset;
61 class ExtPxFamily;
62 class ExtPxListener;
63 class TkFamily;
64 class TkFramework;
65 class TkGroup;
66 class TkJoint;
67 class ExtPxCollisionBuilder;
68 
69 
76 {
79  TkGroup* group;
81 };
82 
83 
89 typedef physx::PxJoint* (*ExtPxCreateJointFunction)(ExtPxActor* actor0, const physx::PxTransform& localFrame0,
90  ExtPxActor* actor1, const physx::PxTransform& localFrame1,
91  physx::PxPhysics& physics, TkJoint& joint);
92 
93 
99 class NV_DLL_EXPORT ExtPxManager
100 {
101  public:
103 
116  static ExtPxManager* create(physx::PxPhysics& physics, TkFramework& framework,
117  ExtPxCreateJointFunction createFn = nullptr, bool useUserData = true);
118 
122  static ExtPxCollisionBuilder* createCollisionBuilder(physx::PxPhysics& physics, physx::PxCooking& cooking);
123 
127  virtual void release() = 0;
128 
129 
131 
136  {
137  LEAF_CHUNK = 1,
138  };
139 
140 
142 
151  virtual ExtPxFamily* createFamily(const ExtPxFamilyDesc& desc) = 0;
152 
163  virtual bool createJoint(TkJoint& joint) = 0;
164 
170  virtual void destroyJoint(TkJoint& joint) = 0;
171 
177  virtual void setCreateJointFunction(ExtPxCreateJointFunction createFn) = 0;
178 
184  virtual uint32_t getFamilyCount() const = 0;
185 
194  virtual uint32_t getFamilies(ExtPxFamily** buffer, uint32_t bufferSize) const = 0;
195 
203  virtual ExtPxFamily* getFamilyFromTkFamily(TkFamily& family) const = 0;
204 
212  virtual ExtPxActor* getActorFromPhysXActor(const physx::PxRigidDynamic& pxActor) const = 0;
213 
219  virtual physx::PxPhysics& getPhysics() const = 0;
220 
226  virtual TkFramework& getFramework() const = 0;
227 
233  virtual bool isPxUserDataUsed() const = 0;
234 
240  virtual void setActorCountLimit(uint32_t limit) = 0;
241 
248  virtual uint32_t getActorCountLimit() = 0;
249 
255  virtual uint32_t getPxActorCount() const = 0;
256 
262  virtual void subscribe(ExtPxListener& listener) = 0;
263 
269  virtual void unsubscribe(ExtPxListener& listener) = 0;
270 };
271 
272 
273 } // namespace Blast
274 } // namespace Nv
275 
276 
277 #endif // ifndef NVBLASTEXTPXMANAGER_H
Definition: NvBlastExtApexImportTool.h:40
Definition: NvBlastTkFamily.h:55
Definition: NvBlastExtPxManager.h:75
Definition: NvBlastTypes.h:395
Definition: NvBlastTkJoint.h:63
Definition: NvBlastExtPxCollisionBuilder.h:52
Definition: NvBlastExtPxAsset.h:123
Definition: NvBlastExtPxListener.h:48
const NvBlastActorDesc * actorDesc
Definition: NvBlastExtPxManager.h:78
Definition: NvBlastExtPxActor.h:57
FilterDataAttributes
Definition: NvBlastExtPxManager.h:135
Definition: NvBlastExtPxFamily.h:105
ExtPxAsset * pxAsset
px asset to create from, pointer will be stored in family.
Definition: NvBlastExtPxManager.h:77
Definition: NvBlastTkFramework.h:160
Definition: NvBlastExtPxManager.h:99
Definition: NvBlastTkGroup.h:101
Definition: NvBlastExtAuthoring.h:34
physx::PxJoint *(* ExtPxCreateJointFunction)(ExtPxActor *actor0, const physx::PxTransform &localFrame0, ExtPxActor *actor1, const physx::PxTransform &localFrame1, physx::PxPhysics &physics, TkJoint &joint)
Definition: NvBlastExtPxManager.h:89