Main Page Class List Class Members

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
75 struct ExtPxFamilyDesc
76 {
77 ExtPxAsset* pxAsset;
78 const NvBlastActorDesc* actorDesc;
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
135 enum FilterDataAttributes
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
physx
Definition: NvBlastExtApexSharedParts.h:34
Nv::Blast::TkFamily
Definition: NvBlastTkFamily.h:55
Nv::Blast::ExtPxFamilyDesc
Definition: NvBlastExtPxManager.h:75
NvBlastActorDesc
Definition: NvBlastTypes.h:395
Nv::Blast::TkJoint
Definition: NvBlastTkJoint.h:63
NvBlastTypes.h
Nv::Blast::ExtPxCollisionBuilder
Definition: NvBlastExtPxCollisionBuilder.h:52
Nv::Blast::ExtPxAsset
Definition: NvBlastExtPxAsset.h:123
NV_DLL_EXPORT
#define NV_DLL_EXPORT
Definition: NvPreprocessor.h:293
Nv::Blast::ExtPxListener
Definition: NvBlastExtPxListener.h:48
Nv::Blast::ExtPxFamilyDesc::actorDesc
const NvBlastActorDesc * actorDesc
Definition: NvBlastExtPxManager.h:78
Nv::Blast::ExtPxActor
Definition: NvBlastExtPxActor.h:57
Nv::Blast::ExtPxManager::FilterDataAttributes
FilterDataAttributes
Definition: NvBlastExtPxManager.h:135
Nv::Blast::ExtPxFamily
Definition: NvBlastExtPxFamily.h:105
Nv::Blast::ExtPxFamilyDesc::pxAsset
ExtPxAsset * pxAsset
px asset to create from, pointer will be stored in family.
Definition: NvBlastExtPxManager.h:77
Nv::Blast::TkFramework
Definition: NvBlastTkFramework.h:160
Nv::Blast::ExtPxManager
Definition: NvBlastExtPxManager.h:99
NvPreprocessor.h
Nv::Blast::TkGroup
Definition: NvBlastTkGroup.h:101
Nv
Definition: NvBlastArray.h:37
Nv::Blast::ExtPxCreateJointFunction
physx::PxJoint *(* ExtPxCreateJointFunction)(ExtPxActor *actor0, const physx::PxTransform &localFrame0, ExtPxActor *actor1, const physx::PxTransform &localFrame1, physx::PxPhysics &physics, TkJoint &joint)
Definition: NvBlastExtPxManager.h:89