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 PxCooking;
00043 class PxRigidDynamic;
00044 class PxJoint;
00045
00046 namespace general_PxIOStream2
00047 {
00048 class PxFileBuf;
00049 }
00050 }
00051
00052
00053 namespace Nv
00054 {
00055 namespace Blast
00056 {
00057
00058
00059 class ExtPxActor;
00060 class ExtPxAsset;
00061 class ExtPxFamily;
00062 class ExtPxListener;
00063 class TkFamily;
00064 class TkFramework;
00065 class TkGroup;
00066 class TkJoint;
00067 class ExtPxCollisionBuilder;
00068
00069
00075 struct ExtPxFamilyDesc
00076 {
00077 ExtPxAsset* pxAsset;
00078 const NvBlastActorDesc* actorDesc;
00079
00080 TkGroup* group;
00081 };
00082
00083
00089 typedef physx::PxJoint* (*ExtPxCreateJointFunction)(ExtPxActor* actor0, const physx::PxTransform& localFrame0,
00090 ExtPxActor* actor1, const physx::PxTransform& localFrame1,
00091 physx::PxPhysics& physics, TkJoint& joint);
00092
00093
00099 class NV_DLL_EXPORT ExtPxManager
00100 {
00101 public:
00103
00116 static ExtPxManager* create(physx::PxPhysics& physics, TkFramework& framework,
00117 ExtPxCreateJointFunction createFn = nullptr, bool useUserData = true);
00118
00122 static ExtPxCollisionBuilder* createCollisionBuilder(physx::PxPhysics& physics, physx::PxCooking& cooking);
00123
00127 virtual void release() = 0;
00128
00129
00131
00135 enum FilterDataAttributes
00136 {
00137 LEAF_CHUNK = 1,
00138 };
00139
00140
00142
00151 virtual ExtPxFamily* createFamily(const ExtPxFamilyDesc& desc) = 0;
00152
00163 virtual bool createJoint(TkJoint& joint) = 0;
00164
00170 virtual void destroyJoint(TkJoint& joint) = 0;
00171
00177 virtual void setCreateJointFunction(ExtPxCreateJointFunction createFn) = 0;
00178
00184 virtual uint32_t getFamilyCount() const = 0;
00185
00194 virtual uint32_t getFamilies(ExtPxFamily** buffer, uint32_t bufferSize) const = 0;
00195
00203 virtual ExtPxFamily* getFamilyFromTkFamily(TkFamily& family) const = 0;
00204
00212 virtual ExtPxActor* getActorFromPhysXActor(const physx::PxRigidDynamic& pxActor) const = 0;
00213
00219 virtual physx::PxPhysics& getPhysics() const = 0;
00220
00226 virtual TkFramework& getFramework() const = 0;
00227
00233 virtual bool isPxUserDataUsed() const = 0;
00234
00240 virtual void setActorCountLimit(uint32_t limit) = 0;
00241
00248 virtual uint32_t getActorCountLimit() = 0;
00249
00255 virtual uint32_t getPxActorCount() const = 0;
00256
00262 virtual void subscribe(ExtPxListener& listener) = 0;
00263
00269 virtual void unsubscribe(ExtPxListener& listener) = 0;
00270 };
00271
00272
00273 }
00274 }
00275
00276
00277 #endif // ifndef NVBLASTEXTPXMANAGER_H