sdk/extensions/physx/include/NvBlastExtPxManager.h

Go to the documentation of this file.
00001 // This code contains NVIDIA Confidential Information and is disclosed to you
00002 // under a form of NVIDIA software license agreement provided separately to you.
00003 //
00004 // Notice
00005 // NVIDIA Corporation and its licensors retain all intellectual property and
00006 // proprietary rights in and to this software and related documentation and
00007 // any modifications thereto. Any use, reproduction, disclosure, or
00008 // distribution of this software and related documentation without an express
00009 // license agreement from NVIDIA Corporation is strictly prohibited.
00010 //
00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
00015 //
00016 // Information and code furnished is believed to be accurate and reliable.
00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
00018 // information or for any infringement of patents or other rights of third parties that may
00019 // result from its use. No license is granted by implication or otherwise under any patent
00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
00021 // This code supersedes and replaces all information previously supplied.
00022 // NVIDIA Corporation products are not authorized for use as critical
00023 // components in life support devices or systems without express written approval of
00024 // NVIDIA Corporation.
00025 //
00026 // Copyright (c) 2016-2020 NVIDIA Corporation. All rights reserved.
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 // Forward declarations
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 }  // namespace physx
00051 
00052 
00053 namespace Nv
00054 {
00055 namespace Blast
00056 {
00057 
00058 // Forward declarations
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 }  // namespace Blast
00274 }  // namespace Nv
00275 
00276 
00277 #endif  // ifndef NVBLASTEXTPXMANAGER_H