00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef NVBLASTEXTPXMANAGER_H
00030 #define NVBLASTEXTPXMANAGER_H
00031
00032 #include "NvBlastTypes.h"
00033 #include "PxConvexMeshGeometry.h"
00034 #include "PxTransform.h"
00035 #include "NvPreprocessor.h"
00036
00037
00038
00039 namespace physx
00040 {
00041 class PxPhysics;
00042 class PxRigidDynamic;
00043 class PxJoint;
00044
00045 namespace general_PxIOStream2
00046 {
00047 class PxFileBuf;
00048 }
00049 }
00050
00051
00052 namespace Nv
00053 {
00054 namespace Blast
00055 {
00056
00057
00058 class ExtPxActor;
00059 class ExtPxAsset;
00060 class ExtPxFamily;
00061 class ExtPxListener;
00062 class TkFamily;
00063 class TkFramework;
00064 class TkGroup;
00065 class TkJoint;
00066
00067
00073 struct ExtPxFamilyDesc
00074 {
00075 ExtPxAsset* pxAsset;
00076 const NvBlastActorDesc* actorDesc;
00077 TkGroup* group;
00078 };
00079
00080
00086 typedef physx::PxJoint*(*ExtPxCreateJointFunction)(ExtPxActor* actor0, const physx::PxTransform& localFrame0, ExtPxActor* actor1, const physx::PxTransform& localFrame1, physx::PxPhysics& physics, TkJoint& joint);
00087
00088
00094 class NV_DLL_EXPORT ExtPxManager
00095 {
00096 public:
00098
00110 static ExtPxManager* create(physx::PxPhysics& physics, TkFramework& framework, ExtPxCreateJointFunction createFn = nullptr, bool useUserData = true);
00111
00115 virtual void release() = 0;
00116
00117
00119
00123 enum FilterDataAttributes
00124 {
00125 LEAF_CHUNK = 1,
00126 };
00127
00128
00130
00138 virtual ExtPxFamily* createFamily(const ExtPxFamilyDesc& desc) = 0;
00139
00150 virtual bool createJoint(TkJoint& joint) = 0;
00151
00157 virtual void destroyJoint(TkJoint& joint) = 0;
00158
00164 virtual void setCreateJointFunction(ExtPxCreateJointFunction createFn) = 0;
00165
00171 virtual uint32_t getFamilyCount() const = 0;
00172
00181 virtual uint32_t getFamilies(ExtPxFamily** buffer, uint32_t bufferSize) const = 0;
00182
00190 virtual ExtPxFamily* getFamilyFromTkFamily(TkFamily& family) const = 0;
00191
00199 virtual ExtPxActor* getActorFromPhysXActor(const physx::PxRigidDynamic& pxActor) const = 0;
00200
00206 virtual physx::PxPhysics& getPhysics() const = 0;
00207
00213 virtual TkFramework& getFramework() const = 0;
00214
00220 virtual bool isPxUserDataUsed() const = 0;
00221
00227 virtual void setActorCountLimit(uint32_t limit) = 0;
00228
00234 virtual uint32_t getActorCountLimit() = 0;
00235
00241 virtual uint32_t getPxActorCount() const = 0;
00242
00248 virtual void subscribe(ExtPxListener& listener) = 0;
00249
00255 virtual void unsubscribe(ExtPxListener& listener) = 0;
00256 };
00257
00258
00259 }
00260 }
00261
00262
00263 #endif // ifndef NVBLASTEXTPXMANAGER_H